

//**********************************************************************//
// 			DETECTAR NAVEGADOR				//

function navegador() {

 browserStyle="0";

 if (browserName == "Netscape" && browserVer >= 3) browserStyle = "1";
  
 if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) browserStyle = "2";

 return browserStyle;
}


//**********************************************************************//
// 			DETECTAR PANTALLA				//

function pantalla(){
 screenStyle = 0;

 if (screen.width == 800 && screen.height == 600)  {document.location= "WEB/Default.asp?p=1";}
 else if (screen.width == 1024 && screen.height == 768)  {document.location= "WEB/Default.asp?p=2";}
 else if (screen.width == 1152 && screen.height == 864)  {document.location= "WEB/Default.asp?p=2";}
 else if (screen.width == 1280 && screen.height == 1024)  {document.location= "WEB/Default.asp?p=2";}
 else {document.location= "Web/Default.asp?p=2";}

 return screenStyle;
}

function pantallannn(){
 screenStyle = 0;

 if (screen.width == 800)  {document.location= "WEB/Default.asp?p=1";}
 if (screen.width == 1024)  {document.location= "WEB/Default.asp?p=2";}
 if (screen.width == 1024)  {document.location= "WEB/Default.asp?p=3";}
 if (screen.width == 1152)  {document.location= "WEB/Default.asp?p=4";}
 if (screen.width == 1280)  {document.location= "WEB/Default.asp?p=5";}
 else {document.location= "Web/Default.asp?p=2";}


 return screenStyle;
}

function pantalla_Seccion(){
 screenStyle = 0;

 if (screen.width == 800 && screen.height == 600)  {document.location= "INI.asp?p=1";}
 else if (screen.width == 1024 && screen.height == 768)  {document.location= "INI.asp?p=2";}
 else if (screen.width == 1152 && screen.height == 864)  {document.location= "INI.asp?p=2";}
 else if (screen.width == 1280 && screen.height == 1024)  {document.location= "INI.asp?p=2";}
 else {document.location= "INI.asp?p=2";}


 return screenStyle;
}

function pantalla2(){
 screenStyle = 0;

 if (screen.width == 640 && screen.height == 480)  {screenStyle = "1";}
 if (screen.width == 800 && screen.height == 600)  {screenStyle = "2";}
 if (screen.width == 1024 && screen.height == 768)  {screenStyle = "3";}
 if (screen.width == 1152 && screen.height == 864)  {screenStyle = "4";}
 if (screen.width == 1280 && screen.height == 1024)  {screenStyle = "5";}

 return screenStyle;
}


//**********************************************************************//
// 			FUNCIONES DE CAPAS				//

function MM_showHideLayers() { //v2.0
  var i, visStr /*visible?*/,   args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-1); i+=2)
   { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+1]; // hide or show
    if (navigator.appName == 'Netscape' && document.layers != null)
     {
      theObj = eval(document.layers[args[i]]);
      if (theObj) theObj.visibility = visStr;
     } 
    else if (document.all != null)
     { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(document.all[args[i]]);
      if (theObj) theObj.style.visibility = visStr;
     }
   }

}

function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}


//**********************************************************************//
// 			ABRIR UNA VENTANA NUEVA				//

function abrirventana(url) {
        window.open(url, "Destino", "toolbar=0,width=200,height=340,menubar=0,scrollbars=0,resize=0");
        }

function nuevaventana(url) {
        window.open(url, "Destino", "toolbar=0,width=700,height=530,menubar=0,scrollbars=0,resize=0,resizable=false");
        }

function ventana_resumen(url) {
        window.open(url, "Destino", "toolbar=0,width=700,height=530,menubar=0,scrollbars=0,resize=0,resizable=false");
        }

function ventana_obra_nueva(url) {
        window.open(url, "Destino", "toolbar=0,width=610,height=275,menubar=0,scrollbars=0,resize=0,resizable=false");
        }

function ventana_maquinaria(url,id) {
        window.open(url, id, "toolbar=0,width=600,height=400,menubar=0,scrollbars=0,resize=0,resizable=false");
        }

function ventana_contenedores(url) {
        window.open(url,"Medidas", "toolbar=0,width=765,height=525,menubar=0,scrollbars=0,resize=0,resizable=false");
        }

function ventana_imagen(url,ancho,alto) {
	var cadena;

	cadena = 'toolbar=0,width='+ancho+',height='+alto+',menubar=0,scrollbars=0,resize=0,resizable=false'

        window.open(url, "Imagen", cadena);
        }

function ventana_sesion(url) {	
        window.open(url, "Destino", "toolbar=0,width=500,height=330,menubar=0,scrollbars=0,resize=0,resizable=false");
        }

function nuevaventana2(url) {
        window.open(url, "Destino", "resizable=no,toolbar=no,scrollbars=yes, width=790,height=560,status=no");
        }

function abrirventana2(url,w,h,mbar,locat,rsize,stat) {
	var newin;
	var cadena;

        cadena = 'width='+w+',height='+h+',menubar=' + mbar + ',location=' + locat + ',resizable=' + rsize + ',scrollbars=no,status=' + stat;

        newin = window.open(url, "Destino", cadena);

        if (browserStyle == "1") {  newin.focus(); }


        }



//**********************************************************************//
// 			VISULIZAR IMAGEN				//

function ver_imagen(nombre_imagen, nombre_objeto) {
        document.images[nombre_imagen].src = eval(nombre_objeto + ".src");
}




