var NSP = (document.layers) ? true : false

function Void_AbrePop(url){
	
	var name = 'jccpop';
	var w = 650;
    var h = (screen.height-250);
    var settings  ='height='+h+','; 
        settings +='width='+w+',';
        settings +='top='+0+',';
        settings +='left='+0+',';
        settings +='scrollbars=yes,';
        settings +='resizable=yes';
	    
	win=window.open(url,name,settings); 
	//window.open('pop','top=0,left=0,width=600,height=600,scrollbars=yes,resizable=yes,status=no,menubar=no,location=no');
}

function AbrirFrame()
{
     document.getElementById('carro').src ='/carrov2/carroV2.php';
	 document.getElementById('carro').style.display = 'block';	
	
}


function Carro(id)
{
  if(document.getElementById('carro'))
  {
       document.getElementById('carro').src = '/carrov2/carroV2.php?id='+id+'&modo=compra&dd';	
       document.getElementById('carro').style.display = 'block';	
  }
  else
  {
      parent.document.getElementById('carro').src = '/carrov2/carroV2.php?id='+id+'&modo=compra&dd';	
      parent.document.getElementById('carro').style.display = 'block';	
  }
   
}

function CerrarFrame()
{
 
	document.getElementById('carro').style.visibility = 'hidden';	
}

function Redim(){
    var fr =    parent.document.getElementById('carro');
	var AltDoc  = (NSP) ? pageYOffset + window.innerHeight + 20 : document.body.scrollHeight +20;
    fr.height = AltDoc
	 
}



function Void_ActualizarCarro(CampoD, id_ficha){
    
	 window.location = '/carrov2/carroV2.php?id=' + id_ficha + '&modo=compra&cantidad='+CampoD.value ;
 }

function Subir(campo,maxi, id_ficha){
     var CampoD = document.getElementById(campo)
     if(parseInt(CampoD.value) >= maxi )
     {
        CampoD.value = maxi 
     }
     else
     {
        CampoD.value = parseInt(CampoD.value)+1
     }
     window.location = '/carrov2/carroV2.php?id=' + id_ficha + '&modo=compra&cantidad='+CampoD.value ;

}

function Bajar(campo,mini, id_ficha){

     var CampoD = document.getElementById(campo)
     if(parseInt(CampoD.value) <= mini)
     {
        CampoD.value = mini 
     }
     else
     {
        CampoD.value = parseInt(CampoD.value)-1
     }
     window.location = '/carrov2/carroV2.php?id=' + id_ficha + '&modo=compra&cantidad='+CampoD.value ;
} 


function  AreaEnvio_onchange(Obj)
{
	window.location = '/carrov2/carroV2.php?cd=' + Obj.value;
	
}


function FormaPago_onchange(Obj)
{
	window.location = '/carrov2/carroV2.php?forma=' + Obj.value;	
	        
} 

function ValidaForm()
{
   var error=false
   if(document.getElementById("pago").selectedIndex  == 0)
   {
	   document.getElementById("pago").style.backgroundColor='red';
	   document.getElementById("pago").style.color = 'white'
	   error = true
   }
   else
   {
	   document.getElementById("pago").style.backgroundColor='#44ff44';
	   document.getElementById("pago").style.color = 'black'
   }
    if(document.getElementById("pais").selectedIndex  == 0)
   {
	   document.getElementById("pais").style.backgroundColor='red';
	   document.getElementById("pais").style.color = 'white'
	   error = true
   }
   else
   {
	   document.getElementById("pais").style.backgroundColor='#44ff44';
	   document.getElementById("pais").style.color = 'black'
   }
   if(error)
   {
	      alert(Elang[2] )
   }
   else
   {
	   document.form2.submit();
   }
	 
}


function CarroReEquivalencia(obj){

       if(obj.checked == true)
       {
	      document.getElementById('carro').src = '/carrov2/carroV2.php?re=si';
 	   }
 	   else
 	   {
	      document.getElementById('carro').src = '/carrov2/carroV2.php?re=no';
	   }

}

function EnviaformCliente(ObjForm)
{ 
  var nueva = window.open('','nueva','top=0,left=0,width=500,height=325,scrollbars=no,resizable=no,status=no,menubar=no,location=no');
  ObjForm.submit()
}
function EnviarFormNoCliente(ObjForm)
{ 
   var NoCliente = window.open('','NoCliente','top=0,left=0,width=500,height=350,scrollbars=no,resizable=no,status=no,menubar=no,location=no');
   ObjForm.submit()
}
function EnviarPass(ObjForm)
{ 
    var nueva = window.open('/escripts/olvido_pass.php?email2='+ObjForm.email.value,'nueva','top=0,left=0,width=500,height=250,scrollbars=no,resizable=no,status=no,menubar=no,location=no');
} 
   

 

