<!--

function img_cambia_botones_bazuca(imgname, img)
{imgname.src = "/BazucaHTML/img/bazuca/"+img;}


function img_cambia_botones(imgname, img)
{imgname.src = "/BazucaHTML/img/botones/img/"+img;}

function img_cambia_botones_NSM(imgname, img)
{imgname.src = "/BazucaHTML/img/botones/img/Home_NSM/"+img;}


function checkFields2( rut )
{
campo = window.document.LOGFORM2
if (campo.name.value == "" || campo.name.value == " ")
{
alert('No has puesto tu Rut');
campo.name.focus();return false;
}
if (campo.password.value == "" || campo.password.value == " ")
{
alert('No has puesto tu Password');
campo.password.focus();return false;
}
}
function checkRutField2(texto)
{
campo = window.document.LOGFORM2;
var tmpstr = "";
for ( i=0; i < texto.length ; i++ )
if ( texto.charAt(i) != ' ' && texto.charAt(i) != '.' && texto.charAt(i) != '-' )
tmpstr = tmpstr + texto.charAt(i);texto = tmpstr;largo = texto.length;
if ( largo < 2 )
{
alert("Debe ingresar el rut completo.");
campo.name.focus();campo.name.select();return false;
}
for (i=0; i < largo ; i++ )
{ 
if ( texto.charAt(i) !="0" && texto.charAt(i) != "1" && texto.charAt(i) !="2" && texto.charAt(i) != "3" && texto.charAt(i) != "4" && texto.charAt(i) !="5" && texto.charAt(i) != "6" && texto.charAt(i) != "7" && texto.charAt(i) !="8" && texto.charAt(i) != "9" && texto.charAt(i) !="k" && texto.charAt(i) != "K" ) 
{
alert("El valor ingresado no corresponde a un Rut válido.");
campo.name.focus();campo.name.select();return false;
}
}
campo.name.value = texto;return false;
}

function f_enviar (bodega)
{
  if(bodega==-1)
  {
    document.cookie = "fuerazona="+1+"; PATH=/";
    document.cookie = "local="+11+"; PATH=/";
  }
  else
  {
    document.cookie = "local="+(bodega)+"; PATH=/";
    document.cookie = "fuerazona="+0+"; PATH=/";
  }
  document.form_bodega.bodega.value = bodega;
  document.form_bodega.submit();
}

function inicio()
{
alert('aa');
  document.LOGFORM.name.focus();
}





function abrepopup(url,conf)
{
  //window.open(url,"ventana1","width=120,height=300,scrollbars=NO") 
  var nueva = window.open(url,"nueva",conf);
  if(nueva)
    nueva.focus();
  else
    alert('Deshabilite el bloqueador de pop-up de su navegador.');
}

function cheqlargo(campo,alertbox) {

largo = campo.value.length
if (largo < 3)
{
alert(alertbox); return false;
}
}

function cheqvacio(campo,alertbox) {
 string = campo.value
 largo = campo.value.length
 for ( i=0; i < largo ; i++ )
 {
    if ( (string.charAt(i) != " ") )
    {
      return true;
    }
 }
 alert(alertbox); return false;
}

function cheqcontenido(campo,alertbox) {
string = campo.value
largo = campo.value.length
for ( i=0; i < largo ; i++ )
   {
      if ( (string.charAt(i)=="'") || (string.charAt(i)=="%") || (string.charAt(i)=="?") || (string.charAt(i)=="*") || (string.charAt(i)=="!") || (string.charAt(i)=="$") || (string.charAt(i)==",") || (string.charAt(i)=="(") || (string.charAt(i)==")") || (string.charAt(i)=="=") || (string.charAt(i)=="[") || (string.charAt(i)=="]") || (string.charAt(i)=="{") || (string.charAt(i)=="}") || (string.charAt(i)=="|") || (string.charAt(i)==">") || (string.charAt(i)==";") )
	{
	alert(alertbox); 
	return false;
	}
   }
}

function valida(thisform) {
with (thisform)
{
if (cheqcontenido(entry, "Este campo no acepta los siguientes caracteres { } [ ]( ) ' % ? * $ ! , = | > ; -")== false) {entry.focus(); return false;};
if (cheqlargo(entry, "La búsqueda se realiza con 3 letras como mínimo")== false) {entry.focus(); return false;};
if (cheqvacio(entry, "Campo vacío")== false) {entry.focus(); return false;};
}
}

function refresca_menu()
{

}

function validar_busqueda()
{
campo = document.busqueda_regalo
if (campo.rango_precio1.value == "0")
	{
	alert('No has seleccionado un rango de precio');
	campo.rango_precio1.focus();
	return false;
	}
if (campo.sexo.value == "0" )
	{
	alert('No has seleccionado el sexo de tu agasajado');
	campo.sexo.focus();
	return false;
	}
if (campo.rango_edad.value == "0")
	{
	alert('No has seleccionado un rango de edad');
	campo.rango_edad.focus();
	return false;
	}
else 
	{	return true;	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if the cookie exists
offset += search.length
end = document.cookie.indexOf(";", offset); // set the index of beginning value
if (end == -1) // set the index of the end of cookie value
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function loadornot(){
if (get_cookie('popunder')==''){
load_pop_power()
document.cookie="popunder=yes"
}
}

function load_pop_power(){
win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"bw",p)
win2.blur()
window.focus()
}

function envio_forma1()
{
 if (document.forma1.orden.value!="0")
  document.forma1.submit();
}

 function Get_Cookie_Generico(name) 
 {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
 }




//-->
