




function Validator(theForm)
{

	var contar = 0;
	var mensaje = "";
	if (theForm.email.value == "")
	{
		 mensaje = mensaje + "Escriba un valor para el campo \"email\".\n";
		contar = contar + 1;
	}
	if (theForm.apellido.value == "")
	{
		mensaje = mensaje + "Escriba un valor para el campo \"nombre\".\n";
		contar = contar + 1;
	}
	if (theForm.licencia.value == "")
	{
		mensaje = mensaje + "Escriba un valor para el campo \"Licencia\".\n";
		contar = contar + 1;
	}
	if (theForm.telefono.value == "")
	{
		mensaje = mensaje + "Escriba un valor para el campo \"Telefono\".\n";
		contar = contar + 1;
	}
	if (theForm.domicilio.value == "")
	{
		mensaje = mensaje + "Escriba un valor para el campo \"Domicilio\".\n";
		contar = contar + 1;
	}

	if (contar == 0)
	{
    
		return (true);
	}
	else
	{
		alert (mensaje);
		return (false);
	}
}





function subirform(idioma,cant_encabezado)
{

 	 	 var x=document.forms.formcontratar;
                 verificarform(idioma,cant_encabezado);
                 var action = "/contratar.cgi";
                 x.action=action;       
                 x.submit();
          
}


function Abrir_ventana (pagina) {
var opciones="target='ventana' toolbar=no, location=no, directories=no, titlebar=no,toolbar=no,status=no, menubar=no, scrollbars=no, resizable=no, width=300, height=265, top=140, left=140";
window.open(pagina,"",opciones);
}

function mostrar_capa (capa) {
  document.getElementById(capa).style.display="inline";
}

function ocultar_capa (capa) {
  document.getElementById(capa).style.display="none";
}

function mostrar_foto (foto) {
var i = 0;
var salir = 0;
  document.getElementById("capafotos").style.display="inline";
  document.getElementById("capatransparente").style.display="inline";
  document.images['imagen'].src=foto;
  while ((i <= album.length - 1) & (salir == 0))
  {
     if (album[i]== foto)
     {
	salir = 1;
	indice_album = i;
     }
     i++;
  }
  

}

function ocultar_foto () {
  document.getElementById("capafotos").style.display="none";
  document.getElementById("capatransparente").style.display="none";

  window.clearInterval(intval);
  intval = 0;
  indice_album=0;

}


    var album = new Array();
    var i = 0;


function album_insertar_foto (foto) {
   album[album.length]=foto;
   i = album.length;
}

function album_siguiente_foto () {
  i ++;
  document.images['imagen'].album[i];
}


var album = new Array();
var album_indice = new Array();
var indice_album = 0;
var intval=0;
   




function album_insertar_foto (foto) 
{
album[album.length]=foto;
}

function album_foto (comando) {

	if (comando == "next")
	{
		
		if ((indice_album != album.length-1) & (intval == 0))
 		{
			indice_album ++;
			document.images['imagen'].src=album[indice_album];
		}
		else if ((indice_album == album.length-1) & (intval != 0))
 		{
			indice_album = 0;
			document.images['imagen'].src=album[indice_album];
		}
		else if ((indice_album != album.length-1) & (intval != 0))
 		{
			indice_album ++;
			document.images['imagen'].src=album[indice_album];
		}

 	}
	else if (comando == "previous")
	{
		if ((indice_album != 0)&(intval ==0))
 		{
			indice_album =	indice_album -1;
			document.images['imagen'].src=album[indice_album];
	
		}
		else if ((indice_album == 0)&(intval != 0))
 		{
			indice_album = album.length-1;
			document.images['imagen'].src=album[indice_album];	
		}
		else if ((indice_album != 0)&(intval != 0))
 		{
			indice_album =	indice_album -1;
			document.images['imagen'].src=album[indice_album];
		}

	}
	else if (comando == "first")
	{
			indice_album =	0;
			document.images['imagen'].src=album[indice_album];
	}
	else if (comando == "last")
	{
			indice_album =	album.length-1;
			document.images['imagen'].src=album[indice_album];
	
	}
	else if (comando == "play")
	{
		intval = setInterval("album_foto('next')",3000)
	}		
	else if (comando == "pause")
	{
		window.clearInterval(intval);
		intval = 0;
	}


}























function ajustartamanio ()
{

var navegador = navigator.appName; 


if ((BrowserDetect.browser.indexOf('Explorer')!=-1)|(BrowserDetect.browser.indexOf('Chrome')!=-1))
{
  var alto = screen.height;
  var ancho = screen.width; 
  var porcentaje = ancho / 850;
  tamanio  = screen.width;  
  var nuevoancho = 0;
  var nuevoalto = 0;
  var nuevoleft = 0;
  var nuevotop = 0;
  

  nuevoancho = document.getElementById("secnoticias").offsetWidth * porcentaje ;
  document.getElementById("secnoticias").style.width = nuevoancho;


  nuevoancho = document.getElementById("colnoticias").offsetWidth * porcentaje ;
  document.getElementById("colnoticias").style.width = nuevoancho;

  tamanio = tamanio * porcentaje;
}

if (BrowserDetect.browser.indexOf('Explorer')==-1)
{  
  alert ('Aśn no optimizado para:'+BrowserDetect.browser + ' ' + BrowserDetect.version + ' en ' + BrowserDetect.OS );

}
}








var BrowserDetect = {   
    init: function () {   
        this.browser = this.searchString(this.dataBrowser) || "An unknown browser";   
        this.version = this.searchVersion(navigator.userAgent)   
            || this.searchVersion(navigator.appVersion)   
            || "an unknown version";   
        this.OS = this.searchString(this.dataOS) || "an unknown OS";   
    },   
    searchString: function (data) {   
        for (var i=0;i<data.length;i++)  {   
            var dataString = data[i].string;   
            var dataProp = data[i].prop;   
            this.versionSearchString = data[i].versionSearch || data[i].identity;   
            if (dataString) {   
                if (dataString.indexOf(data[i].subString) != -1)   
                    return data[i].identity;   
            }   
            else if (dataProp)   
                return data[i].identity;   
        }   
    },   
    searchVersion: function (dataString) {   
        var index = dataString.indexOf(this.versionSearchString);   
        if (index == -1) return;   
        return parseFloat(dataString.substring(index+this.versionSearchString.length+1));   
    },   
    dataBrowser: [   
        {   
            string: navigator.userAgent,   
            subString: "Chrome",   
            identity: "Chrome"  
        },   
        {   string: navigator.userAgent,   
            subString: "OmniWeb",   
            versionSearch: "OmniWeb/",   
            identity: "OmniWeb"  
        },   
        {   
            string: navigator.vendor,   
            subString: "Apple",   
            identity: "Safari"  
        },   
        {   
            prop: window.opera,   
            identity: "Opera"  
        },   
        {   
            string: navigator.vendor,   
            subString: "iCab",   
            identity: "iCab"  
        },   
        {   
            string: navigator.vendor,   
            subString: "KDE",   
            identity: "Konqueror"  
        },   
        {   
            string: navigator.userAgent,   
            subString: "Firefox",   
            identity: "Firefox"  
        },   
        {   
            string: navigator.vendor,   
            subString: "Camino",   
            identity: "Camino"  
        },   
        {       // for newer Netscapes (6+)   
            string: navigator.userAgent,   
            subString: "Netscape",   
            identity: "Netscape"  
        },   
        {   
            string: navigator.userAgent,   
            subString: "MSIE",   
            identity: "Explorer",   
            versionSearch: "MSIE"  
        },   
        {   
            string: navigator.userAgent,   
            subString: "Gecko",   
            identity: "Mozilla",   
            versionSearch: "rv"  
        },   
        {       // for older Netscapes (4-)   
            string: navigator.userAgent,   
            subString: "Mozilla",   
            identity: "Netscape",   
            versionSearch: "Mozilla"  
        }   
    ],   
    dataOS : [   
        {   
            string: navigator.platform,   
            subString: "Win",   
            identity: "Windows"  
        },   
        {   
            string: navigator.platform,   
            subString: "Mac",   
            identity: "Mac"  
        },   
        {   
            string: navigator.platform,   
            subString: "Linux",   
            identity: "Linux"  
        }   
    ]   
  
};   
BrowserDetect.init();   















