var arg = window.location.search.substring(1);
if (arg.length > 1 && arg == "noflash") {
	showFlash = false;
} else {
	showFlash = true;
}

order = new Image();
order.src = "pics/order-a.gif";
viewarticle = new Image();
viewarticle.src = "pics/viewarticle-a.gif";
read4 = new Image();
read4.src = "pics/readmore-a.gif";

function showIndexMenu(page, noAbsolute) {
	if (showFlash) {
		if (noAbsolute) {
			document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
			document.write(" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"");
			document.write(" WIDTH=\"600\" HEIGHT=\"57\" id=\"CDGMenu\" ALIGN=\"\">");
			document.write(" <PARAM NAME=movie VALUE=\"CDGMenu.swf\">");
			document.write(" <PARAM NAME=quality VALUE=high>");
			document.write(" <PARAM NAME=bgcolor VALUE=#FFFFFF>");
			document.write(" <EMBED src=\"CDGMenu.swf\" quality=high bgcolor=#FFFFFF WIDTH=\"600\" HEIGHT=\"57\" NAME=\"CDGMenu\" ALIGN=\"\"");
			document.write(" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">");
			document.write("</EMBED>");
			document.write("</OBJECT>");
		} else {
			document.write("<table height=62><tr><td><p class=\"body\">");
			document.write("The menu did not load properly. Click <a href=\"\" onClick=\"window.location.reload()\">here</a>");
			document.write(" to reload.</p></td></tr></table>");
			document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
			document.write(" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"");
			document.write(" WIDTH=\"600\" HEIGHT=\"57\" id=\"CDGMenu\" ALIGN=\"\" style=\"position:absolute; top:62px\">");
			document.write(" <PARAM NAME=movie VALUE=\"CDGMenu.swf\">");
			document.write(" <PARAM NAME=quality VALUE=high>");
			document.write(" <PARAM NAME=bgcolor VALUE=#FFFFFF>");
			document.write(" <EMBED src=\"CDGMenu.swf\" quality=high bgcolor=#FFFFFF WIDTH=\"600\" HEIGHT=\"57\" NAME=\"CDGMenu\" ALIGN=\"\"");
			document.write(" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">");
			document.write("</EMBED>");
			document.write("</OBJECT>");
		}
	} else {
		document.write("<a href=\"index.htm?noflash\">Home</a>");
		document.write(" | <a href=\"members/default.aspx?noflash\">Members' Site</a>");
		document.write(" | <a href=\"javascript:popUp\('http://www.donorsguide.ca/Search/search.aspx'\)\">");
		document.write("Search Charities</a><br>");

		document.write("About the Guide:");
		document.write(" <a href=\"order.htm?noflash\">Order</a>");
		document.write(" | <a href=\"contact.htm?noflash\">Contact</a>");
		document.write(" | <a href=\"distribution.htm?noflash\">Distribution</a>");
		document.write(" | <a href=\"link.htm?noflash\">How to Link</a>");
		document.write(" | <a href=\"related.htm?noflash\">Related Sites</a>");
		document.write(" | <a href=\"sitemap.htm?noflash\">Site Map</a><br>");

		document.write("Advertising/Listings:");
		document.write(" <a href=\"listtypes.htm?noflash\">Listing Types</a>");
		document.write(" | <a href=\"adrates.htm?noflash\">Rates</a>");
		document.write(" | <a href=\"adspecs.htm?noflash\">Specifications</a>");
		document.write(" | <a href=\"testimonials.htm?noflash\">Testimonials</a>");
		document.write(" | <a href=\"listform.htm?noflash\">Submit Listings/Ads</a><br>");

		document.write(" <a href=\"articles.htm?noflash\">Articles</a>");
	}
}

function showMenu(page) {
	if (showFlash) {
//		document.write("<table height=62><tr><td><p class=\"body\">");
//		document.write("The menu did not load properly. Click <a href=\"\" onClick=\"window.location.reload()\">here</a>");
//		document.write(" to reload.</p></td></tr></table>");
		document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
		document.write(" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"");
//		document.write(" WIDTH=\"600\" HEIGHT=\"57\" id=\"CDGMenu\" ALIGN=\"\" style=\"position:absolute; top:62px\">");
		document.write(" WIDTH=\"600\" HEIGHT=\"57\" id=\"CDGMenu\" ALIGN=\"\">");
		document.write(" <PARAM NAME=movie VALUE=\"CDGMenu.swf\">");
		document.write(" <PARAM NAME=quality VALUE=high>");
		document.write(" <PARAM NAME=bgcolor VALUE=#FFFFFF>");
		document.write(" <EMBED src=\"CDGMenu.swf\" quality=high bgcolor=#FFFFFF WIDTH=\"600\" HEIGHT=\"57\" NAME=\"CDGMenu\" ALIGN=\"\"");
		document.write(" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">");
		document.write("</EMBED>");
		document.write("</OBJECT>");
	} else {
		document.write("<a href=\"index.htm?noflash\">Home</a>");
		document.write(" | <a href=\"members/default.aspx?noflash\">Members' Site</a>");
		document.write(" | <a href=\"javascript:popUp\('http://www.donorsguide.ca/Search/search.aspx'\)\">");
		document.write("Search Charities</a><br>");

		document.write("About the Guide:");
		document.write(" <a href=\"order.htm?noflash\">Order</a>");
		document.write(" | <a href=\"contact.htm?noflash\">Contact</a>");
		document.write(" | <a href=\"distribution.htm?noflash\">Distribution</a>");
		document.write(" | <a href=\"link.htm?noflash\">How to Link</a>");
		document.write(" | <a href=\"related.htm?noflash\">Related Sites</a>");
		document.write(" | <a href=\"sitemap.htm?noflash\">Site Map</a><br>");

		document.write("Advertising/Listings:");
		document.write(" <a href=\"listtypes.htm?noflash\">Listing Types</a>");
		document.write(" | <a href=\"adrates.htm?noflash\">Rates</a>");
		document.write(" | <a href=\"adspecs.htm?noflash\">Specifications</a>");
		document.write(" | <a href=\"testimonials.htm?noflash\">Testimonials</a>");
		document.write(" | <a href=\"listform.htm?noflash\">Submit Listings/Ads</a><br>");

		document.write(" <a href=\"articles.htm?noflash\">Articles</a>");
	}
}

function showReadMoreLink(url, id) {
	if (showFlash) {
		document.writeln("<a href=\"" + url + "\">");
	} else {
		document.writeln("<a href=\"" + url + "?noflash\">");
	}
	document.writeln("<img src=\"pics/readmore.gif\" name=\"" + id + "\" width=85 height=24 border=0");
	document.writeln(" onMouseOver=\"" + id + ".src='pics/readmore-a.gif'\" ");
	document.writeln(" onMouseOut=\"" + id + ".src='pics/readmore.gif'\"></a>");
}

function showReadMoreTestimonialsLink(url, id) {
	if (showFlash) {
		document.writeln("<a href=\"" + url + "\">");
	} else {
		document.writeln("<a href=\"" + url + "?noflash\">");
	}
	document.writeln("<img src=\"pics/readmoretsml.gif\" name=\"" + id + "\" width=142 height=24 border=0");
	document.writeln(" onMouseOver=\"" + id + ".src='pics/readmoretsml-a.gif'\" ");
	document.writeln(" onMouseOut=\"" + id + ".src='pics/readmoretsml.gif'\"></a>");
}

function showOrderLink() {
	if (showFlash) {
		document.writeln("<a href=\"order.htm\">");
	} else {
		document.writeln("<a href=\"order.htm?noflash\">");
	}
	document.writeln("<img src=\"pics/order.gif\" name=\"order\" width=85 height=24 border=0");
	document.writeln(" onMouseOver=\"order.src='pics/order-a.gif'\" ");
	document.writeln(" onMouseOut=\"order.src='pics/order.gif'\"></a>");
}

function showSampleLink(url, id, w, h) {
	document.writeln("<a href=\"javascript:popUpSized('" + url + "'," + w + "," + h + ")\">");
	document.writeln("<img src=\"pics/sample.gif\" name=\"" + id + "\" width=85 height=24 border=0");
	document.writeln(" onMouseOver=\"" + id + ".src='pics/sample-a.gif'\" ");
	document.writeln(" onMouseOut=\"" + id + ".src='pics/sample.gif'\"></a>");
}

function showSampleLinkWithoutPopup(url, id) {
	document.writeln("<a href=\"" + url + "\">");
	document.writeln("<img src=\"pics/sample.gif\" name=\"" + id + "\" width=85 height=24 border=0");
	document.writeln(" onMouseOver=\"" + id + ".src='pics/sample-a.gif'\" ");
	document.writeln(" onMouseOut=\"" + id + ".src='pics/sample.gif'\"></a>");
}

function showPrintLink(url) {
	document.writeln("<a href=\"javascript:popUp('" + url + "')\">");
	document.writeln("<img src=\"pics/printready.gif\" name=\"print\" width=85 height=24 border=0");
	document.writeln(" onMouseOver=\"print.src='pics/printready-a.gif'\" ");
	document.writeln(" onMouseOut=\"print.src='pics/printready.gif'\"></a>");
}

function showArticleLink(url, id) {
	document.writeln("<a href=\"javascript:popUp('" + url + "')\">");
	document.writeln("<img src=\"pics/viewarticle.gif\" name=\"" + id + "\" width=85 height=24 border=0");
	document.writeln(" onMouseOver=\"" + id + ".src='pics/viewarticle-a.gif'\" ");
	document.writeln(" onMouseOut=\"" + id + ".src='pics/viewarticle.gif'\"></a>");
}

function showSearchLink() {
	document.writeln("<a href=\"Search/search.aspx\" target=\"_new\">");
	document.writeln("<img src=\"pics/search.gif\" name=\"search\" width=198 height=44 border=0");
	document.writeln(" onMouseOver=\"search.src='pics/search-a.gif'\" ");
	document.writeln(" onMouseOut=\"search.src='pics/search.gif'\"></a>");
}

function showBrochureLink() {
	document.writeln("<a href=\"pdfdownloads.htm#links\">");
	document.writeln("<img src=\"pics/brochure.gif\" name=\"brochure\" width=111 height=45 border=0");
	document.writeln(" onMouseOver=\"brochure.src='pics/brochure-a.gif'\" ");
	document.writeln(" onMouseOut=\"brochure.src='pics/brochure.gif'\"></a>");
}

function showDigitalSite() {
	document.writeln("<a href=\"http://digital.donorsguide.ca\">");
	document.writeln("<img src=\"pics/btn_digital.gif\" name=\"digitalsite\" width=104 height=49 border=0");
	document.writeln(" onMouseOver=\"digitalsite.src='pics/abtn_digital.gif'\" ");
	document.writeln(" onMouseOut=\"digitalsite.src='pics/btn_digital.gif'\"></a>");
}

function showDigitalSite2() {
	document.writeln("<a href=\"http://digital.donorsguide.ca\">");
	document.writeln("<img src=\"pics/btn_digital2.gif\" name=\"digitalsite2\" width=104 height=49 border=0");
	document.writeln(" onMouseOver=\"digitalsite2.src='pics/abtn_digital2.gif'\" ");
	document.writeln(" onMouseOut=\"digitalsite2.src='pics/btn_digital2.gif'\"></a>");
}

function showMemberSite() {
	document.writeln("<a href=\"members/default.aspx\">");
	document.writeln("<img src=\"pics/btn_membersite.gif\" name=\"membersite\" width=104 height=49 border=0");
	document.writeln(" onMouseOver=\"membersite.src='pics/abtn_membersite.gif'\" ");
	document.writeln(" onMouseOut=\"membersite.src='pics/btn_membersite.gif'\"></a>");
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=700,height=500,left=25,top=20');");
}

function popUpSized(URL, w, h) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=" + w + ",height=" + h + ",left=25,top=20');");
}
