﻿// JScript File

function ToggleControl(chkBox,txtName)
{
	if(!chkBox.checked){
	    txtName.disabled = true;
	    txtName.value="" }
	else{
		txtName.disabled = false;
	}

}

function openWin(FormUrl)
{
   window.open(FormUrl,"FormWin","resizable=yes,width=800,height=700,scrollbars=yes")
}

function openNewWindow(FormUrl,FormNum)
{
    window.open(FormUrl,"FormWin" + FormNum,"width=800,height=700,scrollbars=yes");
    
}

function SetThankWinSize()
{
   self.resizeTo(600,500);
}

function SetFormWinSize()
{
   self.resizeTo(800,700);
}

//function SetWinFullSize()
//{
//   self.resizeTo(screen.width,screen.height);
//}

// Keep user from entering more than maxLength characters
function doKeypress(control){
    maxLength = control.attributes["maxLength"].value;
    value = control.value;
     if(maxLength && value.length > maxLength-1){
          event.returnValue = false;
          maxLength = parseInt(maxLength);
     }
}
// Cancel default behavior
function doBeforePaste(control){
    maxLength = control.attributes["maxLength"].value;
     if(maxLength)
     {
          event.returnValue = false;
     }
}
// Cancel default behavior and create a new paste routine
function doPaste(control){
    maxLength = control.attributes["maxLength"].value;
    value = control.value;
     if(maxLength){
          event.returnValue = false;
          maxLength = parseInt(maxLength);
          var oTR = control.document.selection.createRange();
          var iInsertLength = maxLength - value.length + oTR.text.length;
          var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
          oTR.text = sData;
     }
}