
function utf8_encode ( argString ) {
    // Encodes an ISO-8859-1 string to UTF-8  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/utf8_encode
    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: sowberry
    // +    tweaked by: Jack
    // +   bugfixed by: Onno Marsman
    // +   improved by: Yves Sucaet
    // +   bugfixed by: Onno Marsman
    // +   bugfixed by: Ulrich
    // *     example 1: utf8_encode('Kevin van Zonneveld');
    // *     returns 1: 'Kevin van Zonneveld'
    var string = (argString+''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
 
    var utftext = "";
    var start, end;
    var stringl = 0;
 
    start = end = 0;
    stringl = string.length;
    for (var n = 0; n < stringl; n++) {
        var c1 = string.charCodeAt(n);
        var enc = null;
 
        if (c1 < 128) {
            end++;
        } else if (c1 > 127 && c1 < 2048) {
            enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128);
        } else {
            enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128);
        }
        if (enc !== null) {
            if (end > start) {
                utftext += string.substring(start, end);
            }
            utftext += enc;
            start = end = n+1;
        }
    }
 
    if (end > start) {
        utftext += string.substring(start, string.length);
    }
 
    return utftext;}
	
function utf8_decode ( str_data ) {
    // Converts a UTF-8 encoded string to ISO-8859-1  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/utf8_decode
    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
    // +      input by: Aman Gupta
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Norman "zEh" Fuchs
    // +   bugfixed by: hitwork
    // +   bugfixed by: Onno Marsman
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: utf8_decode('Kevin van Zonneveld');
    // *     returns 1: 'Kevin van Zonneveld'
    var tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0;
    
    str_data += '';
    
    while ( i < str_data.length ) {
        c1 = str_data.charCodeAt(i);
        if (c1 < 128) {
            tmp_arr[ac++] = String.fromCharCode(c1);
            i++;
        } else if ((c1 > 191) && (c1 < 224)) {
            c2 = str_data.charCodeAt(i+1);
            tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
            i += 2;
        } else {
            c2 = str_data.charCodeAt(i+1);
            c3 = str_data.charCodeAt(i+2);
            tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            i += 3;
        }
    }
 
    return tmp_arr.join('');
}


function navegador(){
	var navegador;
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var is_safari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
	if (is_chrome) {navegador="0";}
	else {navegador="1";}
	}
	
function video(contenidoVideo) {
$contenidov = ' <div id="container"><a id="movie1" href="http://www.peseta.org/images/videos/'+contenidoVideo+'">'+contenidoVideo+'</a></div><script>';
$contenido = document.getElementById("itemImageBlock");
$contenido.innerHTML=$contenidov;
}

function numeroimagenesvm (num) {
	$numeroimagenesvm = num;
	}
function cargando() {
if ($imagenvm.complete) {initLoupe("grande");}
else setTimeout("cargando()", 100);
}
function cogevalor() {
$valor = document.getElementById("selecciona");
$seleccion = $valor.value;
$especificaciones="top=0, left=0, toolbar=no,location=no, status=no,menubar=no,scrollbars=no, resizable=no, width=400,height=400";
$el_url = "http://www.peseta.org/index.php?option=com_comprofiler&task=registers&Itemid=48&lang=es&form=" + $seleccion;
$titulo="registro";
window.open($el_url,"_self",$titulo,$especificaciones); 
}
function desaparece(ancho) {
$capaimagen = document.getElementById("peque");
//$capaimagen.src = "";
if ($capaimagen.style.opacity ==1) {
$capaimagen.style.opacity = 0;
$capaimagen.style.filter= 'alpha(opacity = 0)';}
else {
$capaimagen.style.opacity = 1;
$capaimagen.style.filter= 'alpha(opacity = 100)';	
	}
$zoomo = document.getElementById("jqzoom");
$zoomo.style.cursor = "crosshair";
}
function aparece(imagen) {
$capaimagen = document.getElementById("peque");
$capaimagen.style.opacity = 1;
$capaimagen.style.filter = 'alpha(opacity=100)';
$zoomo = document.getElementById("jqzoom");
$zoomo.style.cursor = "pointer";
}
function damealturacontenedor() {
$cont = document.getElementById("contenedor");
}
function cambiarImagen(ruta,num,tienezoom,imagenzoom) {
	
$capafantasma = '<div id="grande" style="height:480px; overflow:hidden;"><div align="left" id="content" style="z-index:1000;"><a style="width:480px;" href="" class="jqzoom" id="jqzoom"><img oncontextmenu="alert(\'Opcion deshabilitada\');return false" oncopy="alert(\'Opcion deshabilitada\');return false" id="peque" style="opacity:1;" src="" onclick="javascript:desaparece()" onMouseOut="javascript:aparece()" border="0" height="480" /></a></div><div style="width:480px; height:480px; position:relative; background-color:#bbbbbb; z-index: 700; opacity:0.1; top:-480px;"></div></div>';
$capafantasmasinzoom = '<div id="grande" style="height:480px; overflow:hidden;"><div align="left" id="content" style="z-index:1000;"><a style="width:480px; cursor:move;" href="" class="jqzoom" id="jqzoom"><img oncontextmenu="alert(\'Opcion deshabilitada\');return false" oncopy="alert(\'Opcion deshabilitada\');return false" id="peque" style="opacity:1;" src="" border="0" height="480" /></a></div><div style="width:480px; height:480px; position:relative; background-color:#bbbbbb; z-index: 700; opacity:0.1; top:-480px;"></div></div>';


if (tienezoom=="1") {
//	$restaura = document.getElementById("restaura").innerHTML;
	$restaura = $capafantasma;
	}
else {	$restaura = $capafantasmasinzoom;	}
//$restaura = document.getElementById("restaura").innerHTML;
$contenido = document.getElementById("itemImageBlock");
$contenido.innerHTML = $restaura;
//$contenido.getElementById("grande").style.height = 480px;
//$imagenvm = document.images["peque"];
$imagenvm = document.getElementById("peque");

for (i=1; i<=$numeroimagenesvm; i++){

	if (i == num) {
		$numeroimagenactiva = i;
		$numerito = "imagennum"+i;		
		$td = document.getElementById($numerito);
		$rutanum = "http://www.peseta.org/images/numero/numa"+i+".jpg"
		$td.src =  $rutanum;
		}
	else {
		$numerito = "imagennum"+i;
		$td = document.getElementById($numerito);
		$rutanum = "http://www.peseta.org/images/numero/num"+i+".jpg"
		$td.src = $rutanum;
		}
	}

$imagenvm.src = ruta;
$imagenvm.height = 480;
$imagenvm.width = 480;
$ajqzoom = document.getElementById("jqzoom");
$ajqzoom.href = imagenzoom;
$(function() {

	$(".jqzoom").jqzoom();
});

//alert($ajqzoom.href);
///peseto/components/com_virtuemart/shop_image/product/
//cargando();
}
function ajustaalturas() {
	var $mayor = 0;
	var $mayortitulo = 0;
	var $tabla;
	$nombre ="";
	$altura = 0;
	$alturatitulo = 0;
	/****************************/
	for(i=0; i<4; i++){

		$nombretitulo ="titulocategoria"+i;
		$tablatitulo = document.getElementById($nombretitulo);
		$alturatitulo = $tablatitulo.offsetHeight;		
		if ($mayortitulo <= $alturatitulo) {$mayortitulo = $alturatitulo;}		
		}

		$mayortitulo = $mayortitulo;
		for(i=0; i<4; i++){		
		$nombre = "titulocategoria"+i;
		$tabla =document.getElementById($nombre);		
		$tabla.height = $mayortitulo;			
		}
/*************************************************/
	for(i=0; i<4; i++){

		$nombre = "textocategoria"+i;
		$tabla =document.getElementById($nombre);
		$altura = $tabla.offsetHeight;		
		if ($mayor <= $altura) {$mayor = $altura;}				

		}
		$mayor = $mayor + 4;
	for(i=0; i<4; i++){
		
		$nombre = "textocategoria"+i;
		$tabla =document.getElementById($nombre);		
		$tabla.height = $mayor;	

		}

	
	}
function une (imagen){
$banners[$contadorarray] = imagen;
//alert ($banners[$contadorarray]);
$contadorarray++;
}
function unelinks (links){
$bannerslinks[$contadorarraylinks] = links;
//alert ($banners[$contadorarray]);
$contadorarraylinks++;
}
function unetextos (textos){

$bannerstextos[$contadorarraytextos] = textos;

//alert ($banners[$contadorarray]);
$contadorarraytextos++;
}
function uneids (ids){

$bannersids[$contadorarrayids] = ids;

//alert ($banners[$contadorarray]);
$contadorarrayids++;
}
function colapse(){

$capa = document.getElementById("itemImageBlock");
$video = document.getElementById("capavideo");
$capa.style.visibility = "hidden";
$video.left = $capa.offsetLeft;
$video.top = $capa.offsetTop;
$video.style.visibility = "visible";
}
function hola(imagenNueva,num) {	

cambianumerosk2(num);
$actual = num;
$capa = document.getElementById("itemImageBlock");
$video = document.getElementById("capavideo");
$imagen = document.getElementById("imagengrande");
if ($imagen == null) {$imagen = document.getElementById("imagengrandegaleria1");}
if ($capa!=null) {$capa.style.visibility = "visible";}
if ($video!=null) { $video.style.visibility = "hidden";}
$imagen.src=imagenNueva;
$numeo = "imagennum"+num;
$numero = document.getElementById($numeo);
$pie = document.getElementById("piefoto");
var $MiMatriz = $numero.title.split("¿");
$titulo = $MiMatriz[0];
$enlace = $MiMatriz[1];
$lace = document.getElementById("enlace");
$lace.href = $enlace;
$pie.innerHTML = $titulo;

}




function dameprimeraimagen(){
$fuente = document.getElementById("imagennum1");
$acargar = $fuente.name;
hola($acargar,'1');
}

function activamenu(elm){

	var arrayclases = new Array();
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");

	arrayclases = getElementByClassProductos("mainlevel_menu",document.getElementById("mainmenu"),elm);	
	
	//arraytag = document.getElementById("mainmenu").getElementsByTagName("*");
	
	}
function activamenuprensa(elm){

	var arrayclases = new Array();
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");

	arrayclases = getElementByClassProductos("mainlevel_submenu",document.getElementById("mainmenu"),elm);	
	
	//arraytag = document.getElementById("mainmenu").getElementsByTagName("*");
	
	}
function activasubmenu(elemento){
	var subarrayclases = new Array();
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");
	subarrayclases = getElementByClassSubmenu("ThemeOfficeMainItemText",document.getElementById("submenu"),elemento);		
	}
function activasubmenuver(elemento){
	var subarrayclases = new Array();
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");
	subarrayclases = getElementByClassSubmenu("ver",document.getElementById("submenu"),elemento);		
	}

function activasubmenupeseta(elemento){
	var subarrayclases = new Array();	
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");
	subarrayclases = getElementByClassSubmenu("mainlevel_submenu",document.getElementById("submenu"),elemento);		
	subarrayclases2 = getElementByClassSubmenu("mainlevel_menu",document.getElementById("mainmenu"),'peSeta');	
	}	
function activasubmenucolaboraciones(elemento){
	var subarrayclases = new Array();	
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");
//	subarrayclases = getElementByClassSubmenu("mainlevel_submenu",document.getElementById("submenu"),elemento);	
	$submenu = document.getElementById("submenu");
	if (document.getElementById("active_menu_submenu")==null) {subarrayclases = getElementByClassSubmenuColaboraciones("mainlevel_submenu",document.getElementById("submenu"),elemento);}
	subarrayclases2 = getElementByClassSubmenu("mainlevel_menu",document.getElementById("mainmenu"),'colaboraciones');
	subarrayclases2 = getElementByClassSubmenu("mainlevel_menu",document.getElementById("mainmenu"),'collaborations');

	}
function activasubmenunoticias(elemento){
	var subarrayclases = new Array();	
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");
	subarrayclases = getElementByClassSubmenuNoticias("ultimas",document.getElementById("submenu"),elemento);	
	}
	
function activasubsubmenu(elemento){
	var subarrayclases = new Array();
	//arrayclases = getElementsByClassName(document.getElementById("mainmenu"),"*","mainlevel_menu");
	subsubarrayclases = getElementByClassSubsubmenu("perraco",document.getElementById("subsubmenu"),elemento);		
	}

var allHTMLTags = new Array();
var allHTMLTagsProductos = new Array();
var allHTMLTagssubProductos = new Array();

function getElementByClassSubmenuNoticias(theClass,elm,elemento) {
if (elemento == "es") {$nombre = "&uacute;ltimas noticias";}
if (elemento == "en") {$nombre = "latest news";}
if (elemento == "ca") {$nombre = "derni&egrave;res nouvelles";}


//Create Array of All HTML Tags
var allHTMLTagsProductos=elm.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTagsProductos.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTagsProductos[i].className==theClass) {
allHTMLTagsProductos[i].innerHTML='<span style="color:#000000;">'+$nombre+'</span>';
}
}
}
function getElementByClassSubmenuColaboraciones(theClass,elm,elemento) {
if (elemento == "es") {$nombre = "&uacute;ltimas colaboraciones";}
if (elemento == "en") {$nombre = "latest collaborations";}
if (elemento == "ca") {$nombre = "derni&egrave;res collaborations";}

//Create Array of All HTML Tags
var allHTMLTagsProductos=elm.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTagsProductos.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTagsProductos[i].className==theClass) {
allHTMLTagsProductos[i].innerHTML='<span style="color:#000000;">'+$nombre+'</span>';
return;
}
}
}

function activacolaboraciones(colabora) {
	getElementByClassSubmenuColabora(colabora);
	}
function getElementByClassSubmenuColabora(colabora) {

var allHTMLTags=document.getElementsByTagName("*");

for (i=0; i<allHTMLTags.length; i++) {

if (allHTMLTags[i].className=="mainlevel_submenu") {
	//alert ("colabora"+colabora+"allHTMLTags[i].innerHTML"+allHTMLTags[i].innerHTML);
if (allHTMLTags[i].innerHTML == colabora) {	
allHTMLTags[i].innerHTML='<span style="color:#000000;">'+colabora+'</span>';
}
}
}
}


function getElementByClassSubmenu(theClass,elm,elemento) {

//Create Array of All HTML Tags
var allHTMLTagsProductos=elm.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTagsProductos.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTagsProductos[i].className==theClass) {
if (allHTMLTagsProductos[i].innerHTML==elemento) {	allHTMLTagsProductos[i].innerHTML='<span style="color:#000000;">'+elemento+'</span>';}
}
}
}

function getElementByClassSubsubmenu(theClass,elm,elemento) {


//Create Array of All HTML Tags
var allHTMLTags=elm.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className==theClass) {
if (allHTMLTags[i].innerHTML==elemento) {allHTMLTags[i].innerHTML='<span style="color:#000000;">'+elemento+'</span>';}
}
}
}


function getElementByClassProductos(theClass,elm,elemento) {

//Create Array of All HTML Tags
var allHTMLTags=elm.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className==theClass) {//alert (allHTMLTags[i].innerHTML);
if (allHTMLTags[i].innerHTML==elemento) {allHTMLTags[i].innerHTML='<span style="color:#000000;">'+elemento+'</span>';}
}
}
}

function desactivazoom() {
	alert("desactivazoom");
	$imagenzoom = document.getElementById("peque");	
	
	$imagenzoom.onclick = function() {$imagenzoom.onmouseout;};
	$contenedor = document.getElementById("jqzoom");
	$contenedor.innerHTML = "<img name=\""+$imagenzoom.name+"\" oncontextmenu=\"alert('Opcion deshabilitada');return false\" oncopy=\"alert('Opcion deshabilitada');return false\" id=\"peque\"  src=\""+$imagenzoom.src+"\" border=\"0\" height=\"480\" />";
	
	
	
}
	
function activazoom() {
	$imagenzoom = document.getElementById("peque");


	}
function cambianumero(numero) {
	
	$rutanum = "http://www.peseta.org/images/numero/numa"+numero+".jpg"
	$numero = "imagennum"+numero;
	$numimg = document.getElementById($numero);
	$numimg.src = $rutanum;
	
	
	}
function vuelve( numero) {
	//alert(ruta);
	if (numero ==$numeroimagenactiva ) {$rutanum = "http://www.peseta.org/images/numero/numa"+numero+".jpg";}
	else {$rutanum = "http://www.peseta.org/images/numero/num"+numero+".jpg"}
	$numero = "imagennum"+numero;
	$numimg = document.getElementById($numero);
	$numimg.src = $rutanum;
	}
function getElementByClassNumeros(theClass,elm) {
var $numero = 0;
//Create Array of All HTML Tags

var allHTMLTags=elm.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {
	
//Get all tags with the specified class name.
if (allHTMLTags[i].className==theClass) {
$numero++;
if ($numero == 1){
$idnumero = "http://www.peseta.org/images/numero/numa"+$numero;
}
else {
$idnumero = "http://www.peseta.org/images/numero/num"+$numero;}
$cadenaoriginal = allHTMLTags[i].href; 
$cadenacortada = $cadenaoriginal.substring(0,$cadenaoriginal.length-2);
$cadenanueva = $cadenacortada+"','"+$numero+"')";
allHTMLTags[i].href = $cadenanueva;
allHTMLTags[i].innerHTML='<img onmouseover="ponover('+$numero+')" onmouseout="quitaover('+$numero+')" id="numerito'+$numero+'" width="19" height="19" src="'+$idnumero+'.jpg" />';
allHTMLTags[i].id = "imagennum"+$numero;

}
}
}
function cambianumeros() {
	var arrayclases = new Array();
	arrayclases = getElementByClassNumeros("numero",document.getElementById("cadenanumeros"));
	dameprimeraimagen();
	
	}
function cambianumerosnoticias() {

	var arrayclases = new Array();
	var arrayclasess = new Array();	
	$noticias = document.getElementById("cadenanumeros1");
	arrayclases = getElementByClassNumeros("numero",document.getElementById("cadenanumeros1"));	
	cambianumerosnoticias2();
	
	
	}
function cambianumerosnoticias2() {	
	var arrayclases = new Array();
	var arrayclasess = new Array();	
	$noticias = document.getElementById("cadenanumeros2");
	arrayclases = getElementByClassNumeros("numero",document.getElementById("cadenanumeros2"));	
	//dameprimeraimagen();
	cambiaholanoticias();	
	}
	
	
function cambiaholanoticias() {
	var allHTMLTogs = new Array();
	$elm = document.getElementById("cadenanumeros1");
	allHTMLTogs = $elm.getElementsByTagName("*");
	for (i=0; i<allHTMLTogs.length; i++) {		
	if (allHTMLTogs[i].className=="numero") {
		$cadenaoriginal = allHTMLTogs[i].href;
		$cadenacortada = $cadenaoriginal.substring(15,$cadenaoriginal.length);
		$nuevacadena = "javascript:holanoticias" + $cadenacortada;
		allHTMLTogs[i].href = $nuevacadena;
		}
	}
	cambiaholanoticias2();	
	}
function cambiaholanoticias2() {
	var allHTMLTogs = new Array();
	$elm = document.getElementById("cadenanumeros2");
	
	allHTMLTogs = $elm.getElementsByTagName("*");
	for (i=0; i<allHTMLTogs.length; i++) {		
	if (allHTMLTogs[i].className=="numero") {
		$cadenaoriginal = allHTMLTogs[i].href;
		$cadenacortada = $cadenaoriginal.substring(15,$cadenaoriginal.length);
		$nuevacadena = "javascript:holanoticias2" + $cadenacortada;
		allHTMLTogs[i].href = $nuevacadena;
		}
	}
	}

function cambianumerosk2 (num) {	
	for (i=0; i<$numeroimagen; i++) {
		$suma = i + 1;
		$siguiente  = "numerito"+$suma;
		$actual = document.getElementById($siguiente);
		if ($suma == num) {
			$actual.src = "http://www.peseta.org/images/numero/numa"+$suma+".jpg";
			}
		else {$actual.src = "http://www.peseta.org/images/numero/num"+$suma+".jpg";}
		}
	}
	
function poninfo (texto, nada, titulo) {	
	$textoinfo = document.getElementById("textoinfo");
	$tituloinfo = document.getElementById("tituloinfo");
	$cuerpo = document.getElementById("cuerpo");
	$cuerpo.style.paddingTop = "6px";
	$textoinfo.innerHTML = texto;
	$tituloinfo.innerHTML = titulo;
	}
function poninfo2 (texto, nada, titulo) {	
	$textoinfo = document.getElementById("textoinfo");
	$tituloinfo = document.getElementById("tituloinfo");
	$cuerpo = document.getElementById("cuerpo");
	$cuerpo.style.paddingTop = "6px";
	$textoinfo.innerHTML = texto;
	$textoinfo.style.color = "#FF9D00";
	titulo = "&iexcl;alerta! campos inv&aacute;lidos u obligatorios"
	$tituloinfo.innerHTML = titulo;
	}
function holanoticias(imagenNueva,num) {

$imagen = document.getElementById("imagengrandegaleria1");
$imagen.src=imagenNueva;
}
function holanoticias2(imagenNueva,num) {

$imagen = document.getElementById("imagengrandegaleria2");
$imagen.src=imagenNueva;
}

function valida_envia(){
    //valido el nombre
 

    //valido la edad. tiene que ser entero mayor que 18
    $precio = document.fvalida.product_id.value;
	$precio = parseInt ($precio) + parseInt(73);	
	document.fvalida.product_id.value = $precio;

 	document.fvalida.action = "index.php?page=shop.product_details&amp;flypage=flypagepeSeta.tpl&amp;category_id=30&amp;option=com_virtuemart&amp;Itemid=20&amp;lang=es";
    //el formulario se envia

    document.fvalida.submit(); 
}
function ajustaalturadatos() {
	$cesta = document.getElementById("cesta");
	$comprador = document.getElementById("datoscomprador");
	$cantidad = (-(283+($cesta.offsetHeight-264)));
	$cantidad = $cantidad +"px";

	$comprador.style.top = $cantidad;
//	alert ($comprador.style.top);
//alert ($cesta.offsetHeight);
	
	}
function cambiaover(icono) {
	$icono = document.getElementById(icono);
	$icono.style.background = "url(http://www.peseta.org/components/com_k2/images/social/over/"+icono+".png)";
	}
function cambiaout(icono) {
	$icono = document.getElementById(icono);
	$icono.style.background = "url(http://www.peseta.org/components/com_k2/images/social/"+icono+".png)";
	}
function ponimagenlink(){
	getElementByClass("linkamarillo","document");
	}
function getElementByClass(theClass,elm,elemento) {

var allHTMLTags=document.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className==theClass) {
$nombre = allHTMLTags[i].innerHTML;
allHTMLTags[i].innerHTML='<table cellpadding="0" cellspacing="0"><tr><td><span>'+$nombre+'</span></td>'+'<td><img width="11px" height="11px" style="border:0px" src="http://www.peseta.org/images/icono-enlace.png"></td></tr></table>';
}
}
}
function ponover(icono) {
	if ($actual!=icono) {
	$imagen = "numerito"+icono;
	$img = document.getElementById($imagen);
	$img.src = "http://www.peseta.org/images/numero/numa"+icono+".jpg";}

	}
function quitaover(icono) {
		if ($actual!=icono) {
	$imagen = "numerito"+icono;
	$img = document.getElementById($imagen);
	$img.src = "http://www.peseta.org/images/numero/num"+icono+".jpg";}
	
	}
function ajustaiconos(lenguaje, navegador){
	
	$check = document.getElementById("acceptedterms");
	$check.style.width = "20px";
	$icono1 = document.getElementById("icono");
	$icono2 = document.getElementById("icono2");
	
	if (navegador.indexOf('Mac')!=-1) {
	if (lenguaje =="es") {
	$cantidad = $icono1.offsetLeft-340;}
	else {if (lenguaje=="ca") {$cantidad = $icono1.offsetLeft-368;}
	else {if (lenguaje=="en") {$cantidad = $icono1.offsetLeft-363;}
	else {$cantidad = $icono1.offsetLeft-340;}
	}
	
	}	
		}
	else {
	if (lenguaje =="es") {
	$cantidad = $icono1.offsetLeft-344;}
	else {if (lenguaje=="ca") {$cantidad = $icono1.offsetLeft-380;}
	else {if (lenguaje=="en") {$cantidad = $icono1.offsetLeft-370;}
	else {$cantidad = $icono1.offsetLeft-344;}}
	
	}}
	$icono2.style.left = $cantidad+"px";

	}

	
var hide= false;	
function show_dropdown(){
		if(!hide) document.getElementById("dd_list").style.visibility="visible";
		hide= false;
		//document.getElementById("dd_text").value=121;
	}	
function cambiaText(val){
		hide=true;
		hide_list();
		document.getElementById("dd_text").value=val;

		
	}
function hide_list(){
		document.getElementById("dd_list").style.visibility="hidden";
	}
function cambiaeur(){
	
var allHTMLTags=document.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className=="eur") {
$coneur = allHTMLTags[i].innerHTML;
$cadenacortada = $coneur.substring(0,$coneur.length-3);
$cadenacortada = $cadenacortada + "&euro;";
allHTMLTags[i].innerHTML=$cadenacortada;}

if (allHTMLTags[i].className=="euro") {
$coneur = allHTMLTags[i].innerHTML;
$cadenacortada = $coneur.substring(0,$coneur.length-12);
$cadenacortada = $cadenacortada + "&euro;</strong>";
allHTMLTags[i].innerHTML=$cadenacortada;}

if (allHTMLTags[i].className=="eure") {
$coneur = allHTMLTags[i].innerHTML;
$cadenacortada = $coneur.substring(0,$coneur.length-9);
$cadenacortada = $cadenacortada + "&euro;</div>";
allHTMLTags[i].innerHTML=$cadenacortada;}
}

	}
	
function quitapuntero(){

var allHTMLTags=document.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className=="ThemeOfficeMainItemText") {
$coneur = allHTMLTags[i].innerHTML;

if ($coneur == "colaboraciones") {
allHTMLTags[i].innerHTML="<span style='cursor:default;'>"+$cadenacortada+"</span>";}
}
}
	}
	

function sobre(){
document.getElementById("actualizar").src="http://www.peseta.org/components/com_virtuemart/themes/peSeta/images/visto_bueno_o.jpg";
}
function fuera(){
document.getElementById("actualizar").src="http://www.peseta.org/components/com_virtuemart/themes/peSeta/images/update_quantity_cart.png";
}

function cajonin(elm, img) {
	$imagen = document.getElementById(elm);
	$imagen.src = 'http://www.peseta.org/images/'+img+'_o.jpg';
	}
function cajonout(elm, img) {
 	$imagen = document.getElementById(elm, img);
	$imagen.src = 'http://www.peseta.org/images/'+img+'.jpg';
	}
function cambiai() {
	$ii = document.getElementById('ii');
	$ii.src="images/bot_i_o.jpg"
	}
function cambiaio() {
	document.getElementById('ii');
	$ii.src="images/bot_i.jpg"	
	}
function cambiad() {
	$dd = document.getElementById('dd');
	$dd.src="images/bot_d_o.jpg"
	}
function cambiado() {
	$dd = document.getElementById('dd');
	$dd.src="images/bot_d.jpg"
	
	}