function goBack(){
	aux=new String(document.location);
	if(aux.indexOf("#")==-1){
		history.back();
	}
	else{
		history.go(-2);
	}
}

function toggle(capa){	
	if(document.getElementById(capa).style.display=="block") document.getElementById(capa).style.display="none";
	else document.getElementById(capa).style.display="block";
}
function comunitat_autonoma(pais){
	if(pais=="ES"){
		document.getElementById("label_community").style.display="block";
	}
	else{
		document.getElementById("community").value="";
		document.getElementById("label_community").style.display="none";
	}
}
function mostra_avislegal(){
	document.getElementById("textcompletavislegal").style.display="block";
}

function BrowserCheck() {
	var b = navigator.appName;
	
	if (b=="Netscape") this.b = "ns";
	else if (b=="Microsoft Internet Explorer") this.b = "ie";
	else this.b = b;
	
	this.version = navigator.appVersion;
	this.v = parseInt(this.version);
	
	this.ns  = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);

	this.ie  = (this.b=="ie" && this.v>=4);
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.ie6 = (this.version.indexOf('MSIE 6')>0);
	this.ie7 = (this.version.indexOf('MSIE 7')>0);

	this.min = (this.ns||this.ie);
	this.comp = (this.ns5||this.ie5||this.ie6);

	this.platf = navigator.platform.toUpperCase();
	this.linux = (this.platf.indexOf('LINUX')!=-1);
}

is = new BrowserCheck();


function ventana(talla,pag,nom){
  aw=screen.availWidth-10;
  switch (talla){
    case 0://newsletter
			ancho=700;alto=500;
			xc=(aw-ancho)/2;
			carac='status=no,scrollbars=yes,menubar=yes,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=no,width='+ancho+',height='+alto+',left='+xc+',top=0,screenX='+xc+',screenY=0';
    break;
	default:
	ancho=650;alto=450;
	xc=(aw-ancho)/2;
	carac='status=no,scrollbars=yes,menubar=no,toolbar=yes,location=no,directories=no,resizable=yes,copyhistory=no,width='+ancho+',height='+alto+',left='+xc+',top=0,screenX='+xc+',screenY=0';
	break;
  }
  if(!nom)nom='FINESTRA';
  eval(nom+'=window.open("'+pag+'","'+nom+'","'+carac+'")');
  setTimeout("eval("+nom+".focus())",400);
}
