
//<![CDATA[
function toggleDisplay(numRanges,num) {
       
	//Set Range ID to check if it exists
	var temp = document.getElementById('Range' + num)
	
	if(temp) {
		var row = document.getElementById('Range' + num);
	}
	//alert('hello'+num);
	
	//Let's assume there are 10 job status at the max and reset all of it's layers display to none
	for(var j=0; j < 10; j++)
	{ 
        if(document.getElementById('Range'+j))
        {
        b=document.getElementById('Range'+j);
        
        b.style.display = 'none'; 
        
        } 
    }
	
    if(temp) {
    //Let's show the layer corresponding to the option checked.
    row.style.display = "inline";
    }
}
//]]>

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});
    }