// LANGUAGES: 1 - CATALÀ , 2 - CASTELLANO , 3 - ENGLISH
var iqua_id=88;
var iqua_lang=1;
var dir_remoto="http://www.uoc.edu/web/cat/img/";

function SetCookie(name, value, expires, path, domain, secure)
			{ document.cookie = name + "=" + escape(value) +
  			((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  			((path == null)    ? "" : "; path=" + path) +
  			((domain == null)  ? "" : "; domain=" + domain) +
  			((secure == null)  ? "" : "; secure");

				if (GetCookie("user_id")){}else{var cad1 = new Date();var d = new Date();cad1.setTime(cad1.getTime() + 864000000001);SetCookie("user_id",d.getFullYear()+"."+(d.getMonth()+1)+"."+d.getDate()+"."+d.getHours()+"."+d.getMinutes()+"."+d.getSeconds()+"."+d.getMilliseconds(),cad1,"/");}

}

function GetCookie(name){ 
			var cname = name + "=";
  			var dc = document.cookie;               
  			if (dc.length > 0){ 
  				begin = dc.indexOf(cname);           
  				if (begin != -1){ 
  					begin += cname.length;
  					end = dc.indexOf(";", begin);
      					if (end == -1) end = dc.length;
      			return unescape(dc.substring(begin, end));
      			}
      		}  
      		return null;
}

function check(){
			var cad1 = new Date();
			cad1.setTime(cad1.getTime() + 864000000001);
			if ((GetCookie("idioma"))){
				}else{
	  		SetCookie("idioma","a",cad1,"/");
			}
		//Cookie de usuari
			if (GetCookie("user_id")){
			}else{
	  		var cad1 = new Date();
	  		var d = new Date();
	  		cad1.setTime(cad1.getTime() + 864000000001);
	  		SetCookie("user_id",d.getFullYear()+"."+(d.getMonth()+1)+"."+d.getDate()+"."+d.getHours()+"."+d.getMinutes()+"."+d.getSeconds()+"."+d.getMilliseconds(),cad1,"/");
			}
}

function keyDown(e) {
	if (document.all)
	{ // Explorer

	  if ( (event.keyCode == 13) && (document.loginForm.l.value.length > 0) )  {
      	    document.loginForm.submit();
	  }
	}
	else
	{ // Netscape
	  if ( (e.which == 13) )
	  {

     	    document.loginForm.submit();
 	  }
 	}
 }
document.onkeydown = keyDown


function Mostra(evnt,idCapa)
{
	
if (evnt.pageY){
	document.getElementById(idCapa).style.top = evnt.pageY;
}else if (evnt.clientY){
   document.getElementById(idCapa).style.top = evnt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop :  document.body.scrollTop);
}

if (evnt.pageX){
	document.getElementById(idCapa).style.left = evnt.pageX;
}else if (evnt.clientX){
   document.getElementById(idCapa).style.left = evnt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft :  document.body.scrollLeft);
}

document.getElementById(idCapa).style.visibility='visible';

}

function Oculta(idCapa)
{
	document.getElementById(idCapa).style.visibility='hidden';
}

function putFont(sizeper){
fontByTag('a',sizeper);
fontByTag('p',sizeper);
fontByTag('span',sizeper);
fontByTag('td',sizeper);
fontByTag('div',sizeper);
}


function fontByTag (tag,size) {
	var divElements = document.getElementsByTagName(tag); 
	for (i=0;i<divElements.length;i++){
		obj=divElements[i];
		if (obj.style.fontSize==""){
			obj.style.fontSize="100%";
		}	
		valor=12+size;
		obj.style.fontSize=valor+"px";
		if(size==0){
		obj.style.fontSize="";
		}
	}		
}


startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav1");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav2");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
//window.onload=startList;

function password_window(mypage) {
myname='passwordWin';
w= 480; h=300;
winl = (screen.width - w) / 2;
wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

