

function abrirpop(imagen){
	var popWnd; 

	var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

	var wndHeight = 500;
	var wndWidth = 600;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open('pop_up.cfm?imagen=' + imagen, 'popup', 'resizable=0,toolbar=0,scrollbars=0,location=0,directories=0,status=0,menubar=0,width=30,height=30,screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  }
  
  
function abrirambiente(idFotoGaleria){
	var popWnd; 

	var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

	var wndHeight = 500;
	var wndWidth = 600;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open('pop_up_ambiente.cfm?imagen=' + idFotoGaleria, 'popup', 'resizable=0,toolbar=0,scrollbars=0,location=0,directories=0,status=0,menubar=0,width=30,height=30,screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  }  
  


  var popWnd; //Objeto ventana de popup

function abrir2 (htmlfile, wndWidth, wndHeight) {
	var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open(htmlfile, 'popup', 'resizable=0,toolbar=0,scrollbars=0,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  }

function abrir3 (htmlfile, wndWidth, wndHeight) {
	var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open(htmlfile, 'popup', 'resizable=0,toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  }  
  
		function printproducto(idProducto) {
  			var popWnd; //Objeto ventana de popup
    		var maxWidth = screen.width-10;
    		var maxHeight = screen.height-56;


			var wndHeight = 10;
			var wndWidth = 10;
    		//Preprocesado de parámetros
    		if (wndHeight==0) wndHeight = maxHeight;
    		if (wndWidth==0) wndWidth = maxWidth;

    		//Calculo de la posición para centrar la ventana
    		var posX = maxWidth/2 - wndWidth/2;
    		var posY = 5000;

    		if (popWnd) popWnd.close();
   			popWnd = open('ficha_producto_print.cfm?id=' + idProducto, '', 'resizable=0,toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    		//this.blur();
    		popWnd.focus();
  		}		
		
	function busquedaGeneral(idioma){
		var cadena = document.getElementById('clavegeneral').value;
		
		switch(idioma){
			case 1:
				var alerta = "Debe introducir una clave de busqueda de una longitud superior a tres caracteres."
				break;
			case 2:
				var alerta = "Debe introducir una clave de busqueda de una longitud superior a tres caracteres."
				break;				
			case 3:
				var alerta = "Debe introducir una clave de busqueda de una longitud superior a tres caracteres."
				break;
			case 4:
				var alerta = "Debe introducir una clave de busqueda de una longitud superior a tres caracteres."
				break;
		}
		if(cadena.length < 4 ){
			alert(alerta);
			}
		else{  
/*26.03.07 BM Remplazo funcion "escape" (que no maneja caracteres Unicode y da probelmas con acentos)
              por encodeURIComponent que es compatible con IE5.5, Netscape 6, and Mozilla 
	          pero no compatible con Netscape 4.x and IE5. Si es necesario esto ultimo hay que usar encodeURIComponentNew() */
			self.location.href = '00_02.cfm?setKey=' +  encodeURIComponent(cadena); // escape(cadena);
			}
		
		}
		