// JavaScript Document
<!--
var apagando,prendiendo;
var nombre = navigator.appName;
var velocidadOpacidad=2;
var velocidadWidth=1;
if (nombre == "Microsoft Internet Explorer"){
	velocidadOpacidad=5;
	velocidadWidth=2;}
	
var hilo;
var opacidad=0;

$(function() {
    if (jQuery.browser.msie)
        $('img[src$=.png]').each(function() {
            this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.src+",sizingMethod='scale')";
            });
});


function signal(elemento){
 	pila=document.getElementById(elemento);
	pila.childNodes[1].style.border="1px solid #990000";	}
	
function unsignal(elemento){
 	pila=document.getElementById(elemento);
	pila.childNodes[1].style.borderLeft="0px";
	pila.childNodes[1].style.borderTop="0px";
	pila.childNodes[1].style.borderRight="1px solid #ccc";
	pila.childNodes[1].style.borderBottom="1px solid #ccc";}
	
function creciendo(imagen,size){
	if(!window.hilo) {
		if (!apagando) {
   			objeto_imagen = imagen;
			tama=size
			prendiendo = setInterval( "aumentando(objeto_imagen,tama)", 40 );}
		}
}
function menguando(imagen,size){
   if (!prendiendo){ 
    objeto_imagen = imagen;  
	tama=size
        apagando = setInterval( "reduciendo(objeto_imagen,tama)", 40 );}
}

function aumentando(imagen,size){
     if ( imagen.width < size ){  imagen.width += velocidadWidth; }else { clearInterval(prendiendo);prendiendo=0;}
}

function reduciendo(imagen,size){  
     if ( imagen.width > size ) { imagen.width -= velocidadWidth; }else{ clearInterval(apagando);apagando=0;}
}
function apareciendo(imagen){
	clearInterval(hilo);
	imagen.style.opacity=".0";
	imagen.style.filter="alpha(opacity=0)";
	imagen.style.display="block";
	objeto_imagen=imagen;
	hilo=setInterval("apareciendo_time(objeto_imagen)",10);
}
function apareciendo_time(imagen){
  opacidad+=velocidadOpacidad;
  opacidadFireFox=opacidad/100;
  imagen.style.opacity=opacidadFireFox;
  imagen.style.filter="alpha(opacity="+opacidad+")";  
  if (opacidad>99) {
   clearInterval(hilo);
   hilo=0;
   imagen.style.opacity="1";
  imagen.style.filter="alpha(opacity=100)";
  imagen.childNodes[1].style.display="block";
  opacidad=0;
   return;

}}

function mueveelemento(elemento,posx,posy){
 	pila=document.getElementById(elemento);
	pila.childNodes[1].style.top=posy;
	pila.childNodes[1].style.left=posx;
}

function muestraelemento(elemento){
 	pila=document.getElementById(elemento);
	apareciendo(pila);
	
	}
function ocultaelemento(elemento){
 	pila=document.getElementById(elemento);
	pila.childNodes[1].style.display="none";}

$(document).ready(function() {
    $('#slideshow').cycle();
});
$(document).ready(function() {
    $('#anuncio').cycle();
});
function empieza(){
var arg=empieza.arguments;
salina=setTimeout("muestraelemento('"+arg[0]+"')",1000);
alcalina=setTimeout("muestraelemento('"+arg[3]+"'),mueveelemento('"+arg[0]+"','"+arg[1]+"','"+arg[2]+"')",5000);
recargable=setTimeout("muestraelemento('"+arg[6]+"'), mueveelemento('"+arg[3]+"','"+arg[4]+"','"+arg[5]+"')",9000);
purenergy=setTimeout("muestraelemento('"+arg[9]+"'), mueveelemento('"+arg[6]+"','"+arg[7]+"','"+arg[8]+"')",13000);
purenergy=setTimeout("mueveelemento('"+arg[9]+"','"+arg[10]+"','"+arg[11]+"')",17000);
clearTimeout();

}
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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\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+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
var ELEMENT_NODE = 1;
var navegador=navigator.appName;

function importXML(fichero,tag)
{
  var xmlhttp = new window.XMLHttpRequest();
    if (navegador!="Microsoft Internet Explorer")
    {
		
		xmlhttp.open("GET",fichero,false);
		xmlhttp.send(null);
		var xmlDoc = xmlhttp.responseXML.documentElement;
        //xmlDoc = document.implementation.createDocument("", "", null);
       // xmlhttp.onload = function(){
  var labels = xmlDoc.getElementsByTagName(tag);
  var span=document.createElement('span');
  span.className='joyerias_nombre';
  for (i=0; i < labels.length; i++)
  {
   	var enlace=document.createElement('A');
	
	enlace.setAttribute('href',labels[i].childNodes[2].firstChild.nodeValue);
    var cdata = document.createTextNode(labels[i].childNodes[1].firstChild.nodeValue);
	if (tag=="feria"){
		var img=document.createElement('img');
		img.setAttribute('src',labels[i].childNodes[4].firstChild.nodeValue);
		enlace.appendChild(img)
		var p=document.createElement('p');
		var fecha=document.createTextNode(labels[i].childNodes[3].firstChild.nodeValue);
	}
	enlace.appendChild(cdata);
	span.appendChild(enlace);
	if (tag=="feria"){
		p.className='joyerias_direccion';
		p.appendChild(fecha);
		span.appendChild(p);
	}
       }
  document.getElementById('lista').appendChild(span);}
    
    else if (window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.onreadystatechange = function () {
            if (xmlDoc.readyState == 4){
  var span=document.createElement('span');
  span.className='joyerias_nombre';
  for (i=0; i < labels.length; i++)
  {
   	var enlace=document.createElement('A');
	
	enlace.setAttribute('href',labels[i].childNodes[1].firstChild.nodeValue);
    var cdata = document.createTextNode(labels[i].childNodes[0].firstChild.nodeValue);
	if (tag=="feria"){
		var img=document.createElement('img');
		img.setAttribute('src',labels[i].childNodes[3].firstChild.nodeValue);
		enlace.appendChild(img)
		var p=document.createElement('p');
		var fecha=document.createTextNode(labels[i].childNodes[2].firstChild.nodeValue);
	}
	enlace.appendChild(cdata);
	span.appendChild(enlace);
	if (tag=="feria"){
		p.className='joyerias_direccion';
		p.appendChild(fecha);
		span.appendChild(p);
	}
       }
  document.getElementById('lista').appendChild(span);}

     }
     xmlDoc.load(fichero);   }
    else
    {
        alert('Your browser can\'t handle this script');
        return;
    }

}    

