function navBarClick( tableCellRef, navStyle, url ) {
		//navBar( tableCellRef, 0, navStyle );
		window.location.href = url;
	}
	
	function navBar( tableCellRef, menuDefault, menuOver, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = menuOver;
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000000';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = menuDefault;
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000000';
				}
		}
	}
	}

function mouseover(element, name){
	try {
		element.className += " " + name;
	}
	catch(error){
		//	ignore errors
	}
}
function mouseout(element, name){
	try {
		element.className = "";
	}
	catch(error){
		//	ignore errors
	}
}
function CheckSingle(v,tableCellRef)
{
	if (document.f1.recordids[v].checked==false) {
		document.f1.recordids[v].checked=true;
	}
	else if (document.f1.recordids[v].checked==true) {
		document.f1.recordids[v].checked=false;
	}
}


function unhide(id, plussign){
	var theRow = document.getElementById(id);
	var theImage = document.getElementById(plussign);
	if (theRow.style.display=="none") {
        theRow.style.display = "";
        theImage.src = "img/arrow_down.gif";
    } else {
        theRow.style.display = "none";
        theImage.src = "img/arrow_next.gif";
    }
}
function unhideShowMore(rowid, divid, plussign, queryStr){
	var theRow = document.getElementById(rowid);
	var theImage = document.getElementById(plussign);
	if (theRow.style.display=="none") {
        theRow.style.display = "";
        theImage.src = "img/Collapse.gif";
		showMore(queryStr,divid)
    } else {
        theRow.style.display = "none";
        theImage.src = "img/Expand.gif";
    }
}
function unhidesmall(id, plussign){
	var theRow = document.getElementById(id);
	var theImage = document.getElementById(plussign);
	if (theRow.style.display=="none") {
        theRow.style.display = "";
        theImage.src = "img/ExpandUp.gif";
    } else {
        theRow.style.display = "none";
        theImage.src = "img/ExpandDown.gif";
    }
}

function singlehide(id){
	var theRow = document.getElementById(id);
	theRow.style.display = "none";
}
function singleunhide(id){
	var theRow = document.getElementById(id);
	theRow.style.display = "";
}

function queryString(val){
	var q = unescape(location.search.substr(1)).split('&');
	for(var i=0; i<q.length; i++){
		var t=q[i].split('=');
		if(t[0].toLowerCase()==val.toLowerCase()) return t[1];
	}
	return '';
}


		function disablesubmit (theform)
		{
		if (document.all || document.getElementById) {
		for (i = 0; i < theform.length; i++) {
		var tempobj = theform.elements[i];
		if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
		tempobj.disabled = true;
		//tempobj.value = 'Recalculate First';
		}
		return true;
		}
		else {
		return false;
		}
		}
		
		
		
	function SubmitTheForm() {
		var submitted = false;
		if(submitted == true) { return; }
		document.myform.submit();
		document.myform.mybutton.value = 'Please wait...';
		document.myform.mybutton.disabled = true;
		submitted = true;
	}

		
		
		

function cnnActivateSelectSection() {
	document.getElementById('cnnSelectSectionOptions').style.visibility='visible';
	document.getElementById('cnnSelectSectionOptionsHide').style.visibility='visible';
}

function cnnDeactivateSelectSection() {
	document.getElementById('cnnSelectSectionOptions').style.visibility='hidden';
	document.getElementById('cnnSelectSectionOptionsHide').style.visibility='hidden';
}

		
		
		

	function toggle_highlight(inputTagReference)
	{
		var is_checked = inputTagReference.checked; //true or false
		if(is_checked)
		{
			inputTagReference.parentNode.parentNode.style.backgroundColor="yellow";
		}
		else
		{
			inputTagReference.parentNode.parentNode.style.backgroundColor="";
		}
	}

	
			//expand and contract menus
			var highZ = 3;
			function xGetElementById(e){if(typeof(e)!='string') return e;if(document.getElementById) e=document.getElementById(e);else if(document.all) e=document.all[e];else e=null;return e;}
			function xDef(){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}return true;}
			function xNum(){for(var i=0; i<arguments.length; ++i){if(isNaN(arguments[i]) || typeof(arguments[i])!='number') return false;}return true;}
			function xZIndex(e,uZ){if(!(e=xGetElementById(e))) return 0;if(e.style && xDef(e.style.zIndex)) {if(xNum(uZ)) e.style.zIndex=uZ;uZ=parseInt(e.style.zIndex);}return uZ;}
			function xWidth(e,w,ow) {
				e=xGetElementById(e);
				if(e.style.width==w+'px') {
					e.style.width=ow+'px';
					document.images["imgarrow"].src = "img/arrow_sm.gif";
					document.images["imgarrow2"].src = "img/arrow_sm.gif";
				} else {
					e.style.width=w+'px';
					document.images["imgarrow"].src = "img/arrow_sm_left.gif";
					document.images["imgarrow2"].src = "img/arrow_sm_left.gif";
				};
				xZIndex(e,highZ++);
			}
			
			
function rowcolor(elem) {
	if (elem.bgColor=='#ffffff' || elem.bgColor=='') {
		elem.bgColor='#e9e9e9'
	}
	else if (elem.bgColor=='#e9e9e9') {
		elem.bgColor='#ffffff'
	}
}

	var gridViewCtlId = 'contacts';
    var gridViewCtl = null;
    var curSelRow = null;
	var prevColor = '';
    function getGridViewControl()
    {
        if (null == gridViewCtl)
        {
            gridViewCtl = document.getElementById(gridViewCtlId);
        }
    }
    
    function rowSelect(rowIdx)
    {
        var selRow = getSelectedRow(rowIdx);
        if (curSelRow != null)
        {
            curSelRow.style.backgroundColor = prevColor;
        }
        
        if (null != selRow)
        {
            curSelRow = selRow;
			prevColor = curSelRow.style.backgroundColor;
            curSelRow.style.backgroundColor = '#D8DFEA';
        }
    }
    
    function getSelectedRow(rowIdx)
    {
        getGridViewControl();
        if (null != gridViewCtl)
        {
            return gridViewCtl.rows[rowIdx];
        }
        return null;
    }


function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id + 
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}



var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) {
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
}

function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
		if(arr[index] == ele)
			found = true;
		else
			index++;
	return found;
}
function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
}
return true;
}


function checkAll(v, formName, boxID) {
	for(var i=0;i<document[formName][boxID].length;i++)
		document[formName][boxID][i].checked=document[formName][v].checked;
}

// functions to display page load time *******************
function y2k(number)   {
   return (number < 1000) ? number + 1900 : number;
                     }
                  
function elapsedpretty(parm1)
{
  var elapsedsecs = 0
  var elapsedmins = 0
  
  elapsedsecs=Math.floor(parm1/1000)
  parm1=parm1%1000
  
  elapsedmins=Math.floor(elapsedsecs/60)
  elapsedsecs=elapsedsecs%60
  
  
elapsedpretty=elapsedmins + " minute"
if(elapsedmins!=1)
       elapsedpretty=elapsedpretty+"s"
  
elapsedpretty = elapsedpretty+" " + elapsedsecs+" second"
if(elapsedsecs!=1)
       elapsedpretty=elapsedpretty+"s"
  
elapsedpretty = elapsedpretty+ " "+parm1+" millisecond"
if(parm1!=1)
       elapsedpretty=elapsedpretty+"s"
  
  return elapsedpretty;
}  
// *********************************************************