menu_array = new Array();
menu_array[0] = 'submenu_forex';
menu_array[1] = 'submenu_eminis';
menu_array[2] = 'submenu_ts';
menu_array[3] = 'submenu_ln';
menu_array[4] = 'submenu_svd';
menu_array[5] = 'submenu_edu';
menu_array[6] = 'submenu_mr';
menu_array[7] = 'submenu_sup';

menu_status = new Array();
/* show one while hide the others */

//var parent_page = "";

function showMenu(id){
		if (document.getElementById){ 
			var switch_id = document.getElementById(id);
			if (menu_status[id] !='show'){
				switch_id.className = 'show';
				menu_status[id] = 'show';
				//alert('hi');
			}
			
			hideOthers(id);
		}
		
	
}

function hideOthers(id){
	
	if (document.getElementById){ 
		//var temp_id = document.getElementById(id)
		for (var i = 0; i< menu_array.length; i++ ){
			
			if (menu_array[i] != id){
				//alert(document.getElementById(id).className);
				document.getElementById(menu_array[i]).className = 'hide';
				menu_status[id] = 'hide';
			}
			
		}
	}
	
}


/*
not hiding others only itself*/


function showHide(id){
	if (document.getElementById){ 
		var switch_id = document.getElementById(id);
		
		if (menu_status[id] !='show'){
			
			
			
			switch_id.className = 'show';
			menu_status[id] = 'show';
		}else{
			switch_id.className = 'hide';
			menu_status[id] ='hide';
		}
		
		
	}
		
}

function showThisMenu(id){
	if(document.getElementById){
			//alert(id);
		document.getElementById(id).className = 'show';
		menu_status[id] = 'show';
	}	
	
}


function getValue(varname, real){
	var url = window.location.href;
	var value="";
	var val = url.split("?");
	
	if (val.length == 1){
		value = real;
		showThisMenu(real);
		
		
	}else{
	
	
	var vars = val[1].split("&");
	
	
	
	for(var i = 0; i< vars.length; i++ ){
		var parts = vars[i].split("=");
		
		if (parts[0] == varname){
			value = parts[1];
			
			break;
		}
		
	}
	
	value = unescape(value);
	
	value.replace(/\+/g, " ");
	
	//alert(value);
	
	showThisMenu(value);
	}
	
	
	if (value == "submenu_forex"){
		if (document.getElementById("banner") != null ){
			document.getElementById("banner").src = "images/ytr_forex_banner.jpg";
		}
	}else if (value == "submenu_eminis"){
		if (document.getElementById("banner") != null ){
			document.getElementById("banner").src = "images/ytr_Banner_Eminis.jpg";
		}	
	}
	//parent_page = value;
	
	
}
