var n4, ie, n6;
var doc, doc2, doc3, sty;

if (document.layers){
	doc = "document.";
	doc2 = ".document.";
	doc3 = "";
	sty = "";
	n4 = true;
}
else if (document.all){
	doc = "document.all.";
	doc2 = "";
	doc3 = "";
	sty = ".style";
	ie = true;
}
else if (document.getElementById){
	doc = "document.getelementById('";
	doc2 = "')";
	doc3 = "')";
	sty = "').style";
	n6 = "true";
}



// ----------------------------------------------------------------
// variables for the window dimensions
var win_width, win_height;
var centerhor, centerver;



// ----------------------------------------------------------------
//get dimensions of the current window
function dimensions(){
	if (n4 || n6){
		win_width = window.innerWidth;
		win_height = window.innerHeight;
	}
	else if (ie){
		win_width = document.body.clientWidth;
		win_height = document.body.clientHeight;
	}
	centerhor = win_width / 2;
	centerver = win_height / 2;
}



// ----------------------------------------------------------------
function initialize(){
	placeIt('products',117, 234);
	placeIt('services',117, 255);
	placeIt('mnuFaq', 117, 277);
	placeIt('download',117, 320);
	placeIt('mnuWebServices',117, 343);
	placeIt('mnuWorkshop',117, 365);
}


// ----------------------------------------------------------------
//place the elements relative to the page
function placeIt(elem, leftPos, topPos){
	docObj = eval(doc + elem + sty);
	if (n4 || n6){
		docObj.left = leftPos;
		docObj.top = topPos;
	}
	else if (ie){
		docObj.pixelLeft = leftPos;
		docObj.pixelTop = topPos;
	}
}

// ----------------------------------------------------------------


var oncolor = "white";
var offcolor = "#ccc";


// ----------------------------------------------------------------
function changecolor(divname, backColor, foreColor){
	//stopall();
	if (!n4){
		menuObj = eval(doc + divname + sty);
		menuObj.backgroundColor = backColor;
		menuObj.color = foreColor;
	}
}

// ----------------------------------------------------------------
//show or hide current selection
function showhide(elem, state){
	docObj = eval(doc + elem + sty);
	docObj.visibility = state;
}



// ----------------------------------------------------------------
//variables that hold the value of the currently active (open) menu
var active_menu = null;
var active_menuelem = null;




// ----------------------------------------------------------------
//this close down any opened menus INSTANTLY
function closeall(){
	if (active_menu != null){
		closeallmenus();
	}
	
}



// ----------------------------------------------------------------
//this one closes all active menu and turns back to 'off'
function closeallmenus(){
	if (active_menu != null){
		showhide(active_menu, 'hidden');
	}
}



// ----------------------------------------------------------------
//this controls the menu display
function controlmenu(menu){
	//first hide any opened menu
	closeall()
	
	showhide(menu, 'visible');
	
	//store current menu reference
	active_menu = menu;
}




