var maxtexT = 400;
function getElementsByClassName(strClass, strTag, objContElm) {
  strTag = strTag || "*";
  objContElm = objContElm || document;
  var objColl = objContElm.getElementsByTagName(strTag);
  if (!objColl.length &&  strTag == "*" &&  objContElm.all) objColl = objContElm.all;
  var arr = new Array();
  var delim = strClass.indexOf('|') != -1  ? '|' : ' ';
  var arrClass = strClass.split(delim);
  for (var i = 0, j = objColl.length; i < j; i++) {
    var arrObjClass = objColl[i].className.split(' ');
    if (delim == ' ' && arrClass.length > arrObjClass.length) continue;
    var c = 0;
    comparisonLoop:
    for (var k = 0, l = arrObjClass.length; k < l; k++) {
      for (var m = 0, n = arrClass.length; m < n; m++) {
        if (arrClass[m] == arrObjClass[k]) c++;
        if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) {
          arr.push(objColl[i]);
          break comparisonLoop;
        }
      }
    }
  }
  return arr;
}

function mandaURL(url){
	window.location= url;	
}
var MSIE =(navigator.userAgent.match('MSIE')?true:false);

function redirigir(aaa,bbb){
document.write('<meta http-equiv="refresh" content="' + bbb + ';url=./' + aaa + '">');
}
function contador (campo, cuentacampo, limite) {
if (campo.value.length > limite) campo.value = campo.value.substring(0, limite);
else cuentacampo.value = limite - campo.value.length;
} 
function NoAtras(){
history.go(1)
}


function cierramenu(a,b){ 
var elementos = getElementsByClassName(a);
for (var i = 0, j = elementos.length; i < j; i++) {
elementos[i].className = b;
//elementos[i].innerText = elementos[i].innerText.replace(/^(.*)-(.*)/,'$1+$2');
}
} 
function activamenu(a,b){ 
a.className=b;

//a.innerText = a.innerText.replace(/^(.*)\+(.*)/,'$1-$2');
}

var intval = "";
/*var intval2 = "";*/

function limpia_menu(a,b){ 

clearInterval(intval);

/*clearInterval(intval2);*/

intval = setInterval("cierramenu('" + a + "', '" + b + "')",3000);
/*intval2 = setInterval("cierra2(10000)",3000);*/

} 


function confirma(destino,testo){
		
		if(confirm(testo)){
			javascript: window.location.href = destino;
		} 
 
}
function confirmaf(testo){
		
		if(!confirm(testo)){
			return false;
		} 
 
}


function saltaMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}



	function abremenuClass($b){
			var p = document.getElementById($b);
			var u = "auto"; 
			if(p.style.height==u){ u = "18px"; } 
			p.style.height = u;
			p.style.width = h;
	}




function abreDIV(div,styl,val){ 
	var p = document.getElementById(div);
	if(val==0){
		var u = "auto"; 
		if(styl==0){ var pif = p.style.height; }
		if(pif==u){ u = val; }
		if(styl==0){ p.style.height = u; }
	} else if(val==1){
		if(styl==0){ p.style.display = "none"; } else { p.style.display = "block"; }
	}
}






//COMPROBACIÓN DE CAMPOS

//tipo nombre
function validaINPUTS(cadena, nombre) {
	if (cadena==''){
		nombre = nombre.replace(/securedsc66/gi,"");
		window.alert("Por favor, rellene correctamente el campo de texto \"" + nombre +"\""); 
		return false; 
	}
}

function validaCAPT(cadena) {
	if (cadena==''){ 
		window.alert("Por favor, escriba la respuesta a la pregunta que aparece en la confirmación visual"); 
		return false; 
	}
}


function validaTELEF(cadena, nombre,forzado) {	
	if(!forzado && cadena==""){ return true; }
	if ( !cadena.match(/^[0-9]{2,3}-? ?[0-9]{6,9}$/) ){ 
		window.alert("Por favor, escriba un número de teléfono válido en el campo \"" + nombre +"\""); 
		return false; 
	}
}

function validaMAIL(cadena, nombre,forzado) {	
	nombre = nombre.replace(/securedsc66/gi,"");
	if(!forzado && cadena==""){ return true; }
	if (!cadena.match(/^[a-zA-Z0-9\.\_\-]+\@[a-zA-Z0-9\.\_\-]+\.([\D]{2,4})$/)  ){ 
		window.alert("Por favor, escriba una dirección de correo electrónico válida del tipo minombre@misitio.ext en el campo  \"" + nombre +"\""); 
		return false; 
	}
}

function validaI(form){
	var inputses = form.getElementsByTagName("INPUT");
	
	var n = 0;
	while(inputses[n]){
		if(inputses[n].type=="text"){
			nombresito = inputses[n].name.toLowerCase();	
				if(nombresito== "action"){
					
					if(validaCAPT(inputses[n].value)==false){
								return false;
							}
				
				} else if(nombresito=="nombre"){
					if (inputses[n].value.length<4){ 
						window.alert("Por favor, escriba un nombre de usuario válido mayor de 3 caracteres"); 
						return false; 
					}
				}
		} else if(inputses[n].type=="password"){
			if (inputses[n].value.length!=40){ 
				if (!inputses[n].value.match(/^[a-zA-Z0-9]{6,13}$/i)){ 
					window.alert("Por favor, escriba una contraseña válida de entre 6 y 13 caracteres"); 
					return false; 
				}
				inputses[n].value = hex_sha1(inputses[n].value);
			}
		
		}
		
		n++;
	}
}

function validaPASS(cadena) {
				if (!cadena.match(/^[a-zA-Z0-9]{6,13}$/i)){ 
					window.alert("Por favor, escriba una contraseña válida de entre 6 y 13 caracteres"); 
					return false; 
				}
		return true;
}

function validaPas(form){
var inputses = form.getElementsByTagName("INPUT");
	var n = 0;
	while(inputses[n]){
		if((inputses[n].type=="password")&&(inputses[n].value!="")){
			inputses[n].value = hex_sha1(inputses[n].value);
		}
	n++;
	}
}


/*
 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
 * in FIPS 180-1
 * Version 2.2 Copyright Paul Johnston 2000 - 2009.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for details.
 */
var hexcase=0;var b64pad="";function hex_sha1(a){return rstr2hex(rstr_sha1(str2rstr_utf8(a)))}function hex_hmac_sha1(a,b){return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(a),str2rstr_utf8(b)))}function sha1_vm_test(){return hex_sha1("abc").toLowerCase()=="a9993e364706816aba3e25717850c26c9cd0d89d"}function rstr_sha1(a){return binb2rstr(binb_sha1(rstr2binb(a),a.length*8))}function rstr_hmac_sha1(c,f){var e=rstr2binb(c);if(e.length>16){e=binb_sha1(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binb_sha1(a.concat(rstr2binb(f)),512+f.length*8);return binb2rstr(binb_sha1(d.concat(g),512+160))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);b+=f.charAt((a>>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d<c.length){a=c.charCodeAt(d);e=d+1<c.length?c.charCodeAt(d+1):0;if(55296<=a&&a<=56319&&56320<=e&&e<=57343){a=65536+((a&1023)<<10)+(e&1023);d++}if(a<=127){b+=String.fromCharCode(a)}else{if(a<=2047){b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binb(b){var a=Array(b.length>>2);for(var c=0;c<a.length;c++){a[c]=0}for(var c=0;c<b.length*8;c+=8){a[c>>5]|=(b.charCodeAt(c/8)&255)<<(24-c%32)}return a}function binb2rstr(b){var a="";for(var c=0;c<b.length*32;c+=8){a+=String.fromCharCode((b[c>>5]>>>(24-c%32))&255)}return a}function binb_sha1(v,o){v[o>>5]|=128<<(24-o%32);v[((o+64>>9)<<4)+15]=o;var y=Array(80);var u=1732584193;var s=-271733879;var r=-1732584194;var q=271733878;var p=-1009589776;for(var l=0;l<v.length;l+=16){var n=u;var m=s;var k=r;var h=q;var f=p;for(var g=0;g<80;g++){if(g<16){y[g]=v[l+g]}else{y[g]=bit_rol(y[g-3]^y[g-8]^y[g-14]^y[g-16],1)}var z=safe_add(safe_add(bit_rol(u,5),sha1_ft(g,s,r,q)),safe_add(safe_add(p,y[g]),sha1_kt(g)));p=q;q=r;r=bit_rol(s,30);s=u;u=z}u=safe_add(u,n);s=safe_add(s,m);r=safe_add(r,k);q=safe_add(q,h);p=safe_add(p,f)}return Array(u,s,r,q,p)}function sha1_ft(e,a,g,f){if(e<20){return(a&g)|((~a)&f)}if(e<40){return a^g^f}if(e<60){return(a&g)|(a&f)|(g&f)}return a^g^f}function sha1_kt(a){return(a<20)?1518500249:(a<40)?1859775393:(a<60)?-1894007588:-899497514}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<<b)|(a>>>(32-b))};

function validaRADIOS(formulario, nombre) {	


	var opciones = document.getElementsByName(nombre);
	var okeys = false;
	
	for(i=0;i<opciones.length;i++){
		if(opciones[i].checked){ okeys = true; }
	}
	
	if (!okeys){ 
		window.alert("Por favor, selecciona una de la las opciones en \"" + nombre +"\""); 
		return false; 
	}
}

function validaSELECT(cadena, nombre,forzado) {
	if (cadena==""){ 
		if(forzado){
			window.alert("Por favor, elige una opción en el selector desplegable \"" + nombre +"\""); 
			return false;
		} else {
			if(!window.confirm("¿Seguro que no deseas elegir ninguna opción en el selector desplegable \"" + nombre +"\"? \n Cancela para volver al formulario")){
			return false;	
			}
		}
	}
}


function validaTEXTAREA(cadena, nombre,forzado) {
	var maxy = maxtexT;
	nombre = nombre.replace(/securedsc66/gi,"");
	if (cadena.length<20){ 
		if(forzado){
			window.alert("Por favor, escribe un texto con más de 20 caracteres en \"" + nombre +"\""); 
			return false; 
		} else {
			if(!window.confirm("¿Seguro que no deseas eescribir nada más en el campo de texto \"" + nombre +"\"? \n Cancela para volver al formulario")){
			return false;	
			}
		}
	
	} else if (cadena.length>maxy){ 
		window.alert("Por favor, escribe un texto con no más de " + maxy + " caracteres en \"" + nombre +"\""); 
		return false; 
	}
}

//formulario general
//creamos la cadena de envio

function validarFormQuest(forme,quest){
	if(quest==''){ quest = '¿Confirmar cambios?'; }
	
	if(!window.confirm(quest)){
		return false;
	}
	
	return validarForm(forme);
}




function validarForm(formulario) {

	var nueva = "";
	
	//EMPIEZAN LOS INPUTS 
	var telefonos = '|telefono|movil|fijo|celular|';		
	
	var correos = '|e-mail|correo|mail|email|correo-electronico|correoelectronico|';
	
	//var fijos = telefonos + 'nombre|asunto|nombre-completo' + correos;

	
	
	
	inputses = formulario.getElementsByTagName("SELECT");
	
	n = 0;
	while(inputses[n]){
		
	nombresito = inputses[n].name.toLowerCase();
	
	if(nombresito.match(/^F\-[.]*/i)){
			var forzado = true; 
			var nombreReal = nombresito.replace(/^F\-([.]*)/i,"$1");
	} else {
			var forzado = false;	
			var nombreReal = nombresito;
	}
		
				
	
	
							if(validaSELECT(inputses[n].options[inputses[n].selectedIndex].text, nombreReal,forzado)==false){
								return false;
							}
		n++;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	var inputses = formulario.getElementsByTagName("INPUT");
	
	var n = 0;
	var nombresito = "";
	
		
	var aceptado = true;
	var radiocampos = '|';
	var radioK = new Array;
	while(inputses[n]){
	
	//nombresito = inputses[n].name.toLowerCase();
	nombresito = inputses[n].name;
	
	if(nombresito=='conformeley' && inputses[n].checked=="false"){
	aceptado = false;
	} 
	
	
	
	if(nombresito.match(/^F\-[.]*/i)){
			var forzado = true; 
			var nombreReal = nombresito.replace(/^F\-([.]*)/i,"$1");
	} else {
			var forzado = false;	
			var nombreReal = nombresito;
	}
			
			if(inputses[n].type=="text"){
			
				if(nombresito== "actionCAPT"){
				
							if(validaCAPT(inputses[n].value)==false){
								return false;
							}
					
				} else {
					var nombr = '|' + nombreReal + '|'; 
					
							if(telefonos.indexOf(nombr)!=-1){ 
								
									if(validaTELEF(inputses[n].value, nombreReal,forzado)==false){
										return false;
									}
							
							} else if(correos.indexOf(nombr)!=-1){ 
								
									if(validaMAIL(inputses[n].value, nombreReal,forzado)==false){
										return false;
									}
							
							} else if(forzado){
							
									if(validaINPUTS(inputses[n].value, nombreReal)==false){
										return false;
									}
							}
		
					
				}
			
			
			} else if(inputses[n].type=="password"){ 
					if(forzado || inputses[n].value.length>0){
							
							
							if(validaPASS(inputses[n].value)==false){
								return false;
							}
							
							inputses[n].value = hex_sha1(inputses[n].value);

					}
			
				
					
			
			
			} else if(inputses[n].type=="radio"){ 
				
				if((forzado) && (radiocampos.indexOf('|' + nombreReal + '|')==-1)){ 
				
				radiocampos = radiocampos + nombreReal + '|';
				radioK[radioK.length] = nombresito;
				
				}
				
		
				
			}
	n++;
	}
	
		n = 0;
		while(radioK[n]){
				
				if(validaRADIOS(formulario,radioK[n])==false){
										return false;
				}
				
			n++;	
			
		}

	
	

	
	
	
	
	//EMPIEZAN LOS TEXTAREA
	inputses = formulario.getElementsByTagName("TEXTAREA");
	
	n = 0;
	
	while(inputses[n]){
	
	nombresito = inputses[n].name.toLowerCase();	
		
	if(nombresito.match(/^F\-[.]*/i)){
			var forzado = true; 
			var nombreReal = nombresito.replace(/^F\-([.]*)/i,"$1");
	} else {
			var forzado = false;	
			var nombreReal = nombresito;
	}
		
		
						if(forzado){
							if(validaTEXTAREA(inputses[n].value, nombreReal,forzado)==false){
								return false;
							}
						}
		n++;
	}
	

	

	//if(formulario.actionCAPT.text!=   timotkin){ window.alert("Debes introducir correctamente el código de Validación"); return false; }
	
		if(!aceptado){
	alert('Para utilizar este recurso antes debes haber leído y aceptado la claúsula de privacidad');	
	return false;
	}
	
	


return true;
}

//var alertasFull = false;

function clausulas(nombre){
/*if(!alertasFull){
	var selpoint=window.document.selection.createRange();
	selpoint.pasteHTML("<div ID='alertasFull' onclick='clausula_privacidad();'><div ID='alertasFullbox'></div></div>");
	alertasFull = true;
} else {

	alertasFull = false;
}*/
clausula=window.open("./layout/lib/output/clausula_" + nombre + ".php", nombre, "top=10,left=10,height=600,width=400,scrollbars=yes");
 
}


function fija_alto(b,is){
	var d; 
	var f = b.firstChild;
	if(f.offsetHeight){ d = f.offsetHeight; } else if(f.style.pixelHeight){ d = f.style.pixelHeight; } else { return; }
	
	/*if(d>0){*/
	b.style.height = d + 'px';
	b.style.display = "block";
	b.style.overflow = "hidden";
	 eval("faderTim" + is + "[2] = false;");
}

function sacador_last(suerte){
				saca_last(suerte);
			}


//var sacadolast = false;
function saca_last(is,nofade){
	var f = getElementsByClassName('PbuttOn ' + is );
			for(a=0;a<f.length;a++){
				f[a].className = 'Pbutt ' + is;
			}
	//navegador[0]=='Chrome' || 
	if(rendimientoER>0){ nofade = true;  }

			
	if(nofade){
		saca_lastIN(is);
	} else {
		fadeador(is,true,true);
	}
		
}
function saca_lastIN(is){
	
			var b = document.getElementById(is);
			var g = eval('numLAST' + is);
			var n = g;
			var np = eval('topeLAST' + is);
			if(n>np){ n = 0;  }
			var t = eval('listLAST' + is + '[' + (n>=0?n:np) + ']');
			//if(n==1){
				ancla = eval("faderTim" + is + "[2]");
				if(ancla){
				fija_alto(b,is);
				}
			//}
			/*if(!sacadolast){
			b.style.minHeight = b.clientHeight + 'px';
			sacadolast = true;
			}*/
			
			b.innerHTML = cambia_corchetes(t);
			
			
			
			if(n<0){
				f = document.getElementById('Pbutt_' + is + np);
			} else {
			f = document.getElementById('Pbutt_' + is + n);
			}
			f.className = 'PbuttOn ' + is;
			if(n>=np || n!=g){
					eval('numLAST' + is + '= 0;');
			} else if(n<0){
					eval('numLAST' + is + '= ' + (np + 1) + ';');
			} else {
					eval('numLAST' + is + '++;');
			}

}

function cortaSlider(is){
	var but = document.getElementById('PbuttControl' + is );
	var estat = eval('auto_p' + is);
	if(estat==true){
		eval('clearInterval(int_p' + is + ');');
		eval('auto_p' + is + ' = false');
		but.className = 'PbuttControlB';
		but.title = 'activar auto';
	} else {
		but.className = 'PbuttControl';
		but.title = 'pausar auto';
		eval('auto_p' + is + ' = true');
		var t = eval('numLAST' + is);
		cambiaP(t,is);
		//eval('int_p' + is + ' = setInterval(\'saca_last("' +  is + '")\',faderTim' + is + '[1]);');
	}
	
		
	
}

function cambiaP(n,is){
		
	var b = document.getElementById(is);
	if(navegador[0]=='IE'){   
		//b.filters.alpha.opacity= 100; 
	} else {
		 b.style.opacity = 1;
	}
	
	
	
		eval('numLAST' + is + '=' + n);
		saca_last(is,true);
		
		var estat = eval('auto_p' + is);
		if(estat==true){
		eval('clearInterval(int_p' + is + ');');
		eval('int_p' + is + ' = setInterval(\'saca_last("' +  is + '")\',faderTim' + is + '[1]);');
		}
}

function cambia_corchetes($cadena){
	if(!$cadena){ return false; }
	$c = $cadena.replace(/\[/g, "<");
	$d = $c.replace(/\]/g, ">");
	return $d;
}

function PbutT(suerte,t){
			var div = document.getElementById("PbutText" + suerte);
			div.innerHTML = t;
			}

	
function fadeador(is,off,blanco){
	var ise = is;
	var offe = off;
	var b = document.getElementById(is);
	var filterer =  false, limit = 0.001;
	
	eval("clearTimeout(faderTim" + is + "[0])");
	
	if(b.filters){   
		filterer = true; 
		var alpa = parseFloat(b.filters.alpha.opacity); 
		if(off==false){ limit = 100; }
	} else {
		var alpa = parseFloat(b.style.opacity);
		if(off==false){ limit = 1; }
	}

	
	
	
				if(filterer==true){	
					if(off==true){
						alpa = alpa - 10;
					} else {
						alpa = alpa + 10;
					}
					//b.style.filter = 'alpha(opacity='+ (alpa>100?100:alpa)+')'; 
					b.filters.alpha.opacity = (alpa>100?100:alpa);
				} else {
					if(off==true){
						alpa = alpa - 0.1;
					} else {
						alpa = alpa + 0.1;
					}
					b.style.opacity = (alpa>1?1:alpa);
					//alert(b.style.opacity);
				} 
		//alert(alpa);
			if( (off==true && alpa<=limit) || (off==false && alpa>=limit) ){ blanco = false; }
			
		
		if(blanco==true){ 
			eval("faderTim" + is + "[0] = setTimeout(\"fadeador('" + is + "'," + off + ",true);\",20);");
		
			//window.setTimeout(fadeador(is,off,true),20); 
			//return false;
		} else {
				if(off==true){ 
					saca_lastIN(is);
					fadeador(is,false,true);
				}
		}
}



			
function destacaSEARCH(cadena){
	var pats = cadena.split('-');
	var tas = new Array('P','H4','H3');
	var b,c,div,regul;
	for(var a = 0; a<tas.length; a++){
		div = document.getElementsByTagName(tas[a]);
		b = 0;
		while(div[b]){
			for(rep=0; rep<3; rep++){
				for(c=0; c<pats.length; c++){
					regul = new RegExp("(>[^>]* )([a-z]*)" + pats[c] +"([a-z]?)", "gi");
					div[b].innerHTML = div[b].innerHTML.replace(regul,'$1<span class="resalta">$2'+pats[c]+'$3</span>'); 
				}
			}
		b++;
		}
	}
}
			


function abretag(coord,di,tex,siz){
	
		
		var div = document.getElementById(di);
		
		if(div){
			if(div.innerHTML==''){
				var pos = ObjectPosition(coord);
				div.style.position = 'absolute';
				div.style.top = (pos[1] + coord.offsetHeight) + 'px';
				div.style.left = (pos[0] + coord.offsetWidth - siz) + 'px';
				div.style.width = siz + 'px';
				div.innerHTML = tex;
			} else {
				div.innerHTML = '';	
			}
		}
	
	
}









/*
*
*
*
*
*
funciones.js unificadas
*
*
*
*/



// Esta función cargará las paginas
function llamarasincrono (url, id_contenedor)
{
		
	/*document.getElementById (id_contenedor).innerHTML = "<img src='layout/patrones/cargando.jpg' width='100%' alt='cargando recurso...'>";*/
	
    var pagina_requerida = false;
    if (window.XMLHttpRequest)
    {
        // Si es Mozilla, Safari etc
        pagina_requerida = new XMLHttpRequest ();
    } else if (window.ActiveXObject)
    {
        // pero si es IE
        try 
        {
            pagina_requerida = new ActiveXObject ("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            // en caso que sea una versión antigua
            try
            {
                pagina_requerida = new ActiveXObject ("Microsoft.XMLHTTP");
            }
            catch (e)
            {
            }
        }
    } 
    else
    return false;
    pagina_requerida.onreadystatechange = function ()
    {
        // función de respuesta
        cargarpagina (pagina_requerida, id_contenedor);
    }
    pagina_requerida.open ('GET', url, true); // asignamos los métodos open y send
    pagina_requerida.send (null);
}
// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtml
function cargarpagina (pagina_requerida, id_contenedor)
{
    if (pagina_requerida.readyState == 4 && (pagina_requerida.status == 200 || window.location.href.indexOf ("http") == - 1))
    document.getElementById (id_contenedor).innerHTML = pagina_requerida.responseText;
}








function ObjectPosition(obj) {
    var curleft = 0;
      var curtop = 0;
      if (obj.offsetParent) {
            do {
                  curleft += obj.offsetLeft;
                  curtop += obj.offsetTop;
            } while (obj = obj.offsetParent);
      }
      return [curleft,curtop];
}



//funciones de buscador

function chirlox(){
	var form = document.getElementById('buscar');
	var busca1 = document.getElementById("busca1");
	var iFrame = document.createElement("DIV");
	iFrame.id = "chirlo";
	iFrame.innerHTML = '<p onmouseover="javascript:apagachirlo();">' + chirlos[2] + '</p>';
	position = ObjectPosition(busca1);
	iFrame.style.left = (position[0]- (busca1.offsetWidth -20)) + 'px';/*((position[0]) + (busca1.offsetWidth )) + 'px';*/
	iFrame.style.top = (position[1]+busca1.offsetHeight) + 'px';

	form.appendChild(iFrame);
	ss = setTimeout ('chirlOFx()',7000);
	
			
			if(busca1){ busca1.value = chirlos[0]; }
			destacaSEARCH(chirlos[1]);
	
}	
	
	function chirlOFx(){ 
		var vut = document.getElementById('chirlo');
		vut.className = "estructura";
		ss = setTimeout ('chirlox2()',15000);
	}
	function chirlox2(){ 
		var vut = document.getElementById('chirlo');
		vut.className = null;
		ss = setTimeout ('chirlOFx()',7000);
	}
	
	function apagachirlo(){
	clearInterval(ss);
	var vut = document.getElementById('chirlo');
		vut.className = "estructura";
	}


 function bool(form){
 var t = form.termino.value;
 if(t.length()>20){ form.booleana.value = 1; }
 return true;
 }

var POPUPstat = getCookie('POPUPstat');
if (POPUPstat == null) { POPUPstat = "0"; }

  function ciegaBody(){
	  			window.document.body.className = "quitascroll";
		}

function sacaPOPUP(){
			  	b = document.getElementById("POPup");
				b.className = "estructura";
				b.style.position= "fixed";
				b.innerHTML = "";
				window.document.body.className = null;
				}
				
				
				
		function abreFOTO(f,h){
			  	b = document.getElementById("POPup");
				b.className = null;
				var hp = (screen.height)?(screen.height - 150):h + 10;
				if(hp>h){
					var je = Math.floor((hp-h)/ 2);
				} else {
					var je = 10;
					h = hp - 40;
				}
				ciegaBody();
				var t = '<img src="' + f + '" height="' + h +'px" onclick="sacaPOPUP()" title="cerrar ventana" alt="cerrar ventana" style="cursor:pointer; margin-top:' + je + 'px;">';
				b.innerHTML = t; 
				//alert('secreen: ' + hp + ' alto: ' + h); 
				}
		
				
		
		function abrePOP(cont,cierra){
			b = document.getElementById("POPup");
				b.className = null;
				
				cont = '<div id="inPOPup">' + cont +'</div>';	
				if(cierra!==false){
						if(typeof(cierra)=='object'&&(cierra instanceof Array)){ 
							var ops = cierra[1]; var ord = cierra[0];
						} else {
							var ord = 'cerrar ventana'; var ops = cierra;
						}
						ops = ops===true ? "sacaPOPUP();" : "mandaURL(\'" + ops + "\');";  
						cont = '<div onclick="' + ops + '" class="cierraPOP" title="cerrar ventana"><span>'+ ord + '</span></div><div class="break"> </div>' + cont;	
				}
				ciegaBody();
				b.innerHTML = cont;
				
					var c = document.getElementById("inPOPup");
					var h = 0;
					if(c.offsetHeight){
						h = c.offsetHeight;
					} else if(c.style.pixelHeight){
						h= c.style.pixelHeight;
					}
					if(h>0){
						if(cierra!==false){ h = h + 90; }
						var hp = screen.height - 150;  
						if(hp>h){ 
							hp = (hp - h)/2; 
							b.style.paddingTop = hp + "px";
						} 
						
					} 
					
				 
					
		}
		
		
function sacaAG(){
			  	var b = document.getElementById("agendaPOPUP");
				b.className = "estructura";
					var c = document.getElementById("INagendaPOP");
					c.innerHTML = "";
				/*window.document.body.className = null;*/
				}




function abreAgenda(ID){
	
	var b = document.getElementById('agendaPOPUP');
	b.className = null;
	/*ciegaBody();*/
	llamarasincrono('layout/lib/output/agenda.php?ID=' + ID,'INagendaPOP');
}

function setCookie(c_name,value,exdays) 
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}


function getCookie(name)
         {
         //Without this, it will return the first value 
         //in document.cookie when name is the empty string.
         if(name == '')
            return('');
         
         name_index = document.cookie.indexOf(name + '=');
         
         if(name_index == -1)
            return('');
         
         cookie_value =  document.cookie.substr(name_index + name.length + 1, 
                                                document.cookie.length);
         
         //All cookie name-value pairs end with a semi-colon, except the last one.
         end_of_cookie = cookie_value.indexOf(';');
         if(end_of_cookie != -1)
            cookie_value = cookie_value.substr(0, end_of_cookie);

         //Restores all the blank spaces.
         space = cookie_value.indexOf('+');
         while(space != -1)
              { 
              cookie_value = cookie_value.substr(0, space) + ' ' + 
              cookie_value.substr(space + 1, cookie_value.length);
							 
              space = cookie_value.indexOf('+');
              }

         return(cookie_value);
         }



 function limpianSRC(form){  
		var u = form.termino.value.toLowerCase(); 
	var q = "|términos de búsqueda|buscar|search|find|";

		if(q.indexOf('|' + u + '|')!=-1){
		form.termino.value = '';
		}
	
	}






function busca_terminoGL(form){  
	var val = document.getElementById('GLbuscaT');  
	var t = prepara_enlace(val.value);
	if(t.length<2){
		return false;
	}
	val.disabled = "disabled";
	form.action = form.action + ',b,' + t + '.html';
	return true;
}



function prepara_enlace(t){
	t = t.toLowerCase();
	t = t.replace(/^[ ]*/,'');
	t = t.replace(/[ ]*$/,'');
	t = t.replace(/[ ]{1,}/g,'-');
	t = t.replace(/ú|ü|ù/g,'u');
	t = t.replace(/ó|ö|ò/g,'o');
	t = t.replace(/í|ï|ì/g,'i');
	t = t.replace(/é|ë|è/g,'e');
	t = t.replace(/á|ä|à/g,'a');
	t = t.replace(/ñ/g,'n');
	t = t.replace(/[^a-z0-9\-]/g,'');
	return t;
}


	function cierraSocial(){
		var un = document.getElementById('abresocialB'); 
		var dos = document.getElementById('abresocial');
		
		if(un.style.display=="none"){
			dos.style.display = 'none';
			un.style.display = 'block';
		
		} else {
			clearInterval(intvalSoc);
			un.style.display = 'none';
			dos.style.display = 'block';
		}
	
	}
	var intvalSoc = "";

function limpia_redSocial(){

clearInterval(intvalSoc);

intvalSoc = setInterval("cierraSocial(10000)",3000);

} 



function autoRefr()
{
window.location = location.href;
}

function refrescaPage()
{
	RefreSet = setTimeout("autoRefr()", eval(refreshe * 1000));
}
function corta_refresh()
{
	clearTimeout(RefreSet); 
	refrescaPage();
}



function abregruposMailing(sel){

	var div = document.getElementById('gruposMailingForm');
	
	if(sel.checked==true){ div.style.display = "block"; } else { div.style.display = "none"; }

}

function tiemportve(){
	var div = document.getElementById('tiemportve');
	div.src = 'http://www.rtve.es/eltiempo/miCiudad/embedded.html';
	div.style.background = "transparent";
}






function sacadoscero(uri,twit){
	var ul = document.getElementById("facebooktwitter");
	
	var url = uri.replace(/(#.*$)/, '');
	var urlb = 'http://www.meneame.net/api/check_url.php?url='+encodeURIComponent(url);
	
	var t = '<li><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal"';
	if(twit!=''){ t += ' data-via="' + twit +'"'; }
	t += ' data-lang="es">Tweet</a></li><li><iframe src="http://www.facebook.com/plugins/like.php?href=' + uri +'&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></li>	<li><iframe width="98" height="17" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" src="'+urlb+'">' + '> </' + 'iframe></li>';
	
	ul.innerHTML = t;
	
	document.src = 'http://platform.twitter.com/widgets.js';
}


function asinc_rep(guat,guere,guen){
	setInterval(function(){ llamarasincrono(guat,guere) },guen *1000);
}




function sacaRSS(div){
	var ul = document.getElementById(div);
	
	
	var fsoXML = new ActiveXObject("Scripting.FileSystemObject");
	var XMLFile = fsoXML.OpenTextFile(canalesRSS[0],1);
	var Data = XMLFile.ReadAll();
	XMLFile.Close();
	
	var xml = new ActiveXObject("Microsoft.XMLDOM");
	xml.async = false;
	xml.loadXML(Data); 
	
	var students=xml.documentElement;
	var student = students.childNodes(0);
	alert(student);
	ul.innerHTML = student.getElementsByTagName("Name")[0].text;
	
	
	
	
	
	/*
	var xmlDoc=new ActiveXObject("MSXML.DOMDocument");
	xmlDoc.async="true";
	xmlDoc.load(canalesRSS[0]);
	*/
	
	
	
	
}


function aleatorio(inferior,superior){
    numPosibilidades = superior - inferior
    aleat = Math.random() * numPosibilidades
    aleat = Math.floor(aleat)
    return parseInt(inferior) + aleat
} 









function comentarios_UPD(num){
	llamarasincrono (comentariosURI + "&comentariosMOD=" + comentariosMOD + "&pageC=" + num, "comentarios_LIST_BODY");
	
				var elementos = getElementsByClassName("pagerComentsOV");
					var i = 0;
					while(elementos[i]){
						elementos[i].className = "pagerComents";
						i++;
					}
	
	}
	
	function comentarios_TUP(){
		if(comentariosMOD==1){ comentariosMOD = 2; } else { comentariosMOD = 1; }
		comentarios_UPD(".$comNu.");
		var h = document.getElementById("comentariosH");
		var cromos = document.getElementById("ComentsBK");
		var p = document.getElementById("verNorevisados");
		if(comentariosMOD==1){
			h.innerText = "Comentarios sin validar (" + comentariosNOVE + ")";
			p.innerText = "volver a comentarios validados (" + comentariosREVI + ")";
			cromos.style.display = "none";		
			 
		} else {
			h.innerText = "Comentarios (" + comentariosREVI + ")";
			p.innerText = "ver comentarios sin validar (" + comentariosNOVE + ")";
			cromos.style.display = "block";
				var elementos = getElementsByClassName("pagerComents");
				if(elementos[0]){ elementos[0].className = "pagerComentsOV"; }	
		
		}

	}


function COManomiza(forme,val){
		var n = document.getElementById("COMnombre");
		var m = document.getElementById("COMmail");
		var u = document.getElementById("COMurl");
		var p = document.getElementById("COMpriv");
		var div = document.getElementById("COMdatos");
		
		if(val==true){
			div.style.display = "none";
			n.disabled = true;
			n.value = "anonimous";
			m.disabled = true;
			m.value = "anonimous@anonimous.ex";
			u.disabled = true;
			p.disabled = true;
		} else {
			div.style.display = "block";
			n.disabled = false;
			n.value = "";
			m.value = "";
			m.disabled = false;
			u.disabled = false;
			p.disabled = false;
		}
	
}
	
	










var apsMN_ary = new Array();

function cambiamenuH(ID,ref){
	/*alert(apsMN_ary[ID]);*/
	
	cierramenu('MenuH2ov','MenuH2');
	var div = document.getElementById('Hapsbk');
		if(div){ 
			if(ID==0){ ID = MenuConf[0]; } 
			
			if(!ref){ ref = document.getElementById('MenuIS'); } /*else { ref = refy.parentNode; }*/
			
			
			div.innerHTML = ''; 
			if(ID>0 && apsMN_ary[ID]){
				
				var position = ObjectPosition(ref);

				var iFrame = document.createElement("DIV");
				
				if(ID==MenuConf[0]){
					iFrame.id = "MenuHap";
				} else {
					iFrame.id = "MenuHaps";
					ref.className = 'MenuH2ov';
				}
				iFrame.innerHTML =  apsMN_ary[ID];
				div.appendChild(iFrame);
				iFrame.style.position = "absolute";
				if(iFrame.offsetWidth+ref.offsetWidth<div.offsetWidth){
					var f = position[0] + iFrame.offsetWidth;
					if(f>div.offsetWidth){
							position[0] = position[0] - (f-div.offsetWidth);
					}
					iFrame.style.left =  position[0] + 'px';
					iFrame.style.top =  (position[1]+div.offsetHeight)  + 'px';
				} else {
					position = ObjectPosition(div); 
					iFrame.style.width = div.offsetWidth + 'px';
					iFrame.style.left =  position[0] + 'px';
					iFrame.style.top =  position[1] + 'px';

				}
				 
				
				
				
			} 
		}
}

var intvalMN;
function sacaMenuH(){
intvalMN = setTimeout('sacandoMenuH()',3000);	
}

function sacandoMenuH(){  
cierramenu('MenuH2ov','MenuH2');
var ref = document.getElementById('MenuIS');
cambiamenuH(MenuConf[0],ref);
}

function limpiasacaMenuH(){
clearTimeout(intvalMN);	
}


function llamaMenu(intra){
var xmlhttp;
var txt,x,i,sn,sb,cl,cssT,color,scr,tmp;
var css = 'Menu'+MenuConf[2];




var script1 = ' onclick="cierramenu(\'' +css+'2ov\',\'+css+\'2");"';
var script2 = 'onclick="if(this.className==\''+css+'2\'){ cierramenu(\''+css+'2ov\',\''+css+'2\'); this.className=\''+css+'2ov\'; }"';	

	
	


if (window.XMLHttpRequest){
  xmlhttp=new XMLHttpRequest();
} else { 
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange=function(){
  if (xmlhttp.readyState==4 && xmlhttp.status==200){
	
    xmlDoc=xmlhttp.responseXML;
		txt="";							
		x=xmlDoc.getElementsByTagName("SEC"); 
		for (i=0;i<x.length;i++){
			id = x[i].getElementsByTagName("ID");
			sn = x[i].getElementsByTagName("SN");
			sb = x[i].getElementsByTagName("SB");
			cl = x[i].getElementsByTagName("CO");
			ur = x[i].getElementsByTagName("URL");
			aps = x[i].getElementsByTagName("APS"); 
		  	 
			 try {
				
		 	color = '';
		 	scr = script1;
			if(id[0].firstChild.nodeValue==MenuConf[0]){ 
					CssT= ' class="'+css+'1" id="MenuIS"'; if(MenuConf[2]=='H'){  scr = ' onmouseover="sacandoMenuH();"'; } 
					color = (cl.length>0&&MenuConf[2]=='V') ? '<div class="'+css+'bk" style="background:#' + cl[0].firstChild.nodeValue + '"> </div>' : '';
			} else if(aps.length>0 || MenuConf[2]=='H'){  
					CssT= ' class="'+css+'2"'; 
					scr = MenuConf[2]=='H' ? 'onmouseover="cambiamenuH('+id[0].firstChild.nodeValue+',this);"' : script2;
			} else {  
					CssT= ' class="'+css+'0"'; 
			}  
		
					
				txt=txt + '<div '+CssT+' '+scr+' >' + color;
				
					sb[0].firstChild.nodeValue = sn[0].firstChild.nodeValue + ' - ' + sb[0].firstChild.nodeValue;
					//sn[0].firstChild.nodeValue = sn[0].firstChild.nodeValue.replace(/([^ ]{13})([^ ]{1,})/,"$1 $2"); 
				
				if(ur[0].firstChild.nodeValue!='null'){
					txt=txt + '<h2><a href="'+ ur[0].firstChild.nodeValue +'.html" title="'+sb[0].firstChild.nodeValue+'">' + sn[0].firstChild.nodeValue + '</a></h2>';
				} else {
					txt=txt + '<span>'+sn[0].firstChild.nodeValue+'</span>'; 
				}
						tmp = '';
						if(aps.length>0){
							
								for (e=0;e<aps.length;e++) {
									ib = aps[e].getElementsByTagName("ID");	  
									sn = aps[e].getElementsByTagName("AN");
									sb = aps[e].getElementsByTagName("AB");
									ur = aps[e].getElementsByTagName("URI");
							
									 if(ib[0].firstChild.nodeValue==MenuConf[1]){ CssT=' class="activa"'; } else { CssT=''; } 
						
						cl = '<h3'+ CssT +'><a href="'+ ur[0].firstChild.nodeValue +'.html" title="'+sb[0].firstChild.nodeValue+'">' + sn[0].firstChild.nodeValue + '</a></h3> ';
						
										if(MenuConf[2]=='H'){ 
											tmp = tmp + cl;
										} else {
											txt=txt + cl;	
										}
								
								}
															
								}
						
								if(MenuConf[2]=='H'){ 
										apsMN_ary [id[0].firstChild.nodeValue] = aps.length>0? tmp : false;
								} 
						
						
							txt=txt + '</div>';	
         		
				} catch (er) {
          			txt=txt + '<a href="#"> Falla ' + i + "</a>";
          		}
        }
			
			
		
		document.getElementById(css).innerHTML=txt;
		
		if(MenuConf[2]=='H' && MenuConf[0]>0){ cambiamenuH(MenuConf[0]); }
    }
  }


xmlhttp.open("GET","galeria/cache/globales/menu"+intra+".xml",true);
xmlhttp.send();


}


























/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;




















/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
