menu_status = new Array();
menu_status1 = new Array();
menu_status2 = new Array();
idArray = new Array(); 


function showHide(theid,idArray){
		
if (document.getElementById) {
   var switch_id = document.getElementById(theid);
        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
		
		for ( var i = 0; i < idArray.length; i++)
			{
				if ( idArray[i] != theid){
				var switch_id = document.getElementById(idArray[i]);
				switch_id.className = 'hide';
				menu_status1[theid] = 'hide';
				}
			}
				
    }
}


function showMenu(theid){
	
if (document.getElementById) {
   var switch_id = document.getElementById(theid);
           switch_id.className = 'show';
           menu_status2[theid] = 'show';
        

				
    }
}











function displayMenu()
{
document.write ("<tr>")
document.write ("<td class = 'menurow'><a class = 'menu' href='index.php'>Home</a>")
document.write (" &nbsp;|&nbsp;<a class = 'menu' href='products.php'>Products</a>")
document.write ("&nbsp;|&nbsp;<a class = 'menu' href='colors.php'>Colors</a>")
document.write ("&nbsp;|&nbsp;<a class = 'menu' href='aboutus.php'>About Us</a>")
document.write ("&nbsp;|&nbsp;<a class = 'menu' href='contact.php'>Contact</a>")
document.write ("</td>")
document.write ("</tr>")

}

//function to change background image on mouse rollover
function rollover(obj, item){
obj.className = item; 
}


function ManageMenu()
{

document.write ("<td class = 'productMenu' valign = 'top'>");
document.write ("<table cellspacing = '0px' cellpadding = '5px' border = '0px'>");
document.write ("<tr><ul><td class = 'left_menu_title'>Product</td></tr>");
document.write ("<tr><td class = 'left_menu'><li><a class = 'left_menu_link' href = 'addproduct.php'>Add Product</a></li></td></tr>");
document.write ("<tr><td class = 'left_menu'><li><a class = 'left_menu_link' href = 'manageproduct.php'>Manage Product</a></li></td></tr>");
document.write ("<tr><ul><td class = 'left_menu_title'>Design</td></tr>");
document.write ("<tr><td class = 'left_menu'><li><a class = 'left_menu_link' href = 'adddesign.php'>Add Design</a></li></td></tr>");
document.write ("<tr><td class = 'left_menu'><li><a class = 'left_menu_link' href = 'managedesign.php'>Manage Design</a></li></td></tr>");
document.write ("<tr><ul><td class = 'left_menu_title'>Item</td></tr>");
document.write ("<tr><td class = 'left_menu'><li><a class = 'left_menu_link' href = 'additem.php'>Add Item</a></li></td></tr>");
document.write ("<tr><td class = 'left_menu'><li><a class = 'left_menu_link' href = 'manageitem.php'>Manage Item</a></li></td></tr>");
document.write ("</table>"); 
document.write ("</td>");
	
	
	
}




function validateproductFields()
{


	if (document.product.p_name.value == "")
		{
		
		alert ("Please enter product name."); 
		document.product.p_name.focus();
		
		
		return false;
	}
	
	

}


function validateupdateproductFields()
{


	
	
	if (document.updateproduct.p_name.value == "")
		{
		
		alert ("Please enter product name."); 
		document.updateproduct.p_name.focus();
		
		
		return false;
	}

}








function validatedesignFields()
{


	if (document.design.design_name.value == "")
		{
		
		alert ("Please enter design name."); 
		document.design.design_name.focus();
		
		
		return false;
	}
	
	
	if (document.design.p_num.value == "Select Product")
		{
		
		alert ("Please select correct Product Name."); 
		document.design.p_num.focus();
		
		
		return false;
	}
	
	
	
	
}



function validateupdatedesignFields()
{

	
	
	
	
	if (document.updatedesign.design_name.value == "")
		{
		
		alert ("Please enter design name."); 
		document.updatedesign.design_name.focus();
		
		
		return false;
	}
	
	
	if (document.updatedesign.p_num.value == "Select Product")
		{
		
		alert ("Please select correct Product Name."); 
		document.updatedesign.p_num.focus();
		
		
		return false;
	}
	
	
	
	
	
}

function validateitemFields()
{


	if (document.item.item_name.value == "")
		{
		
		alert ("Please enter item name."); 
		document.item.item_name.focus();
		
		
		return false;
	}
	
	
	if (document.item.design_num.value == "Select Design")
		{
		
		alert ("Please select correct Design Name."); 
		document.item.design_num.focus();
		
		
		return false;
	}
	

}


function validateupdateitemFields()
{

	if (document.updateitem.item_name.value == "")
		{
		
		alert ("Please enter item name."); 
		document.updateitem.item_name.focus();
		
		
		return false;
	}
	
	
	if (document.updateitem.design_num.value == "Select Design")
		{
		
		alert ("Please select correct Design Name."); 
		document.updateitem.design_num.focus();
		
		
		return false;
	}

}














