// JavaScript Document

// Global scripts for ucoatit.com 2007 site
// Authored for UCoat It America, LLC - SPB 05/04/07


function launchplanner(){parent.frames['mainFrame'].location='planner/planner.htm';}

//-------------------------------------------------------------------------------------BEGIN FUNCTION
function highlightMenu(a){
	for(i=1; i<6; i++){
		var thislink=document.getElementById('link'+String(i));
		if (a==i){thislink.className='menulinkover';}else{thislink.className='menulink';}
	}
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function resetMenu(){
	for(i=1; i<6; i++){
		var thislink=document.getElementById('link'+String(i));
		thislink.className='menulink';
	}
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function highlightSub(a, b){
	var thissub=document.getElementById('sub'+b);
	var thissubicn=document.getElementById('subicn'+b);
	if(a=='over'){thissub.className='subitemup'; thissubicn.src='../imgs/subup.gif';}else{thissub.className='subitem'; thissubicn.src='../imgs/subdn.gif';}
}//------------------------------------------------------------------------------------END FUNCTION
//-----------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function findPos(obj) {
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return {curleft:curleft, curtop:curtop}
}//----------------------------------------------------------------------------------------------------------END OF FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function getSubmenu(a){
	var menuitems=new Array();
		if (a==1){menuitems=Array('About Our Company','About Our Products','News &amp; Announcements','Show Schedule');}
		if (a==2){menuitems=Array('Garage &amp; Automotive Floors','Basement &amp; Interior Floors','Commercial &amp; Industrial Floors','Full Product List');}
		if (a==3){menuitems=Array('UCoat It<span class="registered">&reg;</span> Color Simulator','Photo Gallery','Video Segment from My Classic Car<span class="registered">&reg;</span> with Dennis Gage','Download UCoat It Instructional Video');}
		if (a==4){menuitems=Array('Product Instruction Manuals (MSDS)','Frequently Asked Questions','Preparing a Floor for UCoat It','Advanced Coating Techniques','Cleaning &amp; Maintenance');}
		if (a==5){menuitems=Array('UCoat It<span class="registered">&reg;</span> Material Estimator','Search for a Local Dealer','Purchasing Information','Shipping &amp; Return Policies');}
	return menuitems;
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function getPageTitle(){
	var myurl=String(document.location);
	var pos=myurl.indexOf('.htm');
	var pgid=myurl.substring(pos-2, pos-1); pgid=parseFloat(pgid);
	var subid=myurl.substring(pos-1, pos); subid=parseFloat(subid);
	var mytitle=getSubmenu(pgid);
	document.write(mytitle[subid]);
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function jumpLink(a,b){
	var jumppage='error';
	var pagesnames=new Array();
	b=parseFloat(b);
	if (a==1){pagenames=Array('about_co','about_prod','news','shows'); jumppage=pagenames[b];}
	if (a==2){pagenames=Array('garages','interiors','commercial','products'); jumppage=pagenames[b];}
	if (a==3){pagenames=Array('simulator','gallery','gagevideo','installvideo'); jumppage=pagenames[b];}
	if (a==4){pagenames=Array('instructions','faq','floorprep','advanced','maintenance'); jumppage=pagenames[b];}
	if (a==5){pagenames=Array('estimator','dealersearch','purchase','ship_policy'); jumppage=pagenames[b];}
	//document.location='../pgs/'+String(a)+String(b)+'.htm';
	document.location='../pgs/'+String(jumppage)+'.htm';
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function jumpAnchor(a){document.location='#'+String(a);
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function highlightSolution(a, b){
	var thissub=document.getElementById('solsub'+b);
	if(a=='over'){thissub.className='solution_menu_over';}else{thissub.className='solution_menu';}
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function tourSolution(a){document.location='../pgs/'+a+'11.htm';
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function leftMenu(a, b){
	var thisitem=document.getElementById('left'+a);
	if(b=='out'){thisitem.className='left_linkitem';}
	if(b=='over'){thisitem.className='left_linkitemover';}
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function infoKit(a){
	var usercart=parent.document.getElementById('topFrame').contentWindow.document.getElementById('usercart');
	var userinfo=parent.document.getElementById('topFrame').contentWindow.document.getElementById('userinfo');
	
	if(a==0){
		usercart.i0010.value=0;
		userinfo.usertotal.value=parseFloat(userinfo.usertotal.value)-19.95;}
	if(a==1){
		usercart.i0010.value=1;
		userinfo.usertotal.value=parseFloat(userinfo.usertotal.value)+19.95;}
	usercart.submit();
}//------------------------------------------------------------------------------------END FUNCTION
//-------------------------------------------------------------------------------------BEGIN FUNCTION
function infokitCart(){
	var usercart=parent.document.getElementById('topFrame').contentWindow.document.getElementById('usercart');
	var qty = usercart.i0010.value;
	qty=parseFloat(qty);
	if(qty==0){
		document.write('<p><a href="javascript:infoKit(1)">Add this item to cart?</a></p>');}
	if(qty==1){
		document.write('<p><a href="javascript:infoKit(0)">Remove this item from cart?</a></p>');}
}//------------------------------------------------------------------------------------END FUNCTION

//-------------------------------------------------------------------------------------BEGIN FUNCTION
function highlightkitContents(a, b){
	var thisitem=document.getElementById('contents'+a);
	if(b=='over'){thisitem.className='contents_lite';}
	if(b=='out'){thisitem.className='contents_norm';}
}//------------------------------------------------------------------------------------END FUNCTION

//-------------------------------------------------------------------------------------BEGIN FUNCTION
function filterProducts(a){
	alert(a);
}//------------------------------------------------------------------------------------END FUNCTION

//-------------------------------------------------------------------------------------BEGIN FUNCTION
function colorFlicker(a){
	var flickerimg=document.getElementById('flickerimg'); flickerimg.src='../imgs/sidebar/flickcolors/'+a+'.jpg';
}//------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function loadRandomban(){
	var keywords = new Array('estimator','gallery','giftcards','showfloors','simulator','estimator','gallery','giftcards','showfloors','simulator');
	var i = 0; i = Math.round(100*Math.random()); i=i.toFixed(0); i=String(i); i=i.substring(0,1); i=parseFloat(i);
	var randomban = document.getElementById('randomban'); randomban.src='../imgs/randomban/'+keywords[i]+'.jpg';
	var randomlink = document.getElementById('randomlink'); randomlink.href=''+keywords[i]+'.htm';
}//--------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function loadRandomdiv(){
	if (document.layers) {navigator.family = "nn4"}
	if (document.all) {navigator.family = "ie4"}
	if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}
	var desc='<table width="240" cellpadding="0" cellspacing="4" style="margin-left:10px; margin-top:24px;"><tr><td class="left_tdtxthd">most popular site links</td></tr><tr><td><a href="estimator.htm" class="left_tdtxtlink">UCoat It Material Estimator</a></td></tr><tr><td><a href="simulator.htm" class="left_tdtxtlink">UCoat It Color Simulator</a></td></tr><tr><td><a href="faq.htm" class="left_tdtxtlink">Frequently Asked Questions</a></td></tr><tr><td><a href="instructions.htm" class="left_tdtxtlink">Instruction Manuals (MSDS)</a></td></tr><tr><td><a href="purchase.htm" class="left_tdtxtlink">Purchasing Information</a></td></tr></table>';
	
	var randomdiv = document.getElementById('randomdiv');
	
	if(navigator.family =="nn4") {document.randomdiv.document.write(desc); document.randomdiv.document.close();}
	else if(navigator.family =="ie4" || navigator.family =="gecko"){randomdiv.innerHTML=desc;}
	
}//--------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function showDealerdiv(){
	var userdealer=parent.document.getElementById('topFrame').contentWindow.document.getElementById('userdealer');
	var dealerid = userdealer.dealerid.value;
	var companyname = userdealer.companyname.value;
	var street1 = userdealer.street1.value;
	var city = userdealer.city.value;
	var state = userdealer.state.value;
	var zip = userdealer.zip.value;
	var phone1 = userdealer.phone1.value;
	
	var dealerdivinfo = document.getElementById('dealerdivinfo');
	var thisdesc = '<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="dealerdivinfo" style="margin-left:325px;"><tr><td><img src="" width="200" height="144" border="0"/></td><td><p>'+companyname+'</p><p>'+street1+'</p><p>'+city+', '+state+' '+zip+'</p><p>'+phone1+'</p><a href="dealerinfo.htm">Home Page</a></td>';
	
	if(navigator.family =="nn4") {document.dealerdivinfo.document.write(thisdesc); document.dealerdivinfo.document.close();}
	else if(navigator.family =="ie4" || navigator.family =="gecko"){dealerdivinfo.innerHTML=thisdesc;}
		
}//--------------------------------------------------------------------------------------------------------END FUNCTI0N

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function checkLocal(){
	var master_url = String(top.location);
	var checker = master_url.indexOf('/pgs/');
	if(checker==-1){//dealersite URL - skip the rest
		var toplogo = document.getElementById('toplogo');
		toplogo.src="../imgs/authlogo_top.gif";
		if(navigator.family =="nn4") {document.dealersplash.style.display='';}
		else if(navigator.family =="ie4" || navigator.family =="gecko"){dealersplash.style.display='';}
		return;	
	}
	
	var userdealer=parent.document.getElementById('topFrame').contentWindow.document.getElementById('userdealer');
	var dealerid = userdealer.dealerid.value;
	var companyname = userdealer.companyname.value;
	if(dealerid=="102" || dealerid=="0" || !dealerid){
		return;
	}else{
		var desc='<table width="824" border="0" align="center" cellpadding="0" cellspacing="0" class="dealerdiv"><tr valign="top"><td width="560">&nbsp;</td><td width="19"><img src="../imgs/dealerbanner/transition.gif" width="19" height="22" /></td><td class="dealertext_td" style="padding-top:3px;"><a href="javascript:checkDivstatus();" class="dealerline">Your Local UCoat It Authorized Dealer</a></td><td width="14" class="dealertext_td"><a href="javascript:checkDivstatus();"><img id="divarrow" src="../imgs/arrow_up.gif" width="14" height="14" border="0"/></a></td><td width="9"><img src="../imgs/dealerbanner/endcap.gif" width="9" height="22" /></td></tr></table>';
		var dealerdiv = document.getElementById('dealerdiv');
	
	if(navigator.family =="nn4") {document.dealerdiv.document.write(desc); document.dealerdiv.document.close();}
	else if(navigator.family =="ie4" || navigator.family =="gecko"){dealerdiv.innerHTML=desc;}
		
		}
}//--------------------------------------------------------------------------------------------------------END FUNCTI0N

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function checkDivstatus(){
	var dealerdivinfo = document.getElementById('dealerdivinfo');
	var arrowid = document.getElementById('divarrow');
	
	if(navigator.family =="nn4") {
		if(document.dealerdivinfo.style.display==''){
			document.dealerdivinfo.style.display='none';
			document.arrowid.src='../imgs/arrow_up.gif';
		}else{showDealerdiv(); document.dealerdivinfo.style.display=''; document.arrowid.src='../imgs/arrow_dn.gif';}
	}
	else if(navigator.family =="ie4" || navigator.family =="gecko"){
		if(dealerdivinfo.style.display==''){
			dealerdivinfo.style.display='none';
			arrowid.src='../imgs/arrow_up.gif';}
		else{showDealerdiv(); dealerdivinfo.style.display=''; arrowid.src='../imgs/arrow_dn.gif';}
	}
}//--------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function getPage(){
	var pgstr, pos, endpos;
	pgstr=String(document.location);
	pos=pgstr.indexOf('pgs/');
	endpos=pgstr.indexOf('.htm');
	pgstr=pgstr.substring(pos+4, endpos)
	return pgstr;
}//--------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function loaddealerDiv(){
	var myfix=getPage();
	if(myfix=='reclist'){document.write('<p style="font-size:10px; text-align:justify; letter-spacing:-1px; color:#666666; padding:4px;">Submit your list to the shopping cart to order online using our secure server or search for a local dealer.</p>'); return;}
	/*if (document.layers) {navigator.family = "nn4"}
	if (document.all) {navigator.family = "ie4"}
	if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}
	
	if(navigator.family=="gecko"){
		var userdealer=parent.document.getElementById('topFrame').contentWindow.document.getElementById('userdealer');
		if(!userdealer){alert('userdealer not found');}else{alert('gecko-dealer id:'+userdealer.dealerid.value);}
		
	}*/
	
	//------------------------------------------------------------------------------------------
	var userdealer=parent.document.getElementById('topFrame').contentWindow.document.getElementById('userdealer');
	//------------------------------------------------------------------------------------------
	var dealerid = userdealer.dealerid.value;

	var companyname = userdealer.companyname.value;
	if(dealerid.length>5){userdealer.reset(); dealerid="0";}
	if(dealerid=="102" || dealerid=="0" || !dealerid){
		
		if(dealerid=="102"){
			var userzip = userdealer.userzip.value;
			var desc='<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td><img src="../imgs/dealers/findstore.jpg" alt="Your Local Dealer" width="180" height="100"></td></tr><tr><td class="welcome_dlr_hd">Secure Online Ordering</td></tr><tr><td class="welcome_dlr_td" style="padding:8px;"><p>We currently do not have a local dealer near the '+userzip+' zip code. You may still order via our secure web server and have UCoat It shipped directly to your door!</p></td></tr><tr><td class="welcome_dlr_td" style="padding:8px;"><a href="estimator.htm">Click here</a> to use our Material Estimator to load your cart.</td></tr><tr><td class="welcome_dlr_td" style="padding:6px;">Your zipcode: '+userzip+' <a href="javascript:changeZipcode();">Change?</a></td></tr></table>';}
		else{
			var desc='<form name="dealersearch" method="get" action="javascript:searchDealer();" onSubmit="javascript:searchDealer();"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td><img src="../imgs/dealers/findstore.jpg" alt="Search for dealer" width="180" height="100"></td></tr><tr><td class="welcome_dlr_hd">Search for a local dealer</td></tr><tr><td class="welcome_dlr_td" style="padding-top:8px;"><div align="center"><input id="zipinput" maxlength="6" size="10" name="zipinput2"><input type="button" value="Search" name="Button2" onClick="javascript:searchDealer();" ></div></td></tr><tr><td class="welcome_dlr_td" style="padding:6px;">Enter your zip code to locate an Authorized UCoat It dealer nearest you.</td></tr></table></form>';}

	}else{
		var dealerid = userdealer.dealerid.value;
		var companyname = userdealer.companyname.value;
		var street1 = userdealer.street1.value;
		var city = userdealer.city.value;
		var state = userdealer.state.value;
		var zip = userdealer.zip.value;
		var phone1 = userdealer.phone1.value;
		var userzip = userdealer.userzip.value;
		var dlrinfo = getdlrInfo(dealerid);
		
		var desc='<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>'+dlrinfo.storefront+'</td></tr><tr><td class="welcome_dlr_hd">Your Local Dealer</td></tr><tr><td class="welcome_dlr_td" style="padding:8px;"><div align="center">'+dlrinfo.smlogo+'<p class="welcome_dlr_txt_bold">'+companyname+'</p><p class="welcome_dlr_txt">'+street1+'</p><p class="welcome_dlr_txt">'+city+', '+state+' '+zip+'</p><p class="welcome_dlr_txt_bold">'+phone1+'</p><p class="welcome_dlr_map"><a href="dealerinfo.htm?dealerid='+dealerid+'">Dealer Home Page</a></p><p class="welcome_dlr_map"><a href="'+dlrinfo.dlrmap+' "target="_blank">Map to Location</a></p></div></td></tr><tr><td class="welcome_dlr_td" style="padding:6px;">Please call ahead on all orders to confirm product availablity or use our <a href="estimator.htm">Material Estimator</a> to build your cart.</td></tr><tr><td class="welcome_dlr_td" style="padding:6px;">Your zipcode: '+userzip+' <a href="javascript:changeZipcode();">Change?</a></td></tr></table>';}

	var dealerdiv = document.getElementById('dealerinfo');
	
	if(navigator.family =="nn4") {document.dealerdiv.document.write(desc); document.dealerdiv.document.close();}
	else if(navigator.family =="ie4" || navigator.family =="gecko"){dealerdiv.innerHTML=desc;}
	
}//--------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function changeZipcode(){
	var userdealer=parent.document.getElementById('topFrame').contentWindow.document.getElementById('userdealer');
	userdealer.dealerid.value=0; userdealer.reset();
	newDealerDiv();
}//---------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function checkDealer(){
	var myquery = String(location.search);
	if(!myquery){return;}else{storeDealer();}
}//---------------------------------------------------------------------------------------------------------END FUNCTION

//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function getdlrInfo(a){
	var storefront='<img src="../imgs/dealers/findstore.jpg" alt="Your Local Dealer" width="180" height="100">';
	var dlrmap='';
	var smlogo='<p style="margin:0px;"><a href="dealerinfo.htm?dealerid='+a+'"><img src="../imgs/dealers/auth_logo_sm.gif" width="164" height="100" border="0"></a></p>';//default logo
	
	
	if(a=='00635' || a=='635'){dlrmap='http://maps.google.com/maps?f=q&hl=en&geocode=&q=7216+ACC+Blvd.+27617&sll=35.939517,-78.759656&sspn=0.03558,0.043774&ie=UTF8&ll=35.911507,-78.760664&spn=0.017796,0.013733&t=h&z=16&g=7216+ACC+Blvd.+27617';} // ACC COATINGS
	
	
	if(a=='31604'){dlrmap='http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=745+Atlanta+Highway,+30040&sll=37.0625,-95.677068&sspn=67.840216,59.238281&ie=UTF8&z=17&iwloc=addr&om=1';} // FLOORS-N-MOTION
		
	if(a=='29574'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=29+Maple+Ridge+Drive,+30121&sll=33.849033,-84.199905&sspn=0.566272,0.688019&layer=&ie=UTF8&z=10&ll=34.198173,-84.786987&spn=1.127879,1.376038&om=1';} // NORTH GEORGIA GARAGE SOLUTIONS
		
	if(a=='23008'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=5115+N+Main+St,+77521&sll=34.198173,-84.786987&sspn=1.127879,1.376038&layer=&ie=UTF8&z=10&ll=29.781066,-94.964447&spn=1.183555,1.376038&om=1&iwloc=addr';}//EXTREME TRAILERS OF TEXAS
	
	if(a=='22076'){
		smlogo='<p style="margin:0px;"><a href="dealerinfo.htm?dealerid='+a+'"><img src="../imgs/dealers/22076/logo_sm.gif" width="164" height="90" border="0"></a></p>';
		storefront='<img src="../imgs/dealers/'+a+'/storefront.jpg" alt="Your Local Dealer" width="180" height="100">';
		dlrmap='http://maps.google.com/maps?f=q&hl=en&q=32106+Woodward,+48067&sll=37.0625,-95.677068&sspn=48.555061,81.738281&layer=&ie=UTF8&om=1&z=10&ll=42.52576,-83.19397&spn=0.711485,1.7276&iwloc=addr';}//UCOAT IT GARAGE
	
	if(a=='31972'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=803+Albion+Rd,+60193&sll=40.007073,-86.005676&sspn=0.00816,0.01075&layer=&ie=UTF8&z=11&ll=41.994712,-88.099365&spn=0.506745,0.688019&om=1&iwloc=addr';}//SPEED INC
	
	if(a=='07165' || a=='7165'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=3938+Rufus+Road,+54623&layer=&sll=43.75429,-91.10175&sspn=0.007695,0.01075&ie=UTF8&z=12&ll=43.754233,-91.101723&spn=0.24625,0.344009&om=1&iwloc=addr';}//JOHNS DRY WALL
	
	if(a=='20022'){
		storefront='<img src="../imgs/dealers/'+a+'/storefront.jpg" alt="Your Local Dealer" width="180" height="100">';
		dlrmap='http://maps.google.com/maps?f=q&hl=en&q=10078+Flanders+Ct+NE,+55449&sll=43.754233,-91.101723&sspn=0.24625,0.344009&layer=&ie=UTF8&z=11&ll=45.152506,-93.193588&spn=0.480846,0.688019&om=1&iwloc=addr';}//GARAGE SQUAD
		
	if(a=='07560' || a=='7560'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=1800+Illinois+Street,+69162&sll=41.23238,-96.041794&sspn=0.51277,0.688019&layer=&ie=UTF8&z=11&ll=41.144536,-102.986526&spn=0.513458,0.688019&om=1&iwloc=addr';}//DICKS FLOORING
	
	if(a=='25153'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=15865+W+5th+Avenue,+80401&layer=&sll=39.72375,-105.1603&sspn=0.032777,0.043001&ie=UTF8&z=12&ll=39.724089,-105.087662&spn=0.262211,0.344009&om=1&iwloc=cent';}//PERFORMANCE GARAGE SYSTEMS
	
	if(a=='17675'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=15541+E+Kenyon+Drive,+80013&sll=39.724089,-105.087662&sspn=0.262211,0.344009&layer=&ie=UTF8&z=11&ll=39.649055,-104.806824&spn=0.524991,0.688019&om=1&iwloc=addr';}//DEW ENTERPRISES
	
	if(a=='01543' || a=='1543'){dlrmap='http://maps.google.com/maps?f=q&hl=en&geocode=&q=10679+W.+Missouri,+85307&sll=37.0625,-95.677068&sspn=66.7892,59.238281&ie=UTF8&z=16&iwloc=addr&om=1';}//GARAGE PLUS
	
	if(a=='27147'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=5385+Cameron+Street,+89118&sll=36.091661,-115.203849&sspn=0.006025,0.010664&layer=&ie=UTF8&z=16&t=k&om=1&iwloc=addr';}//AC COATINGS
		
	if(a=='28735'){dlrmap='http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=152+Nelson+Lane,+95648&sll=37.0625,-95.677068&sspn=67.840216,59.238281&ie=UTF8&ll=38.893045,-121.341859&spn=0.066737,0.086002&z=14&om=1';}//CLASSIC GARAGE FLOOR COATINGS
		
	if(a=='34725'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=79015&layer=&ie=UTF8&z=11&ll=34.977127,-101.924973&spn=0.558683,0.688019&om=1&iwloc=addr';}//MESA MOTORSPORTS
	
	if(a=='34293'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=725+Milwaukee+Street,+53018&sll=34.977127,-101.924973&sspn=0.558683,0.688019&layer=&ie=UTF8&z=12&ll=43.061614,-88.402176&spn=0.249082,0.344009&om=1&iwloc=addr';}//AN AMERICAN CLASSIC
	
	if(a=='29604'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=941+E.+Main,+53959&sll=43.061614,-88.402176&sspn=0.249082,0.344009&layer=&ie=UTF8&z=11&ll=43.53262,-89.997253&spn=0.494319,0.688019&om=1&iwloc=addr';}//BADGER PROCOAT
		
	if(a=='33855'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=8930+Sandy+Parkway,+84070&sll=43.53262,-89.997253&sspn=0.494319,0.688019&layer=&ie=UTF8&z=11&ll=40.588407,-111.903992&spn=0.517788,0.688019&om=1&iwloc=addr';}// WARDS CARPETS
	
	if(a=='34573'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=5621+East+Rosedale+St,+76112&sll=37.160317,-54.84375&sspn=109.537811,140.976563&layer=&ie=UTF8&om=1&z=12&ll=32.713066,-97.199478&spn=0.205674,0.316544&iwloc=addr';}//AVIATION PRODUCTS
		
	if(a=='30318'){dlrmap='http://maps.google.com/maps?f=q&hl=en&q=43+Broad+St,+01749&sll=37.0625,-95.677068&sspn=66.828216,59.238281&ie=UTF8&z=16&iwloc=addr&om=1';}//GARAGE GALORE
		
	if(a=='35450'){dlrmap='http://maps.google.com/maps?f=q&hl=en&geocode=&q=320+South+Rock+Blvd,+89502&sll=37.0625,-95.677068&sspn=67.169322,59.238281&ie=UTF8&z=16&iwloc=addr&om=1';}//GARAGES 101
	
	return {smlogo:smlogo, storefront:storefront, dlrmap:dlrmap}
}//---------------------------------------------------------------------------------------------------------END FUNCTION

//-----------------------------------------------------------------------------------------------BEGIN FUNCTION
function submitDirect(prodid,variantid){
	var color = '';
	var prefix = 'https://www.ucoatit.com/ucoatitcart/';
	var quantity = 1;
	var mylink = prefix + "addtocart.aspx?returnurl=showproduct.aspx&productid=" + prodid + "&Quantity=" + quantity + "&variantid=" + variantid + "&Color=" + color;
	window.open(mylink);
}//---------------------------------------------------------------------------------------------END OF FUNCTION
//-------------------------------------------------------------------------BEGIN FUNCTION
function convertString(str){
	var rtnstring='';
	for(i=0; i<str.length; i++){
		var char = str.substring(i, i+1);
		if (char=='+'){char=' ';}
		rtnstring=rtnstring+char;}
	return rtnstring;
}//------------------------------------------------------------------------END FUNCTION
//---------------------------------------------------------------------------------------------------------BEGIN FUNCTION
function buildCustom(){
	var pgname = String(document.location);
	var pg_1 = pgname.indexOf('/pgs/');
	if(pg_1==-1){return;}//skip if URL error
	var pg_2 = pgname.indexOf('.htm');
	if(pg_2==-1){pg_2 = pgname.indexOf('.asp');}
	pgname=pgname.substring(pg_1+5, pg_2);
	var corp=String(document.cookie);
	var pos=corp.indexOf('corplogin=');
	if(pos==-1){return;}//skip if cookie does not exist
	corp=corp.substring(pos+10);
	var endpos=corp.indexOf(';');
	corp=corp.substring(0,endpos);
	//if(navigator.family=="gecko" && pos==0){pos=-1; alert('gecko, pos: '+pos);}
	if(pgname=='home' && corp != ''){document.location=corp+'_home.asp'; return;}
	if(pgname=='estimator' && corp != ''){document.location='corp_estimator.htm'; return;}
	if(pgname=='simulator' && corp != ''){document.location='corp_estimator.htm';return;}
	
	if(corp=="acdelco"){
		var logomap = document.getElementById('logomap');
		logomap.href='acdelco_home.asp';
	var corpdiv = document.getElementById('corpdiv');
	var mycookie = String(document.cookie);
	var posx = mycookie.indexOf('corpname=');
	var corpcookie = mycookie.substring(posx+9);
	var posy = corpcookie.indexOf(';');
	var corpname = corpcookie.substring(0, posy);
	corpname=convertString(corpname);
	corpname=unescape(corpname);
	var desc='<table width="100%" style="background-image:URL(../'+corp+'/cropban.gif); height=34px;"><tr><td style="color:#FFFFFF; font-size:12px; font-weight:bold; padding-left:136px;">'+String(corpname)+'</td><td style="text-align:right; font-size:10px; padding-bottom:12px;"><a href="corplogout.asp" class="logoutlink">Logout?</a></td></tr></table>';
	if(navigator.family =="nn4") {document.corpdiv.document.write(desc); document.corpdiv.document.close(); document.corpdiv.style.display='';}
	else if(navigator.family =="ie4" || navigator.family =="gecko"){corpdiv.innerHTML=desc; corpdiv.style.display='';}
	}
}//--------------------------------------------------------------------------------------------------------END FUNCTION