// ==========================================================
// Hide mail address from spiders
//
// Parms: name      - left hand side of the @           									required
//        text      - displayed value (defaults to full email address     optional
//        classname - css class to control display      									optional
//        subject   - text for subject line of email    									optional
//        vrhs      - override standard right hand side 									optional
//
// Example:
// <script language="JavaScript" type="text/javascript">mail("info","","mail")</script>
// ==========================================================
function mail(name,text,classname,subject,vrhs) {

	var rhs = "readysetshow.ca";
	var add = name + "@" + rhs;
	var classtag = "";

	// Set optional parameters to blank if they are not passed
	if (text==null) {
		text = "";
	}

	if (classname==null) {
		classname = "";
	}

	if (subject==null) {
		subject = "";
	}

	if (vrhs==null) {
		vrhs = "";
	}

	// If the vrhs field is not specified use the basic rhs
	if (vrhs!="") {
		add = name + "@" + vrhs;
	}

	// If the text field is not specified use the basic address
	if (text=="") {
		text = add;
	}

	// Build the subject code if required
	if (subject!="") {
		add = add + "?subject=" + subject;
	}

	// Build the class code if required
	if (classname!="") {
		classtag = "class='" + classname + "'";
	}

	// Write out the completed mail to reference
	document.write("<a " + classtag + " href='" + "mail" + "to:" + add + "'>" + text + "</a>");

}

// ==========================================================
// Open a display window 
//
// Parms: url      - location of page to use        required
//        name     - name to display in window      required
//        width 	 - width of the window      			required
//        height   - height of the window    				required
//
// Example:
// <script language="JavaScript" type="text/javascript">mail("info","","mail")</script>
// ==========================================================
function openWindow(url,name,width,height) {
	window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width='+width+',height='+height);
}


// ==========================================================
// Display Images in open window
//
// Parms: imgId    - image identifier               required
//
// Note: Images must be of the form 'image?x.jpg' where ?
//       is the imgId and x is either 'a' or ' b'. The images 
//       must be in the same directory the page that calls it
//
// Example:
// <a href="#" onClick="displayImg(1); return false;">1</a>
// ==========================================================
function displayImg(imgId) {					
	if (document.images) {		
			beforeImgName = "image" + imgId + "b.jpg";	
			afterImgName  = "image" + imgId + "a.jpg";	
			document.images['before_image'].src = beforeImgName;
			document.images['after_image'].src = afterImgName;
			}	
	}
