if (document.all)    {n=0;ie=1;ns6=0;fShow="visible";fHide="hidden";}
if (document.getElementById&&!document.all)    {n=0;ie=0;ns6=1;fShow="visible";fHide="hidden";}
if (document.layers) {n=1;ie=0;ns6=0;fShow="show";fHide="hide";}


//Top Nav bar script v2- http://www.dynamicdrive.com/dynamicindex1/sm/index.htm

opr6=ie&&navigator.userAgent.indexOf("Opera")!=-1
var lastMenu = null;
var lastTd = null;
window.onerror=new Function("return true")
var rowimage = new Image();
rowimage.src = "/assets/images/AAZButtonRowSpacer.gif";
var rowimageselected = new Image();
rowimageselected.src = "/assets/images/AAZButtonRowSpacerSelected.gif";
////////////////////////////////////////////////////////////////////////////
// Function Menu()                                                        //
////////////////////////////////////////////////////////////////////////////
rightX = 0;
// check if login email and password is submitted 
function checkField()
{
	if(document.LoginMO.WCEmail.value == '')
	{
		alert("Please enter your Primary Email Address.");
		document.LoginMO.WCEmail.focus();
		return false;
	}
	else if(document.LoginMO.WCpwd.value == '')
	{
		alert("Please enter the Password you previously selected or your Member Number if you have not yet selected a Password.");
		document.LoginMO.WCpwd.focus();
		return false;
	}
	else
		return true;
}

function cleartextbox(a) {if(a.value == a.defaultValue) a.value="";}
function filltextbox(a)	{if(a.value =="") a.value= a.defaultValue;}

function Menu()
{
	this.bgColor = 'E0E0E0';
	this.bgHiglightColor = highlightmenucolor;
	if (ie) this.menuFont = "bold 12px Arial";
	if (n)  this.menuFont = "bold 12px Arial";
	this.fontColor   = "black";

	this.addItem    = addItem;
	this.addSubItem = addSubItem;
	this.showMenu   = showMenu;
	this.checkField = checkField;
	this.mainPaneBorder = 0;
	this.subMenuPaneBorder = 0;

	this.subMenuPaneWidth = submenuwidth;

	lastMenu = null;
	lastTd = null;
	
	rightY = 0;
	leftY = 0;
	leftX = 0;
	
	HTMLstr = "";
	HTMLstr += "<!-- MENU PANE DECLARATION BEGINS -->\n";
	HTMLstr += "\n";
	var query = (location.href.indexOf("?")+1);
	if(query == -1)
		query = location.href.length;
	if (ie||ns6) HTMLstr += "<div a id='MainTable'>\n";
	//	if (n)  HTMLstr += "<layer name='MainTable'>\n";
	HTMLstr += "<TABLE width='749'  height='70' style='background-image: url(/assets/images/AAZBanner.png); background-repeat: no-repeat;' width ='100%' bgcolor='ffffff' cellspacing='0' cellpadding='0' border='0'>";
	HTMLstr += "<form name='searchkeyword' action='/search/group.aspx' method='post'><TR align='right' valign='middle'><TD height='30' align='right' colspan='2'><a href='../helpbox.htm?keepThis=true&TB_iframe=true&height=500&width=750' title='How to Order Parts from Autohaus Arizona' class='thickbox'>HOW TO USE</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style='color: red; font-size: 14px;'><b>1.800.240.4620</b>&nbsp;&nbsp;</font></td></TR><TR valign='middle'>";
	HTMLstr += "<TD colspan='2'>";
	HTMLstr += "<div style='text-align:right; verticle-align:middle; width: 744px; float:left;'><input type='hidden' name='searchtype' value='partnumber'>&nbsp;<input id='topsearchbox' type='text' name='searchstring' value='search by part number' onfocus='cleartextbox(this)' onblur='filltextbox(this)' style='verticle-align:middle;height:20px'><input type='image' name='searchbutton' src='/assets/images/topsearchbutton.gif' style='vertical-align: middle; height:20px;margin-bottom:4px'></div><div style='width:5px; float: left;'></div>";
	HTMLstr += "</TD></form></TR></TABLE>";
	HTMLstr += "<TABLE width ='100%' bgcolor='white' cellspacing='0' cellpadding='0' border='0'>\n";
	HTMLstr += "<TR>";
	HTMLstr += "<!-- MAIN MENU STARTS -->\n";
	HTMLstr += "<!-- MAIN_MENU -->\n";
	HTMLstr += "<!-- MAIN MENU ENDS -->\n";
	HTMLstr += "<TD bgcolor='ff0000'nowrap>&nbsp;</TD>";
	HTMLstr += "";
	HTMLstr += "</TR>\n";
	HTMLstr += "</TABLE>\n";
	HTMLstr += "<!-- SUB MENU STARTS -->\n";
	HTMLstr += "<!-- SUB_MENU -->\n";
	HTMLstr += "<!-- SUB MENU ENDS -->\n";
	HTMLstr += "\n";
	if (ie||ns6) HTMLstr+= "</div>\n";
//	if (n)  HTMLstr+= "</layer>\n";
	HTMLstr += "<!-- MENU PANE DECALARATION ENDS -->\n";
	HTMLstr += "<TABLE width ='100%' bgcolor='white' cellspacing='0' cellpadding='0' align='center' height=25><TR>";
    HTMLstr += "<TD width='100%' align ='center' valign='middle' colspan='2' bgcolor='#6e6e6e'>";
	HTMLstr += "<table><tr><td valign='middle'><h5><a href='/html/contact.html' style='color: white'>Call Toll Free <b>1-800-240-4620</b></a>";
	HTMLstr += "</h5></td><td width='40'></td><td></td><td>";
	HTMLstr += "</td><td valign='middle'><h5>&nbsp;<a href='/html/freight.html' style='color: white'><b>FREE</b> UPS Ground on $50+ orders</a>";
	HTMLstr += "</h5></td><td width='40'></td><td align=right>";
	HTMLstr += "</td><td>";
	HTMLstr += "</td><td valign='middle'><h5b><a href='/html/autohausterms.html' style='color: white'>Customer-Friendly Returns Policy</a>";
	HTMLstr += "</h5></td></tr></table></TD></TR></TABLE>\n";
	// search bar
	
}

function addItem(idItem, text, hint, location, altLocation, width)
{
	var Lookup = "<!-- ITEM "+idItem+" -->";
	if (HTMLstr.indexOf(Lookup) != -1)
	{
		alert(idParent + " already exist");
		return;
	}
	var MENUitem = "";
	MENUitem += "\n<!-- ITEM "+idItem+" -->\n";
	if (n)
	{
		MENUitem += "<td height='30' width='80' valign='middle' align='center' background='/assets/images/AAZButtonRowSpacer.jpg' nowrap>";
		MENUitem += "<ilayer name="+idItem+">";
		MENUitem += "<a href='" + altLocation + "' class=clsMenuItemNS onmouseover=\"displaySubMenu('"+idItem+"'); window.status='" + hint + "';return true;\" onmouseout=\"window.status='';return true;\" onclick=\"return false;\">";
		MENUitem += text;
		MENUitem += "</a>";
		MENUitem += "</ilayer>";
		MENUitem += "</td>";
	}
	if (ie||ns6)
	{
		if (idItem != 'cart')
			MENUitem += "<td class='mainmenuitem' bgcolor='d9d9d9' OnClick=\"return menuGoto('" + altLocation + "')\" id='td"+idItem+"'  height='30' width='" + width + "' valign='middle' align='center' nowrap";
		else
			MENUitem += "<td class='mainmenuitem' bgcolor='ff0000' OnClick=\"return menuGoto('" + altLocation + "')\" id='td"+idItem+"' height='30' width='101' valign='middle' align='center' nowrap";
		if (location != null)
			MENUitem += " onmouseover=\"changeimageselected(td" + idItem + ");hideAll();return true;\" onmouseout=\"changeimage(td" + idItem + ");window.status='';return true;\">";
		else
			MENUitem += " onmouseover=\"displaySubMenu('"+idItem+"');\" onmouseout=\"window.status='';return true;\">";
		MENUitem += "<div id='"+idItem+"' font: "+this.menuFont+";'>";
		
		if (idItem == 'cart')
			MENUitem += "<table border=0 cellspacing=0 cellpadding=0><tr><td width='40' align='right'><a href='" + altLocation + "'><img src='/assets/images/cart2.gif' border='0' width='23' height='19' style='margin-left: 10px'></a></td><td height='30' width='75' valign='middle' align='center' nowrap><a href='" + altLocation + "' style='color:white;font-family: Arial; font-size:12px;'>"+text+"</font></a></td></tr></table>";
		else if(idItem == 'home')
			MENUitem += "<a href='" + altLocation + "'><img src='/assets/images/AAZHomeNew.gif' border='0' width='20' height='20'></a>";
		else{
			if (location != null)
				MENUitem += '<a href="' + altLocation + '" style="color:black;font-family: Arial; font-size:12px;">'+text+'</font></a>';
			else
				MENUitem += '<a href="' + altLocation + '" style="color:black;font-family: Arial; font-size:12px;">'+text+'</font></a><img src="/assets/images/dropdown.gif">';
		}
		MENUitem += "</div>";
		MENUitem += "</td>";
		if (idItem != 'cart')
			MENUitem += "<td height='30' width='5' valign='middle' align='center' bgcolor='d9d9d9' nowrap></td>";
	}
	if (n)
		MENUitem += "<!-- END OF ITEM "+idItem+" -->";
	else
		MENUitem += "<!-- END OF ITEM "+idItem+" -->\n\n";
	MENUitem += "<!-- MAIN_MENU -->\n";

	HTMLstr = HTMLstr.replace("<!-- MAIN_MENU -->\n", MENUitem);
}

function changeimage( td )
{
	if (td.className != 'mainmenuitem'){
		td.className = 'mainmenuitem'
	}
}

function changeimageselected( td )
{
	if (td.className != 'mainmenuitemselected'){
		//td.className = 'mainmenuitemselected'
	}
}

function menuGoto( url )
{
	if ( url != null && url.indexOf( "javascript" ) > -1 )
	{
		eval ( url );
	}
	else
	{
		document.location = url;
	}
	if( document.event != null )
	{
		document.event.cancelBubble = true;
	}
	
	return false;
}

function addSubItem(idParent, text, hint, location)
{
	var MENUitem = "";
	Lookup = "<!-- ITEM "+idParent+" -->";
	if (HTMLstr.indexOf(Lookup) == -1)
	{
		alert(idParent + " not found");
		return;
	}
	Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->";
	if (HTMLstr.indexOf(Lookup) == -1)
	{
		if (n)
		{
			MENUitem += "\n";
			MENUitem += "<layer id='"+idParent+"submenu' visibility=hide bgcolor='"+this.bgColor+"'>\n";
			MENUitem += "<table border='"+this.subMenuPaneBorder+"' bgcolor='" + this.bgColor + "' width="+this.subMenuPaneWidth+">\n";
			MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
			MENUitem += "</table>\n";
			MENUitem += "</layer>\n";
			MENUitem += "\n";
		}
		if (ie||ns6)
		{
			MENUitem += "\n";
			MENUitem += "<div id='"+idParent+"submenu' onmouseout=operahide() style='position:absolute; visibility: hidden; z-index:100; width: "+this.subMenuPaneWidth+"; font: "+this.menuFont+"; top: -300;'>\n";
			MENUitem += "<table bgColor = '" + this.bgColor + "'  width="+this.subMenuPaneWidth+" class='menuitem'>\n";
			MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
			MENUitem += "</table>\n";
			MENUitem += "</div>\n";
			MENUitem += "\n";
		}
		MENUitem += "<!-- SUB_MENU -->\n";
		HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
	}

	Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
	if (n)  MENUitem = "<tr><td><a class=clsMenuItemNS style='color:black;font-family: Arial; font-size:12px;' href='"+location+"'>"+text+"</a></td></tr>\n";
	if (ie||ns6) MENUitem = "<tr onmouseover=\"this.bgColor='ffffff'\" onmouseout=\"this.bgColor='" + this.bgColor + "'\"><td onclick=\"window.location.href='" + location + "'\" onmouseover=\"window.status='" + hint + "';return true;\" onmouseout=\"window.status='';return true;\"><a href='" + location + "' style='color:black;font-family: Arial; font-size:12px;'>"+text+"</a><br></td></tr>\n";
	MENUitem += Lookup;
	HTMLstr = HTMLstr.replace(Lookup, MENUitem);

}

function showMenu()
{
	document.writeln(HTMLstr);
}

////////////////////////////////////////////////////////////////////////////
// Private declaration
function displaySubMenu(idMainMenu)
{
	var menu;
	var submenu;
	var td;
	if (n)
	{
		submenu = document.layers[idMainMenu+"submenu"];
		if (lastMenu != null && lastMenu != submenu) hideAll();
		submenu.left = document.layers[idMainMenu].pageX;
		submenu.top  = document.layers[idMainMenu].pageY + 20;
		submenu.visibility = fShow;

		leftX  = document.layers[idMainMenu+"submenu"].left;
		rightX = leftX + document.layers[idMainMenu+"submenu"].clip.width;
		leftY  = document.layers[idMainMenu+"submenu"].top+
			document.layers[idMainMenu+"submenu"].clip.height + 100;
		rightY = leftY;
	} else if (ie||ns6) {
//alert(document.getElementById(idMainMenu+"submenu").id)
		menu = ie? eval(idMainMenu) : document.getElementById(idMainMenu);
		td = ie? eval('td' + idMainMenu) : document.getElementById('td' + idMainMenu);
		submenu = ie? eval(idMainMenu+"submenu.style") : document.getElementById(idMainMenu+"submenu").style;
		submenu.left = calculateSumOffset(menu, 'offsetLeft');
//		submenu.top  = calculateSumOffset(menu, 'offsetTop') + 30;
		submenu.top  = menu.style.top;
		submenu.visibility = fShow;
		if (lastMenu != null && lastMenu != submenu) hideAll();

		leftX  = ie? document.all[idMainMenu+"submenu"].style.posLeft : parseInt(document.getElementById(idMainMenu+"submenu").style.left);
		rightX = ie? leftX + document.all[idMainMenu+"submenu"].offsetWidth : leftX+parseInt(document.getElementById(idMainMenu+"submenu").offsetWidth);

		leftY  = ie? document.all[idMainMenu+"submenu"].style.posTop+
			document.all[idMainMenu+"submenu"].offsetHeight : parseInt(document.getElementById(idMainMenu+"submenu").style.top)+parseInt(document.getElementById(idMainMenu+"submenu").offsetHeight) + 200;
		rightY = leftY;
	}
	lastMenu = submenu;
	lastTd = td;
	changeimageselected(lastTd);
	var agt=navigator.userAgent;
	var browserName=navigator.appName;
	if (agt.indexOf("Mac")!=-1 || agt.indexOf("Macintosh")!=-1) 
	{
		if (browserName=="Microsoft Internet Explorer")
		{
			window.resizeBy(0,1);
			window.resizeBy(0,-1);
		}
	}
}

function hideAll()
{
	if (lastMenu != null) 
	{
		lastMenu.visibility = fHide;
		lastMenu.left = 0; 
		if (lastTd != null){
			changeimage(lastTd);
		}
		lastMenu = null
	}
}

function calculateSumOffset(idItem, offsetName)
{
	var totalOffset = 0;
	var item = eval('idItem');
	do
	{
		totalOffset += eval('item.'+offsetName);
		item = eval('item.offsetParent');
	} while (item != null);
	return totalOffset;
}

function updateIt(e)
{
	if (ie&&!opr6)
	{
		var x = window.event.clientX;
		var y = window.event.clientY;

		if (x > rightX -30 || x < leftX - 30) hideAll();
		else if (y > (rightY + 200)) hideAll();
	}
	if (n||ns6)
	{
		var x = e.pageX;
		var y = e.pageY;

		if (x > rightX || x < leftX) hideAll();
		else if (y > rightY + 200) hideAll();
	}
}

function operahide(){
        if (opr6){
        if (!MainTable.contains(event.toElement))
        hideAll()
}
}

if (ie||ns6)
{
	document.body.onclick=hideAll;
	document.body.onscroll=hideAll;
	document.body.onmousemove=updateIt;
}
if (document.layers)
{
	window.captureEvents(Event.MOUSEMOVE);
	window.captureEvents(Event.CLICK);
	window.onmousemove=updateIt;
	window.onclick=hideAll;
}

// create HTML code to show footer
function SideBar()
{
	this.showSideBar = showSideBar;
	var query = location.href.indexOf("?");
	var length = 0;
	if(query > -1){
		if(location.href.indexOf("sid") > -1)
			length = location.href.indexOf("&");
		else
			length = query;
		if(length < 0)
			length = location.href.length;
	}
	logged = checkCookie("logged");
	user = readCookie("user");
	HTMLsidebar = "<TABLE class='page' id='Table1' cellSpacing='0' cellPadding='0' align='center' width='225'>";
	HTMLsidebar += "<tr>";
	HTMLsidebar += "<td>";
	HTMLsidebar += "<TABLE id='Table2' cellSpacing='0' cellPadding='0' height=70  width='100%' bgColor='#ffffff' border='0'>";
	HTMLsidebar += "<TR>";
	HTMLsidebar += "<TD vAlign='top' noWrap align='left' style='border-bottom: 1px black solid'>";
	HTMLsidebar += "";
	HTMLsidebar += "<div style='display: ;height:70px;background-color: #ffffff;' id='mcafee'><br>&nbsp;<a target='_blank' style='margin-left: 50px' href='https://www.scanalert.com/RatingVerify?ref=www.autohausaz.com'><img width='115' height='32' border='0' src='//images.scanalert.com/meter/www.autohausaz.com/22.gif' alt='HACKER SAFE certified sites prevent over 99.9% of hacker crime.' oncontextmenu='alert('Copying Prohibited by Law - HACKER SAFE is a Trademark of ScanAlert'); return false;'></a></div>";
	HTMLsidebar += "<div style='height:29px;background-color: #000000; color:#ffffff;'";
	HTMLsidebar += "<h5 class='bold' style='text-align: center; padding-top: 7px;color:#ffffff;'>";
	HTMLsidebar += "MY AUTOHAUS CONTROL PANEL</h5>";
	HTMLsidebar += "</div>";
	HTMLsidebar += "</TD>";
	HTMLsidebar += "</TR>";
	HTMLsidebar += "</table></td></tr></table>";
	
	HTMLsidebar += "<TABLE id='Table3' cellSpacing='0' cellPadding='0' width='100%' bgColor='#cccccc' border='0'>";
	HTMLsidebar += "<tr>";
	HTMLsidebar += "<td>";
	HTMLsidebar += "<IFRAME id='sidebar' name='pbarwin' marginWidth='0' marginHeight='0' src='"
	if (logged==false){
		HTMLsidebar += "/membersonly/logininfo.aspx";
	}
	else{
		HTMLsidebar += "/membersonly/logininfo.aspx";
	}
	HTMLsidebar += "'";
	HTMLsidebar += "frameBorder='0' width='225' height='579' scrolling='no'></IFRAME></td>";
	HTMLsidebar += "</tr>";
	HTMLsidebar += "</TABLE>";
}

// show HTML code on a page
function showSideBar()
{
	document.writeln(HTMLsidebar);
	
	// run Google Analytics code
	try {
		var pageTracker = _gat._getTracker("UA-1207791-1");
		pageTracker._trackPageview();
	} catch(err) {}
	
}

function checkCookie(name)
{
	var nameEQ = name;
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return true;
	}
	return false;
}

function readCookie(name)
{
	var nameEQ = name;
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) {
			var cv = c.split('=');
			return cv[1];
		}
	}
	return 'undefined';
}

function setCookie (cookieName, cookieValue, expires, path, domain, secure) {
  document.cookie = 
    escape(cookieName) + '=' + escape(cookieValue) 
    + (expires ? '; EXPIRES=' + expires.toGMTString() : '')
    + (path ? '; PATH=' + path : '')
    + (domain ? '; DOMAIN=' + domain : '')
    + (secure ? '; SECURE' : '');
}

function openpopup(file,window, width, height) {
    msgWindow=open(file,window,"width=" + width + ",height=" + height + ",scrollBars=1, toolbar=0,location=0, directories=0, status=0, menuBar=0, scrollBars=1, resizable=0");
    if (msgWindow.opener == null) msgWindow.opener = self;
	msgWindow.moveTo((screen.availWidth/2)-(width/2),(screen.availHeight/2)-(height/2))
	msgWindow.focus();

}

// import Goolge Analytics js file
if (typeof(km_scripts) == 'undefined') 
	var km_scripts = new Object();
//km_myclass_import('https://ssl.google-analytics.com/urchin.js');

function km_myclass_import(jsFile) {
if (km_scripts[jsFile] != null) return;
var scriptElt = document.createElement('script');
scriptElt.type = 'text/javascript';
scriptElt.src = jsFile;
document.getElementsByTagName('head')[0].appendChild(scriptElt);
km_scripts[jsFile] = jsFile; // or whatever value your prefer
}

// create HTML code to show footer
function Footer()
{
	this.showFooter = showFooter;
	HTMLfooter = "";
	HTMLfooter += "<!-- Autohaus AZ Discount OEM Import Auto Parts - Bottom Border START -->";
	HTMLfooter += "<tr>";
	HTMLfooter += "	<td align='center'>";
	HTMLfooter += "		<style>";
	HTMLfooter += "			.footerheader { font-weight: bold; color: white; margin-left: 10px }";
	HTMLfooter += "			.footertext { color: black; margin-left: 15px; margin-bottom: 3px }";
	HTMLfooter += "			.footersubtext { color: 595959; margin-left: 1px; font-size: 10px; margin-bottom: 5px }";
	HTMLfooter += "			.borderright {border-right: #c1c1c1 1px solid }";
	HTMLfooter += "			.headersafe { font-weight: bold; color: black; font-size: 14px; margin-left: 10px }";
	HTMLfooter += "		</style>";
	HTMLfooter += "		<br>";
	HTMLfooter += "		<table width='98%' border='0' cellpadding=0 cellspacing= 0 ID='Table1'>";
	HTMLfooter += "			<tr bgcolor='#000000'>";
	HTMLfooter += "				<td height='25' width='50%' class='borderright'>";
	HTMLfooter += "					<h5 class='footerheader'>AutohausAZ Quick Links</h5>";
	HTMLfooter += "				</td>";
	HTMLfooter += "				<td>";
	HTMLfooter += "					<h5 class='footerheader'>Company Info</h5>";
	HTMLfooter += "				</td>";
	HTMLfooter += "			</tr>";
	HTMLfooter += "			<tr bgcolor='white' height='75'>";
	HTMLfooter += "				<td class='borderright'>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' href='http://www.autohausaz.com/helpbox.htm?keepThis=true&TB_iframe=true&height=500&width=750' title='How to Order Parts from Autohaus Arizona' class='thickbox'>How To Use Our Site</A></h5>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='http://www.autohausaz.com/html/contact.html'>How To Contact Us</A></h5>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='http://www.autohausaz.com/html/freight.html'>FREE Shipping And Freight Policy</A></h5>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='https://www.autohausaz.com/html/auto-parts-orders.html#Ordering'>How To Place An Order</A></h5>";
	HTMLfooter += "				</td>";
	HTMLfooter += "				<td>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='http://www.autohausaz.com/html/autohaus.html'>About Autohaus</A></h5>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='http://www.autohausaz.com/html/privacystatement.html'>Security & Privacy Information</A></h5>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='http://www.autohausaz.com/html/customercomments.aspx'>Customer Reviews</A></h5>";
	HTMLfooter += "					<h5 class='footertext'>&bull; <A style='color: grey' target='_blank' href='http://www.autohausaz.com/html/autohausterms.html'>Customer-Friendly Returns Policy</A></h5>";
	HTMLfooter += "				</td>";
	HTMLfooter += "			</tr>";
	HTMLfooter += "			<tr bgcolor='white'>";
	HTMLfooter += "				<td colspan='2' height='25' style='border-top: 1px dashed #cccccc' align='center'>";
	HTMLfooter += "					<img src='//www.autohausaz.com/assets/images/callus.jpg' style='margin: 10px'>";
	HTMLfooter += "				</td>";
	HTMLfooter += "			</tr>";
	HTMLfooter += "		</table>";
	HTMLfooter += "		<TABLE cellspacing=0 cellpadding=0' style='background: white;' align='center' width='98%' ID='Table2'>";
	HTMLfooter += "			<TR>";
	HTMLfooter += "				<td colspan='3' align='center'><h5 class='headersafe'><i>Safe & Secure Shopping</i></h5>";
	HTMLfooter += "				<h5 class='footersubtext'>Thawte EV SSL via 256 Bit Encryption - McAfee Tested & Certified Daily</h5>";
	HTMLfooter += "				</td>";
	HTMLfooter += "				<td align='center'><h5 class='headersafe'><i>Payment Options</i></h5>";
	HTMLfooter += "				<h5 class='footersubtext'>Convenient, Safe & Secure Options to Pay for Your Auto Parts!</h5>";
	HTMLfooter += "				</td>";
	HTMLfooter += "			</TR>";
	HTMLfooter += "			<TR valign='top'>	";
	HTMLfooter += "				<TD align='center' width='16%'>";
	HTMLfooter += "				<a href='Javascript: return false' OnClick='showCert()'><img name='SecureCertificateSeal' src='//www.autohausaz.com/assets/images/secured-by-thawte.png' border='0' height='32' alt='AutohausAZ is a Thawte Certified Site Using Extended Validation SSL & 256-Bit Encryption' onmouseover='window.status='Autohaus AZ is a Thawte Certified Secure Site with 256 Bit Encryption!';return true;' onmouseout='window.status='';return true;'></a>";
	HTMLfooter += "				</TD>";
	HTMLfooter += "				<TD align='center' width='16%'>";
	HTMLfooter += "				<a target='_blank' href='https://www.scanalert.com/RatingVerify?ref=www.autohausaz.com'><img width='115' height='32' border='0' src='//images.scanalert.com/meter/www.autohausaz.com/22.gif' alt='McAfee Secure certified sites prevent over 99.9% of hacker crime.' oncontextmenu='alert('Copying Prohibited by Law - HACKER SAFE is a Trademark of ScanAlert'); return false;'></a>";
	HTMLfooter += "				</TD>";
	HTMLfooter += "				<TD align='center' width='16%'>";
	HTMLfooter += "				<a target='_blank' href='http://www.bbb.org/phoenix/business-reviews/auto-parts-and-supplies-new/autohausaz-in-tempe-az-32003758/'><img title='Click to verify BBB accreditation and to see a BBB report.' border='0' src='//www.autohausaz.com/assets/images/bbbonline.gif' alt='Click to verify BBB accreditation and to see a BBB report.' oncontextmenu='alert('Use without permission is prohibited. The BBB Accreditation seal is a trademark of the Council of Better Business Bureaus, Inc.'); return false;' /></a>";
	HTMLfooter += "				</TD>";
	HTMLfooter += "				<TD align='center' width='50%'>";
	HTMLfooter += "					<IMG SRC='//www.autohausaz.com/assets/images/logo_ccVisa.gif' BORDER=0 style='margin: 3px'>";
	HTMLfooter += "					<IMG SRC='//www.autohausaz.com/assets/images/logo_ccMC.gif' BORDER=0 style='margin: 3px'>";
	HTMLfooter += "					<IMG SRC='//www.autohausaz.com/assets/images/logo_ccAMEX.gif' BORDER=0 style='margin: 3px'>";
	HTMLfooter += "					<IMG SRC='//www.autohausaz.com/assets/images/logo_ccDiscover.gif' BORDER=0 style='margin: 3px'>";
	HTMLfooter += "					<IMG SRC='//www.autohausaz.com/assets/images/logo_PayPal.gif' BORDER=0 style='margin: 3px'>";
	HTMLfooter += "					<IMG SRC='//www.autohausaz.com/assets/images/logo_GC.jpg' BORDER=0 style='margin: 3px'>";
	HTMLfooter += "				</TD>	";
	HTMLfooter += "			</TR>";
	HTMLfooter += "			<TR>";
	HTMLfooter += "				<td colspan=4><br><br></td>";
	HTMLfooter += "			</TR>";
	HTMLfooter += "			<TR valign='top'>	";
	HTMLfooter += "				<TD align='center' width='16%' colspan='4'>";
	HTMLfooter += "					<h5 class='headersafe'><i>Award-Winning Company and Online Sales & Customer Service Team</i></h5>";
	HTMLfooter += "				<h5 class='footersubtext'>AutohausAZ won numerous awards in the past four years from Diversity Business (2008, 2009, 2010, 2011), Inc.com/Inc. Magazine (2008, 2009, 2010, 2011), Arizona Small Business Association (ASBA) (2008), Stevie Awards (2008, 2009), Alfred P. Sloan Award for Business Excellence (2009, 2011), ACE (Arizona Corporate Excellence) Top 25  Fastest Growing Private Companies Award (2009), Top 500 Internet Retailer, etc. View Other Awards & News Coverage. View Other <a href='../html/autohausaz-press.html'>Awards & News Coverage</a>.</h5>";
	HTMLfooter += "			</TD>";
	HTMLfooter += "			<TR valign='top'>	";
	HTMLfooter += "				<TD align='center' width='16%' colspan='4'>";
	HTMLfooter += "					<TABLE width='80%' align=center ID='Table4'>";
	HTMLfooter += "						<TR valign=bottom>";
	HTMLfooter += "							<TD align=center width='14%'>";
	HTMLfooter += "								<a target='_blank' href='http://www.autohausaz.com/html/customer-service-stevies.html'><IMG HEIGHT='85' SRC='//www.autohausaz.com/assets/images/OnlineSalesTeam2009Winner.jpg' BORDER='0' title='AutohausAZ brings home the Business Oscar for Online Sales Team of the Year and E-Commerce Customer Service Finalist'></a>";
	HTMLfooter += "							</TD><TD align=center width='14%'>";
	HTMLfooter += "								<a target='_blank' href='http://www.autohausaz.com/html/autohausaz-press.html'><IMG HEIGHT='85' SRC='//www.autohausaz.com/assets/images/2009abafinalist.jpg' BORDER='0' title='American Business Stevie Awards recognizes AutohausAZ as 2009 Online Sales Team of the Yeart Finalist'></a>";
	HTMLfooter += "							</TD><TD align=center width='14%'>";
	HTMLfooter += "								<a target='_blank' href='http://www.autohausaz.com/html/Sloan-Award-2011.html'><IMG WIDTH='85' SRC='//www.autohausaz.com/assets/images/sloanaward2011.jpg' BORDER='0' title='AutohausAZ - Winner of the 2009 AND 2011 Alfred P. Sloan Award for Business Excellence in Workplace Flexibility'></a>";
	HTMLfooter += "							</TD><TD align=center width='14%'>";
	HTMLfooter += "								<a target='_blank' href='http://www.autohausaz.com/html/az-company-to-watch.html'><IMG WIDTH='85' SRC='//www.autohausaz.com/assets/images/comerica.jpg' BORDER='0' title='AZ SBA names AutohausAZ one of the 50 Companies to Watch in 2008'></a>";
	HTMLfooter += "							</TD><TD align=center width='12%'>";
	HTMLfooter += "								<a target='_blank' href='http://www.autohausaz.com/html/autohausaz-press.html'><IMG WIDTH='85' SRC='//www.autohausaz.com/assets/images/ace-award.jpg' BORDER='0' title='ACE Awards names AutohausAZ one of 2009 Top 25 Fastest Growing Private Companies'></a>";
	HTMLfooter += "							</TD><TD align=center width='12%'>";
	HTMLfooter += "								<a target='_blank' href='http://www.resellerratings.com/store/Autohaus_Arizona'><IMG WIDTH='85' SRC='//www.autohausaz.com/assets/images/elitebadge.jpg' BORDER='0' title='AutohausAZ is Reseller Ratings Elite Member'></a>";
	HTMLfooter += "							</TD>";
	HTMLfooter += "						</TR>";
	HTMLfooter += "					</TABLE>";
	HTMLfooter += "				</TD>					";
	HTMLfooter += "			</TR>";
	HTMLfooter += "			<TR>";
	HTMLfooter += "				<td><br></td>";
	HTMLfooter += "			</TR>";
	HTMLfooter += "		</TABLE>";
	HTMLfooter += "		<br><br><H4 class='footer' ALIGN='left'>&nbsp;&nbsp;&nbsp;&copy; Copyright 1998-2012 Autohaus Arizona, Inc. All Rights Reserved<BR>";
	HTMLfooter += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This site best viewed with Internet Explorer 5 and above.<BR><BR>";
	HTMLfooter += "Disclaimer:&nbsp;&nbsp;Every effort has been expended to ensure the accuracy of the information included on this site.";
	HTMLfooter += "No responsibility can be assumed or accepted as a result of errors or omissions. All references to vehicle models, manufacturers and photos are supplied for informational purposes only and are not intended to imply affiliation or approval by the vehicle manufacturers.<br><br>AutohausAZ strongly recommends that you consult a professional mechanic for any questions on parts or repair jobs beyond your technical capabilities.</H4>";
	HTMLfooter += "	</td>";
	HTMLfooter += "</tr>";
	HTMLfooter += "<!-- Autohaus AZ Discount OEM Import Auto Parts - Bottom Border END -->";
}

// show HTML code on a page
function showFooter()
{
	document.writeln(HTMLfooter);
}

var IE4 = navigator.userAgent.toLowerCase().indexOf("msie 4.");
var withChars = window.location.href;
var charIndex = withChars.indexOf("?");

var refererurl;

if(charIndex != -1 ){
    refererurl = withChars.substring(0, charIndex);
}else{
    refererurl = withChars
}

var certurl = 'https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&lang=en&dn=WWW.AUTOHAUSAZ.COM';
var newwindow = '';

// show cert details
function showCert(){
    if (!newwindow.closed && newwindow.location){
            newwindow.location.href = 'https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&lang=en&dn=WWW.AUTOHAUSAZ.COM';
        } else {
            newwindow=window.open(certurl,'window2','height=645,width=518,status=1,scrollbars=1');
            if (!newwindow.opener) newwindow.opener = self;
        }

    if (window.focus){
        if(IE4 == -1){
            newwindow.focus()
        }
    }
    return false;
}

// create HTML code to show footer
function Search()
{
	if (document.location.href.indexOf("audi") != -1)
		bannerimage = "Audi"; 
	else if (document.location.href.indexOf("bmw") != -1)
		bannerimage = "Auto";
	else if (document.location.href.indexOf("honda") != -1)
		bannerimage = "Honda";
	else if (document.location.href.indexOf("jaguar") != -1)
		bannerimage = "Jaguar";
	else if (document.location.href.indexOf("mercedes") != -1)
		bannerimage = "Mercedes";
	else if (document.location.href.indexOf("porsche") != -1)
		bannerimage = "Porsche";
	else if (document.location.href.indexOf("rover") != -1)
		bannerimage = "Rover";
	else if (document.location.href.indexOf("saab") != -1)
		bannerimage = "Saab";
	else if (document.location.href.indexOf("volkswagen") != -1)
		bannerimage = "VW";
	else if (document.location.href.indexOf("volkswagon") != -1)
		bannerimage = "VW";
	else if (document.location.href.indexOf("vw") != -1)
		bannerimage = "VW";
	else if (document.location.href.indexOf("volvo") != -1)
		bannerimage = "Volvo";
	else if (document.location.href.indexOf("nissan") != -1)
		bannerimage = "Nissan";
	else if (document.location.href.indexOf("toyota") != -1)
		bannerimage = "Toyota";
	else
		bannerimage = "Auto";
	this.showSearch = showSearch;
	HTMLsearch = "";
	HTMLsearch += "<center><TABLE ALIGN='center' width='400' border='0' cellspacing='0' cellpadding='0' bgcolor='f1f1f1' background='/assets/images/AAZSearchBox.jpg'>";
	HTMLsearch += "<TR>";
	HTMLsearch += "<TD colspan='3' align=middle>";
	HTMLsearch += "<TABLE cellSpacing=0 cellPadding=0 width='100%' border=0>";
	HTMLsearch += "<TR vAlign=top>";
	//HTMLsearch += "<TD vAlign=top align=left width=5>";
	//HTMLsearch += "<IMG height=5 src='/assets/images/corner_top_left.gif' width=5 border=0>";
	//HTMLsearch += "</TD>";
	HTMLsearch += "<TD width='400'>";
	HTMLsearch += "<TABLE cellSpacing=3 cellPadding=0 width='99%' border=0>";
	HTMLsearch += "<TR>";
	HTMLsearch += "<TD style='COLOR: #ffffff' vAlign=bottom>";
	HTMLsearch += "<h3 align='center' class='bold' style='color:FFFFFF'>Search Our Catalog For " + bannerimage + " Parts</h5>";
	HTMLsearch += "</TD>";
	HTMLsearch += "</TR>";
	HTMLsearch += "</TABLE>";
	HTMLsearch += "</TD>";
	//HTMLsearch += "<TD align=right width=5>";
	//HTMLsearch += "<IMG height=5 src='/assets/images/corner_top_right.gif' width=5 border=0>";
	//HTMLsearch += "</TD>";
	HTMLsearch += "</TR>";
	HTMLsearch += "</TABLE>"; 
	HTMLsearch += "</TD>";
	HTMLsearch += "</TR>";
	HTMLsearch += "<TR>";
	HTMLsearch += "<TD align=middle colspan='3'>";
	HTMLsearch += "</TD>";
	HTMLsearch += "</TR>";
	HTMLsearch += "<TR>";
	HTMLsearch += "<TD colspan='3' style='PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px' align=middle>";
	HTMLsearch += "<form id='formsearch' action='/search/model.aspx' method='get' name='vehiclesearch' style='margin: 0px'>";
	HTMLsearch += "<input type='hidden' name='AddVehicle'>";
	HTMLsearch += "<SELECT name='year'>";
	HTMLsearch += "<option value=''>Select Year</option>";
	HTMLsearch += "<option value='2011'>2011</option>";
	HTMLsearch += "<option value='2010'>2010</option>";
	HTMLsearch += "<option value='2009'>2009</option>";
	HTMLsearch += "<option value='2008'>2008</option>";
	HTMLsearch += "<option value='2007'>2007</option>";
	HTMLsearch += "<option value='2006'>2006</option>";
	HTMLsearch += "<option value='2005'>2005</option>";
	HTMLsearch += "<option value='2004'>2004</option>";
	HTMLsearch += "<option value='2003'>2003</option>";
	HTMLsearch += "<option value='2002'>2002</option>";
	HTMLsearch += "<option value='2001'>2001</option>";
	HTMLsearch += "<option value='2000'>2000</option>";
	HTMLsearch += "<option value='1999'>1999</option>";
	HTMLsearch += "<option value='1998'>1998</option>";
	HTMLsearch += "<option value='1997'>1997</option>";
	HTMLsearch += "<option value='1996'>1996</option>";
	HTMLsearch += "<option value='1995'>1995</option>";
	HTMLsearch += "<option value='1994'>1994</option>";
	HTMLsearch += "<option value='1993'>1993</option>";
	HTMLsearch += "<option value='1992'>1992</option>";
	HTMLsearch += "<option value='1991'>1991</option>";
	HTMLsearch += "<option value='1990'>1990</option>";
	HTMLsearch += "<option value='1989'>1989</option>";
	HTMLsearch += "<option value='1988'>1988</option>";
	HTMLsearch += "<option value='1987'>1987</option>";
	HTMLsearch += "<option value='1986'>1986</option>";
	HTMLsearch += "<option value='1985'>1985</option>";
	HTMLsearch += "<option value='1984'>1984</option>";
	HTMLsearch += "<option value='1983'>1983</option>";
	HTMLsearch += "<option value='1982'>1982</option>";
	HTMLsearch += "<option value='1981'>1981</option>";
	HTMLsearch += "<option value='1980'>1980</option>";
	HTMLsearch += "<option value='1979'>1979</option>";
	HTMLsearch += "<option value='1978'>1978</option>";
	HTMLsearch += "<option value='1977'>1977</option>";
	HTMLsearch += "<option value='1976'>1976</option>";
	HTMLsearch += "<option value='1975'>1975</option>";
	HTMLsearch += "<option value='1974'>1974</option>";
	HTMLsearch += "<option value='1973'>1973</option>";
	HTMLsearch += "<option value='1972'>1972</option>";
	HTMLsearch += "<option value='1971'>1971</option>";
	HTMLsearch += "<option value='1970'>1970</option>";
	HTMLsearch += "<option value='1969'>1969</option>";
	HTMLsearch += "<option value='1968'>1968</option>";
	HTMLsearch += "<option value='1967'>1967</option>";
	HTMLsearch += "<option value='1966'>1966</option>";
	HTMLsearch += "<option value='1965'>1965</option>";
	HTMLsearch += "<option value='1964'>1964</option>";
	HTMLsearch += "<option value='1963'>1963</option>";
	HTMLsearch += "<option value='1962'>1962</option>";
	HTMLsearch += "<option value='1961'>1961</option>";
	HTMLsearch += "<option value='1960'>1960</option>";
	HTMLsearch += "</SELECT>&nbsp;";
	HTMLsearch += "<SELECT name = 'makeid' size = '1'>";
	HTMLsearch += "<option value=''>Select Make</option>";
	HTMLsearch += "<OPTION value='AC'>Acura</OPTION>"
	HTMLsearch += "<OPTION value='800002'>Audi</OPTION>"
	HTMLsearch += "<OPTION value='800003'>BMW</OPTION>"
	HTMLsearch += "<OPTION value='BU'>Buick</OPTION>"
	HTMLsearch += "<OPTION value='CD'>Cadillac</OPTION>"
	HTMLsearch += "<OPTION value='CV'>Chevrolet</OPTION>"
	HTMLsearch += "<OPTION value='CH'>Chrysler</OPTION>"
	HTMLsearch += "<OPTION value='DG'>Dodge</OPTION>"
	HTMLsearch += "<OPTION  value='EG'>Eagle</OPTION>"
	HTMLsearch += "<OPTION value='FO'>Ford</OPTION>"
	HTMLsearch += "<OPTION  value='GO'>Geo</OPTION>"
	HTMLsearch += "<OPTION value='GM'>GMC</OPTION>"
	HTMLsearch += "<OPTION value='HO'>Honda</OPTION>"
	HTMLsearch += "<OPTION value='HY'>Hyundai</OPTION>"
	HTMLsearch += "<OPTION value='IN'>Infiniti</OPTION>"
	HTMLsearch += "<OPTION  value='IS'>Isuzu</OPTION>"
	HTMLsearch += "<OPTION value='JA'>Jaguar</OPTION>"
	HTMLsearch += "<OPTION value='JP'>Jeep</OPTION>"
	HTMLsearch += "<OPTION value='KI'>Kia</OPTION>"
	HTMLsearch += "<OPTION    value='RO'>Land Rover</OPTION>"
	HTMLsearch += "<OPTION value='LX'>Lexus</OPTION>"
	HTMLsearch += "<OPTION   value='LN'>Lincoln</OPTION>"
	HTMLsearch += "<OPTION value='MA'>Mazda</OPTION>"
	HTMLsearch += "<OPTION value='800016'>Mercedes-Benz</OPTION>"
	HTMLsearch += "<OPTION value='MR'>Mercury</OPTION>"
	HTMLsearch += "<OPTION value='805419'>Mini Cooper</OPTION>"
	HTMLsearch += "<OPTION value='MI'>Mistsubishi</OPTION>"
	HTMLsearch += "<OPTION value='NI'>Nissan</OPTION>"
	HTMLsearch += "<OPTION value='OL'>Oldsmobile</OPTION>"
	HTMLsearch += "<OPTION value='PL'>Plymouth</OPTION>"
	HTMLsearch += "<OPTION value='PN'>Pontiac</OPTION>"
	HTMLsearch += "<OPTION value='800019'>Porsche</OPTION>"
	HTMLsearch += "<OPTION value='SA'>Saab</OPTION>"
	HTMLsearch += "<OPTION value='SN'>Saturn</OPTION>"
	HTMLsearch += "<OPTION value='SC'>Scion</OPTION>"
	HTMLsearch += "<OPTION value='SU'>Subaru</OPTION>"
	HTMLsearch += "<OPTION value='SZ'>Suzuki</OPTION>"
	HTMLsearch += "<OPTION value='TO'>Toyota</OPTION>"
	HTMLsearch += "<OPTION value='800026'>Volkswagen</OPTION>"
	HTMLsearch += "<OPTION value='VO'>Volvo</OPTION>"
	HTMLsearch += "</SELECT>&nbsp;";
	HTMLsearch += "<input type='submit' value='SEARCH'>";
	HTMLsearch += "</TD>";
	HTMLsearch += "</TR>";
	//HTMLsearch += "<TR>";
	//HTMLsearch += "<TD colspan='3' align=middle>";
	//HTMLsearch += "<TABLE cellSpacing=0 cellPadding=0 width='100%' border=0>";
	//HTMLsearch += "<TR>";
	//HTMLsearch += "<TD vAlign=bottom align=left>";
	//HTMLsearch += "<IMG height=5 src='/assets/images/corner_bottom_left.gif' width=5 border=0>";
	//HTMLsearch += "</TD>";
	//HTMLsearch += "<TD vAlign=bottom align=right>";
	//HTMLsearch += "<IMG height=5 src='/assets/images/corner_bottom_right.gif' width=5 border=0>";
	//HTMLsearch += "</TD>";
	//HTMLsearch += "</TR>";
	//HTMLsearch += "</TABLE>";
	//HTMLsearch += "</TD>";
	//HTMLsearch += "</TR>";
	HTMLsearch += "</TABLE></center>";
}

// show HTML code on a page
function showSearch()
{
	document.writeln(HTMLsearch);
	document.write('<script language="javascript"> ')
	document.write('	if (make !=  "") { ')
	document.write('		 var makeDD = document.vehiclesearch.makeid;')
	document.write('		 var makeDDLen = makeDD.length;')
	document.write('		 var cnt;')
	document.write('		 var dropMake;')
	document.write('		 for ( cnt = 0; cnt < makeDDLen; cnt++) {')
	document.write('			 dropMake = makeDD.options[cnt].text;')
	document.write('			 if (make == dropMake) {')
	document.write('				 makeDD.selectedIndex = cnt;')
	document.write('				 break;')
	document.write('			 }')
	document.write('		 }')
	document.write('	}')
	document.write('	')
	document.write('	')
	document.write('</script>')
}

function checkBox(inputBox, count){
	if(inputBox.form.index.checked == undefined)
		inputBox.form.index[count].checked = true;
	else
		inputBox.form.index.checked = true;
}

function isNumeric(strString){
	//  check for valid numeric strings
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;
	if (strString.length == 0) return false;
	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
		{
			blnResult = false;
		}
	}
	return blnResult;
}


