/*
	open new window
*/
window.name="parentWin";

function openWin(file, name) {
        
		popupWin = window.open(file, name, 'scrollbars,resizable,status=1,width=850,height=400');
		popupWin = window.open(file, name, 'scrollbars,resizable,status=1,width=850,height=400');

		// focus window (only for > Navigator 3.0)

        if ( (navigator.appName != "Microsoft Internet Explorer") && 
(navigator.appVersion.substring(0,1) == "3") )

        popupWin.focus();
}



function checkForm () { 

	//Initialise variables
	var errorMsg = "";
	
	//Check for a name
	if (document.loginForm.userName.value == ""){
		errorMsg += "\n\t- Please enter your username";	
	}
	
	if (document.loginForm.password.value == ""){
		errorMsg += "\n\t- Please enter your password";	
	}
	
	//alert (document.imgForm.Filedata.value);
	//alert (document.imgForm.Filedata.value.slice(-3, 3));
	
	 	
	//Check for an e-mail address and that it is valid
	/*if ((document.frmEnquiry.email.value == "") || (document.frmEnquiry.email.value.length > 0 && (document.frmEnquiry.email.value.indexOf("@",0) == - 1 || document.frmEnquiry.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter a valid e-mail address";
	}*/
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "____________________________________________\n\n";
		msg += "You must supply your Username and password in order to login.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "____________________________________________\n\n";
		//msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}



function checkTigForm () { 

	//Initialise variables
	var errorMsg = "";
	
	//Check for a name
	if (document.SignupTwo.Username.value == ""){
		errorMsg += "\n\t- Please enter your username";	
	}
	
	if (document.SignupTwo.Password.value == ""){
		errorMsg += "\n\t- Please enter your password";	
	}
	
	//alert (document.imgForm.Filedata.value);
	//alert (document.imgForm.Filedata.value.slice(-3, 3));
	
	 	
	//Check for an e-mail address and that it is valid
	/*if ((document.frmEnquiry.email.value == "") || (document.frmEnquiry.email.value.length > 0 && (document.frmEnquiry.email.value.indexOf("@",0) == - 1 || document.frmEnquiry.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter a valid e-mail address";
	}*/
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "____________________________________________\n\n";
		msg += "You must supply your Username and password in order to login.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "____________________________________________\n\n";
		//msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}

