//
function init()
{
//		
    	var xmlDoc = "";
	window.ActiveXObject ? xmlDoc = new ActiveXObject("Microsoft.XMLDOM") 
				     :  xmlDoc = document.implementation.createDocument("","",null);
	xmlDoc.async = false;
	xmlDoc.load("master.xml");
//
	var x;
	var y;
	x = xmlDoc.getElementsByTagName('lead_recipient')[0].firstChild.data;
	y = replaceChars(x);
	document.myForm.recipient.value = y;
	document.myForm.courtesy_our_email.value = y;
//
	x="";
	y="";
	x = xmlDoc.getElementsByTagName("lead_recipient_upline")[0].firstChild.data;
	y = replaceChars(x);
	document.myForm.cc.value = y;
//
	x="";
	y="";
	x = xmlDoc.getElementsByTagName("bcc")[0].firstChild.data;
	y = replaceChars(x);
	document.myForm.bcc.value = y;
//
	document.myForm.subject.value = 'request from ' + location.href;
//
// We don't want to use the standard SugarMums text for the bottom of the email for WIB 
//	x="";
//	y="";
//	z="";
//	x = xmlDoc.getElementsByTagName("text_at_bottom_of_email")[0].firstChild.data;
//	y = replaceChars(x);
//	z = y + "\r\r" + 
//
// "Our leaders are :\rIn the top 100 income earners in the company\rIn the Million Dollar Earners Club\rTop Ten Income Earners of the Year in Australia\rWorldwide Business Builders of the year 2001\rA few years ago they were in the top 20 people worldwide\r\r\rIf you do not want to receive future emails from us, please send a reply email asking to be taken off our email list."; 
// document.myForm.courtesy_who_we_are.value = z;
//     document.myForm.courtesy_who_we_are.value = y;
//
// Use a WIB related link for the page after they submit
//	x="";
//	y="";
//	x = xmlDoc.getElementsByTagName("page_to_redirect_to")[0].firstChild.data;
//	y = replaceChars(x);
//	document.myForm.redirect.value = y;
	document.myForm.redirect.value = "http://www.smh.com.au/opinion/society-and-culture/a-seat-at-the-table-20101107-17iz0.html";
//
// We don't want to have any URL's at the bottom of the WIB emails.
//	x="";
//	y="";
//	x = xmlDoc.getElementsByTagName("url_at_bottom_of_email")[0].firstChild.data;
//	y = replaceChars(x);
//	document.myForm.courtesy_our_url.value = y;
	document.myForm.courtesy_our_url.value = ""
//
	x="";
	y="";
	x = xmlDoc.getElementsByTagName("about_me_name")[0].firstChild.data;
	y = replaceChars(x);
	document.getElementById('about_me_name').innerHTML = y;
	document.getElementById('about_me_name2').innerHTML = y;
// We want to use the about_me_name for the bottom of the WIB emails
       document.myForm.courtesy_who_we_are.value = y;


	x="";
	y="";
	x = xmlDoc.getElementsByTagName("about_me_text")[0].firstChild.data;
	y = replaceChars(x);
	document.getElementById('about_me_text').innerHTML = y;
//
}
navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);	
//
function replaceChars(entry) {
out = ";"; // replace this
add = ","; // with this
temp = "" + entry; // temporary holder
//---
while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
return temp;
}

