function banner(){
		LeftPosition = (screen.width) ? (screen.width-550)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-220)/2 : 0;
		window.open ('banner.html','','width=606, height=225, scrollbars=no,statusbar=no, mainbar=no, toolbar=no,left='+LeftPosition+',top='+TopPosition+'');
}

function legal(url)
{
		LeftPosition = (screen.width) ? (screen.width-500)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
		window.open (url,'','width=500, height=400, scrollbars=yes,statusbar=no, mainbar=no, toolbar=no,left='+LeftPosition+',top='+TopPosition+'');
}

function go_url (url) {
	window.location.href=url;
}

function go_url_jump (url) {
	window.open (url,'','');
}

function go_url_jump_m (url) {
	LeftPosition = (screen.width) ? (screen.width - 850) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - 475) / 2 : 0;
	window.open (url,'','width=792, height=475, scrollbars=yes, left='+LeftPosition+',top='+TopPosition+'');
}

function show_sector(msg) {
	document.getElementById('isector').innerHTML=msg;
}

function buscar() {
	if ( document.search_form.buscador.value!='' ) {
		document.search_form.submit();
	}
}

function do_login(url) {
	LeftPosition = (screen.width) ? (screen.width - 330) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - 250) / 2 : 0;
	window.open (url,'','width=330,height=150,scrollbars=no,statusbar=no,mainbar=no,toolbar=no,left='+LeftPosition+',top='+TopPosition+'');
}

// FUNCIONES PARA EL MENU DESPLEGABLE

var msie6=true;
var sActiveMenu=0;
var aHideMenu = new Array();
var dTempDate = new Date();
var iDateIni,iDateFin;

function CheckNav(menus) {
	  var n = navigator.appName;
	  var v = navigator.appVersion.indexOf('MSIE 6');
	  if ((n == 'Microsoft Internet Explorer') && (v != -1)) {msie6 = true;}
	  /*for (i=0;i<=menus;i++) {
		obj[i]='menu'+i;  
	  }*/
	  //iniciarmenu(menus);
	}
	
	function iniciarmenu(menus) {
	  if (msie6 && document.getElementById('menu1')) {
	    //document.getElementById('main').style.position='absolute';
	    //document.getElementById('main').style.clip='rect(0px auto 28px 0px)';
	    var obj = new Array();
	    for (i=0;i<=menus;i++) {
//	      if (i==1) continue;
	      obj[i]='menu'+i;
		      document.getElementById(obj[i]).style.marginTop='0px';
		      document.getElementById(obj[i]).style.display='block';
			  document.getElementById(obj[i]).style.visibility='hidden';
	    }
	  }
	}
	
function MenuON(opt) {
	if (msie6) {
		dTempDate = new Date();
		iDateIni = dTempDate.getTime();
		aHideMenu[opt] = false;
		if ( sActiveMenu != 0 && opt != sActiveMenu ) {
			document.getElementById('menu'+sActiveMenu).style.visibility='hidden';
			//document.getElementById('main').style.clip='rect(0px auto 20px 0px)';
		}
		sActiveMenu = opt;
		//document.getElementById('main').style.clip='rect(0px auto auto 0px)';
		document.getElementById('menu'+opt).style.visibility='visible';
	}
}

function hide(opt)
{
	dTempDate = new Date();
	iDateFin = dTempDate.getTime();
	iDiff = iDateFin - iDateIni;
	if (aHideMenu[opt]&& iDiff > 500)
	{
		document.getElementById('menu'+opt).style.visibility='hidden';
		//document.getElementById('main').style.clip='rect(0px auto 20px 0px)';
	}
}

function MenuOFF(opt)
{
 if (msie6){
 	aHideMenu[opt] = true;
	setTimeout('hide('+opt+')',500);
	event.cancelBubble=true;
 }
}
// Fi funcions desplegable ///////////////////


// Funció per obrir el editor de textes -------------------

function introtext(text,textb)
{
	LeftPosition = (screen.width) ? (screen.width - 505) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - 453) / 2 : 0;
	editor = window.open('intro.asp?text='+text+'&textb='+textb+'','','width=505,height=453,scrollbars=no,mainbar=no,statusbar=no,left='+LeftPosition+',top='+TopPosition+'');
}

// ------------------------


// Funció per obrir la finestra de credits -------------
function credits()
{
	LeftPosition = (screen.width) ? (screen.width-300)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-200)/2 : 0;
	window.open ('credits.asp','','width=300,height=200,scrollbars=no,statusbar=no,toolbar=no,mainbar=no,left='+LeftPosition+',top='+TopPosition+'');
}