var listAreaCodes;var markersAreaCodes=[];function loadMapVitualReceptionist(){$(document).ready(function(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("mapVR"));geocoder=new GClientGeocoder();var a=[];a[G_GEO_SUCCESS]="Success";a[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";a[G_GEO_UNKNOWN_ADDRESS]="Unknown Address:  No corresponding geographic location could be found for the specified address.";a[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";a[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";a[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";a[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";a[403]="Error 403: Probably an incorrect error caused by a bug in the handling of invalid JSON.";map.setCenter(new google.maps.LatLng(54.41,-4),5);map.addControl(new GSmallZoomControl3D());mgr=new MarkerManager(map,{trackMarkers:true});iconPhone=new GIcon();iconPhone.image="img/map/phonepin_32.png";iconPhone.iconSize=new GSize(32,32);iconPhone.iconAnchor=new GPoint(16,32);iconPhone.shadow="";iconPhone.infoWindowAnchor=new GPoint(16,26);window.setTimeout(loadDataVR,0)}})}function loadDataVR(){$.getJSON("classes-php/cliengine.php?output=json&usedby=googlemap",function(a){addSitesToMapVR(a)})}function addSitesToMapVR(d){listAreaCodes=d;var b=40;var e="";var a='<option value=""></option>';var c="";$.each(d.rows,function(h,k){if(e!=k.cell[1]){var f=new GLatLng(k.cell[2],k.cell[3]);var j=iconPhone;var g=new GMarker(f,{title:k.cell[1],icon:j,draggable:false});GEvent.addListener(g,"click",function(){title=k.cell[1];address="<b>"+title+"&nbsp;</b>";button="";html='<div style="width: 160px;">'+address+'<br><div style="margin-top:5px;">area code: '+findareacodepercity(title)+"</div></div>";g.openInfoWindowHtml(html,{maxWidth:160})});markersAreaCodes.push(g);mgr.addMarker(g,0,17);e=k.cell[1];c=k.cell[0];for(h=c.length;h<5;h++){c=c+"&nbsp;&nbsp;"}a+='<option value="'+k.cell[0]+'">'+c+" - "+k.cell[1]+"</option>"}});mgr.refresh();$("select#listAreaCode").html(a)}function findareacodepercity(c){var b=new Array();var a=0;$.each(listAreaCodes.rows,function(d,e){d+=1;if(c==e.cell[1]){b.push(e.cell[0]);$("#divMainbuynow").slideDown();document.getElementById("listAreaCode").selectedIndex=d}});areacodeSelect="";if(b.length==1){areacodeSelect="<b>"+b[0]+"</b>"}if(b.length>1){areacodeSelect='<select name="areacode" id="areacode" onChange="javascript: document.getElementById(\'areacode\').value = this.value;">';for(a=0;a<b.length;a++){areacodeSelect+='<option value="'+b[a]+' ">'+b[a]+"</option>"}areacodeSelect+="</select>"}document.getElementById("areacode").value=b[0];return areacodeSelect};