function usePNGWorkaround(){var agt=navigator.userAgent.toLowerCase();var is_major=parseInt(navigator.appVersion);var is_minor=parseFloat(navigator.appVersion);var is_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));var is_ie5_5=(is_ie&&(is_major==4)&&(agt.indexOf("msie 5.5")!=-1));var is_ie6=(is_ie&&(is_major==4)&&(agt.indexOf("msie 6.")!=-1));if((is_ie5_5&&document.body.filters)||(is_ie6&&document.body.filters)){return true;}else{return false;}}function getImageURL(indexString,isCertified){var imgsrc="/consumerfiles/assets/img/pin_empty.gif";var index=parseInt(indexString);var filenames=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6"];var markerPath=(isCertified&&(isCertified==true||isCertified=="true"))?"markers-c/":"markers/";if(index>=1&&index<=filenames.length){imgsrc="/consumerfiles/assets/img/"+markerPath+filenames[index-1]+".png";}return imgsrc;}function restrictZoomLevels(googleMap,minLevel,maxLevel){var mt=googleMap.getMapTypes();for(var i=0;i<mt.length;i++){mt[i].getMinimumResolution=function(){return minLevel;};mt[i].getMaximumResolution=function(){return maxLevel;};}}function getDestinationAddress(){return this.address1+", "+this.city+", "+this.country;}function trim(strValue){return strValue.replace(/^\s+|\s+$/g,"");}function isNullOrEmpty(inputString){return(inputString==null||trim(inputString)=="");}function showMarker(){highlightLocation(this);}function PLocation(name,address1,address2,postcode,city,country,state,phone,fax,email,visualUrl,url,groups,groupsImages,includedProducts,excludedProducts,exclusiveProducts,point,locationIndex,locationRow,locationLabel,logoURL,isCertified){this.name=name;this.address1=address1;this.address2=address2;this.postcode=postcode;this.city=city;this.country=country;this.state=state;this.phone=phone;this.fax=fax;this.email=email;this.visualUrl=visualUrl;this.url=url;this.groups=groups;this.groupsImages=groupsImages;this.includedProducts=includedProducts;this.excludedProducts=excludedProducts;this.exclusiveProducts=exclusiveProducts;this.point=point;this.locationIndex=locationIndex;this.locationRow=locationRow;this.locationLabel=locationLabel;this.getDestinationAddress=getDestinationAddress;this.logoURL=logoURL;this.isCertified=isCertified;this.showMarker=showMarker;this.icon=generateIcon(this.locationIndex,this.isCertified);var marker=new GMarker(this.point,this.icon);var currentDealer=this;GEvent.addListener(marker,"click",function(){currentDealer.showMarker();});this.marker=marker;}function generatePopupVisualURL(visualURL){visualURLPopup="<a href='"+visualURL+"'"+" onclick=\"window.open('"+visualURL+"','philips', 'toobar=no,location=no,direction=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=320, height=390');\">"+visualURL+"</a>";return visualURLPopup;}function generateIcon(index,isCertified){var icon=new GIcon(G_DEFAULT_ICON);icon.image=getImageURL(index,isCertified);icon.iconSize=new GSize(23,39);icon.iconAnchor=new GPoint(6,20);icon.infoWindowAnchor=new GPoint(9,1);return icon;}PLocation.prototype.generateIcon=function(index,isCertified){return generateIcon(index,isCertified);};function highlightLocation(newLocation){var tableCells;if(selectedLocation!=null){tableCells=selectedLocation.locationRow.getElementsByTagName("td");for(var i=0;i<tableCells.length;i++){tableCells[i].style.color="";tableCells[i].style.background="";}selectedLocation.locationLabel.style.color="#0E5FD8";}tableCells=newLocation.locationRow.getElementsByTagName("td");for(var i=0;i<tableCells.length;i++){tableCells[i].style.color="#FFFFFF";tableCells[i].style.background="#669CFF";}newLocation.locationLabel.style.color="#FFFFFF";selectedLocation=newLocation;}function processAddress(response){var searchValue=response.name.toUpperCase();var reCountryCode=new RegExp("\\s"+countryCode+"$","i");if(!response.Placemark){if(searchValue.search(reCountryCode)==-1&&searchValue.indexOf(countryName)==-1){searchValue=searchValue+" "+countryCode;geoCoder.getLocations(searchValue,processAddress);}else{showErrorFragment();}}else{for(var counter=0;counter<response.Placemark.length;counter++){if(response.Placemark[counter].AddressDetails.Country){if(response.Placemark[counter].AddressDetails.Country.CountryNameCode==countryCode){var geocode=new GLatLng(response.Placemark[counter].Point.coordinates[1],response.Placemark[counter].Point.coordinates[0]);document.retailLocation.geoLat.value=geocode.lat();document.retailLocation.geoLong.value=geocode.lng();document.retailLocation.submit();return ;}}}if(searchValue.search(reCountryCode)==-1&&searchValue.indexOf(countryName)==-1){searchValue=searchValue+" "+countryCode;geoCoder.getLocations(searchValue,processAddress);}else{showErrorFragment();return ;}}}function submitIfNotEmpty(){var latLong;var searchAddress=document.getElementById("searchAddress");var searchValue=searchAddress.value;searchValue=searchValue+" "+countryCode;geoCoder.getLocations(searchValue,processAddress);}var isVisible=false;function toggleAdvancedSearch(elementId){var elt=document.getElementById(elementId);var arrowElt=document.getElementById("arrow");if(!isVisible){arrowElt.src="/consumerfiles/assets/img/grey_arrow_down.gif";elt.style.display="inline";hideElement("searchResults");hideElement("errorFragment");isVisible=true;}else{arrowElt.src="/consumerfiles/assets/img/grey_arrow_right.gif";elt.style.display="none";isVisible=false;if(activeFragment=="errorFragment"){showElement("errorFragment");}if(activeFragment=="searchResults"){showElement("searchResults");}}}function showAdvancedSearch(){showElement("advSearch");var arrowElt=document.getElementById("arrow");arrowElt.src="/consumerfiles/assets/img/grey_arrow_down.gif";}function hideAdvancedSearch(){hideElement("advSearch");var arrowElt=document.getElementById("arrow");arrowElt.src="/consumerfiles/assets/img/grey_arrow_right.gif";}function showErrorFragment(){showElement("errorFragment");hideElement("searchResults");hideAdvancedSearch();activeFragment="errorFragment";}function showElement(elementId){var elt=document.getElementById(elementId);if(elt!=null){elt.style.display="inline";}}function hideElement(elementId){var elt=document.getElementById(elementId);if(elt!=null){elt.style.display="none";}}function openGoogleMaps(destinationAddress,countryCode){var addressFrom=document.directions.start.value;var URL="http://maps.google.com/maps?saddr="+addressFrom+","+countryCode+"&daddr="+destinationAddress+"&hl="+language;window.open(URL);}function checkEnter(e){var characterCode;if(e&&e.which){e=e;characterCode=e.which;}else{e=event;characterCode=e.keyCode;}if(characterCode==13){submitIfNotEmpty();}}var focuscount=0;function clearfield(obj){formfield=obj;if(focuscount>0){formfield.select();}else{focuscount+=1;formfield.value="";}}PLocation.prototype.htmlHr=function(){var mhtml="";mhtml+='<div id="line" class="SeparatorLine_retail_store_locator_color"></div>';mhtml+='<div id="line" class="SeparatorLine_retail_store_locator_white"></div>';return mhtml;};PLocation.prototype.htmlSearch=function(){var mhtml="";mhtml+=this.htmlHr();mhtml+='<div style="height:4px; background-color:#f2f2f6; border:0; padding:0;"></div>';mhtml+='<div id="search" style="height:40px; background-color:#f2f2f6; border:0; padding:0px;">';mhtml+='<form method="post" id="directions" name="directions" onSubmit="return false">';mhtml+='<input type="text" id="start" name="start"  value="'+sitetextMap["StartAddress"]+'" onfocus="clearfield(this)" style="position:relative; float:left; margin-left:10px; width:197px; height:17px; border-top:1px solid #9297A3;border-left:1px solid #9297A3;border-bottom:1px solid #D3D5DA;border-right:1px solid #D3D5DA;font-size:1em;padding-left:4px;"/>';mhtml+='<table class="p-button-action" style="float:left; margin-left:16px;" border="0" cellspacing="0"><tr><td onclick="openGoogleMaps(\''+this.getDestinationAddress()+"', '"+this.country+'\');"><div style="padding-left:4px;">'+sitetextMap["GetDirections"]+"</div></td></tr></table>";mhtml+="</form>";mhtml+="</div>";return mhtml;};PLocation.prototype.htmlStoreInfo=function(){var mhtml="";mhtml+='<div style="height:16px; border:0; padding:0;"></div>';mhtml+='<table id="map-storeinfo" border="0" cellspacing="0" cellpadding="4" width="428" align="center">';mhtml+="<tr>";if(this.isCertified=="true"){dealerLogo='<img src="/consumerfiles/assets/img/p-infowindow/dealer_certified.gif" hspace="4"  />';if(!isNullOrEmpty(this.logoURL)){dealerLogo='<img src="'+this.logoURL+'" hspace="4" width="90" />';}mhtml+='<td id="map-storeinfo-logo" valign="top" rowspan="2" width="104" align="center">'+dealerLogo+"</td>";}else{mhtml+='<td id="map-storeinfo-logo" valign="top" rowspan="2" width="8" align="center">&nbsp;</td>';}mhtml+='<td colspan="2" style="font:normal 11px verdana;"><b>';if(!isNullOrEmpty(this.name)){mhtml+=this.name;}mhtml+="</b></td>";mhtml+="</tr>";mhtml+="<tr>";mhtml+='<td valign="top" style="font:normal 11px verdana;padding-bottom:10px">';if(!isNullOrEmpty(this.address1)){mhtml+=""+this.address1+", ";}if(!isNullOrEmpty(this.address2)){mhtml+=""+this.address2+"<br/>";}if(!isNullOrEmpty(this.city)){mhtml+=""+this.city+", ";}if(!isNullOrEmpty(this.state)){mhtml+=""+this.state+"<br/>";}if(!isNullOrEmpty(this.postcode)){mhtml+=""+this.postcode+"<br/>";}if(!isNullOrEmpty(this.email)){mhtml+=""+this.email+"<br/>";}if(!isNullOrEmpty(this.visualUrl)){if(!isNullOrEmpty(this.url)){mhtml+='<a href="'+this.url+'" target="_blank">';}mhtml+=this.visualUrl;if(!isNullOrEmpty(this.url)){mhtml+="</a>";}mhtml+="<br/>";}if(!isNullOrEmpty(this.phone)){mhtml+=""+this.phone+"<br/>";}mhtml+="</td>";mhtml+="</tr>";mhtml+="</table>";return mhtml;};PLocation.prototype.htmlGroupsInfo=function(){var mhtml="";if(this.groups.length>0){mhtml+=this.htmlHr();mhtml+='<div style="height:8px; border:0; padding:0;"></div>';mhtml+='<table id="map-groupsinfo" style="margin-left:4px">';if(this.groups.length>0){mhtml+=printGroupsBegin(sitetextMap["SpecializedFollowingProds"]);for(i=0;i<this.groups.length&&i<7;i++){mhtml+='<img src="'+this.groupsImages[i]+'" width="52" height="52" style="padding-right:4px;" />';}mhtml+=printGroupsEnd();}mhtml+="</table>";mhtml+='<div style="height:8px; border:0; padding:0;"></div>';}return mhtml;};PLocation.prototype.htmlMoreInfoOpen=function(){var mhtml="";mhtml+='<div style="padding:8px; font:10px verdana;">';if(this.groups.length>0){mhtml+='<a style="color:#005AFF;font-weight:bold;text-decoration:none;" href="javascript:googleMap.minimizeExtInfoWindow();"><img src="/consumerfiles/assets/img/p-infowindow/arw_more_open.gif" width="9" height="9" border="0" hspace="4" />';mhtml+=""+sitetextMap["StoreDetails"]+"</a>";}mhtml+="</div>";mhtml+='<div style="height:8px; border:0; padding:0;"></div>';return mhtml;};PLocation.prototype.htmlMoreInfoClosed=function(){var mhtml="";mhtml+='<div style="padding:8px; font:10px verdana;">';if(this.groups.length>0){mhtml+='<a style="color:#005AFF;font-weight:bold;text-decoration:none;" href="javascript:googleMap.maximizeExtInfoWindow();"><img src="/consumerfiles/assets/img/p-infowindow/arw_more_closed.gif" width="9" height="9" border="0" hspace="4" />';mhtml+=""+sitetextMap["StoreDetails"]+"</a>";}mhtml+="</div>";mhtml+='<div style="height:2px; border:0; padding:0;"></div>';return mhtml;};PLocation.prototype.getMaxContent=function(){var mhtml=this.htmlStoreInfo()+this.htmlGroupsInfo()+this.htmlSearch();return mhtml;};PLocation.prototype.getMinContent=function(){var mhtml=this.htmlStoreInfo()+this.htmlSearch();return mhtml;};function printGroupsBegin(title){var mhtml="";mhtml+="<tr>";mhtml+='<td style="height:20px; vertical-align:top; font:normal 11px verdana;">';mhtml+='<strong style="margin-left:4px;">'+title+"</strong><br/>";mhtml+="</td>";mhtml+="</tr>";mhtml+="<tr>";mhtml+='<td style="font:normal 11px verdana;">';return mhtml;}function printGroupsEnd(){var mhtml="";mhtml+="</td>";mhtml+="</tr>";return mhtml;}