function menu_inicial(){
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++)
	{
	hash = hashes[i].split('=');
	vars.push(hash[0]);
	vars[hash[0]] = hash[1];
	}
	var array_menus= new Array('inicio','quem_somos','servicos','solucoes','portfolio','parceiros','contactos');
	var predef='inicio';
	for(var i=0;i<array_menus.length;i++){
		if(vars[hash[0]]!=undefined){
				if(array_menus[i]==vars[hash[0]])
					{
						document.getElementById(array_menus[i]).style.background='url(images/spacer.png) bottom repeat-x';
						document.getElementById(array_menus[i]).style.color='#eeeeee';
						}
				else {
						document.getElementById(array_menus[i]).style.background='none';
						document.getElementById(array_menus[i]).style.color='#777777';
					}
			}
		else {
				document.getElementById('inicio').style.background='url(images/spacer.png) bottom repeat-x';
				document.getElementById('inicio').style.color='#eeeeee';
			}
		}
	}
function on(id) {
		document.getElementById(id).style.background='url(images/spacer.png) bottom repeat-x';
		document.getElementById(id).style.color='#eeeeee';
	}
function off(id){
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++)
	{
	hash = hashes[i].split('=');
	vars.push(hash[0]);
	vars[hash[0]] = hash[1];
	}
	if(vars[hash[0]]!=id){
		document.getElementById(id).style.background='none';
		document.getElementById(id).style.color='#777777';
		}
	}
function areadecliente(){
	var array_id = new Array ('inicio','quem_somos','servicos','solucoes','portfolio','parceiros','contactos');
	for(i=0;i<array_id.length;i++){
				document.getElementById(array_id[i]).style.background='none';
				document.getElementById(array_id[i]).style.color='#777777';

		}
	}
var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=600,width=400');
	if (window.focus) {newwindow.focus()}
}
function quest () {
	inqChecado=0;
	for (i=0;i<document.inquerito.resposta.length;i++)
	{
		if (document.inquerito.resposta[i].checked)
			inqChecado=1;
	}
	
	if (inqChecado == 0){
		alert ("Deve selecionar uma das categorias.");
		return false;
	}
	else {
		return true;
	}
}
function valida() {
	if(document.user.login.value=="" || document.user.senha.value==""){
		alert("Preencha os campos.");
		return false;
	}
	return true;
}
function valida_email() {
/* VALIDADCAO CAMPO email*/
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	
	if (filter.test(document.newsletter.newsletter.value)==false){
		alert ("O email que introduziu não é valido");
		return false
	}
	return true;
}
function calcHeight()
{
  	var the_height=document.getElementById('areadeclientes').contentWindow.document.body.scrollHeight;
	document.getElementById('areadeclientes').height=the_height+40;
}
