var blnDebug = false; // default   
var blnAlert = false;   
    
    function debug(Stuff)
    {
        if (blnAlert)
        {   
            alert(Stuff);
        }
        if (blnDebug)
        {
            document.getElementById('Debug').value += Stuff + '\n';
        }
    }
function loginToMentor()
{
    document.getElementById('txtUN').value = document.getElementById('txtLogin').value;
    document.getElementById('txtPW').value = document.getElementById('txtPassword').value;
    document.getElementById('cmdLogin').click()
}

function getMentorPassword()
{
    var oWindow = window.open('http://195.172.14.242/fCCMentornet/refreshPassword/refreshPassword.aspx?cfc_from=FCCMentorNet','_blank','resizable=yes,location=no,menubar=no,toolbar=no,directories=no,height=450,width=500');
}

function pushBaseDivsDown()
{   
    try
    {
        pushDivDown(document.getElementById('Logo'),220);
        if ((document.documentElement.scrollHeight) <= document.documentElement.clientHeight)
        {
            pushDivDown(document.getElementById('divBaseItems'),150);
            
        }
    }
    catch(e){}
}

function pushDivDown(divID,intOffset)
{
    divID.style.position = 'absolute';
    divID.style.top = (document.documentElement.clientHeight - intOffset) + 'px';
}

function initialise(PageID, ParentID, NoContent)
{
    if (NoContent!='true'){
        ShowHideDiv('anch'+PageID, 'Menu'+PageID, 'Menu'+ParentID, false);
    }
    else
    {
        alert('The page you selected cannot be displayed correctly. \nPlease contact the web administrator quoting Content' + PageID);
    }
    if (this.initTargets){this.initTargets()};
    
    pushBaseDivsDown();
    window.onresize = pushBaseDivsDown;
     
}

function requestQuerystring(strVar){
	prts = location.search.substr(1).split("&")
	for(nn=0;nn<prts.length;nn++){
		if(prts[nn].split("=")[0] == strVar){
			return prts[nn].split("=")[1]
		}
	}
}

function addToQuerystring(qs,strVar,strVal){
	prts = qs.split("&");
	qs = '';
	for(nn=0;nn<prts.length;nn++){
		if(prts[nn].split("=")[0] != strVar){
			if(qs.length > 0) qs += '&';
			qs += prts[nn]
		}
	}
	if(qs.length > 0) qs += '&';
	qs += strVar + '=' + strVal;
	return qs
}