// SMCrunch2 Version 2.0.1, Copyright (C) Smart Media Ltd 2001-2005. All Rights Reserved.
//
// !!! Note: JScript by default
//
var residentsoptions = new Array();
function quicklinkgo()
{
var f = document.getElementById('quicklinksfrm');
var ll = f.linkslist;
var rl = f.residentslist;
if(ll != null && typeof(ll) != 'undefined' &&
rl != null && typeof(rl) != 'undefined')
{
var errmsg = '';
if(ll.selectedIndex == 0)
errmsg = 'Please select an option from the \'Other quick links\' drop-down menu.';
else if(rl.selectedIndex == 0)
errmsg = 'Please select your resident type so we can make sure we give you the right information.';
else if(rl.options[rl.selectedIndex].value == '')
errmsg = "We're sorry, that particular quick link is not applicable to your resident type."+
" Please check that you have selected the correct resident type or choose a different quick link."+
" Alternatively, please browse the Residents' Area for more information that may be relevant to you.";
if(errmsg != '')
{
alert(errmsg);
return false;
}
}
f.action = rl.options[rl.selectedIndex].value;
f.submit();
}
function prepareQuicklinks()
{
var f = document.getElementById('quicklinksfrm');
if(f != null && typeof(f) != 'undefined')
{
var ll = f.linkslist;
if(ll != null && typeof(ll) != 'undefined')
{
for(x in residentsoptions)
{
var o = document.createElement('OPTION');
o.appendChild(document.createTextNode(x));
ll.appendChild(o);
}
}
}
}
function addQuickLinks(type, link, desc)
{
var r = residentsoptions;
var resArr;
link = link.replace(/&amp;/g,'&');
desc = desc.replace(/&amp;/g,'&');
if(r[desc] == null || typeof(r[desc]) == 'undefined')
resArr = new Array();
else
resArr = r[desc];
resArr[type.replace(/\s(.)*/,'')] = link;
residentsoptions[desc] = resArr;
}
function showResidentTypes(desc)
{
var f = document.getElementById('quicklinksfrm');
if(f != null && typeof(f) != 'undefined')
{
var r = residentsoptions[desc];
if(r != null & typeof(r) != 'undefined')
{
var rl = f.residentslist;
if(rl != null && typeof(rl) != 'undefined')
{
var ops = rl.getElementsByTagName('OPTION');
for(var i=1;i<ops.length;i++)
{
var key = ops[i].text.replace(/\s(.)*/,'');
key = key.toUpperCase();
var obj = r[key];
if(obj != null && typeof(obj) != 'undefined')
ops[i].value = obj;
else
ops[i].value = '';
}
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", prepareQuicklinks, false);
else if (window.attachEvent)
window.attachEvent("onload", prepareQuicklinks);

