var GB_ROOT_DIR = "/greybox/";


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;

// Javascript functions for dynamically rendering the password boxes from text to passwords
function changePassword1(){
	document.getElementById("smCandPassDIV").innerHTML = "<input id=\"smCandPass\" name=\"strPassword\" size=\"15\" class=\"textfieldstylesmall\" type=\"password\" onblur=\"setPassword1();\">";
	document.getElementById("smCandPass").focus();
	document.getElementById("smCandPass").focus();
}
function setPassword1(){
	if(document.getElementById("smCandPass").value == ''){
		document.getElementById("smCandPassDIV").innerHTML = "<input value=\"Password\" id=\"smCandPass\" name=\"strPassword\" size=\"15\" class=\"textfieldstylesmall\" type=\"text\" onfocus=\"changePassword1();\" onblur=\"setPassword1();\">";
	}
}
function changePassword2(){
	document.getElementById("candPassDIV").innerHTML = "<input class=\"textfieldstylesmall\" id=\"candPass\" name=\"strPassword\" size=\"30\" type=\"password\" onblur=\"setPassword2();\">";
	document.getElementById("candPass").focus();
	document.getElementById("candPass").focus();
}
function setPassword2(){
	if(document.getElementById("candPass").value == ''){
		document.getElementById("candPassDIV").innerHTML = "<input class=\"textfieldstylesmall\" id=\"candPass\" value=\"Password\" name=\"strPassword\" size=\"30\" type=\"text\" onfocus=\"changePassword2();\" onblur=\"setPassword2();\">";
	}
}
// Javascript functions for fading in and out the error reporting popup
function hideEffect(element){
       new Effect.Fade(element, { duration:0});
    }
function FadeEffect(element){
       new Effect.Fade(element, { duration:1});
    }
function ShowEffect(element){
       new Effect.Appear(element, {duration:1});
    }