function round(number,X) { 

// rounds number to X decimal places, defaults to 2 

X = (!X ? 2 : X); 

return Math.round(number*Math.pow(10,X))/Math.pow(10,X); 

} 


function calcula_cantidad(c,i) {
  document.myForm.cantidad.value=round(c*i,2) + ' €/mes';
}


function Item() {
  this.length = Item.arguments.length; 
  for (var i = 0; i < this.length; i++)
    this[i] = Item.arguments[i];
}


function Fecha(lan) {


if (lan=='es') {



var ndia  = new Item('Domingo', 'Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado');



var nmes  = new Item('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 



'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');



}



else



if (lan=='eng') {



var ndia  = new Item('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');



var nmes  = new Item('January', 'February', 'March', 'April', 'May', 'June', 



'Jule', 'August', 'September', 'October', 'November', 'December');



}



else



if (lan=='fr') {



var ndia  = new Item('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi');



var nmes  = new Item('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 



'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');



}







var ahora;



var fecha = new Date();



var ano   = fecha.getYear();



var mes   = fecha.getMonth();



var dia   = fecha.getDay();



var aux   = "" + fecha;



if (ano<10) { ano2 = "200" + eval(ano) }



else if (ano<80) { ano2 = "20" + ano } 



else if (ano<=99) { ano2 = "19" + ano }



else if (ano<1000) { ano2 = eval(ano) + eval(1900) }



else { ano2 = ano }



ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " " + nmes[mes] + " " + ano2;



return ahora;



}











function change_lan(i,s,p)



{



if (s==0)



{ document.location.href="index.php?lan="+i+"&s="+s+"&p="+p;	 }



else 



{ document.location.href="indexnav.php?lan="+i+"&s="+s+"&p="+p;	 }



}







function change_lan2(i)



{



if (i=="es")



{ document.location.href="index2.php?lan=es";	 }



else if (i=="eng")



{ document.location.href="index.php?lan=eng";	 }



else if (i=="fr")



{ document.location.href="index.php?lan=fr";	 }



}











//selecciona ficha de producto



function change_prod(idp,lan,s,p)



{



if (idp=="0")



{ 



//if (lan="es") { alert('Seleccione un producto dentro de esta opción'); }

//else if (lan="eng") { alert('Select a product from this option'); }

//else if (lan="fr") { alert('Select a product from this option'); }





}



else 



{ 



//alert('id='+idp);



//alert('lan='+lan);



//alert('s='+s);



//alert('p='+p);



document.location.href='indexnav.php?lan='+lan+'&s='+s+'&p='+p+'&id='+idp;



 }







}















// Script to create a drop-down menu effect using layers.



//(c)Copyright Daren Craddock 2002



//You may use this code in any application, no limits,



//provided that you acknowledge Daren Craddock as the originator.



// big() makes selected layer longer (height property)







function big(lyr) {



document.all[lyr].style.height='90px';



document.all[lyr].style.border='1px solid #FFFFFF';







 }







/* small() makes selected layer shorter (height property)*/







function small(lyr) {



document.all[lyr].style.height='32px';



document.all[lyr].style.border='none';



document.link2.src='img/txt/t2_off.gif';



}







/* start() makes all layers short to start with (height property)*/







function start() {







document.all.Layer1.style.height='32px'; }















function preload(imgObj,imgSrc) {



	eval(imgObj+' = new Image()')



	eval(imgObj+'.src = "'+imgSrc+'"')



}







// donde: 



//



// imgObj - el nombre del objeto asociado con la imagen 



// imgSrc - la fuente nombre del fichero (url) de la imagen 



// Ejemplos: 



//



// preload('imageA','imageA.gif')



// preload('imageB','imageB.gif')







function aleatorio(inferior,superior){ 



    numPosibilidades = superior - inferior 



    aleat = Math.random() * numPosibilidades 



    aleat = Math.round(aleat) 



    return parseInt(inferior) + aleat 



} 



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features)

}




































