//<!--
//alert ("Generic Functions Included");

function cancelEvent(e)
{
   event.cancelBubble = true;
   event.returnValue = false;
   return false;
}
//-->
function showImage(URL)
{
return window.open("/showImage.asp?image="+URL,"","toolbar=no,resizeable=no");
}


function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

function shouldRedirect(URL) 
{
if (confirm("This page is currently set to redirect to '" + URL +"'.\n\nThis has been overridden because you are currently administering the site and have permission to change this setting.\n\n You can either follow the redirect (choose 'OK') or you can stay on this page (choose 'Cancel'). \n\n To change the current redirect setting, choose cancel then enter the metadata panel from the menu bar and change the page alias."))
{
location.href=URL;
}
}


function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}



function swapClass (id,newClass)
{
document.getElementById(id).className  = newClass;
}


function getRidOfundefined(value)
{
if (value == undefined)
{
return '';
}
else
{
return value; 
}
}