///////////////////////////////////////////////////////////////////////////
// @Sitio: vacancyrewards.com									 		 //
// @Version: 1.0														 //
// @Autor: Juan J. Lopez Lira	|	Genotipo Laboratorio Creativo		 //
// @Fecha: 13 Mayo 2009											     	 //
// @Descripcion: Archivo de Funciones JS							 	 //
///////////////////////////////////////////////////////////////////////////

///////////////////////////////////
// Funciones Generales del Sitio //
///////////////////////////////////

// Abrir Nueva Ventana
function openwindow(Url) {
  window.open(Url,'Titulo','status=yes,scrollbars=yes,resizable=yes,width=640,height=480');
}

// Ajusta Ventana al Centro del Monitor
function fixwindow(){
	x =(screen.width - 640) / 2;
	y =(150) / 2;
	moveTo(x,y);
}


//Funcion para Envio de formularios
function send(form){
	document.getElementById(form).submit();	
}

//Funcion para mostrar mas informacion
function show(id){
	if(document.getElementById(id).style.display =='none'){
		document.getElementById(id).style.display ='block'
		} else {
			document.getElementById(id).style.display ='none'
			}
	}

/*
function VecImagenes(){
	n=0;
	this[n++]="http://www.vacancyclub.com/go/secciones/BANNER1.gif";
	this[n++]="http://www.vacancyclub.com/go/secciones/BANNER2.gif";
	this[n++]="http://www.vacancyclub.com/go/secciones/BannerCorporativoVACANCYREWARDS.JPG";
	this[n++]="http://www.vacancyclub.com/go/secciones/BANNER-ORLANDO2.gif";
	this[n++]="http://www.vacancyclub.com/go/secciones/BANNER4.gif";
	this[n++]="http://www.vacancyclub.com/go/secciones/BANNER3.gif"; 
	this.N=n;
	}
	
var Imagenes=new VecImagenes();
src= Imagenes[ Math.floor(Math.random() * Imagenes.N) ] ;
document.write("<IMG align='center' SRC="+src+">");
*/

	
///////////////////////////////////
// Funciones AJAX				 //
///////////////////////////////////

// Genera el Objeto de Conexion para Ajax
function newajax(){
	var xmlhttp=false;
	try{
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e){
		try{
			// Creacion del objet AJAX para IE
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(E){
				if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
				}
				}
				return xmlhttp; 
}

//Funcion de Precarga Ajax
function precarga(){
	loader = '<div class="loading"></div>';
	return loader;
}

//
function getestados(){	
	ajax = newajax();
	pais = document.getElementById('paises').value;
	
	ajax.open("POST","/velasvipmemberscom/include/ajaxlib.asp", true);
	ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    ajax.onreadystatechange=function() {
        if (ajax.readyState==1) {
            document.getElementById('estados').innerHTML = precarga();
        }
        if (ajax.readyState==4) {
            document.getElementById('estados').innerHTML = ajax.responseText;
        }
    }
	ajax.send("cmd=getestados&id_pais="+pais)
}

///////////////////////////////////
// Funciones JQuery				 //
///////////////////////////////////

$(document).ready(function(){
	$(".login-container").hide();
	$(".login a").click(function(){
		$(".login-container").slideToggle("slow,");
	});
});


