var strPath = "MyAccount.asp"
var strPathT = strPath + "?tg="

function Login(){
	var sw = true;
	document.getElementById("tdAccEmail").style.border = "";
	document.getElementById("divMsgAccEmailR").style.display = "none";
	document.getElementById("tdAccPwd").style.border = "";
	document.getElementById("divMsgAccPasswordR").style.display = "none";
	if (!isEmail(document.frmSignInAccount.Email.value)){
		sw = false;
		document.getElementById("tdAccEmail").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccEmailR").style.display = "";
	}
	if (document.frmSignInAccount.Password.value == ""){
		sw = false;
		document.getElementById("tdAccPwd").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccPasswordR").style.display = "";
	}
	if (sw){
		document.frmSignInAccount.submit();
	}
}


function SubmitCreateAccount(frm){
	var sw = true;
	var iFName = frm.txtAccFirstName.value.Trim();
	var iLName = frm.txtAccLastName.value.Trim();
/*	var iAddress = frm.txtAccAddress.value.Trim();
	var iCity = frm.txtAccCity.value.Trim();
	var iState = frm.selAccState.value;
	var iPhone = frm.txtAccPhone.value.Trim()
	var iCountry = frm.selAccCountry.value;
*/	var iEmail = frm.txtAccEmail.value.Trim();
	var iPwd = frm.txtAccPassword.value.Trim();
	document.getElementById("tbAccFirstName").style.border = "";
	document.getElementById("divMsgAccFirstNameR").style.display = "none";
	document.getElementById("tbAccLastName").style.border = "";
	document.getElementById("divMsgAccLastNameR").style.display = "none";
/*	document.getElementById("tbAccAddress").style.border = "";
	document.getElementById("divMsgAccAddressR").style.display = "none";
	document.getElementById("tbAccCity").style.border = "";
	document.getElementById("divMsgAccCityR").style.display = "none";
	document.getElementById("tbAccState").style.border = "";
	document.getElementById("divMsgAccStateR").style.display = "none";
	document.getElementById("tbAccPhone").style.border = "";
	document.getElementById("divMsgAccPhoneR").style.display = "none";
	document.getElementById("tbAccCountry").style.border = "";
	document.getElementById("divMsgAccCountryR").style.display = "none";
*/	document.getElementById("tbAccEmail").style.border = "";
	document.getElementById("divMsgAccEmailR").style.display = "none";
	document.getElementById("divMsgAccEmailI").style.display = "none";
	document.getElementById("tbAccPassword").style.border = "";
	document.getElementById("divMsgAccPasswordR").style.display = "none";
	document.getElementById("divMsgAccPasswordI").style.display = "none";
	if (iFName == ""){
		sw = false; frm.txtAccFirstName.value = "";
		document.getElementById("tbAccFirstName").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccFirstNameR").style.display = "";
	}
	if (iLName == ""){
		sw = false; frm.txtAccLastName.value = "";
		document.getElementById("tbAccLastName").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccLastNameR").style.display = "";
	}
/*	if (iAddress == ""){
		sw = false; frm.txtAccAddress.value = "";
		document.getElementById("tbAccAddress").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccAddressR").style.display = "";
	}
	if (iCity == ""){
		sw = false; frm.txtAccCity.value = "";
		document.getElementById("tbAccCity").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccCityR").style.display = "";
	}
	if (iState == 0){
		sw = false;
		document.getElementById("tbAccState").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccStateR").style.display = "";
	}
	if (iPhone == ""){
		sw = false; frm.txtAccPhone.value = "";
		document.getElementById("tbAccPhone").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccPhoneR").style.display = "";
	}
	if (iCountry == 0){
		sw = false;
		document.getElementById("tbAccCountry").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccCountryR").style.display = "";
	}*/
	if (iEmail == ""){
		sw = false;
		document.getElementById("tbAccEmail").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccEmailR").style.display = "";
	}else{
		if (!isEmail(iEmail)){
			sw = false;
			document.getElementById("tbAccEmail").style.border = "solid 2px #ff0000";
			document.getElementById("divMsgAccEmailI").style.display = "";
		}
	}
	if (iPwd == ""){
		sw = false;
		document.getElementById("tbAccPassword").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccPasswordR").style.display = "";
	}else{
		if (iPwd.length < 6 || iPwd.length > 50){
			sw = false;
			document.getElementById("tbAccPassword").style.border = "solid 2px #ff0000";
			document.getElementById("divMsgAccPasswordI").style.display = "";
		}
	}
	if (sw){frm.submit();}
}




///--------------


function DisplayCreditCard(frm){
	document.getElementById("tbCreditCard").style.display = "none";
	if (document.getElementById("radPaymentType_1").checked){
		document.getElementById("tbCreditCard").style.display = "";
	}
}

function GoPayPurchase(kComID){
//	document.frmGoPayPurchase.ComID.value = kComID;
//	document.frmGoPayPurchase.submit();
	window.location.href = "MyAccount.asp?tg="
}

function GoSavePayPurchase(frm){
	frm.submit();
}

function ProfileC(UCID, UCName){
	if (confirm("Category " +UCName+ " will be removed?")){	window.location.href = strPathT + "PROFILE_REMOVEC&UCID=" +UCID;}
}

function ShowNewCategoryForm(){
	//document.getElementById("trNewCatTitle").style.display = "none";
	document.getElementById("trNewCatInput").style.display = "";
}
function ShowNewBookmark(){
	window.location.href = strPathT + "&swNewBk=1";
}
function ShowNewBookmarkForm(){
	//document.getElementById("trNewBkTitle").style.display = "none";
	document.getElementById("trNewBkInput").style.display = "";
}

function GoSaveNewCategory(){
	var txtNewCategory = document.frmUpdateBookmarks.txtNewCategory.value.Trim();
	if (txtNewCategory == ""){
		document.frmUpdateBookmarks.txtNewCategory.focus();
	}else{
		window.location.href = strPathT + "SAVE_NEWCATEGORY&txtNewCategory=" + txtNewCategory;
	}
}

function GoSaveNewBookmark(){
	var txtNewBookmark = document.frmUpdateBookmarks.txtNewBookmark.value.Trim();
	var txtNewBookmarkURL = document.frmUpdateBookmarks.txtNewBookmarkURL.value.Trim();
	if ((txtNewBookmark == "") || (txtNewBookmarkURL == "")){
		if (txtNewBookmarkURL == "") document.frmUpdateBookmarks.txtNewBookmarkURL.focus();
		if (txtNewBookmark == "") document.frmUpdateBookmarks.txtNewBookmark.focus();
	}else{
		window.location.href = strPathT + "SAVE_NEWBOOKMARK&txtNewBookmark=" +txtNewBookmark+ "&txtNewBookmarkURL=" + txtNewBookmarkURL;
	}
}

function GoSaveNewBookmarkNew(){
	var txtNewBookmarkURL = document.frmUpdateBookmarks.txtNewBookmarkURL.value.Trim();
	if (txtNewBookmarkURL == ""){
		document.frmUpdateBookmarks.txtNewBookmarkURL.focus();
	}else{
		window.location.href = strPathT + "SAVE_NEWBOOKMARKNEW&txtNewBookmarkURL=" + txtNewBookmarkURL;
	}
}

function VisitBookmark(ubkID){
	window.location.href = strPathT + "VISIT_BOOKMARK&UBID=" + ubkID;
}

function GoViewBookmark(){
	var iUBID = document.getElementById("selUBID").value;//frm.selUBID.value;
	var iCUBID = document.getElementById("iCUBID").value;
	if (iUBID > 0){
		if (iUBID != iCUBID){
			document.getElementById("selUBID").disable = true;
			window.location.href = "MyBookmarks.asp?tg=&UBID=" + iUBID;
		}
	}
}

function GoNewURL(){
	var txtUrl = document.getElementById("txtNavigatorDtf").value;//document.frmViewBookmark.txtNavigatorDtf.value;
	txtUrl = txtUrl.Trim();
	if (txtUrl == ""){
		document.getElementById("txtNavigatorDtf").value = "";
		document.getElementById("txtNavigatorDtf").focus();
	}else{
		var iPos = txtUrl.indexOf("http");
		if (iPos > 0){
			document.getElementById("txtNavigatorDtf").value = "";
			document.getElementById("txtNavigatorDtf").focus();
		}else{
			if (iPos == -1){txtUrl = "http://" + txtUrl;}
			document.getElementById("dtfIFrame").src = txtUrl;
		}
	}
}

function GoInsertURL(){
	var txtUrl = document.getElementById("txtNavigatorDtf").value;
	if (txtUrl == document.getElementById("hidNavigatorDtf").value) txtUrl = "";
	if (txtUrl == ""){
		document.getElementById("txtNavigatorDtf").value = "";
		document.getElementById("txtNavigatorDtf").focus();
	}else{
		var iPos = txtUrl.indexOf("http");
		if (iPos > 0){
			document.getElementById("txtNavigatorDtf").value = "";
			document.getElementById("txtNavigatorDtf").focus();
		}else{
			var iUCID = document.getElementById("selInsertC").value;
			if (iUCID > 0){
				//if (iPos == -1){txtUrl = "http://" + txtUrl;}
				//document.getElementById("txtNavigatorDtf").value = txtUrl + "_FF";
				var iCUBID = document.getElementById("iCUBID").value;
				window.location.href = "MyBookmarks.asp?tg=INSERT_NEWUB&txtNavigatorDtf=" +txtUrl+ "&UCID=" +iUCID+ "&CUBID=" +iCUBID;
			}else{
				document.getElementById("selInsertC").focus();
			}
		}
	}
}

function GoRemoveUB(iUCID, iUBID, iUBName, i){
	if (confirm('You are about to delete "' +iUBName+ '"')){
		if (i == 0){
			window.location.href = strPathT + "REMOVE_UB&UCID=" +iUCID+ "&UBID=" +iUBID+ "&dtfSrc=1";
		}else{
			window.location.href = strPathT + "REMOVE_UB&UCID=" +iUCID+ "&UBID=" +iUBID;
		}
	}
}

function GoSaveNewBookmarkUCID(frm){
	var ff = frm.ff.value;
	if (ff != ""){
		frm.submit();
	}
}

function ViewFAQ(){
	window.open("/include/ifaq.asp", "FAQ","menubar=0,resizable=0,scrollbars=1,width=600,height=450");
}

/////////////////////////////////////////////////////////////////////////////////////
//###################################################################################


//https://developer.mozilla.org/samples/domref/dispatchEvent.html
//https://developer.mozilla.org/es/DOM/event.preventDefault
/*
function preventDef(event) {
  event.preventDefault();
}
function addHandler() {
  document.getElementById("checkbox").addEventListener("click", preventDef, false);
}
function removeHandler() {
  document.getElementById("checkbox").removeEventListener("click",preventDef, false);
}
function simulateClick() {
  var evt = document.createEvent("MouseEvents");
  evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  var cb = document.getElementById("checkbox"); 
  var canceled = !cb.dispatchEvent(evt);
  if(canceled) {
    // A handler called preventDefault
    alert("canceled");
  } else {
    // None of the handlers called preventDefault
    alert("not canceled");
  }
}
*/

//http://ignorante.wordpress.com/tag/javascript/
/*e es el evento, f es el formulario*/
/*
function check(e, f){
    // forma estándar (soportada por Mozilla firefox y por IE 6) de acceder a los
    // campos de formulario por su nombre (name).
    if(f.elements.namedItem("username").value == "" || f.elements.namedItem("password").value == ""){
        // mostrar cartel
        alert("Ingrese los datos requeridos");
        if(e.preventDefault){
            // forma estandar de evitar el submit.
            e.preventDefault();
        }else{
            // forma de IE de evitar el submit
            e.returnValue = false;
        }
    }
}
<form action="mailto:nadie@pepito.com" method="POST" enctype="text/plain" onsubmit="check(event, this)">
*/
/////////////////////////////////////////////////////////////////////////////////////
//###################################################################################



function DoNotAgree(){
  if (confirm("Are you sure you want to decline the Terms of Service? Click Cancel to continue with registration.")){
    window.location.href="SignIn.asp";
  }
}

function SubmitEditAccount(){
  var xMsg="";
  if (document.frmEditAccount.FirstName.value.Trim()=="") xMsg += "\n\t- First Name (required)";
  if (document.frmEditAccount.LastName.value.Trim()=="") xMsg += "\n\t- Last Name (required)";
  if (!isEmail(document.frmEditAccount.Email.value.Trim())) xMsg += "\n\t- Email Address (invalid)";
  if (document.frmEditAccount.Pass1.value != document.frmEditAccount.Pass2.value){
    xMsg += "\n\t- Password (does not match)";
  }else{
    if (document.frmEditAccount.Pass1.value.Trim().length < 6){
      xMsg += "\n\t- Password (too short)";
    }
  }
  if (document.frmEditAccount.SecQuestion.selectedIndex == 0) xMsg += "\n\t- Security Question (not selected)";
  if (document.frmEditAccount.SecAnswer.value.Trim() == "")  xMsg += "\n\t- Secret Answer (required)";
  if (document.frmEditAccount.BMonth.selectedIndex == 0) xMsg += "\n\t- Birthday Month (not selected)";
  if (!isInteger2(document.frmEditAccount.BDay.value.Trim(),false)) xMsg += "\n\t- Birthday Day (invalid)";
  if (!isInteger(document.frmEditAccount.BYear.value.Trim(),false)) xMsg += "\n\t- Birthday Year (invalid)";
  if (document.frmEditAccount.ZipCode.value.Trim() == "") xMsg += "\n\t- Zip Code (required)";
  if (xMsg == ""){
    document.frmEditAccount.tg.value = "RECORDEDITACCOUNT";
    document.frmEditAccount.submit();
  }else{
    alert("To continue please enter correctly the following information:\n" + xMsg);
  }
}

function ValidateAccount(){
  var xMsg="";
  if (!isEmail(document.frmValidateAccount.Email.value.Trim())) xMsg += "\n\t- Email Address (invalid)";
  if (document.frmValidateAccount.CRCCode.value.length != 20) xMsg += "\n\t- 20-digits Secret Code (invalid)";
  if (xMsg == ""){
    document.frmValidateAccount.tg.value = "VALIDATEACCOUNT";
    document.frmValidateAccount.submit();
  }else{
    alert("To continue please enter correctly the following information:\n" + xMsg);
  }
}

function ReSendValidateEmail(iCode){
  window.open("/ResendValidation.asp?UID=" + iCode, "RESEND","menubar=0,resizable=0,scroll=0,width=450,height=150");
}

function SignIn(){
  var xMsg = "";
  if (!isEmail(document.frmSignInAccount.Email.value)) xMsg += "\n\t- Email Address (invalid)";
  if (document.frmSignInAccount.Password.value=="") xMsg += "\n\t- Password";
  if (xMsg == ""){
//    document.frmSignInAccount.tg.value="SIGNINACCOUNT";
    document.frmSignInAccount.submit();
  }else{
    alert("To continue please enter correctly the following information:\n" + xMsg);
  }
}

function SignOut(){
  window.location.href='/include/SignOut.asp';
}

function ChangeCountry(iCode){
  switch(iCode){
    case 0:
      //document.frmAddStore.tg.value = "ADDSTORE";
      //document.frmAddStore.submit();
      document.frmSubscribe.tg.value = "SUBSCRIPTION";
      document.frmSubscribe.submit();
      break;
  }
}

function ChangeCountryEdit(iCode){
  switch(iCode){
    case 0:
      //document.frmAddStore.tg.value = "ADDSTORE";
      //document.frmAddStore.submit();
      document.frmsaveedit.tg.value = "EDITCARD";
      document.frmsaveedit.submit();
      break;
  }
}

function ChangeSTRUpload(){
  var xFF = document.frmAddStore.CH_LOGO.checked;
  if (xFF){
    document.frmAddStore.btnUpload.disabled = false;
  }else{
    document.frmAddStore.btnUpload.disabled = true;
  }
}

function ChangeSTRView(){
  var xFF = document.frmAddStore.CH_PROFILE.checked;
  if (xFF){
    document.frmAddStore.CH_MESSAGE.disabled = false;
  }else{
    document.frmAddStore.CH_MESSAGE.disabled = true;
  }
}

function SaveStore(){
  var xMsg = "";
  if (document.frmAddStore.StoreName.value.Trim()=="") xMsg += "\nStore Name";
  if (document.frmAddStore.StoreDomain.value.Trim()=="") xMsg += "\nDomain";
  if (xMsg == ""){
    document.frmAddStore.tg.value = "SAVESTORE";
    document.frmAddStore.submit();
  }else{
    alert("To continue please enter correctly the following information:\n" + xMsg);
  }
}



function MyNewsAddSubscription(){
  window.location.href="MyNews.asp?tg=SUBSCRIPTION&Source=MyNews";
}

function UpgradeSubscription(iSID){
  window.location.href = "MySubscriptions.asp?tg=UPGRADE&sid=" + iSID;
}

function PaySubscription(iSID){
  window.location.href = "MySubscriptions.asp?tg=SETPAYMENT&sid=" + iSID + "&source=mynews";
}

function ChangeSubscription(iSID){
  window.location.href = "MySubscriptions.asp?tg=CHANGE&sid=" + iSID;
}

function PrintInvoice(iPayID){
  window.open ("MyBalance.asp?tg=PRINTINVOICE&Pid=" + iPayID,"PrintInvoiceFriendly","menubar=1,scrollbars=1,resizable=1,width=600,height=550");
}

function ON_PayNewCard(){
  document.frmSetPayment.CardType.disabled = false;
  document.frmSetPayment.CardNumber.disabled = false;
  document.frmSetPayment.NameOnCard.disabled = false;
  document.frmSetPayment.CardExpires.disabled = false;
  document.frmSetPayment.CardCVV2.disabled = false;
  document.frmSetPayment.BillName.disabled = false;
  document.frmSetPayment.BillAddress.disabled = false;
  document.frmSetPayment.BillCity.disabled = false;
  document.frmSetPayment.BillState.disabled = false;
  document.frmSetPayment.BillZipCode.disabled = false;
  document.frmSetPayment.BillCountry.disabled = false;
  document.frmSetPayment.BillPhone.disabled = false;
}


function OFF_PayNewCard(){
  document.frmSetPayment.CardType.disabled = true;
  document.frmSetPayment.CardNumber.disabled = true;
  document.frmSetPayment.NameOnCard.disabled = true;
  document.frmSetPayment.CardExpires.disabled = true;
  document.frmSetPayment.CardCVV2.disabled = true;
  document.frmSetPayment.BillName.disabled = true;
  document.frmSetPayment.BillAddress.disabled = true;
  document.frmSetPayment.BillCity.disabled = true;
  document.frmSetPayment.BillState.disabled = true;
  document.frmSetPayment.BillZipCode.disabled = true;
  document.frmSetPayment.BillCountry.disabled = true;
  document.frmSetPayment.BillPhone.disabled = true;
}

function PChangeCountry(iCode){
  switch(iCode){
    case 0:
      //document.frmAddStore.tg.value = "ADDSTORE";
      //document.frmAddStore.submit();
      document.frmSetPayment.tg.value = "SETPAYMENT";
      document.frmSetPayment.submit();
      break;
  }
}

function CancelPayment(){
  var iSource = document.frmSetPayment.source.value;
  switch(iSource){
    case "": window.location.href="MySubscriptions.asp";
      break;
    case "MYNEWS": window.location.href="MyNews.asp";
      break;
  }
}

function GetPayment(){
  var xMsg = "";
  var iCards = document.frmSetPayment.PaymentCounter.value;
  var xSW1 = false;
  for (i=1; i<=iCards; i++){
      xSW1 = xSW1 || (document.frmSetPayment.CCard[i].checked);
  }
  if (!xSW1){
    xMsg += "\n Credit Card (unselected)";
  }else{
    if (!document.frmSetPayment.CardType.disabled){
      if (document.frmSetPayment.CardType.selectedIndex == 0) xMsg += "\n- Card Type (unselected)";
      if (!isCCardValid(document.frmSetPayment.CardNumber.value.Trim())) xMsg += "\n- Card Number (invalid)";
      if (document.frmSetPayment.NameOnCard.value.Trim()=="") xMsg += "\n- Name On Card (empty)";
      if (!isCardExpires(document.frmSetPayment.CardExpires.value.Trim())) xMsg += "\n- Card Expiration (invalid)";
      if (!isCVV2Valid(document.frmSetPayment.CardCVV2.value.Trim())) xMsg += "\n- Card CVV2 (invalid)";
      if (document.frmSetPayment.BillName.value.Trim()=="") xMsg += "\n- Billing Client Name (empty)";
      if (document.frmSetPayment.BillAddress.value.Trim()=="") xMsg += "\n- Billing Address (empty)";
      if (document.frmSetPayment.BillCity.value.Trim()=="") xMsg += "\n- Billing City (empty)";
      if (document.frmSetPayment.BillState.value.Trim()=="") xMsg += "\n- Billing State (empty)";

      if (document.frmSetPayment.Val_ZipCode.value == "true")
      { if (document.frmSetPayment.BillZipCode.value.Trim()=="") xMsg += "\n- Billing ZipCode (empty)";
      }
      if (document.frmSetPayment.BillCountry.value.Trim()=="") xMsg += "\n- Billing Country (empty)";
      if (document.frmSetPayment.BillPhone.value.Trim()=="") xMsg += "\n- Billing Phone (empty)";
    }
  }
  if (xMsg == ""){
    document.frmSetPayment.tg.value = "SAVEPAYMENT";
    document.frmSetPayment.submit();
  }else{
    alert("To continue please enter the following information: \n" + xMsg);
  }
  
  
}

function ResetPassword(){
  window.open ("ResetPassword.asp","","width=410, height=170");
}

function SubmitReportCustomer()
{
 var xMsg="";
  
  //if (document.frmReportCustomer.tcustFirstName.value.Trim()=="") xMsg += "\n\t- First Name (required)";
  //if (document.frmReportCustomer.tcustLastName.value.Trim()=="") xMsg += "\n\t- Last Name (required)";
  //if (!isEmail(document.frmReportCustomer.tcustEmail.value.Trim())) {xMsg += "\n\t- Email Address (invalid)";}
  //if (document.frmReportCustomer.tcustCompany.value.Trim()=="") xMsg += "\n\t- Company (required)";
  
  //Billing
  if (document.frmReportCustomer.tcustFirstName_0.value.Trim()=="") xMsg += "\n\t- Billing - First Name (required)";
  if (document.frmReportCustomer.tcustLastName_0.value.Trim()=="") xMsg += "\n\t- Billing - Last Name (required)";
  if (!isEmail(document.frmReportCustomer.tcustEmail_0.value.Trim())) {xMsg += "\n\t- Billing - Email Address (invalid)";}
  
  if (document.frmReportCustomer.taddrAddress1_0.value.Trim()=="") xMsg += "\n\t- Billing - Addresses 1 (required)";
  if (document.frmReportCustomer.taddrCity_0.value.Trim()=="") xMsg += "\n\t- Billing - City (required)";

  if (document.frmReportCustomer.ch_st_b_0.value.Trim()=="true")
    if (document.frmReportCustomer.taddrState_0.value.Trim()=="") xMsg += "\n\t- Billing - Select State (required)";
  
  if (document.frmReportCustomer.ch_zip_b_0.value.Trim()=="true")
    if (document.frmReportCustomer.taddrZipCode_0.value.Trim() == "") xMsg += "\n\t- Billing - Zip Code (required)";
  
  if (document.frmReportCustomer.taddrCountry_0.value.Trim()=="") xMsg += "\n\t- Billing - Select Country (required)";
  if (document.frmReportCustomer.tphneNumber_0.value.Trim()=="") xMsg += "\n\t- Billing - Phone (required)";
  
  //shipping
  if (document.frmReportCustomer.sameInf.checked == false)
  {
  if (document.frmReportCustomer.tcustFirstName_1.value.Trim()=="") xMsg += "\n\t- Shipping - First Name (required)";
  if (document.frmReportCustomer.tcustLastName_1.value.Trim()=="") xMsg += "\n\t- Shipping - Last Name (required)";
  if (!isEmail(document.frmReportCustomer.tcustEmail_1.value.Trim())) {xMsg += "\n\t- Shipping - Email Address (invalid)";}

  if (document.frmReportCustomer.taddrAddress1_1.value.Trim()=="") xMsg += "\n\t- Shipping - Addresses 1 (required)";
  if (document.frmReportCustomer.taddrCity_1.value.Trim()=="") xMsg += "\n\t- Shipping - City (required)";
  
  if (document.frmReportCustomer.ch_st_b_1.value.Trim()=="true")
    if (document.frmReportCustomer.taddrState_1.value.Trim()=="") xMsg += "\n\t- Shipping - Select State (required)";
  
  if (document.frmReportCustomer.ch_zip_b_1.value.Trim()=="true")
    if (document.frmReportCustomer.taddrZipCode_1.value.Trim() == "") xMsg += "\n\t- Shipping - Zip Code (required)";
  
  if (document.frmReportCustomer.taddrCountry_1.value.Trim()=="") xMsg += "\n\t- Shipping - Select Country (required)";
  if (document.frmReportCustomer.tphneNumber_1.value.Trim()=="") xMsg += "\n\t- Shipping - Phone (required)";
  } 

  if (document.frmReportCustomer.dispPONumber.value.Trim()=="") xMsg += "\n\t- PONumber (invalid)";
  if (document.frmReportCustomer.dispTransactionDate.value.Trim()=="") xMsg += "\n\t- Transaction Date (required)";  
//alert('-->' + document.frmReportCustomer.typeDis[0].checked);

  //if (document.frmReportCustomer.typeDis.checked==false) xMsg += "\n\t- Select Type Dispute (required)";
     
  if (xMsg == ""){
    document.frmReportCustomer.Target.value = "SAVEREPORTCUSTOMER";
    document.frmReportCustomer.submit();
  }else{
    alert("To continue please enter correctly the follow information:\n" + xMsg);
  }

}


function disabledShippingEdit(obj)
{ 
  document.frmReportCustomerEdit.tcustFirstName_1.disabled = obj.checked;
  document.frmReportCustomerEdit.tcustMiddleInitial_1.disabled = obj.checked;
  document.frmReportCustomerEdit.tcustLastName_1.disabled = obj.checked;
  document.frmReportCustomerEdit.tcustEmail_1.disabled = obj.checked;
  document.frmReportCustomerEdit.tcustCompany_1.disabled = obj.checked;
  
  document.frmReportCustomerEdit.taddrAddress1_1.disabled = obj.checked;
  document.frmReportCustomerEdit.taddrAddress2_1.disabled = obj.checked;
  document.frmReportCustomerEdit.taddrCity_1.disabled = obj.checked;

  if (document.frmReportCustomerEdit.ch_st_b_1.value.Trim()=="true")
    document.frmReportCustomerEdit.taddrState_1.disabled = obj.checked;
  if (document.frmReportCustomerEdit.ch_zip_b_1.value.Trim()=="true")
    document.frmReportCustomerEdit.taddrZipCode_1.disabled = obj.checked;
  document.frmReportCustomerEdit.taddrCountry_1.disabled = obj.checked;
  document.frmReportCustomerEdit.tphneNumber_1.disabled = obj.checked;
}



function disabledShipping(obj)
{ 
  document.frmReportCustomer.tcustFirstName_1.disabled = obj.checked;
  document.frmReportCustomer.tcustMiddleInitial_1.disabled = obj.checked;
  document.frmReportCustomer.tcustLastName_1.disabled = obj.checked;
  document.frmReportCustomer.tcustEmail_1.disabled = obj.checked;
  document.frmReportCustomer.tcustCompany_1.disabled = obj.checked;
  
  document.frmReportCustomer.taddrAddress1_1.disabled = obj.checked;
  document.frmReportCustomer.taddrAddress2_1.disabled = obj.checked;
  document.frmReportCustomer.taddrCity_1.disabled = obj.checked;

  if (document.frmReportCustomer.ch_st_b_1.value.Trim()=="true")
    document.frmReportCustomer.taddrState_1.disabled = obj.checked;
  if (document.frmReportCustomer.ch_zip_b_1.value.Trim()=="true")
    document.frmReportCustomer.taddrZipCode_1.disabled = obj.checked;
  document.frmReportCustomer.taddrCountry_1.disabled = obj.checked;
  document.frmReportCustomer.tphneNumber_1.disabled = obj.checked;
}


function SubmitReportCustomerOK()
{
   document.frmReportCustomerSummary.Target.value="REPORTCUSTOMEROK";
   document.frmReportCustomerSummary.submit();
}



function SubmitReportCustomerEdit()
{
   document.frmReportCustomerSummary.Target.value="REPORTCUSTOMEREDIT";
   document.frmReportCustomerSummary.submit();
}


function ChangeCountryCreateAccountCompany()
{
   document.frmCreateAccount.tg.value="CHANGECOUNTRYCOMPANY";
   document.frmCreateAccount.submit();
}

function ChangeCountryCreateAccountContact()
{
   document.frmCreateAccount.tg.value="CHANGECOUNTRYCONTACT";
   document.frmCreateAccount.submit();
}


function UpdateAccount(frm){
	var xMsg = "";
	if (frm.cpnyName.value.Trim()=="") xMsg += "\n\t- Company - Name (required)";
	if (frm.cpnyAddress1.value.Trim()=="") xMsg += "\n\t- Company - Address 1 (required)";
	if (frm.cpnyCity.value.Trim()=="") xMsg += "\n\t- Company - City (required)";

	if (frm.ch_st_company.value.Trim()=="true")
		if (frm.cpnyState.value.Trim()=="") xMsg += "\n\t- Company - Select State (required)";
	if (frm.ch_zip_company.value.Trim()=="true")
		if (frm.cpnyZip.value.Trim()=="") xMsg += "\n\t- Company - Zip Code  (required)";
	if (frm.cpnyCountry.value.Trim()=="") xMsg += "\n\t- Company - Select Country  (required)";

	if (frm.cpnyPhone.value.Trim()=="") xMsg += "\n\t- Company - Phone (required)";
	//if (!isLink(frm.cpnyWebPage.value.Trim())) xMsg += "\n\t- Company - Web Page (invalid)";
	if (!isLink(frm.cpnyTermsConditionsLink.value.Trim())) xMsg += "\n\t- Company - Terms & Conditions Link (invalid)";
	if (!isLink(frm.cpnyPrivacyPolicyLink.value.Trim())) xMsg += "\n\t- Company - Privacy Policy Link (invalid)";

	if (frm.FirstName.value.Trim()=="") xMsg += "\n\t- First Name (required)";
	if (frm.LastName.value.Trim()=="") xMsg += "\n\t- Last Name (required)";
	if (frm.ctcAddr1.value.Trim()=="") xMsg += "\n\t- Addresses 1 (required)";
	if (frm.ctcCity.value.Trim()=="") xMsg += "\n\t- City (required)";
	if (frm.ch_st_contact.value.Trim()=="true")
		if (frm.ctcState.value.Trim()=="") xMsg += "\n\t- Select State (required)";
	if (frm.ctcCountry.value.Trim()=="") xMsg += "\n\t- Select Country (required)";
	if (frm.ctcPhone.value.Trim()=="") xMsg += "\n\t- Phone (required)";

	if (frm.SecQuestion.selectedIndex == 0) xMsg += "\n\t- Security Question (not selected)";
	if (frm.SecAnswer.value.Trim() == "")  xMsg += "\n\t- Secret Answer (required)";
	if (frm.BMonth.selectedIndex == 0) xMsg += "\n\t- Birthday Month (not selected)";
	if (!isInteger2(frm.BDay.value.Trim(),false)) xMsg += "\n\t- Birthday Day (invalid)";
	if (!isInteger(frm.BYear.value.Trim(),false)) xMsg += "\n\t- Birthday Year (invalid)";
	if (frm.ch_zip_contact.value.Trim()=="true")
		if (frm.ZipCode.value.Trim() == "") xMsg += "\n\t- Zip Code (required)";
	if (xMsg == ""){
		//document.frmCreateAccount.tg.value = "RECORDACCOUNT";
		frm.submit();
		//alert('submit');
	}else{alert("To continue please enter correctly the follow information:\n" + xMsg);}
}




