var c1=0;
var c2=0;
var c3=0;
var c4=0;
var c5=0;

jQuery(function(){
	jQuery("input").focus(function (){jQuery(this).css( "backgroundColor", "#CCCCCC" );});
	jQuery("input").blur(function (){jQuery(this).css( "backgroundColor", "#FFFFFF" );});
	
	jQuery(document).ready(function()
	{

	});
		jQuery('.num').numeric();
		jQuery('.char').alphanumeric({allow:".,()/-& "});
		jQuery('.flotante').numeric({allow:"."});
	});


function stock(quien)
{
var cuantos;	
if(quien==1){cuantos=el('c1').value;}	
if(quien==2){cuantos=el('c2').value;}	
if(quien==3){cuantos=el('c3').value;}	
if(quien==4){cuantos=el('c4').value;}	
if(quien==5){cuantos=el('c5').value;}	
x_Stock(quien,cuantos,function rstock(res){	

if(res!="true") {
				alert(res);
				
el('c1').value="";	
el('c2').value="";	
el('c3').value="";	
el('c4').value="";	
el('c5').value="";
				
				
				
				}	 
											   });
}


function cboletos()
{
x_Capcha(el('capcha').value,function res(t){	
	if(t){
	
if( (el('c1').value=="") && (el('c2').value=="") && (el('c3').value=="") && (el('c4').value=="") && (el('c5').value=="") ) 
{ alert("Aun no has seleccionado alguna opcion para la compra de boletos"); return false;}

if(el('c1').value!=""){c1=el('c1').value;}
if(el('c2').value!=""){c2=el('c2').value;}
if(el('c3').value!=""){c3=el('c3').value;}
if(el('c4').value!=""){c4=el('c4').value;}
if(el('c5').value!=""){c5=el('c5').value;}

x_Boletos(c1,c2,c3,c4,c5,function res(r){ 
									  
									 window.location="compraboletos.php";
									  
									  });
	}
	else {alert("El codigo no coincide con el de la imagen"); return false;}
});
}