/* ######################################################### */
/* # © 2007 damedia.com.ar · Reservados todos los Derechos # */
/* #     Autor: da.media.diseño · info@damedia.com.ar      # */
/* ######################################################### */

function $() {
    var elements = new Array();
    for (var i = 0; i < arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == 'string')
            element = document.getElementById(element);
        if (arguments.length == 1)
            return element;
        elements.push(element);
    }
    return elements;
}

function toggleDiv( element ) {
    var e = $(element);
    if (e) {
        e.style.display = ((e.style.display != 'block') ? 'block' : 'none');
    }
}

function showDiv( element ) {
    var e = $(element);
    if (e) {
        e.style.display = 'block';
    }
}

function hideDiv( element ) {
    var e = $(element);
    if (e) {
        e.style.display = 'none';
    }
}

function blankMsgDiv() {
	parent.itemdisplay_frame.document.getElementById('cartMSG').innerHTML='';
}

function updateAllLayers(msg) {
	if (parent.document.getElementById('item_display').style.display == 'block') {
		if (msg>0) {
			parent.itemdisplay_frame.window.location.href = parent.itemdisplay_frame.window.location.href+'&msg='+msg;
		} else {
			parent.itemdisplay_frame.window.location.href = parent.itemdisplay_frame.window.location.href;
		}
	}
        if (parent.document.getElementById('cart_display').style.display == 'block') {
		parent.cartdisplay_frame.window.location.href = parent.cartdisplay_frame.window.location.href;
	}
}

function updateLayers(msg) {
	if (parent.document.getElementById('item_display').style.display == 'block') {
		if (msg==1) {
			parent.itemdisplay_frame.document.getElementById('cartMSG').innerHTML='Este Item se ha agregado a tu Carrito';
			setTimeout("blankMsgDiv()", 10000);
		}
	}
        if (parent.document.getElementById('cart_display').style.display == 'block') {
		parent.cartdisplay_frame.window.location.href = parent.cartdisplay_frame.window.location.href;
	}
}

var shcart=false;
var CartDisplay=true;

function ShowCartDisplay() {
	MM_swapImage('cartmenu_dummy','','imagenes/cartmenu_dummy_open.gif',1);
	showDiv('cart_display');
	open('dacart.php?id=cartdisplay','cartdisplay_frame');
	shcart=true;
}

function HideCartDisplay() {
	MM_swapImage('cartmenu_dummy','','imagenes/cartmenu_dummy_close.gif',1);
	hideDiv('cart_display');
	shcart=false;
}

function ShowHideCartDisplay() {
	if (CartDisplay) {
		if (!shcart) {
			ShowCartDisplay();
			shcart=true;
		} else {
			HideCartDisplay();
			shcart=false;
		}
	}
}

function DoEmailBtm() {
	document.write("<a href=\""+"mailto:"+"inf"+"o@n"+"eotok"+"yostore"+".com\" class=\"middle-yellow-link\">"+"inf"+"o@n"+"eotok"+"yostore"+".com</a>");
}

function GotoTop() {
	scroll(0,120);
}

function mOvr(src) {
  src.style.cursor = 'hand';
  src.bgColor = '#316AC5';
  src.Color = '#ffffff';
}

function mOut(src) {
  src.style.cursor = 'default';
  src.bgColor = '#ffffff';
  src.Color = '#000000';
}

function mClk(src) {
  if(event.srcElement.tagName=='TD'){
    src.children.tags('A')[0].click();
  }
}

var refer=true;

function combo() {
  if (refer) {
    document.all.contents.style.visibility="visible";
    refer=false;
  } else {
    document.all.contents.style.visibility="hidden";
    refer=true;
  }
}

function DA_popup(type,item,img) {
	if (type == "dachat") {
	 win = window.open('dachat/', type, 'width=430,height=310,top=' + (screen.height - 300) / 2 + ',left=' + (screen.width - 450) / 2 );
	 win.focus();
        }
	if (type == "display") {
	 win = window.open('', type, 'width=550,height=550,top=' + (screen.height - 550) / 2 + ',left=' + (screen.width - 550) / 2 );
	 win.document.write("<html><head><title>NeoTokyoStore</title></head><body bgcolor=\"\#ECECEC\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"><table width=\"100%\" height=\"100%\"><tr><td align=\"center\"><img src=\"imagenes/catalogue/ntci-"+item+"_"+img+".jpg\" border=\"1\" bordercolor=\"\#000000\"></td></tr></table></body></html>");
	 win.document.close();
	 win.focus();
        }
}

function validarPago(metodo) {
	if (metodo.value==4) {
		document.pedido.metodo_de_envio.value=3;
		document.getElementById('help_envio').innerHTML='Usted, de forma personal, pasará a retirar su pedido por nuestro en local situado en R&iacute;o de Janeiro 532 (Cdad. de Buenos Aires).';
		document.getElementById('help_pago').innerHTML='El pago se realiza en efectivo, con Tarjeta de D&eacute;bito o Tarjeta de Cr&eacute;dito en nuestro Local.';
	} else if (metodo.value==3) {
		document.pedido.metodo_de_envio.value=2;
		document.getElementById('help_envio').innerHTML='La Mensajería Privada se realiza a través de Motos, cuyo personal le entregará su pedido en su domicilio. El costo adicional de este Método de Envío varía según corresponda a la zona en donde se realiza la entrega.';
		document.getElementById('help_pago').innerHTML='El pago se realiza en efectivo al recibir en Pedido a través de Mensajería Privada, cuyo costo varía según corresponda a la zona en donde se haga la entrega.';
	} else if (metodo.value==2) {
		document.getElementById('help_pago').innerHTML='Se envía un E-mail con todos los Datos de la Persona a la cual Usted le emite el Giro a través de cualquier sucursal de Correo Argentino.';
		if (document.pedido.metodo_de_envio.value==1) {
			document.getElementById('help_envio').innerHTML='Una vez despachado el Pedido, se envía un E-mail con el Número de Rastreo para realizar el seguimiento a través de la página de Internet de Correo Argentino.';
		}
	} else {
		document.getElementById('help_pago').innerHTML='Una vez hecha la compra, verificado todos los datos, se envía un E-mail con la información necesaria para realizar el Deposito o la Transferencia.';
		if (document.pedido.metodo_de_envio.value==1) {
			document.getElementById('help_envio').innerHTML='Una vez despachado el Pedido, se envía un E-mail con el Número de Rastreo para realizar el seguimiento a través de la página de Internet de Correo Argentino.';
		}
	}
}

function validarEnvio(metodo) {
	if (metodo.value==3) {
		if (document.pedido.metodo_de_pago.value!=4) {
			document.getElementById('help_envio').innerHTML='Usted, de forma personal, pasará a retirar su pedido por nuestro en local situado en R&iacute;o de Janeiro 532 (Cdad. de Buenos Aires).<br><font color=#990000><b>ATENCIÓN:</b> Si elige este Método de Envío, debe elegir otro Método de Pago.</font>';
		} else {
			document.getElementById('help_envio').innerHTML='Usted, de forma personal, pasará a retirar su pedido por nuestro en local situado en R&iacute;o de Janeiro 532 (Cdad. de Buenos Aires).';
		}
	} else if (metodo.value==2) {
		if (document.pedido.metodo_de_pago.value==4) {
			document.getElementById('help_envio').innerHTML='La Mensajería Privada se realiza a través de Motos, cuyo personal le entregará su pedido en su domicilio. El costo adicional de este Método de Envío varía según corresponda a la zona en donde se realiza la entrega.<br><font color=#990000><b>ATENCIÓN:</b> Si elige este Método de Envío, debe elegir otro Método de Pago.</font>';
		} else {
			document.getElementById('help_envio').innerHTML='La Mensajería Privada se realiza a través de Motos, cuyo personal le entregará su pedido en su domicilio. El costo adicional de este Método de Envío varía según corresponda a la zona en donde se realiza la entrega.';
		}
	} else {
		if ((document.pedido.metodo_de_pago.value==3)||(document.pedido.metodo_de_pago.value==4)) {
			document.getElementById('help_envio').innerHTML='Una vez despachado el Pedido, se envía un E-mail con el Número de Rastreo para realizar el seguimiento a través de la página de Internet de Correo Argentino.<br><font color=#990000><b>ATENCIÓN:</b> Si elige este Método de Envío, debe elegir otro Método de Pago.</font>';
		} else {
			document.getElementById('help_envio').innerHTML='Una vez despachado el Pedido, se envía un E-mail con el Número de Rastreo para realizar el seguimiento a través de la página de Internet de Correo Argentino.';
		}
	}
}

function validarNombre() {
 if ((document.pedido.nombre.value=="") || (document.pedido.nombre.value==" "))
	{
		showDiv("error-nombre");
	}
 else
	{
		hideDiv("error-nombre");
	}
}

function validarApellido() {
 if ((document.pedido.apellido.value=="") || (document.pedido.apellido.value==" "))
	{
		showDiv("error-apellido");
	}
 else
	{
		hideDiv("error-apellido");
	}
}

function validarDireccion() {
 if ((document.pedido.direccion.value=="") || (document.pedido.direccion.value==" "))
	{
		showDiv("error-direccion");
	}
 else
	{
		hideDiv("error-direccion");
	}
}

function validarCodigopostal() {
 if ((document.pedido.codigopostal.value=="") || (document.pedido.codigopostal.value==" "))
	{
		showDiv("error-codigopostal");
	}
 else
	{
		hideDiv("error-codigopostal");
	}
}

function validarTelefono() {
 var checkOK = "1234567890-)( ";
 var checkStr = document.pedido.telefono.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0;  i < checkStr.length;  i++)
	{
	 ch = checkStr.charAt(i);
	 for (j = 0;  j < checkOK.length;  j++)
	   if (ch == checkOK.charAt(j))
	     break;
	 if (j == checkOK.length)
	  {
	    allValid = false;
	    break;
	  }
	 allNum += ch;
	}
 if ((!allValid)||(document.pedido.telefono.value=="")||(document.pedido.telefono.value==" "))
	{
		showDiv("error-telefono");
	}
 else
	{
		hideDiv("error-telefono");
	}
}

function validarLocalidad() {
 if ((document.pedido.localidad.value=="") || (document.pedido.localidad.value==" "))
	{
		showDiv("error-localidad");
	}
 else
	{
		hideDiv("error-localidad");
	}
}

function validarCiudad() {
 if ((document.pedido.ciudad.value=="") || (document.pedido.ciudad.value==" "))
	{
		showDiv("error-ciudad");
	}
 else
	{
		hideDiv("error-ciudad");
	}
}

function validarEmail() {
TieneArroba = false;
 for (i = 0;  i < document.pedido.email.value.length;  i++)
	{
	 if (document.pedido.email.value.charAt(i) == "@")
	  {
		TieneArroba = true;
	   }
	}
 if (document.pedido.email.value.length < 7)
	{
	 TieneArroba = false; 
	}
 if (!TieneArroba) 
	{
		showDiv("error-email");
	}
 else
	{
		hideDiv("error-email");
	}
}

function ValidarPedido() {
var errores = 0;
 if ((document.pedido.nombre.value=="") || (document.pedido.nombre.value==" "))
	{
		showDiv("error-nombre");
		errores++;
	}
 else
	{
		hideDiv("error-nombre");
	}
 if ((document.pedido.apellido.value=="") || (document.pedido.apellido.value==" "))
	{
		showDiv("error-apellido");
		errores++;
	}
 else
	{
		hideDiv("error-apellido");
	}
 TieneArroba = false;
 for (i = 0;  i < document.pedido.email.value.length;  i++)
	{
	 if (document.pedido.email.value.charAt(i) == "@")
	  {
		TieneArroba = true;
	   }
	}
 if (document.pedido.email.value.length < 7)
	{
	 TieneArroba = false; 
	}
 if (!TieneArroba) 
	{
		showDiv("error-email");
		errores++;
	}
 else
	{
		hideDiv("error-email");
	}
 var checkOK = "1234567890-)( ";
 var checkStr = document.pedido.telefono.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0;  i < checkStr.length;  i++)
	{
	 ch = checkStr.charAt(i);
	 for (j = 0;  j < checkOK.length;  j++)
	   if (ch == checkOK.charAt(j))
	     break;
	 if (j == checkOK.length)
	  {
	    allValid = false;
	    break;
	  }
	 allNum += ch;
	}
 if ((!allValid)||(document.pedido.telefono.value=="")||(document.pedido.telefono.value==" "))
	{
		showDiv("error-telefono");
		errores++;
	}
 else
	{
		hideDiv("error-telefono");
	}
 if ((document.pedido.direccion.value=="") || (document.pedido.direccion.value==" "))
	{
		showDiv("error-direccion");
		errores++;
	}
 else
	{
		hideDiv("error-direccion");
	}
 if ((document.pedido.codigopostal.value=="") || (document.pedido.codigopostal.value==" "))
	{
		showDiv("error-codigopostal");
		errores++;
	}
 else
	{
		hideDiv("error-codigopostal");
	}
 if ((document.pedido.metodo_de_pago[document.pedido.metodo_de_pago.selectedIndex].value==3)&&(document.pedido.metodo_de_envio[document.pedido.metodo_de_envio.selectedIndex].value==1))
	{
		document.getElementById('help_envio').innerHTML='Una vez despachado el Pedido, se envía un E-mail con el Número de Rastreo para realizar el seguimiento a través de la página de Internet de Correo Argentino.<br><font color=#990000><b>ATENCIÓN:</b> Si elige este Método de Envío, debe elegir otro Método de Pago.</font>';
		errores++;
	}

 if ((document.pedido.metodo_de_pago[document.pedido.metodo_de_pago.selectedIndex].value==4)&&(document.pedido.metodo_de_envio[document.pedido.metodo_de_envio.selectedIndex].value==1))
	{
		document.getElementById('help_envio').innerHTML='Una vez despachado el Pedido, se envía un E-mail con el Número de Rastreo para realizar el seguimiento a través de la página de Internet de Correo Argentino.<br><font color=#990000><b>ATENCIÓN:</b> Si elige este Método de Envío, debe elegir otro Método de Pago.</font>';
		errores++;
	}
 if ((document.pedido.metodo_de_pago[document.pedido.metodo_de_pago.selectedIndex].value==4)&&(document.pedido.metodo_de_envio[document.pedido.metodo_de_envio.selectedIndex].value==2))
	{
		document.getElementById('help_envio').innerHTML='La Mensajería Privada se realiza a través de Motos, cuyo personal le entregará su pedido en su domicilio. El costo adicional de este Método de Envío varía según corresponda a la zona en donde se realiza la entrega.<br><font color=#990000><b>ATENCIÓN:</b> Si elige este Método de Envío, debe elegir otro Método de Pago.</font>';
		errores++;
	}
 if ((document.pedido.localidad.value=="") || (document.pedido.localidad.value==" "))
	{
		showDiv("error-localidad");
		errores++;
	}
 if ((document.pedido.ciudad.value=="") || (document.pedido.ciudad.value==" "))
	{
		showDiv("error-ciudad");
		errores++;
	}
 if (errores==0)
	{
		document.pedido.submit();
	}
}

/*
var mfBanners = 1;
var mfBannerIndex = 0;

function mfBannerChange() {
        hideDiv("banner0");
        hideDiv("banner1");
	showDiv("banner"+mfBannerIndex);
	if (mfBannerIndex < mfBanners) {
		mfBannerIndex++;
	} else {
		mfBannerIndex = 0;
	}
}

mfBannerChange();
setInterval("mfBannerChange()", 15000);
*/

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&&id.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 DA_jumpMenu(targ,selObj,restore){ //v3.0
  if ((selObj.options[selObj.selectedIndex].value!="- Series")&&(selObj.options[selObj.selectedIndex].value!="- Colecciones")) {
    eval(targ+".location='index.php?id=vergenero&"+selObj.options[selObj.selectedIndex].value+"&pag=1'");
  }
  if (restore) selObj.selectedIndex=0;
}

/* ######################################################### */
/* # © 2007 damedia.com.ar · Reservados todos los Derechos # */
/* #     Autor: da.media.diseño · info@damedia.com.ar      # */
/* ######################################################### */