

function backCNRRegister()
{
	  document.member_registration.action = "member.php";
	  document.member_registration.submit();	
	 return true;
}


function continueCNRRegister()
{
	  document.member_registration.action = "confirm_member.php";
	  document.member_registration.submit();	
	  	return true;
		// Submit the page
}

function generateConfirm()
{
	document.confirm_generation.action = "confirm_generation.php";
	document.confirm_generation.submit();			// Submit the page
	return true;
}
function generateBack()
{
	document.confirm_generation.action = "generate_cnr.php";
	document.confirm_generation.submit();			// Submit the page
	return true;
}
function cnrads_user()
{
	document.cnrads_user.action = "http://www.clicknringads.com";
	document.cnrads_user.submit();			// Submit the page
	return true;
}
	
function count()
	{
	
	var claim = parseFloat(document.getElementById("ringgit").value)
	var cv = parseFloat(document.getElementById("rate").value) 
	var total =parseFloat(claim/cv)
	var pt =parseInt(total*100)
  	document.payconfirm.amount.value =total.toFixed(2);
	document.payconfirm.points.value =pt;
	}

function count_commission()
	{
	
	var claim = parseFloat(document.getElementById("amount").value)
	var cv = parseFloat(document.getElementById("rate").value) 
	var total =parseFloat(claim/cv)
  	document.give_commmission.ringgit.value =total.toFixed(2);
	}

function eWalletClaim()
{
	method = "ewallet_claim";	
	 var where_to= confirm("Are you sure your customer want to claim using the eWallet ? ");
   if (where_to== true)
    {
	  document.payconfirm.action = "process_loyalty.php?mode="+method;
	  document.payconfirm.submit();			// Submit the page
	  return true;
    }

}

function pointClaim()
{
	method = "points_claim";	
	 var where_to= confirm("Are you sure your customer want to claim using the CNR Point ? ");
   if (where_to== true)
    {
	  document.payconfirm.action = "process_loyalty.php?mode="+method;
	  document.payconfirm.submit();			// Submit the page
	  return true;
    }

}


function eWalletPayment()
{
	method = "ewallet_payment";	
	 var where_to= confirm("Are you sure you want to pay the commission using your ewallet ? ");
   if (where_to== true)
    {
	  document.give_commmission.action = "process_loyalty.php?mode="+method;
	  document.give_commmission.submit();			// Submit the page
	  return true;
    }

}

function onlinePayment()
{
	method = "online_payment";	
	document.give_commmission.action = "process_loyalty.php?mode="+method;
	document.give_commmission.submit();			// Submit the page
	return true;
}

function eWalletToptoken()
{
	 var where_to= confirm("Are you sure you want to topup using your ewallet ? ");
   if (where_to== true)
    {
	  document.token.action = "process_ewallet_topup.php";
	  document.token.submit();			// Submit the page
	  return true;
    }

}

function onlineToptoken()
{
	document.token.action = "process_topup.php";
	document.token.submit();			// Submit the page
	return true;
}

function eWalletTopcnr()
{
	 var where_to= confirm("Are you sure you want to topup using your ewallet ? ");
   if (where_to== true)
    {
	  document.topcnr.action = "process_ewallet_topup.php";
	  document.topcnr.submit();			// Submit the page
	  return true;
    }

}

function onlineTopcnr()
{
	document.topcnr.action = "process_topup.php";
	document.topcnr.submit();			// Submit the page
	return true;
}

function eWalletTopphone()
{
	 var where_to= confirm("Are you sure you want to topup using your ewallet ? ");
   if (where_to== true)
    {
	  document.topphone.action = "process_ewallet_topup.php";
	  document.topphone.submit();			// Submit the page
	  return true;
    }

}

function onlineTopphone()
{
	document.topphone.action = "process_topup.php";
	document.topphone.submit();			// Submit the page
	return true;
}


function available_eWallet(){
	
	    method = "eWallet";
		var link = '../common/check_balance.php?mode='+method+'&screen_name=' + document.getElementById('screen_name').value;
		if(document.getElementById('screen_name').value!=''){
			window.open(link,null,'height=100,width=400,resizable=yes,scrollbars=yes,status=yes');
		}
		else{
			alert('Please insert the customer screen name for checking.');
		}
}

function available_Point(){
	
	    method = "points";
		var link = '../common/check_balance.php?mode='+method+'&screen_name=' + document.getElementById('screen_name').value;
		if(document.getElementById('screen_name').value!=''){
			window.open(link,null,'height=100,width=400,resizable=yes,scrollbars=yes,status=yes');
		}
		else{
			alert('Please insert the customer screen name for checking.');
		}
}


function check_display_name(){
		var link = '../common/check_name.php?screen_name=' + document.getElementById('screen_name').value;
		if(document.getElementById('screen_name').value!=''){
			window.open(link,null,'height=100,width=200,resizable=no,scrollbars=no,status=yes');
		}
		else{
			alert('Please Insert the Display Name.');
		}
}


function screen_name_exist(){
		var link = '../common/exist_name.php?screen_name=' + document.getElementById('screen_name').value;
		if(document.getElementById('screen_name').value!=''){
			window.open(link,null,'height=100,width=200,resizable=no,scrollbars=no,status=yes');
		}
		else{
			alert('Please insert the customer screen name.');
		}
}

function list_screen_name(){
		var link = '../loyalty/customer_list.php?retailer_id=' + document.getElementById('retailer_id').value;
			window.open(link,null,'height=450,width=750,resizable=yes,scrollbars=yes,status=yes');	
}


function list_all_screen_name(){
		var link = '../loyalty/customer_list.php?retailer_id=' + document.getElementById('retailer_id').value;
			window.open(link,null,'height=450,width=750,resizable=yes,scrollbars=yes,status=yes');	
}


function Individual() {
BUDiv.style.visibility='hidden';
INDiv.style.visibility='visible';
register.name.focus();
}

function Business() {
BUDiv.style.visibility='visible';
INDiv.style.visibility='hidden';
register.name.focus();
}


function intro_name() {
SNDiv.style.visibility='visible';
CNDiv.style.visibility='hidden';
register.intro_s_name.focus();
}

function intro_cnr() {
CNDiv.style.visibility='visible';
SNDiv.style.visibility='hidden';
register.intro_cnr_no.focus();
}

function no_introducer() {
SNDiv.style.visibility='hidden';
CNDiv.style.visibility='hidden';
}

function updateGmt()
{
	var delim=document.all.zone.value.indexOf('_')
	document.all.gmt.value=''+document.all.zone.value.substring(delim+1)
}

function updateCountry()
{
	var delim=document.all.pcode.value.indexOf('_')
	document.all.pcountry.value=''+document.all.pcode.value.substring(delim+1)
}
	
function updateCountry2()
{
	var delim=document.all.mcode.value.indexOf('_')
	document.all.mcountry.value=''+document.all.mcode.value.substring(delim+1)
}
function updatetype()
{
	var delim=document.all.member_id.value.indexOf('_')
	document.all.amount.value=''+document.all.member_id.value.substring(delim+1)
}