//<script> Advertising


//function to check valid email address
function isValidEmail(strEmail, msg){
  validRegExp = /^[^@]+@[^@]+\.[a-z]{2,}$/i;
  strEmail = strEmail;

   // search email text for regular exp matches
   if (strEmail.search(validRegExp) == -1) 
   {
      alert(msg);
      return false;
    } 
    return true; 
}

function isValidDeposit(amount, msg){
	if (amount < "100.00") {
		alert(msg);
		return false;
	}
	return true;
}

function addCommission(amount, commission) {
	if (commission > 0) {
		amount = amount + (amount * commission / 100.0);
	}
	return amount.toFixed(2);
}

function lrpayprem() {
	var amount = parseInt(document.userselect.amount.value);

	var price = document.userselect.type.value;
	var type = document.userselect.type.options[document.userselect.type.selectedIndex].text;
	var email = document.userselect.email.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	document.lrform.lr_amnt.value = addCommission(price * amount, PaymentCommissionLR);
	document.lrform.lr_comments.value = type;
	document.lrform.EMAIL.value = email;
	document.lrform.NUMBER_ITEMS.value = amount;
	document.lrform.TYPE.value = type;

	document.lrform.submit();
}

function lrpaystand() {
	var amount = parseInt(document.userselect2.amount.value);

	var price = document.userselect2.type.value;
	var type = document.userselect2.type.options[document.userselect2.type.selectedIndex].text;
	var email = document.userselect2.email.value;
	
	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	document.lrform.lr_amnt.value = addCommission(price * amount, PaymentCommissionLR);
	document.lrform.lr_comments.value = type;
	document.lrform.EMAIL.value = email;
	document.lrform.NUMBER_ITEMS.value = amount;
	document.lrform.TYPE.value = type;

	document.lrform.submit();
}

function lrpaytext() {
	var amount = parseFloat(document.userselect3.amount.value);

	var price = document.userselect3.type.value;
	var type = document.userselect3.type.options[document.userselect3.type.selectedIndex].text;
	var email = document.userselect3.email.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	
	document.lrform.lr_amnt.value = addCommission(price * amount, PaymentCommissionLR);
	document.lrform.lr_comments.value = type;
	document.lrform.EMAIL.value = email;
	document.lrform.NUMBER_ITEMS.value = amount;
	document.lrform.TYPE.value = type;
	
	document.lrform.submit();
}

function lrpay() {
	var amount = parseFloat(document.userselect4.amount.value);

	var price = document.userselect4.amount.value;
	var type = document.userselect4.desc.value;
	var email = document.userselect4.email.value;
	var coupon = document.userselect4.c.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	price=0.00;
	//amount=amount-0;
	
	document.lrform.lr_amnt.value = addCommission(price + amount, PaymentCommissionLR);
	document.lrform.lr_comments.value = type;
	document.lrform.EMAIL.value = email;
	document.lrform.NUMBER_ITEMS.value = amount;
	document.lrform.TYPE.value = type;
	
	document.lrform.submit();
}

function lrpayeshop() {
	var amount = parseFloat(document.userselect.amount.value);

	var price = document.userselect.type.value;
	var type = document.userselect.type.options[document.userselect.type.selectedIndex].text;
	var email = document.userselect.email.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	//price=0.00;
	//amount=amount-0;
	
	document.lrform.lr_amnt.value = addCommission(price * amount, PaymentCommissionLR);
	document.lrform.lr_comments.value = type;
	document.lrform.EMAIL.value = email;
	document.lrform.NUMBER_ITEMS.value = amount;
	document.lrform.TYPE.value = type;
	
	document.lrform.submit();
}

function lrpay4() {
	var amount = parseFloat(document.userselect5.amount.value);

	if (!isValidDeposit(amount,  'Monitoring deposit must be 50$ or higher.\nPlease amend and retry')) { 
		return;
	}

	var price = document.userselect5.type.value;
	var type = document.userselect5.type.options[document.userselect5.type.selectedIndex].text;
	var email = document.userselect5.email.value;
	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	price=price-0;
	amount=amount-0;
	
	document.lrform.lr_amnt.value = addCommission(price + amount, PaymentCommissionLR);
	//document.lrform.lr_amnt.value = 0.02;
	document.lrform.lr_comments.value = type;
	document.lrform.EMAIL.value = email;
	document.lrform.NUMBER_ITEMS.value = amount;
	document.lrform.TYPE.value = type;
	
	document.lrform.submit();
}

function pmpay4() {
	var amount = parseFloat(document.userselect5.amount.value);

	if (!isValidDeposit(amount,  'Monitoring deposit must be 100$ or higher.\nPlease amend and retry')) { 
		return;
	}

	var price = document.userselect5.type.value;
	var type = document.userselect5.type.options[document.userselect5.type.selectedIndex].text;
	var email = document.userselect5.email.value;
	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	price=price-0;
	amount=amount-0;
	
	document.pmform.PAYMENT_AMOUNT.value = addCommission(price + amount, PaymentCommissionPM);
	document.pmform.SUGGESTED_MEMO.value = " " + amount + "," + type + "," + email;
	document.pmform.EMAIL.value = email;
	document.pmform.NUMBER_ITEMS.value = amount;
	document.pmform.TYPE.value = type;
	
	document.pmform.submit();
}

function pmpayprem() {
	var amount = parseInt(document.userselect.amount.value);

	var price = document.userselect.type.value;
	var type = document.userselect.type.options[document.userselect.type.selectedIndex].text;
	var email = document.userselect.email.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	document.pmform.PAYMENT_AMOUNT.value = addCommission(price * amount, PaymentCommissionPM);
	document.pmform.SUGGESTED_MEMO.value = " " + amount + "," + type + "," + email;
	document.pmform.EMAIL.value = email;
	document.pmform.NUMBER_ITEMS.value = amount;
	document.pmform.TYPE.value = type;
	
	document.pmform.submit();
}

function pmpaystand() {
	var amount = parseInt(document.userselect2.amount.value);

	var price = document.userselect2.type.value;
	var type = document.userselect2.type.options[document.userselect2.type.selectedIndex].text;
	var email = document.userselect2.email.value;
	
	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	document.pmform.PAYMENT_AMOUNT.value = addCommission(price * amount, PaymentCommissionPM);
	document.pmform.SUGGESTED_MEMO.value = " " + amount + "," + type + "," + email;
	document.pmform.EMAIL.value = email;
	document.pmform.NUMBER_ITEMS.value = amount;
	document.pmform.TYPE.value = type;
	
	document.pmform.submit();
}

function pmpaytext() {
	var amount = parseFloat(document.userselect3.amount.value);

	var price = document.userselect3.type.value;
	var type = document.userselect3.type.options[document.userselect3.type.selectedIndex].text;
	var email = document.userselect3.email.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	
	document.pmform.PAYMENT_AMOUNT.value = addCommission(price * amount, PaymentCommissionPM);
	document.pmform.SUGGESTED_MEMO.value = " " + amount + "," + type + "," + email;
	document.pmform.EMAIL.value = email;
	document.pmform.NUMBER_ITEMS.value = amount;
	document.pmform.TYPE.value = type;
	
	document.pmform.submit();
}

function pmpay() {
	var amount = parseFloat(document.userselect4.amount.value);

	var price = document.userselect4.amount.value;
	var type = document.userselect4.desc.value;
	var email = document.userselect4.email.value;
	var coupon = document.userselect4.c.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	price=0.00;
	//amount=amount-0;
	
	document.pmform.PAYMENT_AMOUNT.value = addCommission(price * amount, PaymentCommissionPM);
	document.pmform.SUGGESTED_MEMO.value = " " + amount + "," + type + "," + email;
	document.pmform.EMAIL.value = email;
	document.pmform.NUMBER_ITEMS.value = amount;
	document.pmform.TYPE.value = type;
	
	document.pmform.submit();
}

function pmpayeshop() {
	var amount = parseFloat(document.userselect.amount.value);

	var price = document.userselect.type.value;
	var type = document.userselect.type.options[document.userselect.type.selectedIndex].text;
	var email = document.userselect.email.value;

	if (!isValidEmail(email, 'A valid e-mail address is required.\nPlease amend and retry')) {
		return;
	}

	//price=0.00;
	//amount=amount-0;
	
	document.pmform.PAYMENT_AMOUNT.value = addCommission(price * amount, PaymentCommissionPM);
	document.pmform.SUGGESTED_MEMO.value = " " + amount + "," + type + "," + email;
	document.pmform.EMAIL.value = email;
	document.pmform.NUMBER_ITEMS.value = amount;
	document.pmform.TYPE.value = type;
	
	document.pmform.submit();
}

//</script>

