function ventana_centrada(width,height,url,wname,tstyle) {
	x=(640 - width)/2,y=(480-height)/2;

	if(screen) {
			y=(screen.availHeight - height -20)/2;
			x=(screen.availWidth - width)/2;
	}
	if(screen.availWidht > 1800) {
			x=((screen.availWidth/2) - width)/2;
	}
	
	if (wname==null)
		wname = 'intro';

	if (tstyle==null)
		tstyle = 'resizable=no,scrollbars=1';

	vn =window.open(url,wname,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+','+tstyle);
	vn.focus();
}

function ventana_izquierda(width,height,url,wname,tstyle) {
	x=0;
	y=225;	
	
	if (wname==null)
		wname = 'intro';

	if (tstyle==null)
		tstyle = 'resizable=no,scrollbars=1';

	vn =window.open(url,wname,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+','+tstyle);
	vn.focus();
}


function ShowFootImage (url, foot, width, height, idioma, titulo) {	
	
  height = height + 20
		
  var x=(300 - width)/2
  var y=(300-height)/2

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2
 
	  if (idioma==2){
		  if (titulo==null){ titulo="Enlarged view"; }
		  pulsar="Click to close";
		}
	  else if (idioma==3){
		  if (titulo==null){ titulo="vergrößertes Bild"; }
		  pulsar="Zum Schließen hier klicken";	  
		}
 	else if (idioma==4){
		  if (titulo==null){ titulo="Imagem ampliada"; }
		  pulsar="Pulsar para fechar";	  
		}		
	  else{
		  if (titulo==null){ titulo="Imagen ampliada"; }
		  pulsar="Pulse para cerrar";
	  }
	  
	  vn = window.open("../modules/photo.php?img="+url+"&titulo="+escape(titulo)+"&pulsar="+escape(pulsar)+"&foot="+escape(foot),"new_photo","width=" + width + "px,height=" + height + "px,toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0,top=" + y + "px,left=" + x + "px");
	  if (vn) vn.focus(); //aqui
}


function ShowFormState (url,ancho, alto, stl, name) {
	  var width = ancho
	  var height = alto
	  var x=(640 - width)/2
	  var y=(480-height)/2
	
	
	  if(screen) {
		  y=(screen.availHeight - height)/2
		  x=(screen.availWidth - width)/2
	  }
	
	  if(screen.availWidht > 1800)
		  x=((screen.availWidth/2) - width)/2
	
	  window.width=width
	  window.height=height
	  window.x=x
	  window.y=y
	
	  estilo = stl ? stl : "toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0";
	  name = name ? name : 'newwin';
	
	  vn= window.open(url, name, estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px");
	  vn.focus();
	}
	
	
	function carga_ventana_video(enlace_video){
		
	  var width = 600;
	  var height = 480;
	  var x=(640 - width)/2
	  var y=(480-height)/2
	  
	  if(screen) {
		  y=(screen.availHeight - height)/2
		  x=(screen.availWidth - width)/2
	  }
	
	  if(screen.availWidht > 1800)
		  x=((screen.availWidth/2) - width)/2
	  
	  window.width=width
	  window.height=height 
	  
	  window.x=x
	  window.y=y
	 
		/*  if (idioma==2){
			  if (titulo==null){ titulo="Enlarged view"; }
			  pulsar="Click to close";
			}
		  else if (idioma==3){
			  if (titulo==null){ titulo="vergrößertes Bild"; }
			  pulsar="Zum Schließen hier klicken";	  
			}
		else if (idioma==4){
			  if (titulo==null){ titulo="Imagem ampliada"; }
			  pulsar="Pulsar para fechar";	  
			}		
		  else{
			  if (titulo==null){ titulo="Imagen ampliada"; }
			  pulsar="Pulse para cerrar";
		  }
	  
	  url= "../modules/photo.php?img="+url+"&titulo="+escape(titulo)+"&pulsar="+escape(pulsar)+"&foot="+escape(foot);*/
	  
	  	estilo="toolbar=no, status=no, location=no, directories=no, menubar=no, scrollbars=no, resize=no,resizable=no";
		
		 vn = window.open(enlace_video.href, enlace_video.target, estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px"); 
		 
		  if (vn) vn.focus(); //aqui
	}
