// display current year in footer copyright ******************/
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
function curYear() {
	document.write(year)
}

// open popup window
function openW(address,w,h,name) {
    if (w==null)
        w=550;
    if (h==null)
        h=400;
    if (name==null)
        name='popUp';

	windowHandle = window.open(address, name, 'toolbar=no,scrollbars=no,resizable=no,status=yes,width='+w+',height='+h);
	if (windowHandle.opener == null) {
		windowHandle.opener = self;
	}
	windowHandle.focus();
}

// row color alternating ******************/
function alternate(id){
	if (document.getElementById && document.getElementById(id)){	//check that browser has capabilities
		var table = document.getElementById(id);		//get just the selected table not all of them
		var rows = table.getElementsByTagName("tr");	//get all table rows
		for(i = 0; i < rows.length; i++){				//alternate styles			
			//manipulate rows	
			doAlternate(rows[i], i);
		}
	}
}
function doAlternate(row, i){
	if(i % 2 == 0){
		row.className = "even";
	}else{
		row.className = "odd";
	}
}

// Change Button Text ******************/
function replaceButtonText(buttonId, text)
{
  if (document.getElementById)
  {
    var button=document.getElementById(buttonId);
    if (button)
    {
      if (button.childNodes[0])
      {
        button.childNodes[0].nodeValue=text;
      }
      else if (button.value)
      {
        button.value=text;
      }
      else //if (button.innerHTML)
      {
        button.innerHTML=text;
      }
    }
  }
}

// PIP error checking - IS THIS USED OR IS /v2/includes/hs/pip_utl? ******************/
function checkDedType(obj) {
	var percObj = document.getElementById("CG952");
	var amtObj = document.getElementById("CG951");
	if ((percObj!=null)&&(amtObj!=null)&&(percObj.selectedIndex!=0)&&(amtObj.value!="")) {
		alert("Please note that you may give via a Fixed Dollar Amount or Fixed Percentage Amount but not both. Please blank one out of the deduction methods to proceed.");
		if (obj == percObj) percObj.selectedIndex = 0;
		else if (obj == amtObj) amtObj.value = "";
        }
}




