//<script>
// Clears a textbox of any default "accessibility" text on focus - this function is now depracated in favour of clear default
function clearText(textBoxID,defaultVal){
	if (document.getElementById(textBoxID).value == defaultVal) document.getElementById(textBoxID).value = '';
}

// This function clears a form items default value and changes it to its active style
function clearDefault(obj, defaultText) {
	if (obj.value == defaultText) {
		obj.value = "";
		//obj.className += "on";
	}
}

// This function resets a form items default value and changes it to its passive style
function resetDefault(obj, defaultText) {
	if  (obj.value == "") {
		obj.value = defaultText;
		//obj.className = obj.className.substr(0,obj.className.length-2)
	}
}

// Checks for enter key being pressed and fires the click event for the specified button
// OBSOLETE - This version is IE-specific and is deprecated.
function clickOnEnter(buttonID){
	if (((document.all)?window.event.keyCode:event.which) == 13){
		document.getElementById(buttonID).click(); 
		return false;
	} else {
		return true;
	}
}

// Multi-browser version of clickOnEnter.
// Note that, for non-IE browsers, the target button
// is expected to be wrapped with an anchor tag whose
// href is of the form "javascript:"*. This href is
// used for the click event.
function clickOnEnterMultiBrowser(event, buttonID)
{
    var e = window.event || event;
    var code = e.keyCode || e.which;

    if (code == 13)
    {
        if (document.all)
        {
            document.getElementById(buttonID).click();
        }
        else
        {
            // The target of the click event is actually on the anchor tag
            // for searching, so locate the tag and extract the javascript
            // to execute.
            var anchorTag = document.getElementById(buttonID).parentNode;
            var command = anchorTag.href.replace('javascript:', '');
            eval(command);
        }
        return false;
    }
    else
    {
        return true;
    }
}

// Standard function to open pages in a new window
function OpenWindow(URL, name, width, height) {
window.open(URL,name,"scrollbars=yes,width=" + width + ",height=" + height);
}
