function credits() {window.open("../es/credits.html", "credits", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=420,height=350,top=0,left=0");}
function legal() {window.open("../es/legal.html", "legal", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=420,height=350,top=0,left=0");}

function lleida() {window.open("../es/centres_CAP_lleida.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function tarragona() {window.open("../es/centres_CAP_tarragona.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function bcn() {window.open("../es/centres_CAP_bcn.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function girona() {window.open("../es/centres_CAP_girona.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function ponent() {window.open("../es/centres_CAP_ponent.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function maresme() {window.open("../es/centres_CAP_maresme.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function centre() {window.open("../es/centres_CAP_centre.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}
function pirineu() {window.open("../es/centres_CAP_pirineu.html", "centres", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=650,height=400,top=0,left=0");}

function dialeg1() {window.open("../es/estarenamorat.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg2() {window.open("../es/canvisenelmeucos.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg3() {window.open("../es/quancomencar.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg4() {window.open("../es/fareelridicul.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg5() {window.open("../es/embarassadaelprimercop.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg6() {window.open("../es/famalelprimercop.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg7() {window.open("../es/encaranohohefet.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg8() {window.open("../es/semprehihaamor.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg9() {window.open("../es/abussexual.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg10() {window.open("../es/assetjamentsexual.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}
function dialeg11() {window.open("../es/agressiosexual.html", "dialegs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=430,height=300,top=0,left=0");}

function joc1() {window.open("../es/anima_petting.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=440,height=420,top=0,left=0");}
function joc2() {window.open("../es/anima_riscembaras.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=440,height=420,top=0,left=0");}
function joc3() {window.open("../es/anima_historia.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=440,height=420,top=0,left=0");}
function joc4() {window.open("../es/anima_its.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=600,height=420,top=0,left=0");}
function joc5() {window.open("../es/anima_orgasme.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=440,height=420,top=0,left=0");}
function joc6() {window.open("../es/anima_preserv.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=600,height=420,top=0,left=0");}
function joc7() {window.open("../es/anima_primvegada.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=440,height=420,top=0,left=0");}
function joc8() {window.open("../es/anima_regla.html", "jocs", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=440,height=420,top=0,left=0");}


function resaltar_es(nom) {
	document.getElementById(nom).src='../img_es/bt_'+nom+'_f2.gif';
}
function normal_es(nom) {
	document.getElementById(nom).src='../img_es/bt_'+nom+'.gif';
}

function resaltar_portada(nom) {
	
	var amplada=screen.width;
	
	if(nom =='xateja' )
	{		
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'_f2.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'_f2.jpg';
	}
	else if(nom =='diccionari' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'_f2.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'_f2.jpg';	
	}
	else if(nom =='weblog' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'_f2.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'_f2.jpg';	
	}	
	else if(nom =='escriu' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'_f2.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'_f2.jpg';	
	}
	else if(nom =='centres' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'_f2.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'_f2.jpg';	
	}
	else
	{
		document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'_f2.jpg';
	}
}


function normal_portada(nom) {

	var amplada=screen.width;
	
	if(nom =='xateja' )
	{		
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'.jpg';
	}
	else if(nom =='diccionari' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'.jpg';
	}
	else if(nom =='weblog' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'.jpg';
	}	
	else if(nom =='escriu' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'.jpg';
	}
	else if(nom =='centres' )
	{
		if (amplada > 1000)
		{
			document.getElementById(nom).src='../img_es/caixa1000_'+nom+'.jpg';
		}
		else
			document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'.jpg';
	}
	else
	{
		document.getElementById(nom).src='../img_es/caixa_portada_'+nom+'.jpg';
	}



}


function posa_capsalera(){
document.write('<table class="cap" cellspacing="0" cellpadding="0" border="0" summary="capçelera">');
document.write('<tr>');
document.write('    <td class="logo"><a href="http://www.gencat.net/ics" target="_blank"><img src="../img_es/logo_ics.gif" alt="Institut Català de la Salut" title="Institut Català de la Salut" /></a></td>');
document.write('    <td class="logo"><a href="http://www.gencat.net/salut" target="_blank"><img src="../img_es/logo_gencat.gif" alt="Generalitat de Catalunya" title="Generalitat de Catalunya" /></a></td>');
document.write('    <td class="barra-eines"> ');
document.write('    <a href="../es/mapa.html" onmouseover="resaltar(\'sup_mapaweb\')" onmouseout="normal(\'sup_mapaweb\')"><img src="../img_es/bt_sup_mapaweb.gif" id="sup_mapaweb" alt="Mapa web" title="Mapa web" /></a> ');
document.write('    <a href="javascript:credits();" onmouseover="resaltar(\'sup_credits\')" onmouseout="normal(\'sup_credits\')"><img src="../img_es/bt_sup_credits.gif" id="sup_credits" alt="Crèdits" title="Crèdits" /></a> ');
document.write('    </td> ');
document.write('</tr>');
document.write('</table>');
}

function posa_peu(){
document.write('	<div>&copy; 2006 Institut Català de la Salut - <a class="vincle" href="javascript:legal();">Info legal</a></div> ');
}
/*
function resaltar_jpg(nom) {
	document.getElementById(nom).src='img/bt_menu_'+nom+'_f2.jpg';
}
function normal_jpg(nom) {
	document.getElementById(nom).src='img/bt_menu_'+nom+'.jpg';
}
*/


/*permet afegit diversos escripts al onload*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      };
      func();
    }
  }
}
// funci? per obrir els links amb l'atribut rel="extern" en una nova finestra
		function externalLinks() { 
		 if (!document.getElementsByTagName) return; 
		 var anchors = document.getElementsByTagName("a"); 
		 for (var i=0; i<anchors.length; i++) { 
		   var anchor = anchors[i]; 
		   if (anchor.getAttribute("href") && 
		       anchor.getAttribute("rel") == "external") 
		     anchor.target = "_blank"; 
		 } 
		} 
		addLoadEvent(externalLinks);