// Common JavaScript routines for Advanced Techniques Section
// Web Page Design For Designers
// http://www.wpdfd.com/advanced/ch1_1.htm

var an=navigator.appName; 					// tells if Netscape or Explorer
var av=navigator.appVersion; 				// tells if Mac or PC
var ax=navigator.userAgent;
var cssFile="css/stylesheet.css";		// initial CSS file
var currentStyle="yes";							// initial style
var currentInfo=null;

// this is the Netscape browser sniffer
if (an == "Netscape") {
	if (navigator.appVersion.indexOf("Macintosh") == -1) {
		cssFile='css/stylesheet.css';
		currentStyle='Windows Netscape';
	} else {
		cssFile='css/macnn.css';
		currentStyle='Macintosh Netscape';
	}
}
// this is the MSIE browser sniffer
if (an == "Microsoft Internet Explorer") {
	if (ax.indexOf("Opera") == -1) { 
		if (av.indexOf("Macintosh") == -1) {
			cssFile='css/winie.css';
			currentStyle='Windows Explorer';
		} else {
			cssFile='css/macie.css';
			currentStyle='Macintosh Explorer';
		}

	} else {
		if (av.indexOf("Macintosh") == -1) {
			cssFile='css/winopera.css';
			currentStyle='Windows Explorer';
		} else {
			cssFile='css/macie.css';
			currentStyle='Macintosh Explorer';
		}
	}
}

// loads the appropriate style sheet and images
function init() {
	l=document.URL;
	
	ss=cssFile;  	// loads the appropriate style sheet
	// alert(an + "\n" + av + "\n" + ax + "\n");
	document.write("<link rel='styleSheet' type='text/css' href='"+ss+"'>");
}
function init1() {
	l=document.URL;

	ss="../" + cssFile;
	// alert(an + "\n" + av + "\n" + ax + "\n");
	document.write("<link rel='styleSheet' type='text/css' href='"+ss+"'>");
}

