<!--
function readQueryNav(name){
	var nameEQ = name.toLowerCase() + "=";
	var ca = location.search.substring(1).toLowerCase().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 c.substring(nameEQ.length,c.length);
	}
	return null;
}

var URLString = new String(parent.document.location).toLowerCase() //LINE 41

function loadPage(arrPageInfo){
	tab1 = 0;
	tab2 = 0;
	tab3 = 0;
	tab4 = 0;
	tab5 = 0;
	tab6 = 0;
		
	if (URLString != null) {
		//Current Page
		if (URLString.indexOf("shopourstores") > -1)
			tab2 = 1
		else {
			if  (readQueryNav("room") != null)
				tab5 = 1
			else {	
				if (readQueryNav("mfr") != null || URLString.indexOf("shopbybrand") > -1)
					tab6 = 1
				else {
					if (URLString.indexOf("inspiration") > -1)
						tab3 = 1
					else {
						if (readQueryNav("tid") != null || URLString.indexOf("products/default.aspx") > -1)
							tab4 = 1
						else {
							if (URLString.indexOf("default.aspx") > -1)
								tab1 = 1
							else{
								strURL = " " + location
								strURLVar = " " + location.hostname
								strURLVar = strURLVar.replace(" ","")
								
								strURL = strURL.replace(strURLVar, "")
								
								strURLVar = " " + location.protocol
								strURLVar = strURLVar.replace(" ","")
								
								strURL = strURL.replace(strURLVar, "")
								strURL = strURL.replace("//", "")
								strURL = strURL.replace("/", "")
								
								if (strURL.length < 5)
									 tab1 = 1
							};
						};
					};
				};
			};	
		};
	};
	
	//Logged In
	if (readCookie('user%5Fid') != '' && readCookie('user%5Fid') != null)
		logged_in = 1;
	else
		logged_in = 0;
	
	//User Type
	if (readCookie('userType') == 2 || readCookie('usertype') == 2)
		ut = 2;
	else
		ut = 1;
	if ( location.hostname.toLowerCase().indexOf('mail') > -1)
		ut = 2;
	displayTabs(ut, tab1, tab2, tab3, tab4, tab5, tab6, arrPageInfo, logged_in);		
}

function doSearch() {
	var strSearch = document.forms[0].elements['tbxSearch'].value;
	
	if (document.getElementById("ddlType").value > 0)
		strSearch += '&type=' + document.getElementById("ddlType").value
	
	window.location='/search/default.aspx?term=' + strSearch;	
}


function displayTabs(u,t1,t2,t3,t4,t5,t6,arrPageInfo,lg){
	var pathname=location.hostname.toLowerCase()
	var ffc="<img src='/images/1pt_ffffcc.gif' width='2' height='1' />"
	var S="L"
	var N=""
	var strAcctLink = ""
	var strUSABorder = ""
	var strCADBorder = ""
	var strLoginText = ""
	var strLoginTitle = "Logged In As"
	
	if (readCookie('user%5Fid') != '' && readCookie('user%5Fid') != null) {
		if (readCookie2("lui%5Frep%5Fid") != null ){
			strAcctLink = "<a style='font-size:11px;color:white;text-decoration:none;' href='/admin/orders/customer.asp?id=" + readCookie2("user%5Fid")  +"'>"
			strLoginTitle = "<nobr>Surfing as Customer</nobr>" 
			
			if (readCookie2("fullName") != null )
				strLoginText = "<nobr><strong style='color:#eeeeee;font-size:11px;'>" + strLoginTitle + ": " + strAcctLink + readCookie2("fullName").replace("+"," ").replace("%2D","-").replace("%20"," ") + "</a></strong><img src='/images/1pt_trans.gif' width='10' /></nobr>"
		}
	}
	var onText = "<a style=\"color:#00FF00; text-decoration:underline;\" href=\"\/includes\/livehelp.aspx\" onClick=\"window.open('\/includes\/livehelp.aspx','phoneHour','width=600,height=250'); return false \">Available Now</a>"
	var offText = "<a style=\"color:#00FF00; text-decoration:underline;\" href=\"\/includes\/livehelpClosed.aspx\" onClick=\"window.open('\/includes\/livehelpClosed.aspx','phoneHour','width=600,height=250'); return false \">Click for Hours</a>"
	
	var contactText
	
	contactText = offText
	
	//Sunday
	if (arrPageInfo[14] == 1 || arrPageInfo[14] == 7){
		if (arrPageInfo[13] >= 10 && arrPageInfo[13] < 16)
			contactText = onText
	}
	else {
			if (arrPageInfo[13] >= 5 && arrPageInfo[13] < 19)
				contactText = onText
	}
	
	document.write("<table width='100%' cellspacing='0' cellpadding='0' border='0' valign='bottom' bgcolor='#" +arrPageInfo[6]+ "'>" );
		document.write("<tr>");
			  document.write("<td rowspan='2' valign='bottom'>");
				document.write("<table cellspacing='0' cellpadding='0' border='0'><tr><td colspan='2'>");
					document.write("<a href='/'><img alt='" +arrPageInfo[2] +"' border='0' src='/nav/i/" +arrPageInfo[7] +"' /></a><br />");				
				document.write("</td></tr>")
				document.write("<tr><td><img src='/images/1pt_trans.gif' width='3' height='1'>")
				document.write("</td><td width='100%'><img src='/images/1pt_ffffcc.gif' width='100%' height='1'></td></tr>")
				document.write("</table>");
			 document.write("</td>")			
			 document.write("<td colspan='2' width='100%' height='40' align='right' valign='top'>")
				document.write("<table border='0' cellpadding='0' cellspacing='0'>")
					document.write("<tr align='center'>")
						document.write("<td width='100%' style='white-space:nowrap;' align='right' valign='top' rowspan='3'>")
						document.write("<a href='/support/shipping.aspx'><img src='/images/freeship_trans.gif' align='center' border=0></a>&nbsp;&nbsp;&nbsp;")
						
						document.write("<a  style='color:#FFFFE3' href='?" + location.search.substring(1) + "&currency=USA'><img src='/images/usflag_medium.gif' style='border: " +strUSABorder + "px solid #FFFFE3' align='center' /></a>&nbsp;&nbsp;<a style='color:#FFFFE3' class='blueUnderLineNoVisit' href='?" + location.search.substring(1) + "&currency=Canada'><img src='/images/cad_flag_medium.gif' style='border: " +strCADBorder + "px solid #FFFFE3' align='center' /></a>&nbsp;&nbsp;&nbsp;&nbsp;")
						if (arrPageInfo[10] == "True")
							document.write("<img src='/images/showroom_" +arrPageInfo[6]+ ".gif' width='14' height='10' border='0' />&nbsp;<a href='/showrooms/default.aspx' style='color:white;font-size:11px;text-decoration:underline;font-weight:bold;'>Showrooms&nbsp;&&nbsp;Events</a>&nbsp;&nbsp;&nbsp;<br />");
							
						document.write("<img src='/images/phone_" +arrPageInfo[6]+ ".gif' width='14' height='10' border='0' />&nbsp;<strong style='color:#eeeeee;font-size:11px;'>Live Help - " + arrPageInfo[12] + "&nbsp;-&nbsp;" + contactText + "&nbsp;&nbsp;&nbsp;</strong></td>")
						document.write("<td bgcolor='#" +arrPageInfo[3]+ "'><a href='/prod_pg/'><img src='/images/1pt_trans.gif' height='1' width='5' border='0'></a></td>")
						document.write("<td bgcolor='#" +arrPageInfo[3]+ "'><a href='https://" + pathname + "/account/default.aspx' style='color:#" +arrPageInfo[6]+ ";' class='topmenu'>My Account</a></td>")
					   
						document.write("<td rowspan='3' bgcolor='#" +arrPageInfo[6]+ "' width='1'></td><td bgcolor='#" +arrPageInfo[3]+ "'>")
	
						if (lg==1)
							document.write("<a href='/includes/logout.aspx' style='white-space:nowrap;color:#" +arrPageInfo[6]+ ";' class='topmenu'>&nbsp;Logout</a>");
						else
							document.write("<a href='https://" + pathname + "/account/login.aspx' style='white-space:nowrap;color:#" +arrPageInfo[6]+ ";' class='topmenu'>&nbsp;Login / Register</a>");
							
						document.write("</td>");
						document.write("<td bgcolor='#" +arrPageInfo[3]+ "'><img src='/images/1pt_trans.gif' height='1' width='5' /></td><td bgcolor='#" +arrPageInfo[6]+ "'>&nbsp;&nbsp;&nbsp;</td>")
					document.write("</tr>");						
					document.write("<tr>");
						document.write("<td colspan='3'><img src='/images/1pt_" +arrPageInfo[6]+ ".gif' height='1' width='110' /></td><td colspan='4' bgcolor='#" +arrPageInfo[6]+ "'><img src='/images/1pt_" +arrPageInfo[6]+ ".gif' height='1' width='100' /></td>")
					document.write("</tr>");
					document.write("<tr align='center' bgcolor='#" +arrPageInfo[3]+ "'>");	
						document.write("<td style='white-space:nowrap;' valign='bottom' width='5'><img src='/images/new_hp/left_" +arrPageInfo[6]+ "over" +arrPageInfo[3]+ ".gif' width='5' height='5' /></td><td><a href='/support/support.aspx?' style='color:#" +arrPageInfo[6]+ ";' class='topmenu'>Support / Help&nbsp;</td><td width='100%'>&nbsp;&nbsp;&nbsp;<a href='/cart/cart.aspx' style='white-space:nowrap;color:#" +arrPageInfo[6]+ ";' class='topmenu'>View&nbsp;Cart&nbsp;<img src='/images/new_hp/hp_cart" +arrPageInfo[4]+ ".gif' width='16' height='12' border='0' />&nbsp;&nbsp;&nbsp;</td><td valign='bottom' width='5'><img src='/images/new_hp/right_" +arrPageInfo[6]+ "over" +arrPageInfo[3]+ ".gif' width='5' height='5' /></td>");
					document.write("</tr>");
				document.write("</table>");
			document.write("</td>");
		document.write("</tr>");
		document.write("<tr><td valign='bottom' align='left'>")
			//Tabs
			document.write("<table cellspacing='0' cellpadding='0' align='left' valign='bottom' border='0' width='100%'>")
				document.write("<tr style='white-space:nowrap;' valign='bottom'>")
					document.write("<td width='100%'><a href='/default.aspx'><img alt='Home' src='/nav/i/" +arrPageInfo[1] +"/home_"+t1+".gif' width='50' height='21' border='0' /></a>" + ffc)
					document.write("<a href='/products/default.aspx?clearFilter=yes&sc=tnav'><img alt='Shop by Type' src='/nav/i/" +arrPageInfo[1] +"/shopbytype_" + t4 + ".gif' width='98' height='21' border='0' id='imgInteriorTab' /></a>" + ffc)	
	
					if (arrPageInfo[8] == "True")
						document.write("<a href='/products/default.aspx?room=0&sc=tnav'><img alt='Shop by Room' src='/nav/i/" +arrPageInfo[1] +"/shopbyroom_" + t5 + ".gif' width='105' height='21' border='0' id='imgRoomTab' /></a>" + ffc)	
	
					document.write("<a href='/products/shopByBrand.aspx?sc=tnav'><img alt='Shop by Brand'src='/nav/i/" +arrPageInfo[1] +"/shopbybrand_" + t6 + ".gif' width='109' height='21' border='0' id='imgBrandTab' /></a>" + ffc)	
					document.write("<a href='/inspiration/gallery.aspx'><img alt='Inspiration Gallery' src='/nav/i/" +arrPageInfo[1] +"/inspgall_" + t3 + ".gif' width='128' height='21' border='0' /></a>" + ffc);
					
					document.write("<a href='/includes/shopOurStores.aspx'><img alt='Shop More Stores' src='/nav/i/" +arrPageInfo[1] +"/morestores_" + t2 + ".gif' border='0' /></a>")										
					document.write("</td>");					
				document.write("</tr>");
			document.write("</table>");		
		document.write("</td>")
		document.write("<td valign='bottom' align='right'>" + strLoginText + "</td>");
	document.write("</table>");
}
-->


