	function fnFormatMAddr(strAddr1,strAddr2, strAddr3, strCountry, strState, strCity,strPostal, objMAddr)
		{
			var strMAddr;
			
			strMAddr=strAddr1+"\r\n";
						
			
			if (strAddr2!="")
				strMAddr+=strAddr2+"\r\n";
				
			if (strAddr3!="")
				strMAddr+=strAddr3+"\r\n";
			
			
			if (strState!="")
				strMAddr+=strState+"\r\n";				
			
			if (strCity!="")
				strMAddr+=strCity+"\r\n";								

							
			if (strCountry!="")
			{
				if (strCountry.toLowerCase()=="singapore")
				{
					if (strPostal!="")
						strMAddr+="Singapore " +strPostal+"\r\n";	
				}else
				{
					if (strPostal!="")
						strMAddr+=strPostal+"\r\n";	
					strMAddr+=strCountry+"\r\n";
				}
			}
				
											
						
			objMAddr.value=strMAddr;	
		}
		
		function fnFormatMAddrObj(objAddr1,objAddr2, objAddr3,objCountry, objState, objCity,objPostal, objMAddr)
		{
			var strMAddr;
			
			if (objAddr1!=null)
			{
				strMAddr=objAddr1.value+"\r\n";
			}
						
			if (objAddr2!=null)
			{
				if (objAddr2.value!="")
				strMAddr+=objAddr2.value+"\r\n";
			}
		
				
			if (objAddr3!=null)
			{
				if (objAddr3.value!="")
				strMAddr+=objAddr3.value+"\r\n";
			}
		
			
			if (objState!=null)
			{
				if (objState.value!="")
				strMAddr+=objState.value+"\r\n";			
			}
			
			
			if (objCity!=null)
			{
				if (objCity.value!="")
				strMAddr+=objCity.value+"\r\n";		
			}
			
			
							
			if (objCountry!=null)							
			{
				if (objCountry.options[objCountry.selectedIndex].text!="")
				{
					if (objCountry.options[objCountry.selectedIndex].text.toLowerCase()=="singapore")
					{
						if (objPostal!=null)
						{
							if (objPostal.value!="")
								strMAddr+="Singapore "+objPostal.value+"\r\n";						
						}
					}else
					{
						if (objPostal!=null)
						{
							if (objPostal.value!="")
								strMAddr+="Postal Code "+objPostal.value+"\r\n";						
							strMAddr+=objCountry.options[objCountry.selectedIndex].text+"\r\n";
						}
					
						
					}
				}
			}															
						
			objMAddr.value=strMAddr;	
		}
		
		function fnFormatFullname(strFormatType, strSurname, strGivenname, objFullname)
		{
			if (strFormatType=="SG")
			{
				objFullname.value=strSurname+" "+strGivenname;
			}else
			{
				objFullname.value=strGivenname+" "+strSurname;
			}
		}
		
		function fnOpenCalendar(strFieldDD,strFieldMM,strFieldYY, strWndName )
			{
				window.open('/eShop/Component/DatePicker.aspx?fieldDD=' + strFieldDD+'&fieldMM=' + strFieldMM+'&fieldYY=' + strFieldYY+"",strWndName,'width=300,height=260,resizable=yes,scrollbars=1');
			}

		function fnOpenProdSearchExt(strField, strPostBackFunc, strWndName)
		{
				window.open('/eShop/admin/frmProdSearchExt.aspx?strField='+strField+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}
		
		function fnOpenProdWLabelSearchExt(strField, strFieldLabel, strPostBackFunc, strWndName)
		{
				window.open('/eShop/admin/frmProdSearchExt.aspx?strField='+strField+'&strFieldLabel='+strFieldLabel+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}

		function fnOpenProdFeatSearchExt(strProdID, strField, strFieldLabel, strPostBackFunc, strWndName)
		{
			window.open('/eShop/admin/frmProdFeatSearchExt.aspx?strProdID='+strProdID+'&strField='+strField+'&strFieldLabel='+strFieldLabel+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}

		function fnOpenProdSearchMulExt(strField, strPostBackFunc, strRetFormat , strWndName)
		{
				window.open('/eShop/admin/frmProdSearchMulExt.aspx?strField='+strField+'&strRetFormat='+strRetFormat+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}

		function fnOpenCountrySearchExt(strField, strPostBackFunc, strWndName)
		{
				window.open('/eShop/admin/frmCountrySearchExt.aspx?strField='+strField+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}
		
		function fnOpenProdCatSearchMulExt(strField, strPostBackFunc, strRetFormat , strWndName)
		{
				window.open('/eShop/admin/frmProdCatSearchMulExt.aspx?strField='+strField+'&strRetFormat='+strRetFormat+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}
		
		function fnOpenPriceSchemeSearchMulExt(strField, strPostBackFunc, strRetFormat , strWndName)
		{
				window.open('/eShop/admin/frmPriceSchemeSearchMulExt.aspx?strField='+strField+'&strRetFormat='+strRetFormat+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}
		
		function fnOpenAffProfileSearchMulExt(strField, strPostBackFunc, strRetFormat , strWndName)
		{
				window.open('/eShop/admin/frmAffProfileSearchMulExt.aspx?strField='+strField+'&strRetFormat='+strRetFormat+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
		}
		
		function fnOpenCustProfileSearchExt(strField, strPostBackFunc, strWndName)
		{
				var newwin;
				
				newwin=window.open('/eShop/admin/frmCustProfileSearchExt.aspx?strField='+strField+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
				newwin.focus();
		}
		
		function fnOpenProdDetPopUp(strID, strWndName)
		{
				var newwin;
				
				newwin=window.open('ProdDetPopUp.aspx?strID='+strID,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
								
				newwin.focus();
		}
		
		function fnOpenProdVolDiscPopUp(strID, strWndName)
		{
				var newwin;
				
				newwin=window.open('ProdVolDiscTablePopUp.aspx?strID='+strID,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
								
				newwin.focus();
		}
		
		
		function fnAutoCompleteShipInfo()
		{
			
			if ((document.Form1.cboShipSal!=null)&&(document.Form1.cboSal!=null))
			{
			document.Form1.cboShipSal.selectedIndex=document.Form1.cboSal.selectedIndex; 
			}								
			if ((document.Form1.txtShipSurname!=null)&&(document.Form1.txtSurname!=null))
			{
				document.Form1.txtShipSurname.value=document.Form1.txtSurname.value;
			}								
			if ((document.Form1.txtShipGivenname!=null)&&(document.Form1.txtGivenname!=null))
			{
				document.Form1.txtShipGivenname.value=document.Form1.txtGivenname.value;
			}								
			if ((document.Form1.txtShipFullname!=null)&&(document.Form1.txtFullname!=null))
			{
				document.Form1.txtShipFullname.value=document.Form1.txtFullname.value;
			}								
			if ((document.Form1.txtShipCo!=null)&&(document.Form1.txtCo!=null))
			{
				document.Form1.txtShipCo.value=document.Form1.txtCo.value;
			}	
			if ((document.Form1.txtShipDesign!=null)&&(document.Form1.txtDesign!=null))
			{
				document.Form1.txtShipDesign.value=document.Form1.txtDesign.value;
			}	
			
			if ((document.Form1.txtShipTel!=null)&&(document.Form1.txtTel!=null))
			{
				document.Form1.txtShipTel.value=document.Form1.txtTel.value;
			}	
			if ((document.Form1.txtShipMobile!=null)&&(document.Form1.txtMobile!=null))
			{
				document.Form1.txtShipMobile.value=document.Form1.txtMobile.value;
			}	
			if ((document.Form1.txtShipFax!=null)&&(document.Form1.txtFax!=null))
			{
				document.Form1.txtShipFax.value=document.Form1.txtFax.value;
			}	
			if ((document.Form1.txtShipEMail!=null)&&(document.Form1.txtEMail!=null))
			{
				document.Form1.txtShipEMail.value=document.Form1.txtEMail.value;
			}	
							
			
			if ((document.Form1.txtShipAddr1!=null)&&(document.Form1.txtAddr1!=null))
			{
				document.Form1.txtShipAddr1.value=document.Form1.txtAddr1.value;
			}								
			if ((document.Form1.txtShipAddr2!=null)&&(document.Form1.txtAddr2!=null))
			{
				document.Form1.txtShipAddr2.value=document.Form1.txtAddr2.value; 
			}	
			if ((document.Form1.txtShipAddr3!=null)&&(document.Form1.txtAddr3!=null))
			{
				document.Form1.txtShipAddr3.value= document.Form1.txtAddr3.value;
			}
			if ((document.Form1.cboShipCountry!=null)&&(document.Form1.cboCountry!=null))
			{
				document.Form1.cboShipCountry.selectedIndex=document.Form1.cboCountry.selectedIndex; 
			}
			if ((document.Form1.txtShipState!=null)&&(document.Form1.txtState!=null))
			{
				document.Form1.txtShipState.value= document.Form1.txtState.value; 
			}
			if ((document.Form1.txtShipCity!=null)&&(document.Form1.txtCity!=null))
			{
				document.Form1.txtShipCity.value=document.Form1.txtCity.value;
			}
			if ((document.Form1.txtShipPostal!=null)&&(document.Form1.txtPostal!=null))
			{
				document.Form1.txtShipPostal.value=document.Form1.txtPostal.value;
			}
			if ((document.Form1.txtShipMAddr!=null)&&(document.Form1.txtMAddr!=null))
			{
				document.Form1.txtShipMAddr.value= document.Form1.txtMAddr.value;
			}
		}
		
		function fnOpenRecipientSearchExt(strField, strPostBackFunc, strWndName)
		{
				var newwin;
				
				newwin=window.open('/eShop/admin/frmRecipientSearchExt.aspx?strField='+strField+'&strPostBackFunc=' + strPostBackFunc,strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
				newwin.focus();
		}
		
		
		function fnRefreshPaymentCal()
		{
			var dblTender 
			var dblChange
			
			dblTender=0
			dblChange=0
			
			//alert(document.Form1.txtCashAmt.value);
			if (document.Form1.txtCashAmt!=null)
			 {
				if (document.Form1.txtCashAmt.value!="")
				{
					
					dblTender+=(document.Form1.txtCashAmt.value)*1.00;
				} 
			 }
			 if (document.Form1.txtCCardAmt1!=null)
			 {
				if (document.Form1.txtCCardAmt1.value!="")
				{
					
					dblTender+=(document.Form1.txtCCardAmt1.value)*1.00;
				} 
			 }
			  if (document.Form1.txtCCardAmt2!=null)
			 {
				if (document.Form1.txtCCardAmt2.value!="")
				{
					
					dblTender+=(document.Form1.txtCCardAmt2.value)*1.00;
				} 
			 }
			 
			 if (document.Form1.txtChequeAmt1!=null)
			 {
				if (document.Form1.txtChequeAmt1.value!="")
				{
					
					dblTender+=(document.Form1.txtChequeAmt1.value)*1.00;
				} 
			 }
			  if (document.Form1.txtChequeAmt2!=null)
			 {
				if (document.Form1.txtChequeAmt2.value!="")
				{
					
					dblTender+=(document.Form1.txtChequeAmt2.value)*1.00;
				} 
			 }
			 
			 if (document.Form1.txtNETSAmt!=null)
			 {
				if (document.Form1.txtNETSAmt.value!="")
				{
					
					dblTender+=(document.Form1.txtNETSAmt.value)*1.00;
				} 
			 }
			
			
			if (document.Form1.txtCNoteAmt1!=null)
			 {
				if (document.Form1.txtCNoteAmt1.value!="")
				{
					
					dblTender+=(document.Form1.txtCNoteAmt1.value)*1.00;
				} 
			 }
			 
			 if (document.Form1.txtCNoteAmt2!=null)
			 {
				if (document.Form1.txtCNoteAmt2.value!="")
				{
					
					dblTender+=(document.Form1.txtCNoteAmt2.value)*1.00;
				} 
			 }
			
			if (document.Form1.txtTTAmt2!=null)
			 {
				if (document.Form1.txtTTAmt2.value!="")
				{
					
					dblTender+=(document.Form1.txtTTAmt2.value)*1.00;
				} 
			 }
						
			//alert(dblTender);
			document.Form1.txtTenderAmt.value=dblTender;
		}
		
		
		function fnOpenPrtCatalogueExt(strWndName)
		{
				var newwin;
				
				newwin=window.open('/eShop/frmPrtCatalogueExt.aspx',strWndName,'width=800,height=600,resizable=yes,scrollbars=1');		
				newwin.focus();
		}
