//window.onload = starMenu;

function starMenu(){
	queryString = window.location.search.substring(1);
	p = queryString.substring(2);
	switch(p){
		case "QueHacemos": showMenu(3); break;
		case "Experiencia": showMenu(4); break;
		case "Recursos": showMenu(6); break;
		case "RRHH": showMenu(7); break;
		default: break;
	}
}

function showMenu(id){
	for(i=0; i<=7; i++){
		if(document.getElementById('submenu_' + i)){
			if(i == id)
				document.getElementById('submenu_' + i).className = "showSubmenu";
			else
				document.getElementById('submenu_' + i).className = "hideSubmenu";
		}
	}
}

function hideMenu(id){
	document.getElementById('submenu_0').className = "showSubmenu";
	document.getElementById('submenu_' + id).className = "hideSubmenu";
}

function changeSelect(id){
	if(document.getElementById(id).selectedIndex < 2)
		document.getElementById(id).selectedIndex = 0;
}

function check_email(e){
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){ 
			return (false);
		}	
	} 
	if (document.images){
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)){
			return (-1);		
		} 
	}
}