modeac=0;

function BrowserCheck() {

	var b = navigator.appName

	var agente=(navigator.userAgent);

	if (b=="Netscape") this.b = "ns"

	else if (b=="Microsoft Internet Explorer") this.b = "ie"

	else this.b = b

	this.version = navigator.appVersion

	this.platf = navigator.platform.toUpperCase()

	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.linux = (this.platf.indexOf('LINUX')>0)

	this.win = (this.platf.indexOf('WIN')>0)

	this.mac = (this.platf.indexOf('MAC')>0)

	this.konqueror = (agente.indexOf('Konqueror')>0);

	this.firefox = (agente.indexOf('Firefox')>0);

	this.galeon = (agente.indexOf('Galeon')>0);

	this.min = (this.ns||this.ie)

	this.comp = (this.ns5||this.ie5||this.ie6||this.konqueror)

}

is = new BrowserCheck();



function MM_findObj(n,d){

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}

function MM_showHideLayers() { //v6.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }

    obj.visibility=v; }

}



function SetCookie (name, value) { 

	var argv = SetCookie.arguments;

    var argc = SetCookie.arguments.length;

    var expires = (argc > 2) ? argv[2] : null;

    var path = (argc > 3) ? argv[3] : "/";

    var domain = (argc > 4) ? argv[4] : null;

    var secure = (argc > 5) ? argv[5] : false;

    document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" + expires.toGMTString()))+((path == null) ? "" : ("; path=" + path))+((domain == null) ? "" : ("; domain=" + domain))+((secure == true) ? "; secure" : "");

}



function getCookieVal (offset) {

   var endstr = document.cookie.indexOf (";", offset);

   if (endstr == -1)  endstr = document.cookie.length;

   return unescape(document.cookie.substring(offset, endstr));

}



function GetCookie (name) {

	var arg = name + "=";

    var alen = arg.length;        

	var clen = document.cookie.length;

    var i = 0;       

	while (i < clen) {        

	     var j = i + alen;

    	 if (document.cookie.substring(i, j) == arg)

    	 return getCookieVal (j);

	     i = document.cookie.indexOf(" ", i) + 1;

         if (i == 0) break;         

	 }

	return null;

}


function llegirIdioma(){

	galeta2=GetCookie("idioma");

	if(!galeta2){

		URLidioma=new String(document.location);

		if(URLidioma.indexOf("idioma=")!=-1){

			galeta2=URLidioma.substring(URLidioma.indexOf("idioma=")+7,URLidioma.indexOf("idioma=")+8);

		}		

	}

	if(!galeta2) galeta2="0";

	return galeta2;

}

//funciones del liquid.js, para encontrar el alto y el ancho de la ventana

function findWH() {

	if(is.ns) winW = window.innerWidth-17;

	else winW=document.body.offsetWidth-20;

	if(is.konqueror) winW=document.body.offsetWidth;

	winH = (is.ns)? window.innerHeight-20 : document.body.offsetHeight-20

}

function makeLiquid() {

	if ((is.ns && (winW!=window.innerWidth || winH!=window.innerHeight)) || is.ie)

	history.go(0)

}

var par_faq;var par_glo;var par_act;var par_cor;var par_impr;

var FINESTRA;

function ventana(a,params,nombre,pagina){

  switch (a){

    case 0:	params=(params)?params:'';pag='/dursi/AppJava/glossari.jsp'+params;

    carac='width=600,height=420,screenX=50,screenY=50,top=50,left=50,scrollbars=yes,resizable=no';

    break;

	//subscripció

    case 1:pag='/dursi/AppJava/butlleti_subscripcio.jsp'//case 1:pag='/dursi/AppJava/mailing_registre.jsp';

    carac='width=400,height=260,screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=no';

	break;

	case 2:pag='/dursi/AppJava/frmbustia.jsp?area='+area+par_cor;

    carac='width=600,height=660,screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=no';

	break;

    case 3:pag=params;

	carac='width=600,height=420,screenX=50,screenY=50,top=50,left=50,scrollbars=yes,resizable=yes';

	break;

    case 4:pag='ajuda.htm';

	carac='width=600,height=420,screenX=50,screenY=50,top=50,left=50,scrollbars=no,resizable=no';

	break;

	case 5:pag='http://www10.gencat.net/pls/sac/p88.lli_dep?usu=dp&pas=&via=2&cou=10875&sec=0000100235&cap=';

	carac='width=800,height=600,screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=yes,status=yes,menubar=yes';

	document.location='http://www10.gencat.net/pls/sac/p88.lli_dep?usu=dp&pas=&via=2&cou=10875&sec=0000100235&cap=';

	break;

	case 6:pag='/cookie.htm';

	carac='width=300,height=300,screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=no';

	break;

	case 7:pag='/dursi/AppJava/premis.jsp';

	carac='width=714,height=580,screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=no,status=yes,menubar=yes';

	break;

	case 8:pag=prefix+'de/arxiu_plans/pla3_acro.htm';

	carac='width=600,height=420,screenX=50,screenY=50,top=50,left=50,scrollbars=yes,resizable=no';

    break;

	case 9:pag=prefix+'acrobat.htm';

	carac='width=500,height=420,screenX=50,screenY=50,top=50,left=50,scrollbars=yes,resizable=no';

    break;

	case 10:pag=params;

	carac='width=750,height=420,screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes';

    break;

	case 11:pag=params;

	carac='width=600,height=510,screenX=0,screenY=0,top=0,left=0,scrollbars=no,resizable=no';

    break;

	//popups correcte/incorrecte de Posa't a prova

	case 12:pag=params;

	carac='width=200,height=200,screenX=100,screenY=100,top=100,left=100,scrollbars=no,resizable=no';

    break;

	//popups resultats de Posa't a prova

	case 13:pag=params;

	carac='width=600,height=550,screenX=100,screenY=100,top=100,left=100,scrollbars=no,resizable=no';

    break;

	//popup Regional-ist , projecte SI a Catalunya 

	case 14:pag='http://www.regional-ist.org';

	carac='width=600,height=550,screenX=50,screenY=50,top=50,left=50,scrollbars=yes,resizable=yes,toolbar=yes';

    break;

	//minisites

	case 15:pag=params;

	carac='width=720,height=500,screenX=100,screenY=100,top=100,left=100,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes,toolbar=yes';

	break;

	//sortides professionals

	case 16:

	carac='width=645,height=440,screenX=10,screenY=10,top=10,left=10,scrollbars=yes,resizable=no,status=yes,menubar=yes';

	break;

	//sortides professionals

	case 17:pag='/dursi/sortides.htm';

	carac='scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 18:pag='/dursi/AppJava/posat.jsp';//'http://dursi.gencat.net/posataprova';

	carac='scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Diccionati de Telecomunicacions

	case 19:pag='http://www.gencat.net/dursi/stsi/dicctel';

	carac='width=800,height=550,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 20:pag='http://www.gencat.cat/publicacions';

	carac='width=600,height=400,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 21:pag='http://eua.uni-graz.at/documents.html#prior';

	carac='width=600,height=400,screenX=250,screenY=50,top=50,left=150,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes';

	break;

	//intercat

	case 22:pag='http://www.intercat.gencat.net/';

	carac='width=600,height=400,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes';

	break;

	case 23:pag='http://www.cat365.net/';

	carac='width=600,height=400,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes';

	break;

	case 24:pag='http://www.catcert.net/';

	carac='width=600,height=400,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes';

	break;

	//estudiar a Catalunya

	case 25:pag='http://www.estudiaracatalunya.net/';

	carac='scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes';

	break;

	//6è programa marc

	case 26:pag='http://www.cat6pm.com/';

	carac='scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes';

	break;

	//espai europeu dela recerca

	case 27:pag=' http://www.cordis.lu/era/';

	carac='scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,location=yes';

	break;

		//Publicaciones de la Generalidad de Cataluña

	case 28:pag='http://www20.gencat.cat/portal/site/Publicacions?newLang=es_ES';

	carac='width=600,height=400,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Infraestructures comunes de telecomunicacions ICT

	case 29:pag='http://www.gencat.net/dursi/stsi/ict';

	carac='width=800,height=550,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Ràdio digital DAB

	case 30:pag='http://www.gencat.net/dursi/stsi/dab';

	carac='width=800,height=550,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Televisió digital terrestre TDT

	case 31:pag='http://www.tdtcat.net/';

	carac='width=800,height=550,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Investigadors fora

	case 32:pag=prefix+'re/investigadors_fora_accesbd.htm';

	carac='width=800,height=550,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Conveni Pla Serra i Húnter

	case 33:pag='/dursi/pdf/un/conveni_pla_serra_hunter_2003_2015.pdf';

	carac='width=800,height=550,top=50,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Organigrama SAC

	case 34:pag='http://www10.gencat.net/gencat/AppJava/cat/sac/organigrama.jsp?codi=15418&jq=200001';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Organigrama SAC: STSI

	case 35:pag='http://www10.gencat.net/pls/sac/p90.dad_org?usu=DP&pas=&via=1&cou=9881&err=0&cap=';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Organigrama SAC: STSI: Servei de Societat del Coneixement

	case 36:pag='http://www10.gencat.net/pls/sac/p90.dad_org?usu=DP&pas=&via=1&cou=14086&err=0&cap=';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Organigrama SAC: STSI: Servei de Telecomunicacions

	case 37:pag='http://www10.gencat.net/pls/sac/p90.dad_org?usu=DP&pas=&via=1&cou=14087&err=0&cap=';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	//Organigrama SAC: CTTI

	case 38:pag='http://www10.gencat.net/pls/sac/p90.dad_org?usu=DP&pas=&via=1&cou=5612&err=0&cap=';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 39:pag='http://www.gencat.net/pricatalunya';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 40:pag='http://www.gencat.net/eadop/imatges/4350/05077103.pdf';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 41:pag='http://www.gencat.net/generalitat/cat/govern/equip/biografies/sola.htm';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 42:pag='http://www.gencat.net/generalitat/cas/govern/equip/biografies/sola.htm';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 43:pag='http://www.gencat.net/generalitat/eng/govern/equip/biografies/sola.htm';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 44:pag='http://cultura.gencat.net/museus/Lismus.asp?nom=&municipi=0&comarca=0&chkBotanica=checkbox&chkZoologia=checkbox&chkGeologia=checkbox&chkCiencia_Tecnica=checkbox&chkCiencies_naturals=checkbox&Submit3=++Cercar++';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 45:pag='http://www10.gencat.net/sac/AppJava/organigrama.jsp?codi=15421&jq=200001';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

	case 46:pag='http://www10.gencat.net/sac/AppJava/organigrama.jsp?codi=15418&jq=200001';

	carac='width=700,height=500,top=20,left=50,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes';

	break;

  }

  if(ventana.arguments.length>3) pag=ventana.arguments[3];

  //if(modeac<2){

  //if(!nombre)nombre='FINESTRA';

  if(FINESTRA && FINESTRA.closed==0) FINESTRA.close();

  FINESTRA=window.open(pag,nombre,carac);

  FINESTRA.focus();

  /*}

  else{

  	if(pag.indexOf("organigrama_fla")==-1){

		top.frames[1].location=pag;

	}

  }*/

}

function open_envia (url,tipologia,id) {

	ventana(3,"/dursi/AppJava/frmenvia.jsp?url="+escape(url)+"&tipologia="+escape(tipologia)+"&id="+id);

}



//accessibilitat

function consulta_acces(){

	modeac=GetCookie("modeacces");

	if(!modeac || modeac==null)modeac=0;

	//alert(GetCookie("modeacces"));

}

consulta_acces();



function hojaCSS(){

	//alert(modeac);

	if(modeac==1)document.write("<link rel=stylesheet href=/dursi/jsscripts/dursig_a.css>");

	if(is.ns4 && modeac==0)document.write("<style><!--td{font-family:verdana}--></style>");

	if(modeac==2)document.write("<link rel=stylesheet href=/dursi/jsscripts/dursig_b.css>");

}



function foco_frame(quin){

	if(quin==0) top.frames[0].focus();

	else top.frames[1].focus();

}

function hredirect(){

	top.location='/dursi/AppJava/home.jsp';

}

function hredirect_si(){    

  params = (area==3)?"?area=":"";

	top.location='/dursi/AppJava/home.jsp?area=3';

}


