// JavaScript Document
var AboutUsSubMenu;
var menuCount=0;
function setMenu(curMenu) {
	var mtab = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
	var trd = '<TR style="background-color: #CCCCCC;height:25px" valign="middle"><TD width="100%">&nbsp;';
	var trdc = '&nbsp;</TD></TR>';
	var subMenu = '';
	/* Main Menu */
	var menu = checkMenu("Home",curMenu,'index.html','') + mtab ;
	menu+=checkMenu("About Us",curMenu,'aboutus.html','AboutUsMenu') + mtab ;
	menu+=checkMenu("Shop",curMenu,'shop_landing.html','') + mtab ;
	menu+=checkMenu("Contact",curMenu,'contact.html','') + mtab ;
	
	/* About Us Sub Menu */
	menu+='<div id="AboutUsMenu" ' + getSubMenuMouseEvents('AboutUsMenu') + '></div>';
	document.getElementById('Menu').innerHTML = menu;
	AboutUsSubMenu= document.getElementById('AboutUsMenu');
	subMenu+='<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">';
	subMenu+='<TR><TD>&nbsp;</TD></TR>';
	subMenu+=trd + checkMenu("Brief History",'','aboutus.html','') + trdc;
	subMenu+=trd + checkMenu("Testimonials",'','testimonials.html','') + trdc;
	//AboutUsSubMenu.innerHTML+=checkMenu("Blog",'','Blog.html','') + '<BR><BR>' ;
	subMenu+=trd + checkMenu("Photo Gallery",'','design_gallery.html?pic=1','') + trdc;
	subMenu+=trd + checkMenu("Privacy Policy",'','privacy_policy.html','') + trdc;
	//subMenu+='<TR style="height:9px;"><TD style="width:9px;"><img src="images/ll.gif"></TD><TD style="background-color: #CCCCCC;">&nbsp;</TD><TD style="width:9px;"><img src="images/lr.gif"></TD></TR>';
	subMenu+='</table>'
	AboutUsSubMenu.innerHTML = subMenu;
	//alert(AboutUsSubMenu.innerHTML);
	AboutUsSubMenu.style.display='none';
	reIndex();
}
function makeSLButton(buttonName) {
document.write('<img style="filter:alpha(opacity=100)" src="images/sl_' + buttonName +'_button.jpg" alt="' + buttonName + ' button" onClick="window.location=\'' + buttonName + '.html\'" onMouseOver="this.style.cursor=\'pointer\'; this.style.opacity=0.50;this.filters.alpha.opacity=50;" onMouseOut="this.style.opacity=1;this.filters.alpha.opacity=100;"><br><a href="' +buttonName +'.html">' + buttonName.toUpperCase() + '</a>');	
}
function makeTab(tabName) {
	var tab_section = '<table celpadding="0"><TR>'+checkTab(tabName,tabName,tabName.toLowerCase().replace(' ', '_').replace('/','_') )+'</TR></table>';
	document.getElementById('Menu_tab').innerHTML = tab_section;
}
function setTabs(tabset,tab) { /* These are for the gifts */
//<table cellpadding="0"><TR><TD class="tab_white_furniture"><BR/>FURNITURE</TD><TD class="tab_black"><BR/>ACCESSORIES</td><TD class="tab_white_statuary"><BR/>STATUARY</TD><TD class="tab_white_art"><BR/>ART</TD><TD class="tab_white_sale"><BR/>SALE</TD></TR></table>

/* Shop Tabs */
	var tab_section = '<table celpadding="0"><TR>';
	tab_section+=checkTab("Gifts Under $25",tab,'giftsunder25.html','');
	tab_section+=checkTab("Gifts Under $50",tab,'giftsunder50.html','');
	tab_section+=checkTab("Gifts Under $100",tab,'giftsunder100.html','');
	tab_section+=checkTab("The Ultimate Gifts",tab,'theultimategifts.html','');
	tab_section+=checkTab("Shop Entire Store",tab,'shop_landing.html','');
	tab_section+='</TR></table>';
	document.getElementById('Menu_tab').innerHTML = tab_section;
}
function setTab(tabset,tab) {
//<table cellpadding="0"><TR><TD class="tab_white_furniture"><BR/>FURNITURE</TD><TD class="tab_black"><BR/>ACCESSORIES</td><TD class="tab_white_statuary"><BR/>STATUARY</TD><TD class="tab_white_art"><BR/>ART</TD><TD class="tab_white_sale"><BR/>SALE</TD></TR></table>

/* Shop Tabs */
	var tab_section = '<table celpadding="0"><TR>';
	tab_section+=checkTab("Furniture",tab,'furniture.html','');
	tab_section+=checkTab("Accessories",tab,'accessories.html','');
	tab_section+=checkTab("Lighting",tab,'lighting.html','');
	tab_section+=checkTab("Statuary",tab,'statuary.html','');
	tab_section+=checkTab("Jewelry",tab,'jewelry.html','');
	tab_section+=checkTab("Art",tab,'art.html','');
	tab_section+=checkTab("Sale",tab,'sale.html','');
	//tab_section+=checkTab("New Shipment",tab,'newshipment.html','');
	tab_section+='</TR></table>';
	document.getElementById('Menu_tab').innerHTML = tab_section;
}
function checkTab(tabItem, curTab,tabPage) {
	if (curTab == tabItem) {
		return '<TD class="tab_black"><BR/><a style="color:#FFFFFF" href="' + tabPage + '" >' + tabItem.toUpperCase() + '</a></td>';
	}
	else {
			var tmp = tabItem.toLowerCase().replace(/ /g,'');
			return '<TD class="tab_white_' + tmp.replace('$','') + '"><BR/><a href="' + tabPage + '" >' + tabItem.toUpperCase() + '</a></td>';
	}
}
function checkMenu(mnuItem, curMenu,mnuPage,menuName) {
	if (curMenu == mnuItem) {
		if (curMenu == "Shop")
			return '<a ' + getSubMenuMouseEvents(menuName) + ' href="http://www.elementseast.com/'+ mnuPage + '"><span ' + getSubMenuMouseEvents(menuName) + ' class="redfont">' + mnuItem + '</span></a>';
		else
			return '<span ' + getSubMenuMouseEvents(menuName) + ' class="redfont">' + mnuItem + '</span>';
	}
	else {
		if(menuName=='')
			return '<a ' + getSubMenuMouseEvents(menuName) + ' href="http://www.elementseast.com/'+ mnuPage + '">' + mnuItem + '</a>';
		else
			return '<span ' + getSubMenuMouseEvents(menuName) + ' class="menufont">' + mnuItem + '</span>';
	}
}
function showSubMenu(menuName) {
	AboutUsSubMenu.style.display='';
	menuCount++;
}
function hideSubMenu(menuName) {
	if (--menuCount==0)
		AboutUsSubMenu.style.display='none';	
}
function getSubMenuMouseEvents(menuName) {
	if(menuName !='')
		return 'onmouseover="showSubMenu(\'' + menuName + '\');" onmouseout="hideSubMenu(\'' + menuName + '\');"';
	else
		return '';
}
function reIndex(){
zi = 50;
cn = document.getElementsByTagName('div');
for (n=0;n<cn.length;n++){
	if (cn[n].id.substr(0,2) !='lb'/*Exclude Lytebox*/) {
		cn[n].style.zIndex=zi--;
	}
}
}
