cookie_name="ILIPass";
var password=""
var forceit=""

function SetCookie() {
	document.cookie=cookie_name+"="+password+";";
}

function GetCookie() {
	password="";
	if(document.cookie) {
		index=document.cookie.indexOf(cookie_name);
		if (index !=-1) {
			namestart=(document.cookie.indexOf("=",index)+1);
			nameend=document.cookie.indexOf(";",index);
			if (nameend==-1) {nameend=document.cookie.length;}
			password=document.cookie.substring(namestart,nameend);
			return password;
    	}
	}
}

function InputPassword() {
	password = prompt("Please enter your password:" + "\n(all lowercase)", "");
}

function GetPassword(forceit) {
	if (forceit=="1") {
		InputPassword();
		SetCookie();
	}
	GetCookie()
	if (password=="") {
		InputPassword();
		SetCookie();
	}
	return password
}

function GetURL(in_url) {
	return "../"+GetPassword(0)+"/"+in_url+""

}

// externe links da xhtml strict

function externalLinks() {   
 if (!document.getElementsByTagName) return;   
 var anchors = document.getElementsByTagName("a");   
 for (var i=0; i<anchors.length; i++) {   
   var anchor = anchors[i];   
   if (anchor.getAttribute("href") &&   
       anchor.getAttribute("rel") == "external")   
     anchor.target = "_blank";   
 }   
}   
window.onload = externalLinks;
