// Javascripts for email
// Sending meail to Office AT stjamestheapostle.ca

function sendtoOffice(invite, subject, mailbody) {
	sendtoSJA('office', invite, subject, mailbody);
	return ;
	} ;


// Sending email to any address AT stjamestheapostle.ca

function sendtoSJA(adresse, invite, subject, mailbody) {
	var domaine = "stjamestheapostle" + "." + "ca";
	sendto(adresse, domaine, invite, subject, mailbody);
	return ;
	} ;


// Sending email to another address
function sendto(adresse, domaine, invite, subject, mailbody) {
	var at = '&#64;';
	if (invite==undefined) {invite = adresse + at + domaine;} ;
	var chaine = '<a href=' + 'mailt' + 'o:' + adresse + at + domaine;
	if (subject!=undefined) { if (subject == '') {subject='No Title'; } ; }
	if (subject!=undefined) { chaine = chaine + '?subject=' + subject ; }
	if (mailbody!=undefined) { chaine = chaine + '&body=' + mailbody ; }
	chaine = chaine + '>' + invite + '</a>';
	document.writeln(chaine);
	return } ;




// Choisir la feuille de styles supplementaires pour IE 6... ou les autres

if ((navigator.appVersion.indexOf('MSIE') >= 0) && (parseInt(navigator.appVersion) >= 4) && (navigator.platform.indexOf('Win') >= 0)) 
	document.writeln('<link rel="stylesheet" href="/zstyles_ie.css" type="text/css" />')
	;

//   else
//	document.writeln('<link rel="stylesheet" href="/zstyles_fox.css" TYPE="text/css" />')



//Show details when the Description box is clicked on
function ShowDetails(tdescr,taffiche,tcache) {
	if(document.getElementById(tdescr).style.display == "none") {
		document.getElementById(tdescr).style.display = "";
		if(taffiche!==undefined) document.getElementById(tafficher).style.display = "none";
		if(tcache!==undefined) document.getElementById(tcacher).style.display = "";
		}
	else {
		document.getElementById(tdescr).style.display = "none";
		if(taffiche!==undefined) document.getElementById(tafficher).style.display = "";
		if(tcache!==undefined) document.getElementById(tcacher).style.display = "none";
		}
}

