var map;var geocoder;var theIcon=new GIcon(G_DEFAULT_ICON);theIcon.image=sl_map_end_icon;if(sl_map_end_icon.indexOf('flag')!='-1'){theIcon.shadow=add_base+"/icons/flag_shadow.png";}
else if(sl_map_end_icon.indexOf('arrow')!='-1'){theIcon.shadow=add_base+"/icons/arrow_shadow.png";}
else if(sl_map_end_icon.indexOf('bubble')!='-1'){theIcon.shadow=add_base+"/icons/bubble_shadow.png";}
else if(sl_map_end_icon.indexOf('marker')!='-1'){theIcon.shadow=add_base+"/icons/marker_shadow.png";}
else if(sl_map_end_icon.indexOf('sign')!='-1'){theIcon.shadow=add_base+"/icons/sign_shadow.png";}
else{theIcon.shadow=add_base+"/icons/blank.png";}
theIcon.iconSize=new GSize(sl_map_end_icon_width,sl_map_end_icon_height);function sl_load(){if(GBrowserIsCompatible()){geocoder=new GClientGeocoder();map=new GMap2(document.getElementById('map'));if(sl_map_overview_control==1){map.addControl(new GOverviewMapControl());}
map.addMapType(G_PHYSICAL_MAP);geocoder.getLatLng(sl_google_map_country,function(latlng){map.setCenter(latlng,sl_zoom_level,sl_map_type);map.setUIToDefault();});}
if(sl_load_locations_default=="1"){var bounds=new GLatLngBounds();markerOpts={icon:theIcon};GDownloadUrl(add_base+"/data-xml.php",function(data,responseCode){var xml=GXml.parse(data);var markers=xml.documentElement.getElementsByTagName("marker");for(var i=0;i<markers.length;i++){var name=markers[i].getAttribute('name');var address=markers[i].getAttribute('address');var distance=parseFloat(markers[i].getAttribute('distance'));var point=new GLatLng(parseFloat(markers[i].getAttribute('lat')),parseFloat(markers[i].getAttribute('lng')));var description=markers[i].getAttribute('description');var url=markers[i].getAttribute('url');var hours=markers[i].getAttribute('hours');var phone=markers[i].getAttribute('phone');var image=markers[i].getAttribute('image');var marker=createMarker(point,name,address,"",description,url,hours,phone,image);map.addOverlay(marker);bounds.extend(point);}
map.setCenter(bounds.getCenter(),(map.getBoundsZoomLevel(bounds)-1));map.setUIToDefault();});}}
function searchLocations(){var address=document.getElementById('addressInput').value;geocoder.getLatLng(address,function(latlng){if(!latlng){alert(address+' not found');}else{searchLocationsNear(latlng,address);}});}
function searchLocationsNear(center,homeAddress){var radius=document.getElementById('radiusSelect').value;var searchUrl=add_base+'/generate-xml.php?lat='+center.lat()+'&lng='+center.lng()+'&radius='+radius;GDownloadUrl(searchUrl,function(data){var xml=GXml.parse(data);var markers=xml.documentElement.getElementsByTagName('marker');map.clearOverlays();var theIcon=new GIcon(G_DEFAULT_ICON);theIcon.image=sl_map_home_icon;if(sl_map_home_icon.indexOf('flag')!='-1'){theIcon.shadow=add_base+"/icons/flag_shadow.png";}
else if(sl_map_home_icon.indexOf('arrow')!='-1'){theIcon.shadow=add_base+"/icons/arrow_shadow.png";}
else if(sl_map_home_icon.indexOf('bubble')!='-1'){theIcon.shadow=add_base+"/icons/bubble_shadow.png";}
else if(sl_map_home_icon.indexOf('marker')!='-1'){theIcon.shadow=add_base+"/icons/marker_shadow.png";}
else if(sl_map_home_icon.indexOf('sign')!='-1'){theIcon.shadow=add_base+"/icons/sign_shadow.png";}
else{theIcon.shadow=add_base+"/icons/blank.png";}
theIcon.iconSize=new GSize(sl_map_home_icon_width,sl_map_home_icon_height);var bounds=new GLatLngBounds();markerOpts={icon:theIcon};point=new GLatLng(center.lat(),center.lng());bounds.extend(point);var homeMarker=new GMarker(point,markerOpts);var html='<div id="sl_info_bubble"><span class="your_location_label">Your Location:</span> <br/>'+homeAddress+'</div>';GEvent.addListener(homeMarker,'click',function(){homeMarker.openInfoWindowHtml(html);});map.addOverlay(homeMarker);var sidebar=document.getElementById('map_sidebar');sidebar.innerHTML='';if(markers.length==0){sidebar.innerHTML='<div class="no_results_found"><h2>No results found.</h2></div>';geocoder=new GClientGeocoder();geocoder.getLatLng(sl_google_map_country,function(latlng){map.setCenter(point,sl_zoom_level);});return;}
for(var i=0;i<markers.length;i++){var name=markers[i].getAttribute('name');var address=markers[i].getAttribute('address');var distance=parseFloat(markers[i].getAttribute('distance'));var point=new GLatLng(parseFloat(markers[i].getAttribute('lat')),parseFloat(markers[i].getAttribute('lng')));var description=markers[i].getAttribute('description');var url=markers[i].getAttribute('url');var hours=markers[i].getAttribute('hours');var phone=markers[i].getAttribute('phone');var image=markers[i].getAttribute('image');var marker=createMarker(point,name,address,homeAddress,description,url,hours,phone,image);map.addOverlay(marker);var sidebarEntry=createSidebarEntry(marker,name,address,distance,homeAddress,url);sidebar.appendChild(sidebarEntry);bounds.extend(point);}
map.setCenter(bounds.getCenter(),(map.getBoundsZoomLevel(bounds)-1));});}
function createMarker(point,name,address,homeAddress,description,url,hours,phone,image){markerOpts={icon:theIcon};var marker=new GMarker(point,markerOpts);var more_html="";if(url.indexOf("http://")==-1){url="http://"+url;}
if(url.indexOf("http://")!=-1&&url.indexOf(".")!=-1){more_html+="| <a href='"+url+"' target='_blank' class='storelocatorlink'><nobr>"+sl_website_label+"</nobr></a>"}else{url=""}
if(image.indexOf(".")!=-1){more_html+="<br/><img src='"+image+"' class='sl_info_bubble_main_image'>"}else{image=""}
if(description!=""){more_html+="<br/>"+description+"";}else{description=""}
if(hours!=""){more_html+="<br/><span class='location_detail_label'>Hours:</span> "+hours;}else{hours=""}
if(phone!=""){more_html+="<br/><span class='location_detail_label'>Phone:</span> "+phone;}else{phone=""}
var street=address.split(',')[0];if(street.split(' ').join('')!=""){street+='<br/>';}else{street="";}
var city=address.split(',')[1];if(city.split(' ').join('')!=""){city+=', ';}else{city="";}
var state_zip=address.split(',')[2];if(homeAddress.split(" ").join("")!=""){var html='<div id="sl_info_bubble"><!--tr><td--><strong>'+name+'</strong><br>'+street+city+state_zip+'<br/> <a href="http://'+sl_google_map_domain+'/maps?saddr='+encodeURIComponent(homeAddress)+'&daddr='+encodeURIComponent(address)+'" target="_blank" class="storelocatorlink">Directions</a> '+more_html+'<br/><!--/td></tr--></div>';}
else{var html='<div id="sl_info_bubble"><!--tr><td--><strong>'+name+'</strong><br>'+street+city+state_zip+'<br/> <a href="http://'+sl_google_map_domain+'/maps?q='+encodeURIComponent(address)+'" target="_blank" class="storelocatorlink">Map</a> '+more_html+'<!--/td></tr--></div>';}
GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml(html);});return marker;}
var resultsDisplayed=0;var bgcol="white";function createSidebarEntry(marker,name,address,distance,homeAddress,url){document.getElementById('map_sidebar_td').style.display='block';var div=document.createElement('div');var street=address.split(',')[0];var city=address.split(',')[1];if(city.split(' ').join('')!=""){city+=', ';}else{city="";}
var state_zip=address.split(',')[2];if(url.indexOf("http://")==-1){url="http://"+url;}
if(url.indexOf("http://")!=-1&&url.indexOf(".")!=-1){link="<a href='"+url+"' target='_blank' class='storelocatorlink'><nobr>"+sl_website_label+"</nobr></a>&nbsp;|&nbsp;"}else{url="";link="";}
var html='<center><table width="96%" cellpadding="4px" cellspacing="0" class="searchResultsTable"><tr><td class="results_row_left_column"><span class="location_name">'+name+'</span><br>'+distance.toFixed(1)+' '+sl_distance_unit+'</td><td class="results_row_center_column">'+street+'<br/>'+city+state_zip+' </td><td class="results_row_right_column">'+link+'<a href="http://'+sl_google_map_domain+'/maps?saddr='+encodeURIComponent(homeAddress)+'&daddr='+encodeURIComponent(address)+'" target="_blank" class="storelocatorlink">Directions</a></td></tr></table></center>';div.innerHTML=html;div.className='results_entry';resultsDisplayed++;GEvent.addDomListener(div,'click',function(){GEvent.trigger(marker,'click');});return div;};function GetXmlHttpObject()
{var objXMLHttp=null;if(window.XMLHttpRequest)
{objXMLHttp=new XMLHttpRequest();}
else if(window.ActiveXObject)
{objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");}
return objXMLHttp;}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("ajaxMsg").innerHTML="Submission Successful.";}}
var xmlHttp;function showArticles(start){xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request");return false;}
var url="/display_document_info.php";url=url+"?start="+start;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function doc_counter(the_loc){if(the_loc.search.indexOf('u=')!=-1){parts=the_loc.href.split('u=');u_part=parts[1].split('&')[0];}
else{dirs=the_loc.href.split('/');u_part=dirs[dirs.length-1];u_part=u_part.split('?')[0].split('.')[0];}
xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request");return false;}
var url="/scripts/doc_counter.php";url=url+"?u="+u_part;xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function anim2(imgObj,url){imgObj.src=url;}
function anim(name,type){if(type==0)
document.images[name].src="/images/"+name+".gif";if(type==1)
document.images[name].src="/images/"+name+"_over.gif";if(type==2)
document.images[name].src="/images/"+name+"_down.gif";}
function checkAll(cbox,formObj){var i=0;if(cbox.checked==true)
cbox.checked==false;else
cbox.checked==true;while(formObj.elements[i]!=null){formObj.elements[i].checked=cbox.checked;i++;}}
function checkEvent(formObj){var key=-1;var shift;key=event.keyCode;shift=event.shiftKey;if(!shift&&key==13)
{formObj.submit();}}
function show(block){theBlock=document.getElementById(block);if(theBlock.style.display=="none"){theBlock.style.display="block";}
else{theBlock.style.display="none";}}
function setCookie()
{the_date=new Date("December 31, 2023");the_cookie_date=the_date.toGMTString();the_login=document.forms['loginForm'].flogname.value;var the_cookie="loginCookie="+escape("loginName:"+the_login)+";expires="+the_cookie_date+";path=/;domain=fridayniteparty.com;";document.cookie=the_cookie;}
var the_cookie=document.cookie;var the_cookie=unescape(the_cookie);var broken_cookie=the_cookie.split(":");if(document.forms['loginForm']!=null){document.forms['loginForm'].flogname.value=lname;document.forms['loginForm'].fpassword.focus();}
function emailSelectCheck(emailObj,inputObj){if(inputObj.value.indexOf(emailObj.innerHTML)!=-1){emailObj.style.fontWeight='bold';}
else{emailObj.style.fontWeight='normal';}}
function bolden(type,prefix,count){for(i=0;i<count;i++){document.getElementById(prefix+i).style.fontWeight=type;}}
function showPic(pic,imageTitle,description)
{picWin=window.open("about:blank","","height=100,width=150,scrollbars=no,left=50,top=50");with(picWin.document){writeln("<html><head><title>...Loading...</title><style>body{margin:0px;background:"+document.body.bgColor+"} a{text-decoration:none; font-family:Verdana;}</style>");writeln('<sc'+'ript>');writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');writeln('width=100-(document.body.clientWidth-document.images[0].width)+50;');writeln('height=200-(document.body.clientHeight-document.images[0].height)+50;');writeln('window.resizeTo(width,height);}');writeln('if (isNN){');writeln('window.innerWidth=document.images["randPic"].width+50;');writeln('window.innerHeight=document.images["randPic"].height+90;}}');writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');writeln("</head><body class=frame scroll='no' onload='reSizeToImage();doTitle();self.focus()' onblur='close()'><table width=100% height=100%><tr><td style='vertical-align:middle'><center><span style='font-size:24;font-family:Monotype Corsiva;color:white'>"+imageTitle+"</span><img src="+pic+" name=randPic style='display:block'><p style='color:silver'>"+description+"<br><a href=javascript:window.close()>close</a></center></td></tr></table>");writeln("</body></html>");close();}}
var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+
keyStr.charAt(enc3)+keyStr.charAt(enc4);}while(i<input.length);return output;}
function decode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}
if(enc4!=64){output=output+String.fromCharCode(chr3);}}while(i<input.length);return output;}
function confirmClick(message,href){if(confirm(message))
{location.href=href;}
else
{return false;}};function externalLinks(){if(!document.getElementsByTagName)return;var anchors=document.getElementsByTagName("a");for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute("href")&&anchor.getAttribute("rel")=="external")
anchor.target="_blank";}}
window.onload=externalLinks;
