
			
//<!--

var win=null;
function NewWindow(mypage,w,h,bScroll,bMenu,bResize, sWinName){
	var LeftPosition, TopPosition, settings
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=((screen.height)?(screen.height-h)/2:100)-100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+bScroll+',location='+bMenu+',directories='+bMenu+',status='+bMenu+',menubar='+bMenu+',toolbar='+bMenu+',resizable='+bResize;
	
	if(win)
	{
		win.close();
		win=window.open(mypage,sWinName,settings);
		win.focus();
	}
	else
	{
		win=window.open(mypage,sWinName,settings);
//		win.resizeTo(w,h); 
		win.focus();
	}				
}

function checkSubmit(e, jsCode)
{
	var charCode = (navigator.appName == "Netscape")? e.which : e.keyCode;
	if(charCode == 13)
	{
		e.keyCode = 9;
		eval(jsCode);
	}
}

function TieButton(btn){
    if (document.all)
    {
		var charCode = (navigator.appName == "Netscape")? event.which : event.keyCode;
    
		if (charCode == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
    }
}


function doSearchForm(document_id, textbox)
{
	document.location.href = "?did=" + document_id + "&" +  textbox.name + "=" + textbox.value;
}

function getElement(elName)
{	
	return document.all ? document.all(elName) : document.getElementById ? document.getElementById(elName) : document.layers ? document.layers[elName] : null;
}

function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
   }
   // if we get to this point, no radio button is selected
   return -1;
} 

function getSelectedRadioValue(buttonGroup) {
   // returns the value of the selected radio button or "" if no button is selected
   var i = getSelectedRadio(buttonGroup);
   if (i == -1) {
      return "";
   } else {
      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
         return buttonGroup[i].value;
      } else { // The button group is just the one button, and it is checked
         return buttonGroup.value;
      }
   }
} 
function doVoteForm(document_id, radiobutton, bUseOwnWindow)
{
	var iObjectId = getSelectedRadioValue(radiobutton)
	if(iObjectId > -1)
	{
		if(bUseOwnWindow == false)
		{
			document.location.href = "?did=" + document_id + "&documentobjectid=" +  iObjectId + "&viewtype=vote";
		}
	}
}



// -->