// ========================================================
// Common javascript 
//
// Written by 
// Yenius Web Designs
// 10909 Yonge St., Suite 105
// Richmond Hill, Ontario
// L4C 3E3
//
// ========================================================

// detect supported browsers for rollovers and layers

var supported = 
((navigator.appName == "Netscape") && 
(parseInt(navigator.appVersion) >= 3)) ||
((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 3));


// Identify Browser as Netscape or IE

if (navigator.appName == 'Netscape') {
	Browser_Name = 'Netscape';
	Doc = 'document.';
	Sty = '';
} else
if (navigator.appName == 'Microsoft Internet Explorer') {
	Browser_Name = 'Explorer';
	Doc = '';
	Sty = '.style';
}


// start the layer or div tag
function startlayer(x,y,title) {
	if (supported && (Browser_Name == "Netscape")) 
	document.writeln("<layer id='" + title + "' left=" + x + " top=" + y + " z-index=1000>");
	else if (supported && (Browser_Name == "Explorer"))
	document.writeln("<div id='" + title + "' style='position: absolute; left: " + x + "; top: " + y + "; z-index: 1000;'>");	
}

// end the layer or div tag
function endlayer() {
	if (supported && (Browser_Name == "Netscape")) 
	document.writeln("</layer>");
	else if (supported && (Browser_Name == "Explorer"))
	document.writeln("</div>");	
}

function rollover(imgName) {
	if (supported) {
	roll_img = eval("document." + imgName); 
	roll_img.src = eval(imgName + "_ov.src");
	}
}


function rollback(imgName) { 
	if (supported) {
	roll_img = eval("document." + imgName);
 	roll_img.src = eval(imgName + "_df.src");
	}
}

function rollto(imgName,num) {
	if (supported) {
	roll_img = eval("document." + imgName); 
	roll_img.src = eval(imgName + "_" + num + ".src");
	}
}

var currentcheck = "check0";

function checkit(imgName) {
	if (supported) {
		// uncheck each box before making a check
		// document.check0.src = "images/checkbox.gif";
		document.check1.src = "images/checkbox.gif";
		document.check2.src = "images/checkbox.gif";
		document.check3.src = "images/checkbox.gif";
		document.check4.src = "images/checkbox.gif";
		document.check5.src = "images/checkbox.gif";
		
		// as long as not clicking on a checked box, then check box
		if (imgName != currentcheck) {
			roll_img = eval("document." + imgName);
			roll_img.src = checkmark.src;
			currentcheck = imgName;
		}
		//otherwise, just keep unchecked and set check to zero
		else {
			currentcheck = "check0";
		}
			
		// set up blurb and display in the info showcase
		solution = eval(currentcheck + "blurb");
		document.infoshowcase.src = solution.src;	
	}
}