
//whois dominis

function cl_whois(){
	f=document.formu;
	if(f.domini.value.length==0)f.domini.value="nombreempresa";
}

function bl_whois(){
	f=document.formu;
	if(f.domini.value=="nombreempresa")f.domini.value="";
}


//buscador

function cl_buscador(){
	f=document.form_buscador;
	if(f.query.value.length==0)f.query.value="¿Buscas algo?";
}

function bl_buscador(){
	f=document.form_buscador;
	if(f.query.value=="¿Buscas algo?")f.query.value="";
}

function buscar(){
	f=document.form_buscador;
	if(f.query.value=="¿Buscas algo?"||f.query.value.length==0){
		alert("Introduce el texto a buscar");
	}
	else if(f.query.value.length<4){
		alert("La palabra introducida es demasiado corta");
	}
	else{
		f.submit();
	}
}


//menu desplegable

function HideContent(d) {
	if(d.length < 1) { return; }
	document.getElementById(d).style.display = "none";
}

function ShowContent(d) {
	if(d.length < 1) { return; }
	document.getElementById(d).style.display = "block";
}


function desplega_menu(num,imatge,idioma){
	var imatge_actual;
	var len;
	var act;
	
	imatge_actual=document.getElementById("imenu"+num).src;
	len=imatge_actual.length;
	act=imatge_actual.substr(len-6,2);
	
	HideContent("menu1");
	HideContent("menu2");
	HideContent("menu3");
	
	document.getElementById("imenu1").src="../img/menu/web_disseny_"+idioma+"_01.gif";
	document.getElementById("imenu2").src="../img/menu/emarketing_"+idioma+"_01.gif";
	document.getElementById("imenu3").src="../img/menu/hosting_"+idioma+"_01.gif";	

		
	if(act=="01"){
		document.getElementById("imenu"+num).src="../img/menu/"+imatge+"_"+idioma+"_02.gif";	
		ShowContent("menu"+num);
	}
}

	
fmenu0 = new Image();
fmenu0.src = "../img/menu/web_disseny_es_02.gif";

fmenu1 = new Image();
fmenu1.src = "../img/menu/emarketing_es_02.gif";
	
fmenu2 = new Image();
fmenu2.src = "../img/menu/hosting_es_02.gif";



//varis

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


function email(a,b){
	location.href="mailto:"+a+"@"+b;
}

