	  function chgCountry(obj,stateSpanId,provinceSpanId,stateId,provinceId){
	   	   var stateTrObj = document.getElementById(stateSpanId); 
	   	   var provinceTrObj = document.getElementById(provinceSpanId); 
	   	   var stateObj = document.getElementById(stateId); 
	   	   var provinceObj = document.getElementById(provinceId);
	   	   if (obj.value=='226' || obj.value=='US'){
	   	    	 //show stat
	   	    	  stateTrObj.style.display = "";
	   	    	  provinceTrObj.style.display = "none";
	   	    	  provinceObj.value="";
	   	    	  stateObj.setAttribute("dataType","Require");	   	    	  
	   	    	  provinceObj.setAttribute("dataType","");
	   	   }else{	   	    	 
	   	    	 //hide privince
	   	    	  stateTrObj.style.display = "none";
	   	    	  provinceTrObj.style.display = "";
	   	    	  stateObj.value="";
	   	    	  stateObj.setAttribute("dataType","");	   	    	  
	   	    	  provinceObj.setAttribute("dataType","");
	   	   }
	  }
	  
	  function str2Double(strVal){
	  	  var decimalVal = 0;
	  	  try{
	  	      decimalVal = parseFloat(strVal);
	  	      if (isNaN(decimalVal)){
	  	      	 decimalVal = 0;
	  	      }
	  	  }catch(e){
	  	  	  decimalVal = 0;
	  	  }
	  	  return decimalVal;
	  }
	  function selAmount(obj){
	  	  if (obj.type=="radio" && obj.checked){
	  	  	  if (obj.value=="0" || obj.value=="25" || (obj.value=="-1" && str2Double(document.getElementById("other_amount").value)<50)){
	  	  	  	  document.getElementById("gift_table").style.visibility="hidden"; //visible
	  	  	  }else{
	  	  	  	  document.getElementById("gift_table").style.visibility="visible"; //visible
	  	  	  }
	  	  	  if (obj.value=="-1"){
	  	  	  	  otherAmountRequire("true");
				  document.getElementById("other_amount").disabled=false;
	  	  	  }else{
	  	  	  	  otherAmountRequire("false");
				  document.getElementById("other_amount").disabled=true;
	  	  	  }
	  	  	  
	  	  }else if(obj.type=="text"){
  	          var isOtherAmount = false;
  	          for(var i = 0;i<obj.form.amount.length;i++){
  	          	  if (obj.form.amount[i].value=="-1" && obj.form.amount[i].checked){
  	          	  	  isOtherAmount = true;
  	          	  	  break;
  	          	  }
  	          }
	  	      if (str2Double(obj.value)>=50 && isOtherAmount){
	  	      	  document.getElementById("gift_table").style.visibility="visible"; //visible
	  	      }else{
	  	      	  document.getElementById("gift_table").style.visibility="hidden"; //visible
	  	      }

	  	  }
	  	  
	  	  var dataType = "";
	  	  
	  	  if (obj.type=="radio" && obj.checked && obj.value=="0"){
	  	  	  
	  	  	  showBillingInfo(false);
	  	  	  showSecurity(true);
	  	  	  
	  	  	  document.getElementById("address").setAttribute("dataType",dataType);
	  	  	  document.getElementById("city").setAttribute("dataType",dataType);
	  	  	  document.getElementById("phone1").setAttribute("dataType",dataType);
	  	  	  document.getElementById("btn_submit").value="Submit";
	  	  }else{
	  	  	  dataType = "Require";
	  	  	  document.getElementById("address").setAttribute("dataType",dataType);
	  	  	  document.getElementById("city").setAttribute("dataType",dataType);
	  	  	  document.getElementById("phone1").setAttribute("dataType",dataType);
	  	  	  document.getElementById("btn_submit").value="Submit Secure Payment";
	  	  	  showBillingInfo(true);
	  	  	  showSecurity(false);
	  	  }
	  }
	  
	  function showSecurity(isShow){
	  	 var securityTrObj = document.getElementById("img_securityCode_tr");
	  	 if (!securityTrObj){
	  	 	  return;
	     }
	  	 var imgSecurityObj = document.getElementById("imgSecurityCode");
	  	 
	  	 if (isShow){
	 	  	   securityTrObj.style.display="";
	 	  	   imgSecurityObj.setAttribute("dataType","Require");
	  	 }else{
	  	 	   securityTrObj.style.display="none";
	  	 	   imgSecurityObj.setAttribute("dataType","");
	  	 }
	  	  
	  }
	  
	  function otherAmountRequire(requireVal){
	  	  document.getElementById("other_amount").setAttribute("require",requireVal);
	  }
	  
	  function doSubmit(formObj){
	  	 var returnVal = false;
	  	 try{
	  	 	    var amountChecked = false;
	  	 	   
	  	 	    var amountObjs = formObj.amount;
	  	 	   
	  	 	    if (amountObjs && amountObjs.length){
	  	 	   
			  	 	    for(var i = 0;i<amountObjs.length;i++){
			  	 	 	     if (amountObjs[i].checked){
			  	 	 	 	      amountChecked = true;
			  	 	 	 	      break;
			  	 	 	     }
			  	 	    }
			  	 	    if (amountChecked==false){
			  	 	 	      alert("Please select amount.");
			  	 	 	      return false;
			  	 	    }
	  	 	    }
	  	      returnVal = Validator.Validate(formObj,2);	  	     
	  	      if (returnVal){
	  	      	  if(document.getElementById("passwd") && document.getElementById("confirmPasswd")){
		  	     	    if (document.getElementById("passwd").value!=document.getElementById("confirmPasswd").value){
		  	     	 	 
		  	     	 	      alert("Confirm Password Must be equal with password.");
		  	     	 	      document.getElementById("confirmPasswd").focus();
		  	     	 	      return false;
		  	     	    }
		  	     	  }
	  	          document.getElementById("wait_tr").style.display="";
	  	       }
	  	       return returnVal
	  	 }catch(e){
	  	 	    alert(e.description);
	  	 	    return false;
	  	 }	  	 
	  }
	  function showBillingInfo(isShow){
	  	  var displayVal = "none";
	  	  var dataType = "";
	  	  if (isShow){
	  	  	  displayVal = "";
	  	  	  dataType = "Require";
	  	  }	  	  
	  	document.getElementById("billing_tr").style.display = displayVal;
	  	document.getElementById("bFirstName").setAttribute("dataType",dataType);	
		  document.getElementById("bLastName").setAttribute("dataType",dataType);
		  //document.getElementById("cardType").setAttribute("dataType",dataType);
		  document.getElementById("bCountry").setAttribute("dataType",dataType);
		  document.getElementById("bAddress").setAttribute("dataType",dataType);
		  document.getElementById("bCity").setAttribute("dataType",dataType);
		  document.getElementById("bState").setAttribute("dataType",dataType);
		  document.getElementById("bProvince").setAttribute("dataType",dataType);
		  document.getElementById("bZipcode").setAttribute("dataType",dataType);
		  if (document.getElementById("bCountry").value=="226" || document.getElementById("bCountry").value=="US"){
		  	  if (dataType == "Require"){
		  	  	  document.getElementById("bProvince").setAttribute("dataType","");
		  	  }
		  }else{
		  	  if (dataType == "Require"){
		  	  	  document.getElementById("bState").setAttribute("dataType","");
		  	  }		  	
		  	  
		  }
	  }
	  
	  function copyAddress(){
	  	  document.getElementById("bFirstName").value=document.getElementById("firstName").value;
		  document.getElementById("bLastName").value=document.getElementById("lastName").value;
		  document.getElementById("bCountry").value=document.getElementById("country").value;
		  document.getElementById("bAddress").value=document.getElementById("address").value;
		  document.getElementById("bAddress1").value=document.getElementById("address1").value;
		  document.getElementById("bCity").value=document.getElementById("city").value;
		  document.getElementById("bState").value=document.getElementById("state").value;
		  document.getElementById("bProvince").value=document.getElementById("province").value;
		  document.getElementById("bZipcode").value=document.getElementById("zipcode").value;
		  chgCountry(document.getElementById("bCountry"),'bState_span','bProvince_span','bState','bProvince');
	  }
	  
	  function changePaymentType(paymentType){
		  var displayVal = "none";
	  	var dataType = "";
		  if (paymentType!="check" && paymentType!=""){
			      displayVal = "";
	  	  	  dataType = "Require";
		  }
		  document.getElementById("creditCardInfo_tr").style.display = displayVal;
		  document.getElementById("cardNumber").setAttribute("dataType",dataType);
		  document.getElementById("expmon").setAttribute("dataType",dataType);
		  document.getElementById("expyear").setAttribute("dataType",dataType);
		  document.getElementById("securityCode").setAttribute("dataType",dataType);
		  
	  }
	  
	  function clickNedAut(obj){	  	
	  	  if (obj.checked){
	  	  	  document.getElementById("ned_user_type_tr").style.display="";
	  	  	  document.getElementById("nedUserType").setAttribute("dataType","Require");
	  	  	  
	  	  }else{
	  	  	  document.getElementById("ned_user_type_tr").style.display="none";
	  	  	  document.getElementById("nedUserType").setAttribute("dataType","");
	  	  }
	  }
	  

