// JavaScript Document



	var showFlash = false;

	checkBrowser();

	var numHolders = 3;
	var imgArray = new Array("images/ad_cftc.jpg", "images/ad_es.jpg", "images/ad_bcspca.jpg", "images/ad_cbm.jpg",
		"images/ad_pac.jpg", "images/ad_gsc.jpg", "images/ad_cwf.jpg", "images/ad_tlmc.jpg",
		"images/ad_clf.jpg", "images/ad_rc.jpg", "images/ad_chs.jpg", "images/ad_mrcf.jpg",
		"images/ad_mdc.jpg", "images/ad_sm.jpg", "images/ad_crs.jpg", "images/ad_sa.jpg", "images/ad_kfc.jpg",
		"images/ad_shs.jpg", "images/ad_st.jpg", "images/ad_smh.jpg", "images/ad_yuf.jpg", "images/ad_wv.jpg",
		"images/ad_ysm.jpg", "images/ad_vs.jpg", "images/ad_wa.jpg", "images/ad_tc.jpg", "images/ad_ccfc.jpg",
		"images/ad_wlu.jpg", "images/ad_cmic.jpg", "images/ad_bh.jpg");
	var linkArray = new Array("http://www.canadianfeedthechildren.ca", "http://www.easterseals.ca", 
		"http://www.spca.bc.ca/help/bequest.asp", "http://www.cbmicanada.org",
		"http://www.pediatricaidscanada.org", "http://www.goodshepherdcentres.ca",
		"http://www.cwf-fcf.org", "http://www.leprosy.ca",
		"http://www.liver.ca", "http://www.orea.com", "http://www.chs.ca", "http://www.mtroyal.ca/foundation",
		"http://www.mdac.ca", "http://scottmission.com", "http://www.src-crs.ca", "http://www.sciencealberta.org",
		"http://www.kidney.ca", "http://www.sunnybrookfoundation.ca",
		"http://www.stewardshiptoronto.org", "http://www.stmichaelshospital.com/foundation/index.php",
		"http://www.yorku.ca/foundation", "http://www.worldvision.ca", "http://www.ysm.on.ca",
		"http://www.victoriasymphony.ca", "http://www.waramps.ca", "http://www.tidescanada.org",
		"http://www.ccfcanada.ca", "http://www.wlu.ca", "http://www.cmic.info", "http://www.belmonthouse.com");
	var imgInd = new Array(0,1,2);
	imgInd[0] = Math.floor(Math.random() * imgArray.length);
	imgInd[1] = imgInd[0] + 1;
	if (imgInd[1] >= imgArray.length) { imgInd[1] = 0; }
	imgInd[2] = imgInd[1] + 1;
	if (imgInd[2] >= imgArray.length) { imgInd[2] = 0; }
	var curImgInd = -1;

	// Part of JavaScript Browser Sniffer
	// Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002
	// see http://www.webreference.com/tools/browser/javascript.html for more information
	//
	// This program is free software; you can redistribute it and/or modify
	// it under the terms of the GNU General Public License as published by
	// the Free Software Foundation; either version 2 of the License, or
	//  (at your option) any later version.

	function checkBrowser() {
		var agt=navigator.userAgent.toLowerCase();

		var is_konq = false;
		var kqPos   = agt.indexOf('konqueror');
		if (kqPos !=-1) { is_konq  = true; }

		var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
		var is_khtml  = (is_safari || is_konq);

		var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;

		var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
		             (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
     		        (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
           		  (is_gecko) && (navigator.vendor=="Firefox"));

		var is_Flash = false;
		var is_FlashVersion = 0;

		if (is_fx) {
		   var plugin = (navigator.mimeTypes && 
		                 navigator.mimeTypes["application/x-shockwave-flash"] &&
		                 navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?
		                 navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		   if (plugin&&plugin.description) {
		      is_Flash = true;
		      is_FlashVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
		   }
		} 

		if (is_fx) {
			showFlash = is_Flash;
		} else if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) {
			showFlash = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
		} else if (document.all && (navigator.appVersion.indexOf("Mac")==-1)) {
			// Internet Explorer for Windows only - check for ActiveX control
			eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if (xObj)	showFlash = true; xObj = null; } catch (e) {}');
		}
	}

	function setCurrentImage(obj) {
		curImgInd = obj.name.substring(5);
	}

	function unsetCurrentImage() {
		curImgInd = -1;
	}

	function rotateImages() {
		var img, link;
		for (ind=0; ind<numHolders; ind++) {
			img = imgArray[imgInd[ind]];
			link = linkArray[imgInd[ind]];
			imgInd[ind] = (imgInd[ind]+1) % imgArray.length;
			if (document.images) {
				document.images['rImg'+ind].src = img;
			} else if (document.all) {
				document.all['rImg'+ind].src = img;
			} else if (document.getElementById) {
				document.getElementById('rImg'+ind).src = img;
			}
			if (document.all) {
				document.all['rLink'+ind].href = link;
			} else if (document.getElementById) {
				document.getElementById('rLink'+ind).href = link;
			}
			if (curImgInd > -1 && curImgInd == ind) {
				window.status = link;
			}
		}
		setTimeout("rotateImages()", 15000);
	}

	if (! showFlash) { 
		document.write("<a href=\"" + linkArray[0] + "\" name=rLink0 id=rLink0 target=\"_new\" "); 	
		document.write("onMouseOver=\"setCurrentImage(this)\" onMouseOver=\"unsetCurrentImage()\">");
		document.write("<img src=\"" + imgArray[0] + "\" name=rImg0 id=rImg0 width=125 height=125 ");
		document.write("vspace=5 hspace=10 border=0></a>");

		document.write("<a href=\"" + linkArray[1] + "\" name=rLink1 id=rLink1 target=\"_new\" "); 	
		document.write("onMouseOver=\"setCurrentImage(this)\" onMouseOver=\"unsetCurrentImage()\">");
		document.write("<img src=\"" + imgArray[1] + "\" name=rImg1 id=rImg1 width=125 height=125 ");
		document.write("vspace=5 hspace=10 border=0></a>");

		document.write("<a href=\"" + linkArray[2] + "\" name=rLink2 id=rLink2 target=\"_new\" "); 	
		document.write("onMouseOver=\"setCurrentImage(this)\" onMouseOver=\"unsetCurrentImage()\">");
		document.write("<img src=\"" + imgArray[2] + "\" name=rImg2 id=rImg2 width=125 height=125 ");
		document.write("vspace=5 hspace=10 border=0></a>");

		rotateImages();
	} else {
		document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
		document.write("codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ");
		document.write("width=395 height=145 id=CDGRotator align=\"\">");
		document.write("<PARAM NAME=movie VALUE=\"CDGRotator2.swf\">");
		document.write("<PARAM NAME=quality VALUE=high>");
		document.write("<PARAM NAME=bgcolor VALUE=#FFFFFF>");
		document.write("<PARAM NAME=wmode value=transparent>");
		document.write("<EMBED src=\"CDGRotator2.swf\" quality=high bgcolor=#FFFFFF ");
		document.write("width=395 height=145 wmode=transparent NAME=CDGRotator ALIGN=\"\" ");
		document.write("TYPE=\"application/x-shockwave-flash\" ");
		document.write("PLUGINSPAGE=\"https://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>");
	}



