function NewsletterSubPage2()
{

	var sReturn;
	var sParam;	
	
	var divWorking = document.getElementById('divWorking');
	var btn_submit = document.getElementById('btn_submit');


	if (NewsletterSubPageValidate2())
	{		
	
			btn_submit.style.display = 'none';	
			divWorking.innerHTML = 'Sending please wait...';
			divWorking.style.display = 'block';	
			
						
			sReturn = onDemandSite(sParam);
			
			
			if (document.getElementById('txtmCountry').value == 'Australia'){
			sParam = 'method=SITE_SEND_ENQUIRY&select=1098&site=971&group=3635&type=596&sendnews=1';
			
			sParam = sParam + '&firstname=' + document.getElementById('txtFirstName2').value; //first name
			sParam = sParam + '&surname=' + document.getElementById('txtSurname').value; //surname
			sParam = sParam + '&email=' + document.getElementById('txtEmail').value; //email
			sParam = sParam + '&mailingpostcode=' + document.getElementById('txtmPostCode').value; //postcode
			sParam = sParam + '&mailingcountry=' + document.getElementById('txtmCountry').value; //postcode
			
			}
			
			else if  (document.getElementById('txtmCountry').value == 'New Zealand'){
			sParam = 'method=SITE_SEND_ENQUIRY&select=1098&site=971&group=3636&type=649&sendnews=1';
			
			sParam = sParam + '&firstname=' + document.getElementById('txtFirstName2').value; //first name
			sParam = sParam + '&surname=' + document.getElementById('txtSurname').value; //surname
			sParam = sParam + '&email=' + document.getElementById('txtEmail').value; //email
			sParam = sParam + '&mailingpostcode=' + document.getElementById('txtmPostCode').value; //postcode
			sParam = sParam + '&mailingcountry=' + document.getElementById('txtmCountry').value; //postcode
			
			}
			
			else{
			sParam = 'method=SITE_SEND_ENQUIRY&select=1098&site=971&group=6903&type=730&sendnews=1';
			
			sParam = sParam + '&firstname=' + document.getElementById('txtFirstName2').value; //first name
			sParam = sParam + '&surname=' + document.getElementById('txtSurname').value; //surname
			sParam = sParam + '&email=' + document.getElementById('txtEmail').value; //email
			sParam = sParam + '&mailingpostcode=' + document.getElementById('txtmPostCode').value; //postcode
			sParam = sParam + '&mailingcountry=' + document.getElementById('txtmCountry').value; //postcode

			


			}
		sReturn = onDemandSite(sParam);
			if (sReturn.substring(0, 2) == 'OK')
			{
			
				document.location.href = '/newsletter_subscribe'
			}
			else
			{
		
				window.alert('Could not send!');
			
			}
		}

}


function NewsletterSubPageBlog()
{

	var sReturn;
	var sParam;	
	var divLoading = document.getElementById('divLoading');
	var news_form = document.getElementById('news_form');

	divLoading.style.display = 'none';


	if (NewsletterSubPageValidate2())
	{			
						
			sReturn = onDemandSite(sParam);
			
			
			if (document.getElementById('txtmCountry').value == 'Australia'){
			sParam = 'method=SITE_SEND_ENQUIRY&select=1098&site=971&group=3635&type=596&sendnews=1';
			
			sParam = sParam + '&firstname=' + document.getElementById('txtFirstName2').value; //first name
			sParam = sParam + '&surname=' + document.getElementById('txtSurname').value; //surname
			sParam = sParam + '&email=' + document.getElementById('txtEmail').value; //email
			sParam = sParam + '&mailingpostcode=' + document.getElementById('txtmPostCode').value; //postcode
			sParam = sParam + '&mailingcountry=' + document.getElementById('txtmCountry').value; //postcode
			
			}
			
			else if  (document.getElementById('txtmCountry').value == 'New Zealand'){
			sParam = 'method=SITE_SEND_ENQUIRY&select=1098&site=971&group=3636&type=649&sendnews=1';
			
			sParam = sParam + '&firstname=' + document.getElementById('txtFirstName2').value; //first name
			sParam = sParam + '&surname=' + document.getElementById('txtSurname').value; //surname
			sParam = sParam + '&email=' + document.getElementById('txtEmail').value; //email
			sParam = sParam + '&mailingpostcode=' + document.getElementById('txtmPostCode').value; //postcode
			sParam = sParam + '&mailingcountry=' + document.getElementById('txtmCountry').value; //postcode
			
			}
			
			else{
			sParam = 'method=SITE_SEND_ENQUIRY&select=1098&site=971&group=6903&type=730&sendnews=1';
			
			sParam = sParam + '&firstname=' + document.getElementById('txtFirstName2').value; //first name
			sParam = sParam + '&surname=' + document.getElementById('txtSurname').value; //surname
			sParam = sParam + '&email=' + document.getElementById('txtEmail').value; //email
			sParam = sParam + '&mailingpostcode=' + document.getElementById('txtmPostCode').value; //postcode
			sParam = sParam + '&mailingcountry=' + document.getElementById('txtmCountry').value; //postcode

			


			}
		sReturn = onDemandSite(sParam);
			if (sReturn.substring(0, 2) == 'OK')
			{
				news_form.style.display = 'none';
				divLoading.innerHTML = 'Thank you for subscribing to our newsletter!';
				divLoading.style.width = '300px';
				divLoading.style.display = 'block';	
				
			}
			else
			{
		
				window.alert('Could not send!');
			
			}
		}

}




function NewsletterSubPageValidate2() 
{

	sOnDemandValidateMessage = '';
	sOnDemandValidateObject = '';
	
	onDemandValidate('txtFirstName2', 'First Name', '');
	onDemandValidate('txtSurname', 'Surname', '');
	onDemandValidate('txtEmail', 'Email', '');
	onDemandValidate('txtmCountry', 'Country', '');
	onDemandValidate('txtmPostCode', 'PostCode', '');
	
	if (!onDemandIsEmail(document.getElementById('txtEmail').value))
	{
		sOnDemandValidateMessage = sOnDemandValidateMessage + '\r\n # Not a valid email address.';
	}

	if (sOnDemandValidateMessage != '')
	{
		window.alert('Sorry can\'t submit your registration as:\r\n' + sOnDemandValidateMessage);
		document.getElementById(sOnDemandValidateObject).focus();
		return (false);
	}
	
	else
	{
		return (true);
	}
}	


