
/*
************************* 
* www.buddhafield.com 2.6.1
*************************
*
* Original author: Satyadarshin
* Document created: spring 2010
*  
* Abstract: 
* 
* Changelog (date / editor / changes): 
* 10.12.10 / Satyadarshin / Updated info@buddhafield.com to information@buddhafield.com
*/
		
window.onload = function obfuscateEmail() {
	// Inserts an email address into PayPal button forms
	if (document.getElementById("switch_paypal_email")) {
		var paypal = document.getElementById("switch_paypal_email"); 
		var pieces = "payments" + "@" + "buddhafield" + ".com";	
		paypal.setAttribute("value",pieces);
	}
	
	// Switches block photos of tshirt models, women for men
	// This is preparatory to there being an in-page switch button
	if (document.getElementById("models")) {
		var tShirtImage = document.getElementById("models"); 
		var men = "multimedia/images/womenTshirtStyles.jpg";
		tShirtImage.setAttribute("src",men);
	}
	
	// Mungs email address
	// HTML: <span id="email_address"><span class="fauxlink">Hannahaha15</span>[replace with an &ldquo;at&rdquo;]<span class="fauxlink">hotmail</span>[replace with a &ldquo;dot&rdquo;]<span class="fauxlink">com</span><br />(This email address has been &ldquo;munged&rdquo; to stop it being harvested by email spammers.)</span>
	if (document.getElementById("email_address")) {
		munged = document.getElementById("email_address"); 			// get <p> element with id email_address
		while (munged.childNodes[0]) {								// cycle through all of munged's children	
			munged.removeChild(munged.childNodes[0]);				// delete ev
		}
		var pieces = "louiseinthetrees" + "@" + "hotmail" + ".com";
		var jigsaw = "mailto:" + pieces;
		var substitute = document.createElement("a");
		substitute.setAttribute("href",jigsaw);
		var text = document.createTextNode(pieces);
		substitute.appendChild(text);
		munged.appendChild(substitute);
	}
	
	if (document.getElementById("general_office")) {
		munged = document.getElementById("general_office"); 		// get <p> element with id email_address
		while (munged.childNodes[0]) {								// cycle through all of munged's children	
			munged.removeChild(munged.childNodes[0]);				// delete ev
		}
		var pieces = "information" + "@" + "buddhafield" + ".com";
		var jigsaw = "mailto:" + pieces;
		var substitute = document.createElement("a");
		substitute.setAttribute("href",jigsaw);
		var text = document.createTextNode(pieces);
		substitute.appendChild(text);
		munged.appendChild(substitute);
	}
	
	if (document.getElementById("email_festival")) {
		munged = document.getElementById("email_festival"); 			// get <p> element with id email_address
		while (munged.childNodes[0]) {								// cycle through all of munged's children	
			munged.removeChild(munged.childNodes[0]);				// delete ev
		}
		var pieces = "festivalenquiries" + "@" + "buddhafield" + ".com";
		var jigsaw = "mailto:" + pieces;
		var substitute = document.createElement("a");
		substitute.setAttribute("href",jigsaw);
		var text = document.createTextNode(pieces);
		substitute.appendChild(text);
		munged.appendChild(substitute);
	}
}




