// BEGINNING OF FUNCTONS
// Function to open 'contact us' window
function stuck()
{
var mainURL="main.cgi";
if (window.location.href)
{
mainURL=(window.location.href.substring(0,window.location.href.indexOf("help.cgi")))+"main.cgi";
}
var winName="stuck"; var winTop=10; var winLeft=10; var winWidth=450; var winHeight=320;
var winURL=mainURL+"?html=contact_us";
eval("window.open('" + winURL + "', '" + winName + "', 'top="+winTop+",left="+winLeft+",width="+winWidth+",height="+winHeight+",scrollbars,resizable');");
}
// Function to switch folder
function turnOn(newFolder)
{
// Adjust the visibility and background color for the folders
thisFolder = document.getElementById(newFolder);
thisFolder.style.visibility = "visible";
thisFolder.style.backgroundColor = "#000000";
var oldFolder = document.getElementById(currentFolder);
oldFolder.style.visibility = "hidden";
// Make the new folder the current folder
var prevFolder = currentFolder;
currentFolder = newFolder;
window.scrollTo(0,0);
}
// Function to calculate the time when the document finished loading
function calcTime()
{
var then = new Date();
var loadTime = then - now;
willDetails.r_time_val.value = 0.001*loadTime;
willDetails.f_br_ver.value = navigator.appVersion;
willDetails.f_br_name.value = navigator.appName;
}
// Turn off Resources Menu
function resOff()
{
var resBox = document.getElementById("ResourcesMenu");
resBox.style.visibility="hidden";
window.status='';
}
// Function to ask to Select a Charity to get donation
function doChSelect()
{
turnOn('Folder0');
fFolder = document.getElementById("FolderBlankTop"); fFolder.style.visibility = "visible";
rFolder = document.getElementById("Resources"); rFolder.style.visibility = "hidden";
gFolder = document.getElementById("GuideButton"); gFolder.style.visibility = "hidden";
var h1="Error";
var h2="There has been an error loading the Intelligent Willwriting Composer.
";
h2+="Please click here to re-load.
";
h2+="If the problem persists then please click here and contact us.
";
page0Part1.innerHTML=insHTML+"
";
page0Part2.innerHTML=insHTML+"";
}
// Function doQs - do the questionaire
function doQs()
{
turnOn('Folder0');
fFolder = document.getElementById("FolderBlankTop"); fFolder.style.visibility = "visible";
rFolder = document.getElementById("Resources"); rFolder.style.visibility = "hidden";
gFolder = document.getElementById("GuideButton"); gFolder.style.visibility = "hidden";
var h1="Error";
var h2="There has been an error loading the Intelligent Willwriting Composer.
";
h2+="Please click here to re-load.
";
h2+="If the problem persists then please click here and contact us.
";
page0Part1.innerHTML=insHTML+"";
page0Part2.innerHTML=insHTML+"";
}