function AjaxRequest(){var a=new Object();a.timeout=null;a.generateUniqueUrl=true;a.url=window.location.href;a.method="GET";a.async=true;a.username=null;a.password=null;a.parameters=new Object();a.requestIndex=AjaxRequest.numAjaxRequests++;a.responseReceived=false;a.groupName=null;a.queryString="";a.responseText=null;a.responseXML=null;a.status=null;a.statusText=null;a.aborted=false;a.xmlHttpRequest=null;a.onTimeout=null;a.onLoading=null;a.onLoaded=null;a.onInteractive=null;a.onComplete=null;a.onSuccess=null;a.onError=null;a.onGroupBegin=null;a.onGroupEnd=null;a.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(a.xmlHttpRequest==null){return null}a.xmlHttpRequest.onreadystatechange=function(){if(a==null||a.xmlHttpRequest==null){return}if(a.xmlHttpRequest.readyState==1){a.onLoadingInternal(a)}if(a.xmlHttpRequest.readyState==2){a.onLoadedInternal(a)}if(a.xmlHttpRequest.readyState==3){a.onInteractiveInternal(a)}if(a.xmlHttpRequest.readyState==4){a.onCompleteInternal(a)}};a.onLoadingInternalHandled=false;a.onLoadedInternalHandled=false;a.onInteractiveInternalHandled=false;a.onCompleteInternalHandled=false;a.onLoadingInternal=function(){if(a.onLoadingInternalHandled){return}AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof(window.AjaxRequestBegin)=="function"){AjaxRequestBegin()}if(a.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[a.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[a.groupName]=0}AjaxRequest.numActiveAjaxGroupRequests[a.groupName]++;if(AjaxRequest.numActiveAjaxGroupRequests[a.groupName]==1&&typeof(a.onGroupBegin)=="function"){a.onGroupBegin(a.groupName)}}if(typeof(a.onLoading)=="function"){a.onLoading(a)}a.onLoadingInternalHandled=true};a.onLoadedInternal=function(){if(a.onLoadedInternalHandled){return}if(typeof(a.onLoaded)=="function"){a.onLoaded(a)}a.onLoadedInternalHandled=true};a.onInteractiveInternal=function(){if(a.onInteractiveInternalHandled){return}if(typeof(a.onInteractive)=="function"){a.onInteractive(a)}a.onInteractiveInternalHandled=true};a.onCompleteInternal=function(){if(a.onCompleteInternalHandled||a.aborted){return}a.onCompleteInternalHandled=true;AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window.AjaxRequestEnd)=="function"){AjaxRequestEnd(a.groupName)}if(a.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[a.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[a.groupName]==0&&typeof(a.onGroupEnd)=="function"){a.onGroupEnd(a.groupName)}}a.responseReceived=true;a.status=a.xmlHttpRequest.status;a.statusText=a.xmlHttpRequest.statusText;a.responseText=a.xmlHttpRequest.responseText;a.responseXML=a.xmlHttpRequest.responseXML;if(typeof(a.onComplete)=="function"){a.onComplete(a)}if(a.xmlHttpRequest.status==200&&typeof(a.onSuccess)=="function"){a.onSuccess(a)}else{if(typeof(a.onError)=="function"){a.onError(a)}}delete a.xmlHttpRequest.onreadystatechange;a.xmlHttpRequest=null};a.onTimeoutInternal=function(){if(a!=null&&a.xmlHttpRequest!=null&&!a.onCompleteInternalHandled){a.aborted=true;a.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window.AjaxRequestEnd)=="function"){AjaxRequestEnd(a.groupName)}if(a.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[a.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[a.groupName]==0&&typeof(a.onGroupEnd)=="function"){a.onGroupEnd(a.groupName)}}if(typeof(a.onTimeout)=="function"){a.onTimeout(a)}delete a.xmlHttpRequest.onreadystatechange;a.xmlHttpRequest=null}};a.process=function(){if(a.xmlHttpRequest!=null){if(a.generateUniqueUrl&&a.method=="GET"){a.parameters.AjaxRequestUniqueId=new Date().getTime()+""+a.requestIndex}var c=null;for(var b in a.parameters){if(a.queryString.length>0){a.queryString+="&"}a.queryString+=encodeURIComponent(b)+"="+encodeURIComponent(a.parameters[b])}if(a.method=="GET"){if(a.queryString.length>0){a.url+=((a.url.indexOf("?")>-1)?"&":"?")+a.queryString}}a.xmlHttpRequest.open(a.method,a.url,a.async,a.username,a.password);if(a.method=="POST"){if(typeof(a.xmlHttpRequest.setRequestHeader)!="undefined"){a.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded")}c=a.queryString}if(a.timeout>0){setTimeout(a.onTimeoutInternal,a.timeout)}a.xmlHttpRequest.send(c)}};a.handleArguments=function(b){for(var c in b){if(typeof(a[c])=="undefined"){a.parameters[c]=b[c]}else{a[c]=b[c]}}};a.getAllResponseHeaders=function(){if(a.xmlHttpRequest!=null){if(a.responseReceived){return a.xmlHttpRequest.getAllResponseHeaders()}alert("Cannot getAllResponseHeaders because a response has not yet been received")}};a.getResponseHeader=function(b){if(a.xmlHttpRequest!=null){if(a.responseReceived){return a.xmlHttpRequest.getResponseHeader(b)}alert("Cannot getResponseHeader because a response has not yet been received")}};return a}AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				return null;
			}
		}
		@end @*/
}else{return null}}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0)};AjaxRequest.get=function(a){AjaxRequest.doRequest("GET",a)};AjaxRequest.post=function(a){AjaxRequest.doRequest("POST",a)};AjaxRequest.doRequest=function(c,a){if(typeof(a)!="undefined"&&a!=null){var b=new AjaxRequest();b.method=c;b.handleArguments(a);b.process()}};AjaxRequest.submit=function(a,b){var d=new AjaxRequest();if(d==null){return false}var c=AjaxRequest.serializeForm(a);d.method=a.method.toUpperCase();d.url=a.action;d.handleArguments(b);d.queryString=c;d.process();return true};AjaxRequest.serializeForm=function(b){var e=b.elements;var a=e.length;var g="";this.addField=function(h,j){if(g.length>0){g+="&"}g+=encodeURIComponent(h)+"="+encodeURIComponent(j)};for(var d=0;d<a;d++){var f=e[d];if(!f.disabled){switch(f.type){case"text":case"password":case"hidden":case"textarea":this.addField(f.name,f.value);break;case"select-one":if(f.selectedIndex>=0){this.addField(f.name,f.options[f.selectedIndex].value)}break;case"select-multiple":for(var c=0;c<f.options.length;c++){if(f.options[c].selected){this.addField(f.name,f.options[c].value)}}break;case"checkbox":case"radio":if(f.checked){this.addField(f.name,f.value)}break}}}return g};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0;function load_maps_script(){var a=document.createElement("script");a.type="text/javascript";a.src="http://maps.google.com/maps?file=api&v=2.x&key="+gkey+"&async=2&callback=load_distributor_map";document.body.appendChild(a)}function create_marker(a,c){var b=new GMarker(a);GEvent.addListener(b,"click",function(){b.openInfoWindowHtml(c,{maxWidth:150})});return b}function get_marker(a){gmarkers[a].openInfoWindowHtml(htmls[a],{maxWidth:150})}function load_distributor_map(){if(GBrowserIsCompatible()){var g=new GMap2($("map")),h=json_decode(search_address),f=new GLatLng(h.latitude,h.longitude),e=json_decode(locations);g.addControl(new GSmallZoomControl3D());g.addControl(new GScaleControl());g.setCenter(f,(h.tolerance==100?6:(h.tolerance==50?7:9)));for(var c in e){if(trim(e[c].name)!=""){var a=new GLatLng(e[c].latitude,e[c].longitude);var d="<div><h4>"+unescape(e[c].name)+"</h4><p>"+unescape(e[c].address)+"<br />"+unescape(e[c].city)+", "+unescape(e[c].state)+" "+e[c].zip+"<br />"+(e[c].phone!=""?"Phone: "+e[c].phone+"<br />":"")+(e[c].fax!=""?"Fax: "+e[c].fax+"<br />":"")+e[c].distance+" mile"+((e[c].distance>1||e[c].distance==0)?"s":"")+' &bull; <a href="http://maps.google.com/maps?saddr='+h.address+"&daddr="+e[c].address+","+e[c].city+","+e[c].state+" "+e[c].zip+'" target="_blank">Get Directions</a></p></div>';var b=create_marker(a,d);g.addOverlay(b);gmarkers[c]=b;htmls[c]=d}}}}function hide_product(){$("content-browse").innerHTML="";$("content-browse").style.display="none";$("content").style.display=""}function last_div(a,b){return a+(b.substring(a.length)-0-1)}function next_div(a,b){return a+(b.substring(a.length)-0+1)}function list_children(b,a){return((a=="as")?explode_array(ASplist[b],","):explode_array(PBplist[b],","))}function show_image(c,b){for(var a=1;a<=b;a++){$("prod"+a).style.display="none"}$(c).style.display="block"}function show_div(e){var d=$("products-nav").getElementsByTagName("a"),b=$("products-container").getElementsByTagName("div");for(var c=0,a=d.length;c<a;c++){d[c].className=""}for(c=0,div_length=b.length;c<div_length;c++){if(b[c].id!=""){b[c].style.display="none"}}if($(e)){$("nav-"+e).className="current";$(e).style.display="block"}return}function show_content(d){var a=child_elements("product-container");for(var b=0,c=a.length;b<c;b++){a[b].style.display="none"}reset_expand_collapse_images();if($(d+"-content")){$(d+"-content").style.display="block"}return}function reset_expand_collapse_images(){var a=$("product-container").getElementsByTagName("li");for(var e=0,b=a.length;e<b;e++){if(a[e].id.indexOf("excol")!=-1){$(a[e]).className="expand";var d=child_elements(a[e].id);for(var c=0,f=d.length;c<f;c++){if(d[c].id!=""){d[c].style.display="none"}}}}}function toggle_menu(b,a){if(!a){var a=false}switch(b){case"hide":if($("side-pane")){$("side-pane").style.display="none"}if($("hide")){$("hide").style.display="none"}if($("show")){$("show").style.display=""}if($("content")){$("content").style.width="100%"}break;case"show":if($("side-pane")){$("side-pane").style.display="block"}if($("hide")){$("hide").style.display=""}if($("show")){$("show").style.display="none"}if($("content")){$("content").style.width="600px"}break}if(a){save_product_browse_cookie(b)}}function set_active_tab(b){for(var a=0,c=$("tabNav").getElementsByTagName("li").length;a<c;a++){$("tabNav").getElementsByTagName("li")[a].className=""}if($(b+"Tab")){$(b+"Tab").className="current";show_content(b)}}function save_product_browse_cookie(a){create_cookie("product_browse_preference",a,365)}function get_product_browse_preference(){toggle_menu(read_cookie("product_browse_preference"))}function attribute_search(c){if(!c){var c=""}var b="";$("content-browse").style.display="none";$("content").style.display="block";var a=' <ul>  <li class="selected"><a href="javascript: void(0);" onclick="attribute_search();"><span>Attribute Search</span></a></li>  <li><a href="javascript: void(0);" onclick="product_browse();"><span>Product Browse</span></a></li> </ul>';$("pbrowse-tabs").innerHTML=a;$("content-browse").innerHTML="";$("attSearch1").innerHTML="";$("content-browse").style.display="none";$("attSearch1").style.display="block";$("prod-browse").innerHTML="";$("prod-browse").style.display="none";if(c!=""){write_attribute_search_dd(asDid,"attSearch1",b,c,c)}else{write_attribute_search_dd(asDid,"attSearch1",b)}}function product_browse(a){if(!a){var a=""}var c="";$("content-browse").style.display="";$("content").style.display="block";var b=' <ul>  <li><a href="javascript: void(0);" onclick="attribute_search();"><span>Attribute Search</span></a></li>  <li class="selected"><a href="javascript: void(0);" onclick="product_browse();"><span>Product Browse</span></a></li> </ul> <div class="clear"></div>';$("pbrowse-tabs").innerHTML=b;$("content-browse").innerHTML="";$("bottomDiv").innerHTML="";$("attSearch1").innerHTML="";$("prod-browse").innerHTML="";$("attSearch1").style.display="none";write_product_browse_dd(pbDid,"prod-browse",c,(a!=""?a:""));$("prod-browse").style.display=""}function search_choice(c,g,h,d,e){if(!e){var e=""}var f=c.options[c.selectedIndex].value;if(f==c.name){var a=last_div("attribute-search",g);if(e!=""){var e=arguments[4].substring(0,arguments[4].indexOf(f)+f.length);write_attribute_search_dd(f,a,d,e)}else{write_attribute_search_dd(f,a,d,"")}}else{if(h=="as"){if(e!=""){var l=explode_array(arguments[4],"_");var b=l.length;var j=g.substring(9)-0-1;if(b>=j){for(i=0;i<j-1;i++){if(i==0){var e=l[i]}else{e+="_"+l[i]}}if(!defined(e)){var e=f}else{e+="_"+f}}else{var e=arguments[4]+"_"+f}}else{var e=f}write_attribute_search_dd(f,g,d,e)}else{if(h=="pb"){if(f==pbDid){$(g).innerHTML=""}else{$(g).innerHTML="";if(PBindex[f][0]=="Non-Product Link"){c.selectedIndex=0;window.open(PBindex[f][2]);return}else{var k=new Object();k._method="get_index_product_list";k.did=f;AjaxRequest.post({url:d+"includes/ajax.php",parameters:k,onLoading:toggle_element("loading"),onSuccess:function(m){write_product_browse_list(f,g,d,m.responseText);toggle_element("loading")},onError:function(m){alert("Unable to retrieve product(s) for this product type");toggle_element("loading")}})}}}}}}function write_attribute_search_dd(j,g,d,f,a){if(j==""){return false}if(!f){var f=""}if(!a){var a=""}if(a!=""){if(a.indexOf("_")!=-1){var n=a.substring(0,a.indexOf("_"));a=a.substring(a.indexOf("_")+1)}else{var n=a;a=""}}var e=ASindex[j][2];var l=next_div("attSearch",g);var c=list_children(j,"as");if(ASindex[c[0]][0]=="Product Name"){if(arguments.length!=5){var k=new Object();k._method="get_index_product_list";k.did=j;AjaxRequest.post({url:d+"includes/ajax.php",parameters:k,onLoading:toggle_element("loading"),onSuccess:function(o){show_products(d,o.responseText,f);toggle_element("loading")},onError:function(o){alert("Unable to retrieve product(s) for this product type");toggle_element("loading")}})}$(g).innerHTML=""}else{if(j==asDid){$("content-browse").innerHTML="";$("content-browse").style.display="none";$("content").style.display="block"}else{if(arguments.length!=5){var k=new Object();k._method="get_index_product_list";k.did=j;AjaxRequest.post({url:d+"includes/ajax.php",parameters:k,onLoading:toggle_element("loading"),onSuccess:function(o){show_products(d,o.responseText,f);toggle_element("loading")},onError:function(o){alert("Unable to retrieve product(s) for this product type");toggle_element("loading")}})}}var h='<h4 class="light">'+ASindex[c[0]][1]+"</h4>\n";h+='<select name="'+j+'" onChange="search_choice(this, \''+l+"', 'as', '"+d+"', '"+f+"');\">\n";h+='<option value="'+j+'">-- All --</option>\n';var m=list_children(c[0],"as");for(i=0;i<m.length;i++){if(m[i]==n){h+='<option value="'+m[i]+'" selected>'+ASindex[m[i]][1]+"</option>\n"}else{h+='<option value="'+m[i]+'">'+ASindex[m[i]][1]+"</option>\n"}}h+='</select><div id="'+l+'"></div>\n';if($(g)){$(g).innerHTML=h}$("bottomDiv").innerHTML=""}if(j!=asDid){var b='<p class="light">Found Matches: '+e+"</p>";b+='<p id="reset"><input type="button" onClick="attribute_search();" value="Reset" /></p>\n';$("bottomDiv").innerHTML=b}if(trim(a)!=""){write_attribute_search_dd(n,l,d,f,a)}}function write_product_browse_dd(f,e,b,a){if(!a){var a=""}var j=next_div("prod-browse",e);var g='<form id="productBrowseForm"><h4 class="light">Browse Product Type</h4><select onChange="search_choice(this, \''+j+"', 'pb','"+b+'\');" />\n<option value="'+f+'">-- All --</option>\n';var k=list_children(f,"pb");for(var c=0,d=k.length;c<d;c++){g+='<option value="'+k[c]+'"'+((a!=""&&[c]==a)?" selected":"")+">"+PBindex[k[c]][1]+"</option>\n"}g+='</select>\n<div id="'+j+'"></div></form>\n';$(e).innerHTML=g;if(a!=""){var h=new Object();h._method="get_index_product_list";h.did=a;AjaxRequest.post({url:b+"includes/ajax.php",parameters:h,onLoading:toggle_element("loading"),onSuccess:function(l){write_product_browse_list(a,j,b,l.responseText);toggle_element("loading")},onError:function(l){alert("Unable to retrieve product(s) for this product type");toggle_element("loading")}})}}function write_product_browse_list(j,g,b,f){var d=window.location.pathname.split("/");var a=d[d.length-2];var c='<ul class="side-nav" style="width:180px">\n';if(f==""){alert("No data available for the selected category. Please try your request again.");product_browse("");return}f=json_decode(f);var h=f.products;for(var e=0,k=h.length;e<k;e++){if(a==h[e].filename){c+='<li><a class="current">'+h[e].productName+"</a></li>\n"}else{c+='<li onmouseover="show_product('+h[e].did+",'"+b+"','"+escape(json_encode(h[e]))+'\');" onmouseout="this.className=\'\';hide_product();"><a href="'+b+"products/"+h[e].filename+"/?pbid="+j+'">'+h[e].productName+"</a></li>\n"}}c+="</ul>\n";$(g).innerHTML=c}function show_products(c,a,e){if(a==""){alert("No data available for the selected category. Please try your request again.");attribute_search();return}var g=json_decode(unescape(a));g=g.products;var d=g.length;var b='<div id="content-header"><h4>Attribute Search</h4></div>';b+='<div class="section">';for(var f=0;f<d;f++){if(defined(g[f])){b+='<div class="box">';if(g[f].productImage!=""){b+=' <img class="thumbnail float-left" src="'+c+"content/products/images/thumb/"+g[f].productImage+'" alt="'+g[f].productName+'" />'}b+='<div class="box-text float-left">';b+=" <h3>"+g[f].productName+"</h3>";if(g[f].subtitle!="template"){b+=" <h4>"+g[f].subtitle+"</h4>"}if(g[f].productDescription!="template"){b+=" <p>"+g[f].productDescription+"</p>"}if(g[f].filename!=""){b+=' <p><a href="'+c+"products/"+g[f].filename+(e!=""?"/?ashist="+e:"")+'">View Product Page</a></p>'}b+="</div>";b+='<div class="clear"></div>';b+="</div>"}}b+="</div>";if($("results")){$("results").innerHTML="Found Matches: "+d}$("content").style.display="none";$("content-browse").innerHTML=b;$("content-browse").style.display="block"}function create_cookie(c,d,e){var a="";if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));a="; expires="+b.toGMTString()}else{a=""}document.cookie=c+"="+d+a+"; path=/"}function read_cookie(b){var f=b+"=";var a=document.cookie.split(";");for(var d=0,e=a.length;d<e;d++){var g=a[d];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function pre_activate_selection(a){a=$(a);if(a.className!="activeSelection"){set_opacity(a,1)}}function de_activate_selection(a){a=$(a);if(a.className!="activeSelection"){set_opacity(a,0.2);a.className=""}}function apply_selection(e,a){var d=child_elements(e);a=$(a);for(var c=0,b=d.length;c<b;c++){if(d[c].id!=""&&d[c].id!=a.id){set_opacity(d[c],0.2);d[c].className=""}}set_opacity(a,1);a.className="activeSelection"}function toggle_download_terms(b,a){b=typeof(b)!="undefined"?b:"hide";$("terms-agreement").style.display=(b=="show"&&($("terms-agreement").style.display=="none")?"":"none");if(a==""){$("file_to_download").value=1;$("file_requested").innerHTML=""}else{$("file_to_download").value=a;$("file_requested").innerHTML="<strong>Downloading file: "+$("file_"+a).innerHTML+"</strong>"}}function defined(a){return(a!=undefined)}function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push(document.getElementById(arguments[a]))}return d}if(is_string(b)){b=document.getElementById(b)}return b}function replace_chars(b){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return a[b]||"\\u00"+Math.floor(b.charCodeAt()/16).toString(16)+(b.charCodeAt()%16).toString(16)}function json_encode(b){switch(typeof(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,replace_chars)+'"';case"array":case"object":var a=[];for(var d in b){var c=json_encode(b[d]);if(c){a.push(json_encode(d)+":"+c)}}return"{"+a+"}";case"number":case"boolean":return String(b);case false:return"null"}return null}function json_decode(string){if(typeof(string)!="string"||!string.length){return null}if(!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}function base64_encode(e){var a=new String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");var c=new String();var d,f,b=0;while(e.length>=b+3){d=(e.charCodeAt(b++)&255)<<16|(e.charCodeAt(b++)&255)<<8|e.charCodeAt(b++)&255;c+=a.charAt((d&16515072)>>18)+a.charAt((d&258048)>>12)+a.charAt((d&4032)>>6)+a.charAt((d&63))}if((e.length-b)>0&&(e.length-b)<3){f=Boolean(e.length-b-1);d=((e.charCodeAt(b++)&255)<<16)|(f?(e.charCodeAt(b)&255)<<8:0);c+=a.charAt((d&16515072)>>18)+a.charAt((d&258048)>>12)+(f?a.charAt((d&4032)>>6):"=")+"="}return c}function base64_decode(f){var a=new String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");var e,b=new String();var d,c;for(c=0;c<f.length;c+=4){d=(a.indexOf(f.charAt(c))&255)<<18|(a.indexOf(f.charAt(c+1))&255)<<12|(a.indexOf(f.charAt(c+2))&255)<<6|a.indexOf(f.charAt(c+3))&255;b+=String.fromCharCode((d&16711680)>>16,(d&65280)>>8,d&255)}if(f.charCodeAt(c-2)==61){e=b.substring(0,b.length-2)}else{if(f.charCodeAt(c-1)==61){e=b.substring(0,b.length-1)}else{e=b}}return e}function toggle_element(a){$(a).style.display=($(a).style.display=="none"?"block":"none")}function trim(a){return(a?(a).toString().replace(/^\s+|\s+$/g,""):"")}function add_option(a,c){try{a.add(c,null)}catch(b){a.add(c,a.length)}}function remove_all_options(a){var b=a;a=$(a);if(a){a.options.length=1}}function format_currency(d){d=d.toString().replace(/\$|\,/g,"");if(isNaN(d)){d="0"}var b=(d==(d=Math.abs(d)));d=Math.floor(d*100+0.50000000001);var a=d%100;d=Math.floor(d/100).toString();if(a<10){a="0"+a}for(var c=0;c<Math.floor((d.length-(1+c))/3);c++){d=d.substring(0,d.length-(4*c+3))+","+d.substring(d.length-(4*c+3))}return(((b)?"":"-")+"$"+d+"."+a)}function remove(a){if($(a)){a=$(a);a.parentNode.removeChild(a)}}function scroll_to(b){b=$(b);var c=0;var a=0;do{c+=b.offsetTop||0;a+=b.offsetLeft||0;b=b.offsetParent}while(b);window.scrollTo(a,c);return b}function set_opacity(c,b){c=$(c);var a=navigator.userAgent.toLowerCase();if(/msie/.test(a)&&!/opera/.test(a)){if(!c.currentStyle||!c.currentStyle.hasLayout){c.style.zoom=1}c.style.filter=(parseInt(b)+""=="NaN"?"":"alpha(opacity="+(b*100)+")")}else{c.style.opacity=(parseFloat(b)=="NaN"?"":b)}}function next_siblings(a){a=$(a);var b=[];while((a=a.nextSibling)){if(a.nodeType==1){b.push($(a))}}return b}function child_elements(a){if(!(a=$(a).firstChild)){return[]}while(a&&a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat(next_siblings(a))}return[]}function get_elements_by_class_name(h,g){if(!g){g=document.getElementsByTagName("body")[0]}var b=[];var f=new RegExp("\\b"+h+"\\b");var e=g.getElementsByTagName("*");for(var d=0,c=e.length;d<c;d++){if(f.test(e[d].className)){b.push(e[d])}}return b}function explode_array(c,a){var e=new Array(1);var b=0;var d=new String(c);while(d.indexOf(a)>0){e[b]=d.substr(0,d.indexOf(a));d=d.substr(d.indexOf(a)+1,d.length-d.indexOf(a)+1);b=b+1}e[b]=d;return e}function open_window(a,c,b){window.open(a,c,b)}function get_url_parameter(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+b+" = ([^&#]*)";var d=new RegExp(a);var c=d.exec(window.location.href);return((c==null)?"":c[1])}function write_breadcrumb(a){var b=$("bread-crumbs");(b)?b.innerHTML="<b>"+a+"</b>":""}function toggle_expand_collapse(a){a=$(a);a.className=(a.className=="expand")?"collapse":"expand"}function print_r(c,a){var b="";if(a==undefined){a=" "}else{a+=" "}if(c.constructor==Array||c.constructor==Object){for(var e in c){if(c[e].constructor==Array||c[e].constructor==Object){var d=(c[e].constructor==Array)?"Array":"Object";b+=a+"["+e+"]("+d+")=>\n";b+=print_r(c[e],a)}else{b+=a+"["+e+"]:"+c[e]+"\n"}}}return b}function is_string(a){return(typeof(a)=="string")}function is_integer(a){var b=/^[-+]?[1-9]\d*$/;return(b.test(a)?true:false)}function is_float(a){var b=/^[-+]?\d*\.?\d*$/;return(b.text(a)?true:false)}function is_currency(a){var b=/^\$?(\d{1,3},?(\d{3},?)*\d{3}(\.\d{0,2})?|\d{1,3}(\.\d{0,2})?|\.\d{1,2}?)$/;return(b.test(a)?true:false)}function is_email(a){var b=/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;return(b.test(a)?true:false)}function is_date(a){var b=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return(b.test(a)?true:false)}function is_postalcode(a){var b=/^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$/;return(b.test(a)?true:false)}function is_phone(a){var b=/^([a-zA-Z,#\/ \.\(\)\-\+\*]*[0-9]){7}[0-9a-zA-Z,#\/ \.\(\)\-\+\*]*$/;return(b.test(a)?true:false)}function validate_form(b){b=$(b);for(c=0;c<b.length;c++){if(b[c].id!=""&&b[c].type!="hidden"){if(b[c].type=="select-one"){if(b[c].getAttribute("required")=="required"&&!b[c].selectedIndex>0){alert(($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+" is required.");b[c].focus();return false}}else{if(b[c].type=="radio"||b[c].type=="checkbox"&&b[c].getAttribute("required")=="required"){var f=b[c].name;var e=false;var a=b.getElementsByTagName("input");for(var c=0,d=a.length;c<d;c++){if(a[c].type=="radio"){if(a[c].checked){e=true}}}if(!e){alert(($("lbl_"+f)?$("lbl_"+f).innerHTML:f)+" is required.");return false}}else{if(b[c].getAttribute("required")=="required"){switch(b[c].getAttribute("datatype")){case"integer":if(trim(b[c].value)==""||!is_integer(b[c].value)){alert(($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+" must be an integer value.");b[c].focus();return false}break;case"float":if(trim(b[c].value)==""||!is_float(b[c].value)){alert(($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+" must be a float value.");b[c].focus();return false}break;case"currency":if(trim(b[c].value)==""||!is_currency(b[c].value)){alert(($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+" must be a currency value.");b[c].focus();return false}break;case"email":if(trim(b[c].value)==""||!is_email(b[c].value)){alert("Please enter a valid email address for "+($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+".");b[c].focus();return false}break;case"date":if(trim(b[c].value)==""||!is_date(b[c].value)){alert("Please enter a valid date for "+($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+" in the format (mm/dd/yyyy).");b[c].focus();return false}break;case"zip_code":if(trim(b[c].value)==""||!is_postalcode(b[c].value)){alert("Please enter a valid postal code for "+($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+".");b[c].focus();return false}break;case"phone":if(trim(b[c].value)==""||!is_phone(b[c].value)){alert("Please enter a valid phone number for "+($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+".");b[c].focus();return false}break;case"string":default:if(trim(b[c].value)==""||!is_string(b[c].value)){alert(($("lbl_"+b[c].id)?$("lbl_"+b[c].id).innerHTML:b[c].id)+" is required.");b[c].focus();return false}break}}}}}}return true}function validate_search(a){if((a.zip.value.length<5||trim(a.zip.value)==""||!is_postalcode(trim(a.zip.value)))&&(a.city.value.length==0&&a.state.selectedIndex==0)){alert("Please enter a valid zip code OR a valid city and state.");return false}else{if(a.zip.value.length==0){if(a.city.value.length==0&&a.state.selectedIndex==0||a.city.value.length>0&&a.state.selectedIndex==0||a.state.selectedIndex>0&&a.city.value.length==0){alert("Please enter the City and State or search by Zip code.");return false}}}return true}function validate_quantity(f,e){var d="0123456789";var c="yes";var a;for(var b=0;b<f.value.length;b++){a=""+f.value.substring(b,b+1);if(d.indexOf(a)=="-1"){c="no"}if(f.value=="0"){c="no"}}if(c=="no"){alert("Please enter a valid quantity.");if(e){var g=f.id.toString().replace("cart_item_quantity_","");f.value=$("_item_quantity_"+g).value}f.select();return false}else{return true}}function validate_order(){var d=0;var e=0;var a=$("cart-details").getElementsByTagName("input");var b=0;for(var c=0;c<a.length;c++){if((a[c].type=="hidden")&&(a[c].id!="")&&(a[c].id.indexOf("_item_quantity_")!=-1)){b=a[c].id.toString().replace("_item_quantity_","");e+=parseInt($("_item_quantity_"+b).value);d+=(parseInt($("_item_quantity_"+b).value)*parseFloat($("_item_price_"+b).value))}}if(d>1000000){alert("Please contact us to place your order");return false}else{return true}}function validate_selections(){if(($("voltage").selectedIndex>0)&&($("number_lamps").selectedIndex>0)&&($("lamp_type").selectedIndex>0)&&($("number_circuits").selectedIndex>0)){get_row_length_by_configuration()}else{remove_all_options($("length"));$("length").disabled=true;$("configure").disabled=true;$("results-div").innerHTML=""}}function validate_agreement(){if(!($("agreement").checked)){alert("You must agree to the terms of use agreement in order to download this file.");return false}else{return true}}function validate_password_reset_form(a){if(a.password.value.length<5){alert("Password must be at least 5 characters.");a.password.value="";a.confirm_password.value="";a.password.focus();return false}if(a.confirm_password.value.length<5){alert("Please confirm the password entered.");a.confirm_password.value="";a.confirm_password.focus();return false}if(a.password.value!=a.confirm_password.value){alert("The two passwords you entered do not match. Please re-enter your password.");a.password.value="";a.confirm_password.value="";a.password.focus();return false}return true}function process_form(b){if(validate_form(b)){var c=new Array;for(i=0;i<b.length;i++){if(b[i].id!=""&&b[i].type!="reset"&&b[i].type!="submit"){var a=new Object;a.id=b[i].id;a.label=($("lbl_"+b[i].id)?escape($("lbl_"+b[i].id).innerHTML):"");a.value=escape(b[i].value);a.required=b[i].getAttribute("required");a.datatype=b[i].getAttribute("datatype");a.type=b[i].type;c[a.id]=a}}alert("1/14/2009 - C.D.H.\n\nNeed to verify path for core form_processor.php page!");return false;var d=new Object();d._method="process_form_submission";d.data=json_encode(c);AjaxRequest.post({url:"../../../core"+(aspb==1?"_dev":(aspb==2?"_test":(aspb==3?"_qa":"_prod")))+"/includes/form_processor.php",parameters:d,onLoading:toggle_element("loading"),onSuccess:function(e){if(e.responseText!=1){alert(e.responseText)}else{$("form-results").innerHTML="<p>Thank you for your questions/comments.<br/>You will receive a reply from our respective department very soon.</p>";$("form-contents-div").style.display="none"}},onError:function(e){alert("Ajax error:\n"+e.statusText)},onComplete:toggle_element("loading")})}return false}function add_to_cart(m){var d=$("total_items").value;var c=(parseInt(d)+1);var j=($("product_name_"+m)?$("product_name_"+m).innerHTML:"");var b=($("product_number_"+m)?$("product_number_"+m).innerHTML:"");var g=$("product_description_"+m).innerHTML;var k=$("product_quantity_"+m).value;var a=($("product_price_"+m).value/100);var h=($("product_size_"+m)?$("product_size_"+m).value:"");if(k==""){alert("Please enter a quantity for item: "+j);return}if($("item_id_"+m+(h!=""?"_"+h:""))){update_cart(m,$("item_id_"+m+(h!=""?"_"+h:"")).value,k)}else{var l=build_shopping_cart_row(c,m,k,a,j,b,g,h);var f=$(d==0?"cart_header":"cart_item_"+d);var e=f.nextSibling;(e)?f.parentNode.insertBefore(l,e):f.parentNode.appendChild(l);$("total_items").value=(parseInt(d)+parseInt(1));update_cart_subtotal()}$("product_quantity_"+m).value="";if(h!=""){$("product_size_"+m).selectedIndex=0}scroll_to("cart-details")}function build_shopping_cart_row(d,o,m,a,k,b,g,h){var n="";var l="";var c="";var f="";var j="";var e="";n=document.createElement("tr");n.setAttribute("id","cart_item_"+d);n.setAttribute("class","cart-content");l=document.createElement("td");l.setAttribute("height","30");f=document.createElement("a");f.setAttribute("href","javascript:void(0);");f.setAttribute("onclick","scroll_to('product_"+o+"');");f.appendChild(document.createTextNode(((b!="")?b+" - "+((k!="")?k:g):"")+((h!="")?" ("+h+")":"")));l.appendChild(f);n.appendChild(l);l=document.createElement("td");l.setAttribute("align","left");l.setAttribute("height","30");l.appendChild(document.createTextNode(format_currency(a)));n.appendChild(l);l=document.createElement("td");l.setAttribute("height","30");j=document.createElement("input");j.setAttribute("type","hidden");j.setAttribute("id","item_id_"+o+(h!=""?"_"+h:""));j.setAttribute("name","item_id_"+o+(h!=""?"_"+h:""));j.setAttribute("value",d);l.appendChild(j);j=document.createElement("input");j.setAttribute("type","hidden");j.setAttribute("id","item_name_"+d);j.setAttribute("name","item_name_"+d);j.setAttribute("value",(b!=""?b:(k!=""?k:g)));l.appendChild(j);j=document.createElement("input");j.setAttribute("type","hidden");j.setAttribute("id","item_description_"+d);j.setAttribute("name","item_description_"+d);j.setAttribute("value",((k!="")?k:g)+((h!="")?" ("+h+")":""));l.appendChild(j);j=document.createElement("input");j.setAttribute("type","hidden");j.setAttribute("id","item_quantity_"+d);j.setAttribute("name","item_quantity_"+d);j.setAttribute("value",m);l.appendChild(j);j=document.createElement("input");j.setAttribute("type","hidden");j.setAttribute("id","item_price_"+d);j.setAttribute("name","item_price_"+d);j.setAttribute("value",a);l.appendChild(j);j=document.createElement("input");j.setAttribute("type","text");j.setAttribute("id","cart_item_quantity_"+d);j.setAttribute("name","cart_item_quantity_"+d);j.setAttribute("value",m);j.setAttribute("size","1");j.setAttribute("onchange","if(validate_quantity(this, true)){update_cart("+o+", "+d+", this.value, true);}");l.appendChild(j);n.appendChild(l);l=document.createElement("td");l.setAttribute("align","left");l.setAttribute("height","30");l.setAttribute("id","cart_item_price_"+d);l.appendChild(document.createTextNode(format_currency(parseFloat(a)*parseInt(m))));n.appendChild(l);l=document.createElement("td");l.setAttribute("height","30");l.setAttribute("align","center");e=document.createElement("img");e.setAttribute("src","images/merchandise-delete-icon.jpg");e.setAttribute("alt","Delete Item");f=document.createElement("a");f.setAttribute("href","javascript:remove_from_cart("+d+");");f.setAttribute("class","remove");f.appendChild(e);l.appendChild(f);n.appendChild(l);return n}function update_cart(c,f,e,b){if(e!=""){var a=(b?e:(parseInt($("item_quantity_"+f).value)+parseInt(e)));var d=$("item_price_"+f).value;$("cart_item_quantity_"+f).value=a;$("cart_item_price_"+f).innerHTML=format_currency(a*d);$("item_quantity_"+f).value=a;update_cart_subtotal()}}function update_cart_subtotal(){var b=$("total_items").value;var e=0;var f=0;var a=$("cart-details").getElementsByTagName("input");var c=0;for(var d=0,g=a.length;d<g;d++){if((a[d].type=="hidden")&&(a[d].id!="")&&(a[d].id.indexOf("item_quantity_")!=-1)){c=a[d].id.toString().replace("item_quantity_","");f+=parseInt($("item_quantity_"+c).value);e+=(parseInt($("item_quantity_"+c).value)*parseFloat($("item_price_"+c).value))}}e=format_currency(e);$("cart_subtotal").innerHTML="<strong>"+e+"</strong>";if(b==0){$("btn-checkout").src=checkout_url+"buttons/checkout.gif?merchant_id="+merchant_id+"&w=160&h=43&style=white&variant=disabled&loc=en_US";$("btn-checkout").disabled=true}else{$("empty_cart").style.display="none";$("btn-checkout").src=checkout_url+"buttons/checkout.gif?merchant_id="+merchant_id+"&w=160&h=43&style=white&variant=text&loc=en_US";$("btn-checkout").disabled=false}$("cart-summary").innerHTML="("+f+") items in your cart "+e}function empty_cart(){var c=get_elements_by_class_name("cart-content",$("cart-table"));var b=parseInt(c.length);for(var a=0;a<b;a++){if(c[a].id.indexOf("cart_item_")!=-1){remove(c[a].id)}}$("total_items").value=0;update_cart_subtotal();$("empty_cart").style.display=""}function remove_from_cart(a){remove($("cart_item_"+a));$("total_items").value=(parseInt($("total_items").value)-parseInt(1));update_cart_subtotal();if($("total_items").value==0){$("empty_cart").style.display=""}}function get_product_row_length(){$("results-div").innerHTML="";var b=$("length").value;var d=$("product").value;if(d==""||b==""){alert("Please select a valid Product and Row Length");return}else{var a=function(){alert("Please consult factory.")};var e=function(f){if(f.responseText==""){alert("Please consult factory.")}else{$("results-div").innerHTML=f.responseText}};var c=new Object();c._method="get_product_row_length";c.product=d;c.row_length=b;AjaxRequest.post({url:"includes/ajax.php",parameters:c,onLoading:toggle_element("loading"),onSuccess:e,onError:a,onComplete:toggle_element("loading")})}}function get_row_length_by_configuration(){$("results-div").innerHTML="";remove_all_options($("length"));$("length").disabled=true;$("configure").disabled=true;var g=$("voltage").value;var e=$("number_lamps").value;var b=$("lamp_type").value;var c=$("number_circuits").value;if(g==""&&e==""&&b==""&&c==""){alert("Please select an option from each drop down menu");return}else{var a=function(h){alert("Unable to retrieve available row length(s) for this product");$("length").disabled=true};var f=function(l){if(l.responseText==""){alert("Unable to retrieve available row length(s) for this product");$("length").disabled=true}else{var h=json_decode(l.responseText);var m=$("length");for(var k=0,j=h.length;k<j;k++){add_option(m,new Option(h[k].row_length))}$("length").disabled=false}};var d=new Object();d._method="get_row_length_by_configuration";d.voltage=g;d.number_lamps=e;d.lamp_type=b;d.number_circuits=c;AjaxRequest.post({url:"includes/ajax.php",parameters:d,onLoading:toggle_element("loading"),onSuccess:f,onError:a,onComplete:toggle_element("loading")})}}function get_configuration_list_by_product(c){if(c!=""){if($("results-div")){$("results-div").innerHTML=""}remove_all_options($("length"));if($("length")){$("length").disabled=true}if($("configure")){$("configure").disabled=true}var a=function(){alert("Unable to retrieve row length configuration for this product")};var d=function(h){if(h.responseText==""){alert("Unable to retrieve row length configuration for this product")}else{var g=new Array($("voltage"),$("number_lamps"),$("lamp_type"),$("number_circuits"));var l=json_decode(h.responseText);for(var j=0,k=g.length;j<k;j++){remove_all_options(g[j].id);for(var f=0,e=l[g[j].id].length;f<e;f++){add_option(g[j],new Option(l[g[j].id][f]))}g[j].disabled=false}}};var b=new Object();b._method="get_configuration_list_by_product";b.product=c;AjaxRequest.post({url:"includes/ajax.php",parameters:b,onLoading:toggle_element("loading"),onSuccess:d,onError:a,onComplete:toggle_element("loading")})}else{reset_row_configurator()}}function get_product_list_by_type(a,d){if(d!=""){var c=function(f){if(f.responseText==""){alert("Unable to retrieve product(s) for this product type");$(a).disabled=true}else{remove_all_options(a);var g=json_decode(f.responseText);for(var e=0;e<g.length;e++){add_option($(a),new Option(g[e].productnamedescr,g[e].idproductname))}$(a).disabled=false;$("configure").disabled=false}};var b=new Object();b._method="get_product_list_by_type";b.product_type=d;AjaxRequest.post({url:"includes/ajax.php",parameters:b,onLoading:toggle_element("loading"),onSuccess:c,onError:function(e){alert("Unable to retrieve product(s) for this product type");$(a).disabled=true},onComplete:toggle_element("loading")})}else{remove_all_options($(a));$(a).disabled=true;remove_all_options($("number_lamps"));$("number_lamps").disabled=true;$(a).selectedIndex=0;if($F("catalog_number").length==0){$("configure").disabled=true}}}function get_product_row_list(a,d){$("results-div").innerHTML="";if(d!=""){var b=function(f){alert("Unable to retrieve available row length(s) for this product");$(a).disabled=true};var e=function(g){if(g.responseText==""){alert("Unable to retrieve available row length(s) for this product");$(a).disabled=true}else{remove_all_options(a);var h=json_decode(g.responseText);for(var f=0;f<h.length;f++){add_option($(a),new Option(h[f].productnamedescr,h[f].idproductname))}$(a).disabled=false}};var c=new Object();c._method=get_product_row_list;c.product=d;AjaxRequest.post({url:"includes/ajax.php",parameters:c,onLoading:toggle_element("loading"),onSuccess:e,onError:b,onComplete:toggle_element("loading")})}else{$(a).disabled=true;$("doWork").disabled=true;$(a).selectedIndex=0;$("results-div").innerHTML=""}}function toggle_row_length_configuration_button(){$("results-div").innerHTML="";if($("length").selectedIndex==0){$("configure").disabled=true}else{$("configure").disabled=false}}function reset_row_configurator(){$("product").selectedIndex=0;remove_all_options($("voltage"));remove_all_options($("number_lamps"));remove_all_options($("lamp_type"));remove_all_options($("number_circuits"));remove_all_options($("length"));$("voltage").disabled=true;$("number_lamps").disabled=true;$("lamp_type").disabled=true;$("number_circuits").disabled=true;$("length").disabled=true;$("results-div").innerHTML="";$("configure").disabled=true}function reset_photometry_search(){$("product_type").selectedIndex=0;remove_all_options($("product"));$("product").disabled=true;remove_all_options($("number_lamps"));$("number_lamps").disabled=true;$("catalog_number").value="";$("search").disabled=true;$("results-div").innerHTML="";$("product-image-div").innerHTML=""}function get_photometry_search(a){$("results-div").innerHTML="";var g=$("product_type").value;var e=$("product").value;var d=$("number_lamps").value;var b=$("catalog_number").value;if(g==""&&e==""&&d==""&&b==""){alert("Please select at least one search criteria.");return}else{var f=function(k){if(k.responseText==""){alert("Please consult factory.")}else{var l=json_decode(k.responseText);for(var j=0,h=l.length;j<h;j++){$("results-div").innerHTML+="<div><strong>"+l[j].catnum+"</strong><br /><i>Description:&nbsp;</i>"+l[j].lumdescr+"<br /><i>Test Number:&nbsp;</i>"+l[j].testnum+'&nbsp;&nbsp;<a href="'+a+"products/ies/ies_files/"+l[j].testnum+'.IES" target="_blank">IES File</a>&nbsp;&nbsp;<a href="'+$rel+"products/ies/ies_reports/"+l[j].testnum+'.pdf" target="_blank">PDF Test Report</a></div><div class="spacer"><span>Spacer</span></div>'}}};var c=new Object();c._method=get_photometry_search;c.product_type=g;c.product=e;c.number_lamps=d;c.catalog_number=b;AjaxRequest.post({url:"includes/ajax.php",parameters:c,onLoading:toggle_element("ps-loader"),onSuccess:f,onError:function(){alert("Please consult factory.")},onComplete:toggle_element("ps-loader")})}}function toggle_photometry_search_button(){var c=$("product_type").value;var b=$("product").value;var a=$("number_lamps").value;var d=$("catalog_number").value;if(d.length>0){$("search").enable()}else{if(b==""&&c==""&&a==""&&d==""){$("search").disabled=true}}}var liveSearchReq=false;var t=null;var liveSearchLast="";var isIE=false;function liveSearchInit(){if(navigator.userAgent.indexOf("Safari")>0){$("livesearch").addEventListener("keydown",liveSearchKeyPress,false)}else{if(navigator.product=="Gecko"){$("livesearch").addEventListener("keypress",liveSearchKeyPress,false);$("livesearch").addEventListener("blur",liveSearchHideDelayed,false)}else{$("livesearch").attachEvent("onkeydown",liveSearchKeyPress);isIE=true}}$("livesearch").setAttribute("autocomplete","off")}function liveSearchHideDelayed(){window.setTimeout("liveSearchHide()",200)}function liveSearchHide(){$("search_results").style.display="none";var a=$("LSHighlight");if(a){a.removeAttribute("id")}}function liveSearchKeyPress(a){if(a.keyCode==40){highlight=$("LSHighlight");if(!highlight){highlight=$("search_results_shadow").firstChild.firstChild}else{highlight.removeAttribute("id");highlight=highlight.nextSibling}if(highlight){highlight.setAttribute("id","LSHighlight")}if(!isIE){a.preventDefault()}}else{if(a.keyCode==38){highlight=$("LSHighlight");if(!highlight){highlight=$("search_results").firstChild.firstChild.lastChild}else{highlight.removeAttribute("id");highlight=highlight.previousSibling}if(highlight){highlight.setAttribute("id","LSHighlight")}if(!isIE){a.preventDefault()}}else{if(a.keyCode==27){highlight=$("LSHighlight");if(highlight){highlight.removeAttribute("id")}$("search_results").style.display="none"}else{if(a.keyCode==8&&isIE){liveSearchStart()}}}}}function liveSearchStart(a){if(t){window.clearTimeout(t)}t=window.setTimeout("liveSearchDoSearch('"+a+"')",200)}function liveSearchDoSearch(a){if(typeof(liveSearchRootSubDir)=="undefined"){liveSearchRootSubDir=""}if(typeof(liveSearchParams)=="undefined"){liveSearchParams2=""}else{liveSearchParams2="&"+liveSearchParams}if(liveSearchLast!=document.forms.searchform.q.value){if(liveSearchReq&&liveSearchReq.readyState<4){liveSearchReq.abort()}if(document.forms.searchform.q.value==""){liveSearchHide();liveSearchLast="";return false}var c=function(f){var e=$("search_results");e.style.display="block";var d=$("search_results_shadow");if(trim(f.responseText)==""){liveSearchHide()}else{d.innerHTML=f.responseText}};var b=new Object();b._method="product_search_suggest";b.q=document.forms.searchform.q.value;AjaxRequest.post({url:"includes/ajax.php",parameters:b,onLoading:toggle_element("loading"),onSuccess:c,onError:function(){alert("Unable to retrieve list of products.")},onComplete:toggle_element("loading")})}}function liveSearchSubmit(){var a=$("LSHighlight");if(a&&a.firstChild){window.location=liveSearchRootSubDir+a.firstChild.nextSibling.getAttribute("href");return false}else{return true}}function closeResults(){$("search_results").style.display="none"}var first,last,nav_first,nav_last,pre_first=0,pre_last=9;function set_active(b){for(var a=0;a<document.getElementById("search-nav-top").getElementsByTagName("a").length;a++){document.getElementById("search-nav-top").getElementsByTagName("a")[a].className="nav-paging"}for(var a=0;a<document.getElementById("search-nav-bottom").getElementsByTagName("a").length;a++){document.getElementById("search-nav-bottom").getElementsByTagName("a")[a].className="nav-paging"}document.getElementById("navLinkT"+b).className="nav-paging-active";document.getElementById("navLinkB"+b).className="nav-paging-active"}function nav(){results=json_decode(results);var c=str_nav_bottom=nav_next=nav_previous="",a=Math.ceil(results.length/10);for(var b=0;b<a;b++){if(b==0){pre_first=0;pre_last=(((b+1)>=a)?results.length:9);nav_first=pre_first;nav_last=pre_last;first=nav_first;last=nav_last}else{if((b+1)>=a){pre_first=pre_last+1;pre_last=results.length}else{pre_first+=10;pre_last+=10}}c+='<a id="navLinkT'+b+'" href="javascript:show_search_results('+pre_first+","+pre_last+");set_active("+b+');" class="nav-paging">'+(b+1)+"</a>&nbsp;";str_nav_bottom+='<a id="navLinkB'+b+'" href="javascript:show_search_results('+pre_first+","+pre_last+");set_active("+b+');" class="nav-paging">'+(b+1)+"</a>&nbsp;"}document.getElementById("search-nav-top").innerHTML=c;document.getElementById("search-nav-bottom").innerHTML=str_nav_bottom}var tabdropdown={disappeardelay:200,disablemenuclick:false,enableiframeshim:1,dropmenuobj:null,ie:document.all,firefox:$&&!document.all,previousmenuitem:null,currentpageurl:window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,""),getposOffset:function(d,c){var b=(c=="left")?d.offsetLeft:d.offsetTop;var a=d.offsetParent;while(a!=null){b=(c=="left")?b+a.offsetLeft:b+a.offsetTop;a=a.offsetParent}return b},showhide:function(c,b,a){if(this.ie||this.firefox){this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"}if(b.type=="click"&&c.visibility==hidden||b.type=="mouseover"){if(a.parentNode.className.indexOf("default")==-1){a.parentNode.className="selected"}c.visibility="visible"}else{if(b.type=="click"){c.visibility="hidden"}}},iecompattest:function(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body},clearbrowseredge:function(e,c){var b=0;if(c=="rightedge"){var d=this.ie&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15;this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth;if(d-this.dropmenuobj.x<this.dropmenuobj.contentmeasure){b=this.dropmenuobj.contentmeasure-e.offsetWidth}}else{var a=this.ie&&!window.opera?this.standardbody.scrollTop:window.pageYOffset;var d=this.ie&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18;this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight;if(d-this.dropmenuobj.y<this.dropmenuobj.contentmeasure){b=this.dropmenuobj.contentmeasure+e.offsetHeight;if((this.dropmenuobj.y-a)<this.dropmenuobj.contentmeasure){b=this.dropmenuobj.y+e.offsetHeight-a}}this.dropmenuobj.firstlink.style.borderTopWidth=(b==0)?0:"1px"}return b},dropit:function(c,b,a){if(this.dropmenuobj!=null){this.dropmenuobj.style.visibility="hidden";if(this.previousmenuitem!=null&&this.previousmenuitem!=c){if(this.previousmenuitem.parentNode.className.indexOf("default")==-1){this.previousmenuitem.parentNode.className=""}}}this.clearhidemenu();if(this.ie||this.firefox){c.onmouseout=function(){tabdropdown.delayhidemenu(c)};c.onclick=function(){return !tabdropdown.disablemenuclick};this.dropmenuobj=$(a);this.dropmenuobj.onmouseover=function(){tabdropdown.clearhidemenu()};this.dropmenuobj.onmouseout=function(d){tabdropdown.dynamichide(d,c)};this.dropmenuobj.onclick=function(){tabdropdown.delayhidemenu(c)};this.showhide(this.dropmenuobj.style,b,c);this.dropmenuobj.x=this.getposOffset(c,"left");this.dropmenuobj.y=this.getposOffset(c,"top");this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(c,"rightedge")+"px";this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(c,"bottomedge")+c.offsetHeight+1+"px";this.previousmenuitem=c;this.positionshim()}},contains_firefox:function(d,c){while(c.parentNode){if((c=c.parentNode)==d){return true}}return false},dynamichide:function(c,b){var a=window.event?window.event:c;if(this.ie&&!this.dropmenuobj.contains(a.toElement)){this.delayhidemenu(b)}else{if(this.firefox&&c.currentTarget!=a.relatedTarget&&!this.contains_firefox(a.currentTarget,a.relatedTarget)){this.delayhidemenu(b)}}},delayhidemenu:function(a){this.delayhide=setTimeout(function(){tabdropdown.hideshim();tabdropdown.dropmenuobj.style.visibility="hidden";if(a.parentNode.className.indexOf("default")==-1){a.parentNode.className=""}},this.disappeardelay)},clearhidemenu:function(){if(this.delayhide!="undefined"){clearTimeout(this.delayhide)}},positionshim:function(){if(this.enableiframeshim&&typeof this.shimobject!="undefined"){if(this.dropmenuobj.style.visibility=="visible"){this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px";this.shimobject.style.left=this.dropmenuobj.style.left;this.shimobject.style.top=this.dropmenuobj.style.top}this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")?"block":"none"}},hideshim:function(){if(this.enableiframeshim&&typeof this.shimobject!="undefined"){this.shimobject.style.display="none"}},isSelected:function(a){a=a.replace("http://"+a.hostname,"").replace(/^\//,"");return(tabdropdown.currentpageurl==a)},init:function(e,c){if(defined($(e))){this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;var f=$(e).getElementsByTagName("a");for(var d=0;d<f.length;d++){if(f[d].getAttribute("rel")){var a=f[d].getAttribute("rel");$(a).firstlink=$(a).getElementsByTagName("a")[0];f[d].onmouseover=function(h){var g=typeof h!="undefined"?h:window.event;tabdropdown.dropit(this,g,this.getAttribute("rel"))}}if(c=="auto"&&typeof b=="undefined"&&this.isSelected(f[d].href)){f[d].parentNode.className+=" selected default";var b=true}else{if(parseInt(c)==d){f[d].parentNode.className+=" selected default"}}}if(this.enableiframeshim&&document.all&&!window.XDomainRequest&&!this.iframeshimadded){document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>');this.shimobject=document.getElementById("iframeshim");this.shimobject.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";this.iframeshimadded=true}}}};