
var dirPath="";			


var  flagPassStage3="false";
var  flagPassStage5="false";
var  flagPaymentClick="false";
var	 SetPageToStage2Var="false";
var FlagSetFocusIframeStage4=false;
var	 EndSerialNo;
flg=false;
var FLGScroll=false;


/*function MaximizeWindow()
{
	top.window.moveTo(0,0); 
	if (document.all) 
	{ top.window.resizeTo(screen.availWidth-2000,screen.availHeight); } 
	else if (document.layers || document.getElementById) 
	{ 
		if(top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)		
		{
			top.window.outerHeight = top.screen.availHeight; 
			top.window.outerWidth = top.screen.availWidth-2000;
		} 
   } 
}*/



function HidePanel()
{
	document.getElementById("DivErrorSendMails").style.visibility="hidden";
	
}
function ShowPanel()
{
	document.getElementById("DivErrorSendMails").style.visibility="visible";
	document.getElementById("aLinkHere").disabled=true;
	document.getElementById("aLinkHere").style.cursor="normal";
	
}

function ChangeHand()
{
	if (document.getElementById("aLinkHere").disabled==true)
	{
		document.getElementById("aLinkHere").style.cursor="normal";
	}
}


function SetPDF()
{
	if (document.getElementById("pdfName")!="")
	{
		switch(document.getElementById("pdfName").value)
		{
			case "participatingFI.pdf":
			document.getElementById("ifrmPDF").src="../links/participatingFI.pdf"; 
			document.title="Current Participating Financial Institutions";
			break;	
			
			case "packages.pdf":
			document.getElementById("ifrmPDF").src="../links/packages.pdf"; 
			document.title="Current Packages Supported";
			break;
			
			case "productService.pdf":
			document.getElementById("ifrmPDF").src="../links/productService.pdf"; 
			document.title="Product and Service Features";
			break;
			
			case "overview.pdf":
			document.getElementById("ifrmPDF").src="../links/overview.pdf"; 
			document.title="Order Processing Overview";
			break;
			
			case "pricing.pdf":
			document.getElementById("ifrmPDF").src="../links/pricing.pdf"; 
			document.title="Pricing";
			break;
			
			case "HowTo.pdf":
			document.getElementById("ifrmPDF").src="../links/HowTo.pdf"; 
			document.title="How to Complete Your BizCheque Order";
			break;
			
			case "imagehints.pdf":
			document.getElementById("ifrmPDF").src="../links/imagehints.pdf"; 
			document.title="Image Upload Hints and Tips";
			break;			
			
			case "conditions.pdf":
			document.getElementById("ifrmPDF").src="../links/conditions.pdf"; 
			document.title="Terms and Conditions";
			break;
			
			case "privacypolicy.pdf":
			document.getElementById("ifrmPDF").src="../links/privacypolicy.pdf"; 
			document.title="Privacy Policy";
			break;
			
			case "fraudhints.pdf":
			document.getElementById("ifrmPDF").src="../links/fraudhints.pdf"; 
			document.title="Download Fraud Hints and Tips";
			break;
			
			case "usefullinks.pdf":
			document.getElementById("ifrmPDF").src="../links/usefullinks.pdf"; 
			document.title="Useful Links";
			break;
			
			case "FAQ.pdf":
			document.getElementById("ifrmPDF").src="../links/FAQ.pdf"; 
			document.title="Frequently Asked Questions";
			break;
		}
		
	}
}

function OpenOtherLMProducts()
{
	window.open("http://www.leighmardon.com.au/Products_and_Services.aspx?id=3","OtherProducts","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1,alwaysRaised=1");
}
//**** End ****//

function OpenAboutUs()
{	
	newwindow=window.open("http://www.leighmardon.com.au/about/index.html","AboutUs","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1,alwaysRaised=1");
	if (window.focus) {newwindow.focus()}
	

}


function SetFAQ()
{
	
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Frequently Asked Questions"+"&PDFName="+"FAQ.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	 
}

function SetUsefulLinks()
{
	
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Useful Links"+"&PDFName="+"usefullinks.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}

function SetFraudhints()
{
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Download Fraud Hints and Tips"+"&PDFName="+"fraudhints.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}

function SetPrivacyPolicy()
{	 
	newwindow=window.open("http://www.leighmardon.com.au/privacypolicy/index.html","PrivacyPolicy","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1,alwaysRaised=1");
	if (window.focus) {newwindow.focus()}	

}

function SetConditions()
{	
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Terms and Conditions"+"&PDFName="+"conditions.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}


function SetImageHints()
{
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Image Upload Hints and Tips"+"&PDFName="+"imagehints.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}

function SetHowTo()
{	
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "How to Complete Your BizCheque Order"+"&PDFName="+"HowTo.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}


function SetPricing()
{
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Pricing"+"&PDFName="+"pricing.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}

function SetOrverview()
{
	 
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Order Processing Overview"+"&PDFName="+"overview.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}

function SetProductServiceFea()
{
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Product and Service Features"+"&PDFName="+"productService.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}

function SetPaticipatingFI()
{
	
	
	if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Current Participating Financial Institutions"+"&PDFName="+"participatingFI.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}			
	}
	
	
}
function SetPakcages()
{
 
 if (document.getElementById("hddnWebURL").value!="" || document.getElementById("hddnWebURL").value!=null)
	{
		newwindow=window.open(document.getElementById("hddnWebURL").value + "/links/links.aspx?PageName=" + "Current Packages Supported"+"&PDFName="+"packages.pdf","","toolbar=0,resizable=1,title=0,width=1020,scrollbars=1");		
		if (window.focus) {newwindow.focus()}		
		
		
	} 
}

function ClosePDFWindow()
{
	window.close();
}




function SetImage()
{
	if ((document.getElementById("chkAgreement").checked==true) && (document.getElementById("chkViewPDF").checked==true))
	{
		document.getElementById("imgBtnContinue").disabled=false;
		document.getElementById("imgBtnContinue").src="../pics/continue.gif";
		document.getElementById("imgBtnContinue").style.cursor="Hand";
	}
	else
	{
		document.getElementById("imgBtnContinue").disabled=true;
		document.getElementById("imgBtnContinue").src="../pics/continuegray.jpg";
		document.getElementById("imgBtnContinue").style.cursor="Normal Select";
	}	
}


function DissableContinue()
{
	//document.getElementById("imgBtnContinue").disabled=true;
	document.getElementById("ImageButton1").style.cursor="Normal Select";
}

function MaximizeWindow()
{
	top.window.moveTo(0,0);
	if (document.all)
	{
		top.window.resizeTo(screen.availWidth+150,screen.availHeight+150);
	}
	else if (document.layers||document.getElementById)
	{
	/*
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
		{
			top.window.outerHeight = screen.availHeight+50;
			top.window.outerWidth = screen.availWidth+50;
		}
	*/
	}
}


function EnableContinu()
{
	if (document.getElementById("chkAgreement").checked==true)
	{
		document.getElementById("htmlBtnContinue").disabled=false;
		document.getElementById("htmlBtnContinue").style.backgroundImage="url(../pics/continue.gif)";
	}
	else
	{
		document.getElementById("htmlBtnContinue").disabled=true;
		document.getElementById("htmlBtnContinue").style.backgroundImage="url(../pics/continuegray.jpg)";
	}
}

function SetLogoPath()
{
	//document.getElementById("logo").title="C:\WINDOWS";
	//document.getElementById("TextBox1").value==document.getElementById("hddnEndSerialNo").value;
	document.getElementById("lblEndSerialNo").innerHTML=document.getElementById("hddnEndSerialNo").value;
					
	
}

function Test()
{
	window.opener=self;
	window.close();
	window.open("http://www.leighmardon.com.au");
}


function SetFocusTitle1()
{
	document.getElementById("txtAccNo").focus();
}

function SetFocusAreaCode()
{
	if (document.getElementById("txtReqPostCode").value!=="")
	{
		if (document.getElementById("cboSuburb").value=="Select Suburb")
		{
			if (document.getElementById("cboSuburb").disabled==false)
			{
	
				document.getElementById("cboSuburb").focus();
			}
					
		}
		else
		{
			if (document.getElementById("txtReqPhnNo1").disabled==false)
			{
				document.getElementById("txtReqPhnNo1").focus();
				event.keyCode=9;
				return;	
			}
		}
	}
}

function SetFocusState()
{
	if (document.getElementById("txtDelivryPostCode").value!="")
	{
		if (document.getElementById("cboSuburb").value=="Select Suburb")
		{
			document.getElementById("cboSuburb").focus();
		}				
		
	}		
}



function SehddnSetFocusPhnno1()
{
	if (document.getElementById("txtReqPostCode").value!="")
	{
		if (document.getElementById("cboSuburb").value=="Select Suburb")
		{
			document.getElementById("cboSuburb").focus();
			
		}	
		else if (document.getElementById("cboSuburb").value!="Select Suburb")
		{
			document.getElementById("cboSuburb").disabled=true;
			document.getElementById("txtReqPhnNo1").focus();
		}			
		
	}	
	
}

function SetPageToStage2()
{
	parent.document.getElementById("ifrm").src="stage1.aspx";
	SetPageToStage2Var="true";
}

function SetSecurity()
{
	document.getElementById("ifrmSecurity").src="../links/security.pdf"; 
}



function SetAboutUs()
{
	document.getElementById("ifrmAboutUs").src="../links/aboutus.pdf"; 
}

function SetAboutUsOnDemend()
{
	document.getElementById("ifrmAboutUs").src="links/aboutus.pdf"; 
}




function NumericCheckBSB()
{

	if(event.keyCode==8 || event.keyCode==46 || event.keyCode==38 || event.keyCode==39) 
	{
		event.returnValue = true;
		return;
	}

	if(event.keyCode==13 || event.keyCode==9) 
	{
		event.keyCode=9;
		return;
	}
	
	if (event.keyCode <=105 && event.keyCode >= 96) 
	{
		event.returnValue = true;
		return;
	}
	
	if (event.keyCode <= 45 || event.keyCode > 57) 
	{
		event.returnValue = false;
	}
	if (event.keyCode==46 || event.keyCode==47)
	{
		event.returnValue = false;
	}
	
	if (document.getElementById("txtBSB").value.length==3)
	{
		document.getElementById("txtBSB").value +="-";
	}
	
	
}

function OnlyNumerics ($char, $mozChar) 
{ 

if($mozChar != null) { // Look for a Mozilla-compatible browser

if(($mozChar >= 48 && $mozChar <= 57) || $mozChar == 0 || $char ==
8 || $mozChar == 13) $RetVal = true;

else {
$RetVal = false;
//alert('Please enter a numeric value.');
}
}
else { // Must be an IE-compatible Browser

if(($char >= 48 && $char <= 57) || $char == 13) $RetVal = true;

else {
$RetVal = false;
//alert('Please enter a numeric value.');
}
}
return $RetVal;

}








function NumericCheck()
{
	if(event.keyCode==8 || event.keyCode==46 || event.keyCode==38 || event.keyCode==39) 
	{
		event.returnValue = true;
		return;
	}

	if(event.keyCode==13 || event.keyCode==9) 
	{
		event.keyCode=9;
		return;
	}
	
	if (event.keyCode <=105 && event.keyCode >= 96) 
	{
		event.returnValue = true;
		return;
	}
	if (event.keyCode <= 45 || event.keyCode > 57) 
	{
		event.returnValue = false;
	}
	if (event.keyCode==46 || event.keyCode==47)
	{
		event.returnValue = false;
	}
		
}

function noNumbers(e)
{
	var keynum
	var keychar
	var numcheck
	
	if(event.keyCode==13 || event.keyCode==9) 
	{
		event.keyCode=9;
		return;
	}
	
	if(window.event) // IE
	{
		keynum = e.keyCode
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which
	}
		keychar = String.fromCharCode(keynum)
		numcheck = /\d/
	return !numcheck.test(keychar)
}


function GetEndSerialNo()
{
	var intStartNo=document.getElementById("txtSerialNo").value;
	var intEndNo;

	//document.getElementById("txtSerialNo").value="12345";

	if (document.getElementById("txtSerialNo").value!="" && document.getElementById("txtQuantity").value!="")
	{
		if (parseInt(document.getElementById("txtSerialNo").value/1) !=0 && parseInt(document.getElementById("txtQuantity").value/1) !=0)
		{
			if (parseInt(document.getElementById("txtSerialNo").value)>999500)
			{
				//document.getElementById("lblNoExceedWarnning").innerHTML="Starting serial number can not exceed 999500.";
				
				
			}
			else
			{
				document.getElementById("lblNoExceedWarnning").innerHTML="";
				
				for(var i=1;i<=6;i++)
				{
					if (intStartNo.substr(i-1,1)!="0")
					{
						intStartNo=intStartNo.substr(i-1);
						i=1;
						break;
					}
				}
			}
		
			
			
			var intNoLen=intStartNo.length;			
			
			intEndNo=parseInt(document.getElementById("txtQuantity").value) * 500 + parseInt(intStartNo.toString())-1;	
			document.getElementById("lblEndSerialNo").innerHTML=intEndNo;
			document.getElementById("hddnEndSerialNo").value=intEndNo;
			
			//document.getElementById("TextBox1").value=intEndNo;
			
			
				
			if (document.getElementById("txtSerialNo").value.length!=6)
			{
				for(var i=1;i<=6-intNoLen;i++)
				{
					
						intStartNo="0"+intStartNo;
						
				}
				document.getElementById("txtSerialNo").value=intStartNo;
			}
			
				
			
			
			if (document.getElementById("lblEndSerialNo").innerHTML.length!=6)
			{
				var intEndSerialNo=intEndSerialNoLen=document.getElementById("lblEndSerialNo").innerHTML;
				var intEndSerialNoLen=document.getElementById("lblEndSerialNo").innerHTML.length;	
				
				
				for(var i=1;i<=6-intEndSerialNoLen;i++)
				{					
						intEndSerialNo="0"+intEndSerialNo;
												
				}	
				document.getElementById("lblEndSerialNo").innerHTML=intEndSerialNo;	
				document.getElementById("hddnEndSerialNo").value=intEndSerialNo;					
			}		
			
		} 
		else
		{
			//document.getElementById("lblEndSerialNo").innerHTML=""; 26022007
			//document.getElementById("txtSerialNo").value="";
			//makeAlert("MTO bizCheques","Invalid Serial No.");
		}
		
		if (parseInt(document.getElementById("txtSerialNo").value)>999500)
		{
			document.getElementById("lblNoExceedWarnning").innerHTML="Starting serial number can not exceed 999500.";
			document.getElementById("txtSerialNo").value="1";
			document.getElementById("txtSerialNo").focus();
			document.getElementById("lblEndSerialNo").innerHTML="";
			
		}
		else
		{
			document.getElementById("lblNoExceedWarnning").innerHTML="";
		}
		
	}
	else
	{
		document.getElementById("lblEndSerialNo").innerHTML="";
	}
	
	//ValidateSerialNo();
}

function ValidateQty()
{
		
	if (document.getElementById("txtSerialNo").value!="" && document.getElementById("txtQuantity").value!="")
	{
		var intStartNo=document.getElementById("txtSerialNo").value;
	
		if (parseInt(document.getElementById("txtSerialNo").value/1) !=0 && parseInt(document.getElementById("txtQuantity").value/1) !=0)
		{
			for(var i=1;i<=6;i++)
			{
				if (intStartNo.substr(i-1,1)!="0")
				{
					intStartNo=intStartNo.substr(i-1);
					i=1;
					break;
				}
			}
			
			intEndNo=parseInt(document.getElementById("txtQuantity").value) * 500 + parseInt(intStartNo.toString())-1;	 
			
			document.getElementById("lblEndSerialNo").innerHTML=intEndNo;
			document.getElementById("hddnEndSerialNo").value=intEndNo;
			
			if (document.getElementById("lblEndSerialNo").innerHTML.length!=6)
			{
				var intEndSerialNo=intEndSerialNoLen=document.getElementById("lblEndSerialNo").innerHTML;
				var intEndSerialNoLen=document.getElementById("lblEndSerialNo").innerHTML.length;	
				
				
				for(var i=1;i<=6-intEndSerialNoLen;i++)
				{					
						intEndSerialNo="0"+intEndSerialNo;
												
				}	
				document.getElementById("lblEndSerialNo").innerHTML=intEndSerialNo;		
				EndSerialNo=intEndSerialNo;
				document.getElementById("hddnEndSerialNo").value=intEndSerialNo;				
			}		
			
			
		}
		else
		{
			document.getElementById("lblEndSerialNo").innerHTML="";
		}
	}
	else
	{
		document.getElementById("lblEndSerialNo").innerHTML="";
	}
	
}


function ValidateSerialNo()
{
	if (document.getElementById("txtSerialNo").value!="")
	{
		if (document.getElementById("txtSerialNo").value.length!=6)
		{
			document.getElementById("txtSerialNo").value="";
			document.getElementById("lblEndSerialNo").innerHTML="";
			makeAlert("MTO bizCheques","Invalid Serial No.");
		}
		else if(document.getElementById("txtSerialNo").value.length==6)
		{
			if (parseInt(document.getElementById("txtSerialNo").value)/1==0)
			{
				document.getElementById("txtSerialNo").value="";
				document.getElementById("lblEndSerialNo").innerHTML="";
				makeAlert("MTO bizCheques","Invalid Serial No.");
			}
			else
			{
				//document.getElementById("txtValidateSerialNo").value="true";
			}
		}
	}
	else
	{
		document.getElementById("txtSerialNo").value="";
		document.getElementById("lblEndSerialNo").innerHTML="";
		//alert("Invalid Serial No.");
	}
}

function validatePostCode()
{
	if (document.getElementById("txtReqPostCode").value!="")
	{
		if (document.getElementById("txtReqPostCode").value.length!=4)
		{
			document.getElementById("txtReqPostCode").value="";
			makeAlert("MTO bizCheques","  Invalid Post Code");
			document.getElementById("txtReqPostCode").AutoPostBack=false;
			
		}
		else
		{
			document.getElementById("txtReqPostCode").AutoPostBack=true;
		}
	}

}


function ValidateBSB()
{
	

	if (document.getElementById("txtBSB").value!="")
	{
		if (document.getElementById("txtBSB").value.length!=7)
		{
			document.getElementById("txtBSB").value="";
			//alert("Invalid BSB");
			makeAlert("MTO bizCheques","  Invalid BSB!");
		}
		else if(document.getElementById("txtBSB").value.length==7)
		{
			if (parseInt(document.getElementById("txtBSB").value.substr(0,3)+ document.getElementById("txtBSB").value.substr(3,3) )/1==0)
			{
				document.getElementById("txtBSB").value="";
				makeAlert("MTO bizCheques","  Invalid BSB!");
				
			}
			else
			{
				//document.getElementById("txtBSB").value="true";
			}
		}
	}
	else
	{
		document.getElementById("txtBSB").value="";
	}
}

function EraseAccNo()
{
	if (document.getElementById("cboFinancialInst").value!="Select Financial Institute")
	{
		if (document.getElementById("hdnFinsSelected").value !=document.getElementById("cboFinancialInst").value)
		{
			document.getElementById("hdnFinsSelected").value=document.getElementById("cboFinancialInst").value
			document.getElementById("txtAccNo").value="";		
			
		}
		
		if (document.getElementById("txtBSB").disabled)
		{
			document.getElementById("txtAccNo").focus();
			event.keyCode=9;
		}
	}
	
}

function ValidateAccNo()
{

	if (document.getElementById("txtAccNo").value!="")
	{
	
		if (document.getElementById("cboFinancialInst").value=="1")
		{
			if (document.getElementById("txtAccNo").value.length!=9)
			{
				document.getElementById("txtAccNo").value="";
				makeAlert("MTO bizCheques","Invalid Account Number for Westpac");
				return;
			}
		}
		else if (document.getElementById("cboFinancialInst").value!="1")
		{
			if (document.getElementById("txtAccNo").value.length==9)
			{
				document.getElementById("txtAccNo").value="";
				makeAlert("MTO bizCheques","Invalid Account Number");
				return;
			}
		}
		
	
		if (document.getElementById("txtAccNo").value.length==6)
		{
			if (parseInt(document.getElementById("txtAccNo").value)/1 ==0)
			{
				document.getElementById("txtAccNo").value="";
				makeAlert("MTO bizCheques","Invalid Account Number");				
			}
			else
			{
				//document.getElementById("txtValidateAccNo").value="true";
			}
		}
		else if (document.getElementById("txtAccNo").value.length==9)
		{
			if (parseInt(document.getElementById("txtAccNo").value)/1 ==0)
			{
				document.getElementById("txtAccNo").value="";
				makeAlert("MTO bizCheques","Invalid Account Number");
			}
			else
			{
				//document.getElementById("txtValidateAccNo").value="true";
			}
		}
		else
		{
			document.getElementById("txtAccNo").value="";
			makeAlert("MTO bizCheques","Invalid Account Number");
		}
	}
	else
	{
		document.getElementById("txtAccNo").value="";
		//alert("Invalid Account No.");
	}
}






function SetPckValidation()
{
	if (document.getElementById("optLowChqSeTop").checked==true || document.getElementById("optHighChqTop").checked==true)
	{
		document.getElementById("txtPkgOptionValidate").value="true";
	}
}

function SetSignatureValidation()
{
	if (document.getElementById("optSigLine1").checked==true || document.getElementById("optSigLine2").checked==true )
	{
		document.getElementById("txtSigValidate").value="true";
	}
}

function SetCrossingValidation()
{
	if (document.getElementById("optOpen").checked==true || document.getElementById("optAccPayee").checked==true || document.getElementById("optNotNego").checked==true )
	{
		document.getElementById("txtCrossingValidate").value="true";
	}
}

function ValidatePhoneNoReq()
{
	var PhnNo1=document.getElementById("txtReqPhnNo1").value;
	var PhnNo2=document.getElementById("txtReqPhnNo2").value;	
	
	//document.getElementById("txtValidateReqPhnNo").value="true";
	

	if(PhnNo1!="" )
	{
		if (PhnNo1/1==0)
		{
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
		if (PhnNo1.length!=2)
		{
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
		/*if (PhnNo2.length!=10)
		{
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
		}*/
		
		if (PhnNo1.substr(0,1)=="0")
		{
			if (parseInt(PhnNo1.substr(1,1))< 1 && parseInt(PhnNo1.substr(1,1))>9)
			{
				document.getElementById("txtReqPhnNo1").value="";
				document.getElementById("txtReqPhnNo2").value="";
				makeAlert("MTO bizCheques","Invalid Phone Number.");
				return;
			}
			
		}
		else
		{	
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;		
		}
	}
	else
	{
		document.getElementById("txtReqPhnNo1").value="";
		document.getElementById("txtReqPhnNo2").value="";
		return;
	}
	
	if(PhnNo2!="" )
	{
		if (PhnNo2/1==0)
		{
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
		if (PhnNo2.length<8)
		{
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
			
		
	}
	else
	{
		document.getElementById("txtReqPhnNo1").value="";
		document.getElementById("txtReqPhnNo2").value="";
		return;
	}

}

function ValidatePhoneNoSig()
{
	var PhnNo1=document.getElementById("txtSigPhnNo1").value;
	var PhnNo2=document.getElementById("txtSigPhnNo2").value;	
	
		if(PhnNo1!="" )
	{
		if (PhnNo1/1==0)
		{
			document.getElementById("txtSigPhnNo1").value="";
			document.getElementById("txtSigPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
		if (PhnNo1.length!=2)
		{
			document.getElementById("txtSigPhnNo1").value="";
			document.getElementById("txtSigPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
		/*if (PhnNo2.length!=10)
		{
			document.getElementById("txtReqPhnNo1").value="";
			document.getElementById("txtReqPhnNo2").value="";
		}*/
		
		if (PhnNo1.substr(0,1)=="0")
		{
			if (parseInt(PhnNo1.substr(1,1))< 1 && parseInt(PhnNo1.substr(1,1))>9)
			{
				document.getElementById("txtSigPhnNo1").value="";
				document.getElementById("txtSigPhnNo2").value="";
				makeAlert("MTO bizCheques","Invalid Phone Number.");
				return;
			}
			
		}
		else
		{	
			document.getElementById("txtSigPhnNo1").value="";
			document.getElementById("txtSigPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;		
		}
	}
	else
	{
		document.getElementById("txtSigPhnNo1").value="";
		document.getElementById("txtReqPhnNo2").value="";
		return;
	}
	
	if(PhnNo2!="" )
	{
		if (PhnNo2/1==0)
		{
			document.getElementById("txtSigPhnNo1").value="";
			document.getElementById("txtSigPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
		if (PhnNo2.length<8)
		{
			document.getElementById("txtSigPhnNo1").value="";
			document.getElementById("txtSigPhnNo2").value="";
			makeAlert("MTO bizCheques","Invalid Phone Number.");
			return;
		}
			
		
	}
	else
	{
		document.getElementById("txtSigPhnNo1").value="";
		document.getElementById("txtSigPhnNo2").value="";
		return;
	}

}
function setWelcomePage()
{	
	window.defaultStatus="--- MTO bizCheques ---";
	
		//document.getElementById("ifrm2").src="../bizcheques/default.aspx";
		
		switch(document.getElementById("hddnSetPage").value)
		{
			
			case "":
					document.getElementById("ifrm").src="../bizcheques/welcome.aspx";
					break;
			case "stage1.aspx":
					document.getElementById("ifrm").src="../bizcheques/stage1.aspx";
					break;
			case "orverview.aspx":
					document.getElementById("ifrm").src="../links/overview.aspx";
					break;
			case "welcome.aspx":
					document.getElementById("ifrm").src="../bizcheques/welcome.aspx";
					break;					
			case "pricing.aspx":
					document.getElementById("ifrm").src="../links/pricing.aspx";
					break;					
			case "security.aspx":
					document.getElementById("ifrm").src="../links/security.aspx";
					break;
			case "conditions.aspx":
					document.getElementById("ifrm").src="../links/conditions.aspx";
					break;
			case "imagehints.aspx":
					document.getElementById("ifrm").src="../links/imagehints.aspx";
					break;
			case "fraudhints.aspx":
					document.getElementById("ifrm").src="../links/fraudhints.aspx";
					break;
			case "usefullinks.aspx":
					document.getElementById("ifrm").src="../links/usefullinks.aspx";
					break;
			case "aboutus.aspx":
					document.getElementById("ifrm").src="../links/aboutus.aspx";
					break;
					
		}
		
	/*
		if (document.getElementById("hddnSetPage").value=="")
		{
			document.getElementById("ifrm").src="../bizcheques/welcome.aspx";
		}
		else
		{
			document.getElementById("ifrm").src=document.getElementById("hddnSetPage").value;
		}*/
		resetStageFlags();		
	
}

function SetPDFOrdered()
{
	document.getElementById("ifrmPdfOrdered").src=document.getElementById("pdfNameOrdered").value;
}

function SetPaymentClick()
{
	flagPaymentClick="true";
}
	

function setPdf()
{
	var IFrame2=document.getElementById("ifrmShowPdf");
	document.getElementById("ifrmShowPdf").src=document.getElementById("pdfName").value;
	IFrame2.focus();
	//document.getElementById("lblPdfShowHeading").setText=document.getElementById("HeadingName").value;
}

/*function GoBack()
{
	parent.window.history.back();
}*/

function setPageStage1()
{
	parent.document.stage1="true";
	parent.document.getElementById("ifrm").src="stage1.aspx";
}

function GoBack()
{
	window.history.back();
}
function stage1packgeSelected()
{
	
	parent.document.stage2="true";
}
function GoBackFromStage2()
{
	
	//window.history.back();
	parent.window.document.getElementById("wizard_imgStg1").src="../pics/1i.gif";
	parent.window.document.getElementById("wizard_imgStg2").src="../pics/2.gif";
	//resetStageFlags();
}
function GoForwardFromStg2()
{
		
		if (parent.window.stage2=="true")
		{
			//alert("GoForwardFromStg2-if");
			window.history.forward();
		}
		else
		{	
			//alert("GoForwardFromStg2-else");
			parent.window.document.getElementById("ifrm").src="stage3.aspx";
			parent.window.stage2="true"
			//parent.document.getElementById("cboFinancialInst").focus();
			
		}				
}
function GoForwardFromStg3()
{
		
		if (parent.window.stage3=="true")
		{
			//window.history.forward();
			parent.window.flagPassStage3="true";
		}
		else
		{
			
			//parent.window.document.getElementById("ifrm").src="stage4.aspx";
			parent.window.stage3="true"
			parent.window.flagPassStage3="true";
			
		}		
		
			
}

function GoBackFromStage3()
{
	
	//window.history.back();
	parent.window.document.getElementById("wizard_imgStg2").src="../pics/2i.gif";
	parent.window.document.getElementById("wizard_imgStg3").src="../pics/3.gif";
}

function GoForwardFromStg4()
{
		
		if (parent.window.stage4=="true")
		{
			window.history.forward();
			parent.window.flagPassStage4="true";
		}
		else
		{
			//parent.window.document.getElementById("ifrm").src="stage5.aspx";
			parent.window.stage4="true";
			parent.window.flagPassStage3="true";
			
			
		}				
}

function GoBackFromStage4()
{
	
	//window.history.back();
	parent.window.document.getElementById("wizard_imgStg3").src="../pics/3i.gif";
	parent.window.document.getElementById("wizard_imgStg4").src="../pics/4.gif";
	
	
	
}
function GoForwardFromStg5()
{
		
		if (parent.window.stage5=="true")
		{
			//window.history.forward();
			parent.window.flagPassStage5="true";
		}
		else
		{
			//parent.window.document.getElementById("ifrm").src="stage6.aspx";
			parent.window.stage5="true"
			parent.window.flagPassStage5="true";
		}				
}

function GoBackFromStage5()
{
	
	//window.history.back();
	parent.window.document.getElementById("wizard_imgStg4").src="../pics/4i.gif";
	parent.window.document.getElementById("wizard_imgStg5").src="../pics/5.gif";
	
}

function GoForwardFromStg6()
{
		
		if (parent.window.stage6=="true")
		{
			window.history.forward();
			parent.window.flagPassStage6="true";
		}
		else
		{
			//parent.window.document.getElementById("ifrm").src="stage7.aspx";
			parent.window.stage6="true";
			parent.window.flagPassStage6="true";
		}				
}

function GoBackFromStage6()
{
	
	//window.history.back();
	parent.window.document.getElementById("wizard_imgStg5").src="../pics/5i.gif";
	parent.window.document.getElementById("wizard_imgStg6").src="../pics/6.gif";
	
	
}
function GoForwardFromStg7()
{
		SetPaymentClick();
		
		if (parent.window.stage7=="true")
		{
			window.history.forward();
		}
		else
		{
			//parent.window.document.getElementById("ifrm").src="stage8.aspx";
			parent.window.stage7="true"
		}	
		parent.document.url="https://payments.verisign.com.au";
		setWizardStage8Images();	
		
}

function GoBackFromStage7()
{	
	//window.history.back();
	parent.window.document.getElementById("wizard_imgStg6").src="../pics/6i.gif";
	parent.window.document.getElementById("wizard_imgStg7").src="../pics/7.gif";	
}

function resetStageFlags()
{
	//alert("resetStageFlags");
	parent.window.stage1="false";
	parent.window.stage2="false";
	parent.window.stage3="false";
	parent.window.stage4="false";
	parent.window.stage5="false";
	parent.window.stage6="false";
	parent.window.stage7="false";
	parent.window.stage8="false";
	parent.window.stage9="false";

	hideWizard();
}
function packageSelected()
{
	parent.window.stage1="true"
}

function OnScrlStage3()
{
		
	if (parent.window.flagPassStage3=="true")
	{
		setTimeout('setFocusStage3()',1000/3);		
	}
	
}

function setFocusStage3()
{
	self.scrollTo(0,0);
	parent.window.flagPassStage3="false";
	
}

function OnScrlStage5()
{
	if (parent.window.flagPassStage5=="true")
	{
		setTimeout('setFocusStage5()',1000/3);
	}
	
}

function setFocusStage5()
{
	self.scrollTo(500,0);
	parent.window.flagPassStage5="false";
	
}

function OnScrlStage6()
{
	if (parent.window.flagPassStage6=="true")
	{
		setTimeout('setFocusStage6()',1000/3);
	}
	
}

function setFocusStage6()
{
	self.scrollTo(500,0);
	parent.window.flagPassStage6="false";	
}




//**********************************************************************************//
//This part contains functions of setting up images on nevigation on the wizard    //

function hideWizard()
{
	parent.window.document.getElementById("wizard_imgStg1").src="../pics/tmpHolder.gif";
	
	parent.window.document.getElementById("wizard_imgStg2").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg3").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg4").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg5").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg6").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg7").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg8").src="../pics/tmpHolder.gif";
	parent.window.document.getElementById("wizard_imgStg9").src="../pics/tmpHolder.gif";
}

function setWizardStage1Image()
{
	
	parent.window.document.getElementById("wizard_imgStg1").src="../pics/1i.gif";
	
	//document.getElementById("wizard_imgStg1").src="../pics/1i.gif";
	
	parent.window.document.getElementById("wizard_imgStg2").src="../pics/2.gif";
	parent.window.document.getElementById("wizard_imgStg3").src="../pics/3.gif";
	parent.window.document.getElementById("wizard_imgStg4").src="../pics/4.gif";
	parent.window.document.getElementById("wizard_imgStg5").src="../pics/5.gif";
	parent.window.document.getElementById("wizard_imgStg6").src="../pics/6.gif";
	parent.window.document.getElementById("wizard_imgStg7").src="../pics/7.gif";
	parent.window.document.getElementById("wizard_imgStg8").src="../pics/8.gif";
	//parent.window.document.getElementById("wizard_imgStg9").src="../pics/9.gif";
	
	

}

function setWizardStage2Images()
{
	
	parent.window.document.getElementById("wizard_imgStg1").src="../pics/1.gif";
	parent.window.document.getElementById("wizard_imgStg2").src="../pics/2i.gif";

}

function setWizardStage3Images()
{
	parent.window.defaultStatus="--- MTO bizCheques ---";
	parent.window.document.getElementById("wizard_imgStg2").src="../pics/2.gif";
	parent.window.document.getElementById("wizard_imgStg3").src="../pics/3i.gif";
	
	
	
	if (document.getElementById("hddnSetScrollLocation").value.substr(0,4)=="true")
	{
		switch(document.getElementById("hddnSetScrollLocation").value.substr(5,1))
		{
			case "1":
				window.scrollTo(0,100);
				break;
			case "2":
				window.scrollTo(0,150);
				break;
			case "3":
				window.scrollTo(0,400);
				break;
		}
		document.getElementById("hddnSetScrollLocation").value="false";
		
		
	}
	document.getElementById("lblEndSerialNo").innerHTML=document.getElementById("hddnEndSerialNo").value;

}

/*function setWizardStage4Images()
{
	var IFrameOne=document.getElementById("frmPdfProof");
	
	parent.window.document.getElementById("wizard_imgStg3").src="../pics/3.gif";
	parent.window.document.getElementById("wizard_imgStg4").src="../pics/4i.gif";	
	document.getElementById("frmPdfProof").src=document.getElementById("pdfProofPath").value;
	FlagSetFocusIframeStage4=false;
	SetFocusToStep4Iframe();
		
}*/

function SetPdfSample()
{
	document.getElementById("frmPdfProof").src=document.getElementById("pdfProofPath").value;
	
}

function ScrollPage()
{
	window.setTimeout("AfterTimeOutScroll()",500);
}

function ScrollInvoicePage()
{
	window.scrollTo(0,screen.height);
}

function AfterTimeOutScroll()
{
	if (FLGScroll==false)
	{
		if (document.getElementById("hddnScrollTopBottom").value!=null)
		{
			if (document.getElementById("hddnScrollTopBottom").value!="")
			{
				if (document.getElementById("hddnScrollTopBottom").value=="2")
				{
					FLGScroll=true;
					window.scrollTo(0,screen.height);
					
				}
			}
		}
	}
}



function ResetScroll()
{
		FLGScroll=false;
}

function SetFocusToStep4Iframe()
{
	if (FlagSetFocusIframeStage4==false)
	{	
		var IFrameOne=parent.window.document.getElementById("ifrm");
		IFrameOne.focus();
		//document.getElementById("imgBtnStg4Cont").onfocusout
		FlagSetFocusIframeStage4=true;
	}
}

function setWizardStage5Images()
{
	
	parent.window.document.getElementById("wizard_imgStg4").src="../pics/4.gif";
	parent.window.document.getElementById("wizard_imgStg5").src="../pics/5i.gif";
	
	if (document.getElementById("lblReqState").value!="")
	{
		document.getElementById("txtReqEMail").focus();
	}
	else
	{
		document.getElementById("txtReqPostCode").focus();
	}

}

function setWizardStage6Images()
{
	
	parent.window.document.getElementById("wizard_imgStg5").src="../pics/5.gif";
	parent.window.document.getElementById("wizard_imgStg6").src="../pics/6i.gif";

}

function setWizardStage7Images()
{
	
	parent.window.document.getElementById("wizard_imgStg6").src="../pics/6.gif";
	parent.window.document.getElementById("wizard_imgStg7").src="../pics/7i.gif";

}

function setWizardStage8Images()
{
	
	parent.window.document.getElementById("wizard_imgStg7").src="../pics/7.gif";
	parent.window.document.getElementById("wizard_imgStg8").src="../pics/8i.gif";

}

function setWizardStage9Images()
{
	
	
	
	//parent.window.document.getElementById("wizard_imgStg8").src="../pics/8.gif";
	//parent.window.document.getElementById("wizard_imgStg9").src="../pics/9i.gif";

}

function hideStatusbarMsg()
{
	parent.window.status="";
	

}





function Stage3PageValidation(source,args)
{
	if (args.Value=="Select Financial Institute")
	{
		args.IsValid=false;
		alert("Invalid Data");
		return;
	}

}



//***************************************** Print Invoice ******************************************//
//**** Start ****//

function getPrint(print_area)
{ 
	//Creating new pagevar 
	
	pp = window.open("http://203.48.66.54/bizcheques/bizcheques/PrintInvoice.aspx");
	//Adding HTML opening tag with <HEAD> … </HEAD> portion 
	/*
	pp.document.writeln('<HTML><HEAD><title>Print Preview</title>')
	pp.document.writeln('<LINK href=Styles.css type="text/css" rel="stylesheet">')
	pp.document.writeln('<LINK href=../css/Printer.css type="text/css" rel="stylesheet" media="print">')
	pp.document.writeln('<base target="_self"></HEAD>')
	//Adding Body Tag
	pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
	pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
	//Adding form Tag
	pp.document.writeln('<form method="post">');
	//Creating two buttons Print and Close within a HTML table
	pp.document.writeln(document.getElementById(print_area).innerHTML);
	pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');
	pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
	pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
	
	pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');
	//Writing print area of the calling page
	
	//Ending Tag of </form>, </body> and </HTML>
	pp.document.writeln('<INPUT ID="CLOSE" type="button" value="Close" onclick="window.close();">');
	pp.document.writeln('</form></body></HTML>');	
	*/
	window.print();
} 

function OpenWindow()
{
	window.open("http://www.adobe.com/products/acrobat/readstep2.html?wa=hk05");
}

function OpenNewWindowPrintInvoice()
{
	
	//window.open("http://localhost/bizcheques/MTO-FinalWebUIProjects_WebUI/bizcheques/PrintInvoice.aspx?1=" + document.getElementById('hddnName').value + "&2=" + document.getElementById('hddnAdd1').value + "&3=" + document.getElementById('hddnAdd2').value + "&4=" + document.getElementById('hddnAdd3').value + "&5=" + document.getElementById('hddnAdd4').value + "&6P=" + document.getElementById('hddnPostCode').value + "&7S=" + document.getElementById('hddnSuburb').value + "&8S=" + document.getElementById('hddnState').value +"&9R=" + document.getElementById('hddnReceiptNo').value + "&10M=" +document.getElementById('hddnMasterOrderNo').value + "&11=" + document.getElementById('hddnTaxPerforma').value) ;
	window.open("http://www.lmondemand.com/bizcheques/bizcheques/PrintInvoice.aspx?1=" + document.getElementById('hddnName').value + "&2=" + document.getElementById('hddnAdd1').value + "&3=" + document.getElementById('hddnAdd2').value + "&4=" + document.getElementById('hddnAdd3').value + "&5=" + document.getElementById('hddnAdd4').value + "&6P=" + document.getElementById('hddnPostCode').value + "&7S=" + document.getElementById('hddnSuburb').value + "&8S=" + document.getElementById('hddnState').value +"&9R=" + document.getElementById('hddnReceiptNo').value + "&10M=" +document.getElementById('hddnMasterOrderNo').value + "&11=" + document.getElementById('hddnTaxPerforma').value);
	//window.open("http://220.247.217.124/bizcheques/bizcheques/PrintInvoice.aspx");
}

function PrintInvoice()
{
	window.print();
}

function ClosePrintWindow()
{
	window.close();
}



function NewNumericCheckBSB ($char, $mozChar) 
{ 
 
	if($mozChar != null)
	{ // Look for a Mozilla-compatible browser
 
		if(($mozChar >= 48 && $mozChar <= 57) || $mozChar == 0 || $mozChar == 13|| $mozChar==8)
		{
 
			if (document.getElementById("txtBSB").value.length==3 && $mozChar!=8)
			{
				document.getElementById("txtBSB").value +="-";
			}
 
			$RetVal = true;
		}
 
		else
		{
			$RetVal = false; 
		}
	}
	else 
	{ // Must be an IE-compatible Browser
 
		if(($char >= 48 && $char <= 57) || $char == 13)
		{
		 $RetVal = true;
		}
		else
		{
			$RetVal = false;		
			
		}
		if (document.getElementById("txtBSB").value.length==3)
		{
			document.getElementById("txtBSB").value +="-";
		}
	}
	

return $RetVal;
 
} 




function OpenParticipatingFI()
{	
	

}

function OpenLMHome()
{
	window.open("http://www.abnote.com.au");
}



