// javascript code should detect which browser we
// have in order to use document.all or document.layers
// Netscape : document.theobject.visibility.
// Explorer: document.all.theobject.style.visibility 

var MENU_FOCUSED = false;
var MENU_NAME = '';
var MENU_CLICK = false;


function startBlock() {
	if(MENU_CLICK == true){
			MENU_CLICK  = false;
	}
	else if (MENU_CLICK == false){
	MENU_CLICK  = true;
	}
}


IE4 = (document.all) ? 1 : 0;       // browser is Internet Explorer 4
NS4 = (document.layers) ? 1 : 0;    // browser is Netscape 4

ver4 = (IE4 || NS4) ? 1 : 0;  // know that we have version 4 browser
                              // this will be required for non-dhtml browsers

function hoverMenu(whichElement,status) {
arrayOfLayers = [
'FashionspaceDesigner','FashionspaceIllustration','FashionspaceStylist','FashionspaceTextiles','FinespaceArt','GraphicspaceDesign','HairspaceBeauty','Jewellery','MakespaceUp','Modelling','NailspaceWork','Photography','ProductspaceDesign','Textiles'];
maxNbrOfLayers = 14;

	if(!MENU_CLICK) {

	if (status == true) {
		setMenuFocused()
	    vis = 'visible';
	}
	else if (status == false) {
	   vis = 'hidden';
	}


	  // checking which browser
	  if (IE4) {
    	 for (i=0;i<maxNbrOfLayers;i++) {
        	 layerName = arrayOfLayers[i];
	         if (layerName == whichElement) {
    	        // get its index first
        	    layerIndex = i;
            	theElement = eval("document.all." + arrayOfLayers[i] + ".style");
	            theElement.visibility=vis;
    	     } // check if layer exists
        	 else {
	            theElement = eval("document.all." + arrayOfLayers[i] + ".style");
    	        theElement.visibility='hidden'; 
        	 } // set other layers to hidden

	     } // end if for loop
 	  } // end of IE4

	  else if (NS4) { // netscape or similar browser
	     for (i=0;i<maxNbrOfLayers;i++) {
    	     layerName = arrayOfLayers[i];
	         if (layerName == whichElement) {
    	        // get its index first
	            layerIndex = i;
    	        theElement = eval("document." + arrayOfLayers[i]);
	            theElement.visibility=vis; 
    	     } // check if layer exists
	         else {
	            theElement = eval("document." + arrayOfLayers[i]);         
    	        theElement.visibility='hidden'; 
        	 } // set other layers to hidden
        
        	 
	     } // end if for loop
	  } // end of NS
	  else { // for Opera browser
	     for (i=0;i<maxNbrOfLayers;i++) {
    	     layerName = arrayOfLayers[i];
        	 if (layerName == whichElement) {
	            // get its index first
    	        layerIndex = i;
        	    theElement = eval(document.getElementById(arrayOfLayers[i])).style;  
	            theElement.visibility=vis; 
    	     } // check if layer exists
	         else {
    	        theElement = eval(document.getElementById(arrayOfLayers[i])).style;  
        	    theElement.visibility='hidden'; 
	         } // set other layers to hidden

	     } // end if for loop
	  } // end of Opera
	         }
} // end hoverOver function

function startHideMenu(whichElement) {
	MENU_FOCUSED = false;
	MENU_NAME = whichElement;
	setTimeout("hideMenu()", 1000);
	return;
} // end startHideMenu()

function hideMenu() {
	if (!MENU_FOCUSED) hoverMenu(MENU_NAME,false);
	return;
} // end hideMenu()

function setMenuFocused() {
	MENU_FOCUSED = true;
} // end setMenuFocused

