var localiza=location.href;

		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 openWin(url) {
   			window.open(url,getWinNm(),'width=510,height=520,location=no,toolbar=yes,directories=no,menubar=yes,resizable=yes,scrollbars=yes,status=no');
			}
		function check(){
			var cad1 = new Date();
			cad1.setTime(cad1.getTime() + 864000000001);	
			if ((GetCookie("idioma"))){
				}else{
	  		SetCookie("idioma","b",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 canviacolor(cela,cfons){
			cela.bgColor=cfons;			
			}
/*
		function keyDown(e) {			
			if (document.all) 
			{ // Explorer
		
			  if ( (event.keyCode == 13) && (document.frmClass.l.value.length > 0) )  {
		      	    document.frmClass.submit();
			  }
			} 
			else 
			{ // Netscape
			  if ( (e.which == 13) )
			  {
			  
		     	    document.frmClass.submit();     	    
		 	  }
		 	}  	
		 }
		document.onkeydown = keyDown
*/

function cellcolor(cell,background_color){		
	cell.bgColor=background_color;			
	
	}

function getWinNm() {
		var now = new Date();
		var hr = new String(now.getHours());
		var mn = new String(now.getMinutes());
		var sc = new String(now.getSeconds());
		var winNm = hr + mn + sc;
		return winNm;
			}

function obre(url,target){
	if(target=="_self"){	
		location.href=url;
	}else if (target=="_blank"){ 
		window.open(url,getWinNm(),'location=yes,toolbar=yes,directories=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes');
	}
}