function obre(desti,am,al,nom){
  var ampla = am;
  var altura = al;
  strURL = desti;
  poshoritz = (screen.width) ? (screen.width-ampla)/2 : 0;
  posvert = (screen.height) ? (screen.height-altura)/2 : 0;
  strW = 'toolbar=0,directories=0,location=0,status=no,menubar=0,resizable=false,copyhistory=yes,scrollbars=no,width='+ ampla + ',height='+ altura + ',top='+ posvert + ',left='+ poshoritz;
  eval("window.open('" + strURL + "',nom,'" + strW + "')");
}

var f=0;
function surtfoto(f) {
if (nav=="ns4"){
	      eval("document.tot.document.write(foto"+f+")");
	      document.tot.document.close();
	}
    else  eval("tot.innerHTML=foto"+f);
}	


winW=0;
winH=0;
function tamany_finestra(){
if (nav == "ns4"){
		winW = window.innerWidth-17;
		winH = window.innerHeight-8;}	
else{
	if (navigator.appName == "Microsoft Internet Explorer"){
		winW = document.body.offsetWidth-20;
		winH = document.body.offsetHeight+5;}
	else {
		winW = window.innerWidth;
		winH = window.innerHeight+7;}		
	}
posicionar();	
}

function posicionar(){
	if (winW<770){winW=769}
	if (winH<453) {winH=444}
	distx=(winW-769)/2;
	disty=(winH-444)/2;
	posx_tot=distx+5;
	posy_tot=disty+87;
	mourecapa("tot",posx_tot,posy_tot); 
	veure("tot");
}

function tamany_finestra_ini(){
if (nav == "ns4"){
		winW = window.innerWidth-17;
		winH = window.innerHeight-8;}	
else{
	if (navigator.appName == "Microsoft Internet Explorer"){
		winW = document.body.offsetWidth-20;
		winH = document.body.offsetHeight+5;}
	else {
		winW = window.innerWidth;
		winH = window.innerHeight+7;}		
	}
posicionar_ini();	
}

function posicionar_ini(){
	if (winW<770){winW=769}
	if (winH<453) {winH=444}
	distx=(winW-769)/2;
	disty=(winH-444)/2;
	posx_tot=distx+5;
	posy_tot=disty+87;
	mourecapa("tot",posx_tot,posy_tot); 
	veure("tot");
}

function mourecapa(capa,posx,posy){
   	if (nav=="ns4" || nav=="ie5ns6") {
        eval(ref(capa) + "left=posx;");
        eval(ref(capa) + "top=posy;");
  	}
    else {
    	eval(ref(capa) + "pixelLeft=posx;");
        eval(ref(capa) + "pixelTop=posy;");
    }
}

function veure(nom_capa){
	eval(ref(nom_capa) + "visibility = 'visible'");     
}

function amagar(nom_capa){
    eval(ref(nom_capa) + "visibility = 'hidden'");
}

function ref(nom_capa){
    if (nav == "ie5ns6") return "document.getElementById('" + nom_capa + "').style."
 	else 	if (nav == "ie4") return "document.all['" + nom_capa + "'].style."
			else return "document." + nom_capa + "."
} 

var nav="";

function navegador(){
if(document.layers){//NS4
	nav="ns4";}
	else if(document.getElementById){//IE 5 i posteriors i NS6
		nav="ie5ns6"}
		else if(document.all && !document.getElementById){
			nav="ie4"} //anteriors a IE 5
tamany_finestra_ini();		
}