
function ventanaContacto(url){
 if (jsActivo){ window.open(url+'?aj=true','contacto','height=290, width=500'); }
 else{location.href=url; }
return false;
}

var caducidad = Caduca(3100)	
var jsActivo =  true			
var jsActivoOnString='Desactivar efectos de movimiento y ventanas emergentes en esta página';
var jsActivoOffString='Activar efectos de movimiento y ventanas emergentes en esta página';
function getValueCookie(indice) {
	var cookieSession = document.cookie
	var finDeCadena = cookieSession.indexOf(";", indice)
	if (finDeCadena == -1)	finDeCadena = cookieSession.length
	return unescape(cookieSession.substring(indice, finDeCadena))
	}

function getCookie(nombre) {
	var cookieSession = document.cookie 
	var arg = nombre + "="
	var alen = arg.length	
	var glen = cookieSession.length	

	var i = 0
	while (i < glen) {
		var j = i + alen			
		if (cookieSession.substring(i, j) == arg)	return getValueCookie(j)	
		i = cookieSession.indexOf(" ", i) + 1
		if (i == 0) break				
	}
	return null	
}

function setCookie (nombre, valor, caducidad) {
	if(!caducidad)	caducidad = Caduca(0)
	document.cookie = nombre + "=" + escape(valor) + "; expires=" + caducidad + "; path=/"
}

function Caduca(dias) {
	var hoy = new Date()
	var msEnXDias = eval(dias) * 24 * 60 * 60 * 1000
	hoy.setTime(hoy.getTime() + msEnXDias)
	return (hoy.toGMTString())
}

function delCookie(nombre) {
	document.cookie = nombre + "=; expires=" + Caduca(-1) + "; path=/"
}


function showCookie() {
  if(getCookie('jsActivo') != null)  // && //
     if(getCookie('jsActivo')=='no') 
       jsActivo = false;
  
}

function tooglejs(){
  jsActivo = (!jsActivo);
  setCookie ('jsActivo', jsActivo?'si':'no', caducidad);
  
  var node=document.getElementById('activeJs');
  node.replaceChild(document.createTextNode( jsActivo?jsActivoOnString:jsActivoOffString),node.childNodes[0]);
  
  
  }

