
function qnav(goto) {

	var categoria = goto;

if (!enProceso && http) {
		      
		      var url = "lib/php/qnav.php?id="+categoria;
				http.open("GET", url, true);
				http.onreadystatechange = function () {
					if(http.readyState==1){
						document.getElementById ("content").innerHTML = '<div class="preloader"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="100"><param name="movie" value="template/default/flash/loading.swf""><param name="quality" value="high"><embed src="template/default/flash/loading.swf"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed></object></div>';
					}else if (http.readyState == 4) {
							if (http.status == 200) {
								if (http.responseText.indexOf('invalid') == -1) {
									results = http.responseText;
									document.getElementById ("content").innerHTML = results;
									
									
									$("a[rel^='prettyPhoto']").prettyPhoto({
										animationSpeed: 'normal', /* fast/slow/normal */
										padding: 40, /* padding for each side of the picture */
										opacity: 0.55, /* Value betwee 0 and 1 */
										showTitle: true, /* true/false */
										allowresize: true, /* true/false */
										counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
										theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
										callback: function(){}
									});
									
									
									
									enProceso = false;
								}
							}
				    }
		    	};
				
		enProceso = true;
		http.send(null);
		
		
		}
       
    
};

function qpagin(goto,pagex) {

	var categoria = goto;
	var page = pagex;

if (!enProceso && http) {
		      
		      var url = "lib/php/qnav.php?id="+categoria+"&page="+page;
				http.open("GET", url, true);
				http.onreadystatechange = function () {
					if(http.readyState==1){
						document.getElementById ("content").innerHTML = '<div class="preloader"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="100"><param name="movie" value="template/default/flash/loading.swf""><param name="quality" value="high"><embed src="template/default/flash/loading.swf"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed></object></div>';
					}else if (http.readyState == 4) {
							if (http.status == 200) {
								if (http.responseText.indexOf('invalid') == -1) {
									results = http.responseText;
									document.getElementById ("content").innerHTML = results;
									
									
									$("a[rel^='prettyPhoto']").prettyPhoto({
										animationSpeed: 'normal', /* fast/slow/normal */
										padding: 40, /* padding for each side of the picture */
										opacity: 0.55, /* Value betwee 0 and 1 */
										showTitle: true, /* true/false */
										allowresize: true, /* true/false */
										counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
										theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
										callback: function(){}
									});
									
									
									
									enProceso = false;
								}
							}
				    }
		    	};
				
		enProceso = true;
		http.send(null);
		
		
		}
       
    
};

function changel() {

var comb = document.getElementById("idioma");
var leng = comb.selectedIndex;

if(leng == 1){
document.location=("http:///www.latinaproducciones.com.ve/EN/index.php");
} else {
document.location=("http:///www.latinaproducciones.com.ve/index.php");
}


    
};

function qnew(goto,id) {

	var categoria = goto;

if (!enProceso && http) {
		      
		      var url = "lib/php/qnew.php?view="+categoria+"&id="+id;
				http.open("GET", url, true);
				http.onreadystatechange = function () {
					if(http.readyState==1){
						document.getElementById ("content").innerHTML = '<div class="preloader"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="100"><param name="movie" value="template/default/flash/loading.swf""><param name="quality" value="high"><embed src="template/default/flash/loading.swf"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed></object></div>';
					}else if (http.readyState == 4) {
							if (http.status == 200) {
								if (http.responseText.indexOf('invalid') == -1) {
									results = http.responseText;
									document.getElementById ("content").innerHTML = results;
									
									$("a[rel^='prettyPhoto']").prettyPhoto({
										animationSpeed: 'normal', /* fast/slow/normal */
										padding: 40, /* padding for each side of the picture */
										opacity: 0.55, /* Value betwee 0 and 1 */
										showTitle: true, /* true/false */
										allowresize: true, /* true/false */
										counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
										theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
										callback: function(){}
									});
									
									enProceso = false;
								}
							}
				    }
		    	};
				
		enProceso = true;
		http.send(null);
		
		}
       
    
};

function qnewp(goto,id) {

	var categoria = goto;

if (!enProceso && http) {
		      
		      var url = "lib/php/qnewp.php?view="+categoria+"&id="+id;
				http.open("GET", url, true);
				http.onreadystatechange = function () {
					if(http.readyState==1){
						document.getElementById ("content").innerHTML = '<div class="preloader"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="100"><param name="movie" value="template/default/flash/loading.swf""><param name="quality" value="high"><embed src="template/default/flash/loading.swf"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed></object></div>';
					}else if (http.readyState == 4) {
							if (http.status == 200) {
								if (http.responseText.indexOf('invalid') == -1) {
									results = http.responseText;
									document.getElementById ("content").innerHTML = results;
									
									$("a[rel^='prettyPhoto']").prettyPhoto({
										animationSpeed: 'normal', /* fast/slow/normal */
										padding: 40, /* padding for each side of the picture */
										opacity: 0.55, /* Value betwee 0 and 1 */
										showTitle: true, /* true/false */
										allowresize: true, /* true/false */
										counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
										theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
										callback: function(){}
									});
									
									enProceso = false;
								}
							}
				    }
		    	};
				
		enProceso = true;
		http.send(null);
		
		}
       
    
};


function enviarForm(nombres,apellidos,email,razon,pais,mensaje) {

	

if (!enProceso && http) {
		      
		      var url = "lib/php/qnav.php?id=contact&view=message&nombres="+nombres+"&apellidos="+apellidos+"&email="+email+"&razon="+razon+"&pais="+pais+"&mensaje="+mensaje;
				http.open("GET", url, true);
				http.onreadystatechange = function () {
					if(http.readyState==1){
						document.getElementById ("content").innerHTML = '<div class="preloader"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="100"><param name="movie" value="template/default/flash/loading.swf""><param name="quality" value="high"><embed src="template/default/flash/loading.swf"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed></object></div>';
					}else if (http.readyState == 4) {
							if (http.status == 200) {
								if (http.responseText.indexOf('invalid') == -1) {
									results = http.responseText;
									document.getElementById ("content").innerHTML = results;
									
									$("a[rel^='prettyPhoto']").prettyPhoto({
										animationSpeed: 'normal', /* fast/slow/normal */
										padding: 40, /* padding for each side of the picture */
										opacity: 0.55, /* Value betwee 0 and 1 */
										showTitle: true, /* true/false */
										allowresize: true, /* true/false */
										counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
										theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
										callback: function(){}
									});
									
									enProceso = false;
								}
							}
				    }
		    	};
				
		enProceso = true;
		http.send(null);
		
		}
       
    
};


function qwork(level,goto,id) {

	var categoria = goto;

if (!enProceso && http) {
		      
		      var url = "lib/php/qwork.php?view="+categoria+"&id="+id+"&level="+level;
				http.open("GET", url, true);
				http.onreadystatechange = function () {
					if(http.readyState==1){
						document.getElementById ("content").innerHTML = '<div class="preloader"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="100"><param name="movie" value="template/default/flash/loading.swf""><param name="quality" value="high"><embed src="template/default/flash/loading.swf"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed></object></div>';
					}else if (http.readyState == 4) {
							if (http.status == 200) {
								if (http.responseText.indexOf('invalid') == -1) {
									results = http.responseText;
									document.getElementById ("content").innerHTML = results;
									
									$("a[rel^='prettyPhoto']").prettyPhoto({
										animationSpeed: 'normal', /* fast/slow/normal */
										padding: 40, /* padding for each side of the picture */
										opacity: 0.55, /* Value betwee 0 and 1 */
										showTitle: true, /* true/false */
										allowresize: true, /* true/false */
										counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
										theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
										callback: function(){}
									});
									
									enProceso = false;
								}
							}
				    }
		    	};
				
		enProceso = true;
		http.send(null);
		
		}
       
    
};






function limpiar(){
	
	document.getElementById("divNombres").innerHTML = '';
	document.getElementById("divApellidos").innerHTML = '';
	document.getElementById("divEmail").innerHTML = '';
	document.getElementById("divRazon").innerHTML = '';
	document.getElementById("divMensaje").innerHTML = '';
	
};



function validar(enviarx){
	
	var nombres = document.getElementById("nombres");
	var apellidos = document.getElementById("apellidos");
	var email = document.getElementById("email");
	var razon = document.getElementById("razon");
	var mensaje = document.getElementById("mensaje");
	var pais = document.getElementById("pais");
	

	
	var divNombres = document.getElementById("divNombres");
	var divApellidos = document.getElementById("divApellidos");
	var divEmail = document.getElementById("divEmail");
	var divRazon = document.getElementById("divRazon");
	var divMensaje = document.getElementById("divMensaje");
	
	var enviar = enviarx;

	var flag = false;
	
	if(nombres.length==0 || nombres.value =='' ){
		limpiar();
		flag = false;
		divNombres.innerHTML='<img src="template/default/images/green.png" width="17" height="15" />';
		nombres.focus(true);
		
		} else {
	
			if(apellidos.length==0 || apellidos.value =='') {
				limpiar();
				flag = false;
				apellidos.focus();
				divApellidos.innerHTML='<img src="template/default/images/green.png" width="17" height="15" />';

			} else {

				 if(email.length==0 || email.value ==''){
				    limpiar();
					flag = false;
					email.focus();
					divEmail.innerHTML='<img src="template/default/images/green.png" width="17" height="15" />';

				} else {
					if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value))){
						limpiar();
						flag = false;
						email.focus();
						divEmail.innerHTML='<img src="template/default/images/advr.png" width="17" height="15" />';

					} else {
						
						if (razon.length==0 || razon.value =='') {
							limpiar();
							flag = false;
							razon.focus();
							divRazon.innerHTML='<img src="template/default/images/green.png" width="17" height="15" />';

						} else {
							
							 if (mensaje.length==0 || mensaje.value ==''){
								limpiar();
								flag = false;
								mensaje.focus();
								divMensaje.innerHTML='<img src="template/default/images/green.png" width="17" height="15" />';
						
							  } else {
								  
								  flag = true;
									  if(enviar){
									  enviarForm(nombres.value,apellidos.value,email.value,razon.value,pais.value,mensaje.value)
									  }
								  }
							
							}
						
						
						}
					
					
					}
				
				}
			
			
			}    
	
	
	
}



