// JavaScript Document



var ventana;
var cont = 0;

function afoto(cual) {
    if (cont == 1) { ventana.close(); ventana = null }

    ventana = window.open('', 'ventana', 'toolbar=0,location=0,directories=0,status=0,menubar=0, scrollbars=0,resizable=1,fullscreen=0')



    ventana.document.write('<html><head><title>turgalicia</title></head><body ONBLUR="self.focus()"  style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><table border=1><tr><td>  <A HREF="javascript:window.close();"><img aling="center" src="' + cual + '" onLoad="opener.redimensionar(this.width+12, this.height+28)" ></a></td></tr></table></html>');
    ventana.document.close();
    cont++;
}
function redimensionar(ancho, alto) {
    ventana.resizeTo(ancho + 12, alto + 28);
    ventana.moveTo((screen.width - ancho) / 2, (screen.height - alto) / 2); //centra la ventana. Eliminar si no se quiere centrar el popup

}





function imprimirFicha(url){
		ventanaImpresion = window.open(url, "Xanela","width=600,height=600,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,titlebar=no");
//		setTimeout('ventanaImpresion.print()', 500);
		ventanaImpresion.print()
}

bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
browser= ((bName == "Netscape" && bVer >=3) || (bName == "Microsoft Internet Explorer" && bVer >=4));

	anteon = new Image(30, 34); 
	anteon.src = "../images/ante_on.gif"; 
	anteoff = new Image(30, 34); 
	anteoff.src = "../images/ante.gif"; 

	siguion = new Image(30, 34); 
	siguion.src = "../images/sigui_on.gif"; 
	siguioff = new Image(30, 34); 
	siguioff.src = "../images/sigui.gif"; 



function img_act(imgName) { 
  if (browser) {
	imgOn = eval(imgName + "on.src"); 
	document[imgName].src = imgOn; 
  }
} 
function img_inact(imgName) { 
  if (browser) {
	imgOff = eval(imgName + "off.src"); 
	document[imgName].src = imgOff; 
  }
} 



function newwindow(url) {
if ( url != "null") window.open(url,'feuille','width=516,height=336,scrollbars=0');
   document.write('<A HREF="javascript:window.print()">Imprimir</A>');
}

function imprimir(imgName) {
window.print()
 msgWin.document.write('<A HREF="javascript:window.print()">Imprimir</A>');
}



function img_show(imgName) {
 msgWin=window.open("","nada","toolbar=no, resize=yes,width=370, height=370")
 msgWin.document.write("<HTML>")
 msgWin.document.write("<HEAD><TITLE>IMAGEN</TITLE></HEAD>")
 msgWin.document.write("<BODY><FORM><IMG SRC=" + imgName + " BORDER=0></FORM></BODY>")
 msgWin.document.write("</HTML>")
}



function confirmar(direc,texto) {
   if (confirm(texto)) {
     window.open(direc)
   }
}


function FitPic() {
    iWidth = (NS) ? window.innerWidth : document.body.clientWidth;
    iHeight = (NS) ? window.innerHeight : document.body.clientHeight;
    iWidth = document.images[0].width - iWidth;
    iHeight = document.images[0].height - iHeight;
    window.resizeBy(iWidth, iHeight);
    self.focus();
}


function ampliar(KK,color){  

    ampliacion=KK
	cf=color

	var pagina = "" +
	    "   <HTML>" +
	    "   <HEAD></HEAD>  " +
        "   <TITLE>TURGALICIA</TITLE>  "+
        "   <BODY  LEFTMARGIN='0' TOPMARGIN='0' MARGINWIDTH='0' MARGINHEIGHT='0'  " +
        "   ONBLUR='self.focus()' BGCOLOR="+cf+">  "+
     	"   <TABLE  BORDER='1' height=100% width=100%>  "+
        "   <TR VALIGN='middle'>  "+
        "   <TD ALIGN='center' VALIGN='middle' > "+
        "   <A HREF='javascript:window.close();'>"+
        "   <IMG  SRC="+ampliacion+"   BORDER='0'  NAME='imagen1'>" +        
        "   </A>"+
        "   <FONT COLOR='FF0000' FACE='arial,helvetica' SIZE='1'>  "+
        "   </FONT>"+
        "   </TD>  "+
        "   </TR>  "+
        "   </TABLE> "+
	    "   </BODY>  " +
        "   </HTML>  ";
	  
	ventana = window.open("","ampliacion",'toolbar=0,location=0,directories=0,status=0,menubar=0,height=620 ,width=820, scrollbars=0,resizable=1')
	ventana.document.write(pagina)
	//ventana.moveTo((screen.width - 800 / 2, (screen.height - 600) / 2); //centra la ventana. Eliminar si no se quiere centrar el popup

	ventana.document.close()
}

function vernavegador() 
       {
        if (navigator.appName== "Netscape" && parseInt(navigator.appVersion) >= 3 ) 
          {
           return true;
          } 
        else if (navigator.appName == "Microsoft Internet Explorer" && parseFloat( navigator.appVersion ) >= 3.01 ) 
	  {
           return true;
          }
        return false;
       }

function venta(aa) 
{
window.open(aa,"","width=620,height=650,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,titlebar=no");
}

function ventacatedral(aa) 
{
window.open(aa,"","width=800,height=600,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,titlebar=no");
}


