<!-- //
// toggle an element's display property
function flip(rid) {
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
    document.getElementById(rid).style.display = current;
}
// show or hide an element based on its id
function show(rid) {
    document.getElementById(rid).style.display = 'block';
}
function hide(rid) {
    document.getElementById(rid).style.display = 'none';
}
// checkbox bulk check / uncheck
function checkAllFields(ref,cid,field)
{
var chkAll = document.getElementById(cid);
var checks = document.getElementsByName(field);
var boxLength = checks.length;
var allChecked = false;
var totalChecked = 0;
	if ( ref == 1 )
	{
		if ( chkAll.checked == true )
		{
			for ( i=0; i < boxLength; i++ )
			checks[i].checked = true;
		}
		else
		{
			for ( i=0; i < boxLength; i++ )
			checks[i].checked = false;
		}
	}
	else
	{
		for ( i=0; i < boxLength; i++ )
		{
			if ( checks[i].checked == true )
			{
			allChecked = true;
			continue;
			}
			else
			{
			allChecked = false;
			break;
			}
		}
		if ( allChecked == true )
		chkAll.checked = true;
		else
		chkAll.checked = false;
	}
	for ( j=0; j < boxLength; j++ )
	{
		if ( checks[j].checked == true )
		totalChecked++;
	}
}
// open window
function openWindow(theURL,winName,winWidth,winHeight,otherFeatures) {
	var x = 0;
	var y = 0;
	x = (screen.availWidth - 12 - winWidth) / 2;
	y = (screen.availHeight - 48 - winHeight) / 2;
	if (otherFeatures != "") {otherFeatures = "," + otherFeatures}
	var features = "screenX=" + x + ",screenY=" + y + ",width=" + winWidth +
	",height=" + winHeight+",top="+y+",left="+x+"'" + otherFeatures
	var NewWindow = window.open(theURL,winName,features);
	NewWindow.focus();
}
// a better popup dealio
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}

// for ul/li drop menus
function startList() {
	if ( document.all && document.getElementById ) {
		navRoot = document.getElementById( "menu" );
		for (i = 0; i < navRoot.childNodes.length; i++ ) {
			node = navRoot.childNodes[i];
			if ( node.nodeName == "LI" ) {
				node.onmouseover=function() {
					this.className += " over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace( " over", "" );
				}
			}
		}
	}
}
window.onload=startList;
/*
*/
//-->
