// 
var bDirty = false;

function window_onbeforeunload() {
	if (bDirty!=null) {
		if (bDirty == true) {
			return 'You have changed some fields without saving';
		}	
	}
}

function firstFocus()
// Don't send focus to embedded directories
{
   if (document.forms.length > 0)
   {
	for (d=0;d<document.forms.length;d++)
	{
		var TForm = document.forms[d];
		if ((TForm.name.substring(0,6)!='up_dir')&& // embedded directories
			(TForm.name.substring(0,7)!='frmPoll'))  // embedded wizards
		{	
			//window.alert(TForm.name.substring(0,7));	
			for (i=0;i<TForm.length;i++)
			{
			   if ((TForm.elements[i].type=="text")||
			     (TForm.elements[i].type=="textarea")||
			     (TForm.elements[i].type=="checkbox")||
			     (TForm.elements[i].type.toString().charAt(0)=="s"))
			   {
			      if ((TForm.elements[i].offsetHeight>0)&& // hidden tabs
					(TForm.elements[i].disabled==false))   // disabled fields
					{
			  		TForm.elements[i].focus();
			      	break;
					}
			   }
			}
		}

	}
   }
}


function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function Impersonate(host,site){
}

function Old_Impersonate(host,site){
	var winWelcome;
	var strLogin = 'NTImpersonate:readfiles@';
	winWelcome = window.open (host + strLogin + site + '/NTImpersonate.asp', 'winWelcome', 'width=40,height=20,top=1000,toolbar=no,directories=no, location=no,status=no,scrollbars=no,resizeable=no,menubar=no');
	if (winWelcome != null){
		if (winWelcome.opener == null)   
			winWelcome.opener = self;
	}
}
