function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// imagenes con rollover
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_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_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];}
}
//

// Validar formularios
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- El campo '+nm+' debe ser una direccion de e-mail.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- El campo '+nm+' debe contener un numero.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- El campo '+nm+' debe contener un numero entre '+min+' y '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- El campo '+nm+' es requerido.\n'; }
    } if (errors) alert('Errores al procesar el formulario:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

// Agregar a FAVORITOS

function Agregar(Titulo,URL) {
/* Condición para el navegador Firefox */
if (navigator.appName=="Netscape") {
/* Agrega la página a favoritos y asigna un título al enlace */
	window.sidebar.addPanel(Titulo,URL,""); 
}
/* Condición para el navegador IE */
if (navigator.appName=="Microsoft Internet Explorer"){
/* Agrega la página a favoritos y asigna un título al enlace */
	window.external.AddFavorite(URL,Titulo);
}
}


function enviar() {
document.formulario.submit();
}
// ocultar/mostrar elementos
function showHide(elementid){
	if (document.getElementById(elementid).style.display == 'none'){
		document.getElementById(elementid).style.display = '';
	} else {
		document.getElementById(elementid).style.display = 'none';
	}
}

// tamaño texto
function zoomText(Accion,Elemento){
//inicializacion de variables y parámetros
var obj=document.getElementById(Elemento);
var max = 200 //tamaño máximo del fontSize
var min = 70 //tamaño mínimo del fontSize
if (obj.style.fontSize==""){
obj.style.fontSize="100%";
}
actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto
incremento=10;// el valor del incremento o decremento en el tamaño

//accion sobre el texto
if( Accion=="reestablecer" ){
obj.style.fontSize="100%"
}
if( Accion=="aumentar" && ((actual+incremento) <= max )){
valor=actual+incremento;
obj.style.fontSize=valor+"%"
}
if( Accion=="disminuir" && ((actual+incremento) >= min )){
valor=actual-incremento;
obj.style.fontSize=valor+"%"
}
}


// MARQUESINA HORIZONTAL

var bannerID=0
function text(msg,ctrlwidth) {
        msg = " // "+msg
        newmsg = msg
        while (newmsg.length < ctrlwidth) {
                newmsg += msg
        }
        document.write ('<FORM NAME="Scrolltext" id="Scrolltext" style="margin: 0px; padding: 0px;">');
        document.write ('<INPUT NAME="text" VALUE= "'+newmsg+'" SIZE= '+ctrlwidth+' class="aviso-scroll" readonly="readonly">');
        document.write ('</FORM>');
        var bannerID = null
        rollmsg()
}
function rollmsg() {
      NowMsg = document.Scrolltext.text.value
        NowMsg = NowMsg.substring(1,NowMsg.length)+NowMsg.substring(0,1)
        document.Scrolltext.text.value = NowMsg
        bannerID = setTimeout("rollmsg()",200)//change the number 100 to represent the speed of the scroll. The larger the number the slower it moves
}

// Alerta cuando elije otro pais
   function habilita(){
    document.formulario.pais.disabled = false;
    alert("Debido a los altos costos de los envíos al exterior normalmente no se realiza la operación, el único método seria que usted envíe una empresa para que se encargue de todo el tramite (previa entrega del dinero, DHL, Fedex, UPS, etc.) o persona para que abone y retire. \n \nCasa Libertella");
   }

   function deshabilita(){
    document.formulario.pais.disabled = true;
    document.formulario.pais.value = "";
   }
// 

// TOOLTIP:
var ns4 = (document.layers)? true:false
            var ie4 = (document.all)? true:false
            var ns6 = (document.getElementById && !document.all) ? true: false;
            var coorX, coorY;

            if (ns6) document.addEventListener("mousemove", mouseMove, true)
            if (ns4) {document.captureEvents(Event.MOUSEMOVE); document.mousemove = mouseMove;}

            function mouseMove(e)    {
                if (ns4||ns6)    {
                    coorX = e.pageX;
                    coorY = e.pageY;
                }
                if (ie4)    {
                    coorX = event.x;
                    coorY = event.y;
                }
                coorX += document.body.scrollLeft;
                coorY += document.body.scrollTop;
                return true;
            }

            function ini()    {
                if (ie4)    document.body.onmousemove = mouseMove;
            }

            function mostrar(dato)    {
                with(document.getElementById("ayuda"))    {
                    style.top = coorY + 10;
                    style.left = coorX + 10;
                    style.visibility = "visible";
                    innerHTML = dato;
                }
            }

            function ocultar()    {
                document.getElementById("ayuda").style.visibility = "hidden";
            }

            function mover()    {
                with(document.getElementById("ayuda"))    {
                    style.top = coorY + 10;
                    style.left = coorX + 10;
                }
            }


// CARRITO

/***********************************************
* Floating Top Bar script- © Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 60 //set x offset of bar in pixels
var startY = 3 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

function staticbar(){
	barheight=document.getElementById("topbar").offsetHeight;
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("topbar");
	stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar

//          