var map_initialized=false;var current_marker=null;var marker_array=Array();var yMap=null;var max_markers=50;var max_labels_to_show=5;var timeoutPeriod=5000;function initialize_map(){if(document.getElementById("map")=="undefined"){return false}yMap=new YMap(document.getElementById("map"));yMap.setMapType(YAHOO_MAP_REG);yMap.disablePanOnDoubleClick();yMap.disableDragMap();yMap.disableKeyControls();var c=new YGeoPoint(0,0);var b=$('#map').width();var a=(b<1200)?16:(b<2400)?15:(b<4800)?14:13;yMap.drawZoomAndCenter(c,a);map_initialized=true;return true}function destroy_map(){if(map_initialized==true){yMap=null;current_marker=null;marker_array=Array();map_initialized=false}return true}function addNextMarker(h,a,f,b,e){if(typeof e=="undefined"){e=4}if(map_initialized==false){initialize_map()}if(current_marker){marker_array.push(current_marker)}if(marker_array.length>max_labels_to_show-1){var g=marker_array.length-max_labels_to_show;yMap.removeOverlay(marker_array[g]);var i=new YGeoPoint(marker_array[g].latitude,marker_array[g].longitude);var d=createYahooMarker(i,"","",marker_array[g].record_type,false);d.db_record_id=marker_array[g].db_record_id;d.record_type=marker_array[g].record_type;d.label=marker_array[g].label;d.latitude=marker_array[g].latitude;d.longitude=marker_array[g].longitude;yMap.addOverlay(d);marker_array[g]=d}i=new YGeoPoint(h,a);if(e==2){var c="<span style='color:black;'>"+b.replace(" ","&nbsp;")+"</span>";var j="<div id='bubble_btm'><div id='bubble_top'>"+b.replace(" ","&nbsp;")+"</div></div>"}else{if(e==6){var c="<span style='color:black;'>"+b.replace(" ","&nbsp;")+"</span>";var j="<div id='bubble_btm' class='bubble_orange'><div id='bubble_top'>"+b.replace(" ","&nbsp;")+"</div></div>"}else{var c="<span style='color:black;'>"+b.replace(" ","&nbsp;")+"</span>";var j="<div id='bubble_btm' class='bubble_blue'><div id='bubble_top'>"+b.replace(" ","&nbsp;")+"</div></div>"}}current_marker=createYahooMarker(i,j,c,e,true);current_marker.db_record_id=f;current_marker.record_type=e;current_marker.label=j;current_marker.latitude=h;current_marker.longitude=a;yMap.addOverlay(current_marker);yMap.panToLatLon(i);removeOldMarkers()}function createYahooMarker(c,e,f,d,g){if(map_initialized==false){initialize_map()}var b=new YImage();if(d==2){b.src="http://www.greatcommission2020.com/images/marker_person_yellow.png"}else{if(d==6){b.src="http://www.greatcommission2020.com/images/marker_person_orange.png"}else{b.src="http://www.greatcommission2020.com/images/marker_person_blue.png"}}b.size=new YSize(9,13);var a=new YMarker(c,b);a.addLabel(e);setTimeout('$("img[id^=\'ymiymarkeryid\']").css("z-index","4");',200);return a}function removeOldMarkers(){if(map_initialized==false){initialize_map()}if(marker_array){while(marker_array.length>=max_markers){var a=marker_array.shift();yMap.removeOverlay(a);delete a}}}function fullscreen(){var a=$(window).width();var b=$(window).height();$("#map").height(b);yMap.resizeTo(new YSize(a,b))}
jQuery.fn.liScroll=function(){return this.each(function(){var b=jQuery(this);var d=0;b.wrap("<div class='tickercontainer'></div>");var e=b.parent().width();b.find("li").each(function(g){d+=jQuery(this,g).outerWidth(true)});b.width(d);var c=d+e;var a=c/0.05;function f(h,g){b.animate({left:"-="+h},g,"linear",function(){b.css("left",e);f(c,a)})}f(c,a);b.hover(function(){jQuery(this).stop()},function(){var i=jQuery(this).offset();var g=i.left+d;var h=g/0.05;f(g,h)})})};
