// JavaScript Document

function NoDisponible () {
	alert("La función solicitada no está aun disponible!");
}

function AbrirVentana(URL,SB,ANCHO,ALTO,IZDA,ARRIBA) 
{ // <--- Designed By Miguel M.( webmiguel(a)gmail.com ) - www.ski-cams.com
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + SB + ",location=0,statusbar=0,menubar=0,resizable=0,width=" + ANCHO + ",height=" + ALTO + ",left = " + IZDA + ",top = " + ARRIBA + "');");
}

function ActivarFormulario(inputFather,inputSoon) {		
	var FatherSelected=inputFather[inputFather.selectedIndex].value;

	if (FatherSelected > 0) {
		inputSoon.disabled = false;
	} else {
		inputSoon.disabled = true;			
	}
}
function ActivarFormularioCheck(inputFather,inputSoon) {		
	var FatherSelected=inputFather.checked;

	if (FatherSelected > 0) {
		inputSoon.disabled = false;
	} else {
		inputSoon.disabled = true;			
	}
}
function DesactivarFormularioCheck(inputFather,inputSoon) {		
	var FatherSelected=inputFather.checked;
	
	if (FatherSelected) {
		inputSoon.disabled = true;
	} else {
		inputSoon.disabled = false;			
	}
}

function LimpiarContenido(input) {
	for (i = 0;i < input.length;i++)
		input[i]=null;
	input.length=0;
}

//función para cambiar el valor de la página e ir a la página del paginador
function Pagina(valor) {
	document.paginador.page.value = valor;
	document.paginador.submit();
}
//función para cambiar el valor de la página e ir a la página del paginador
function Pagina2(valor) {
	document.paginador2.page.value = valor;
	document.paginador2.submit();
}

function ValidarEmail(valor)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)) {
		return true; }
	else {
		return false; }
}

// funciones para la capa overlay de realizando busqueda
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function Overlay()
{
	var division = document.getElementById("overlay");
	var division2 = document.getElementById("overlaycontainer");
	var arrayPageSize = getPageSize();
	
	division.style.height = arrayPageSize[1] + 'px';
	division.style.display = 'block';
	division2.style.display = 'block';
}

function TrabajaConNosotros()
{
	AbrirVentana('trabaja-con-nosotros.php',0,400,500,50,50);
}
