// 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 cssFile="";						// initial CSS file
var currentStyle="no";				// initial style
//var chapterNum=0; 					// initial page number
//currentChapter=new MakeArray(6); 	// make array with each page set to false
//currentChapter[chapterNum]=true;	// set initial page to true
//var currentInfo=null;

var msg1="Chapter 1"; // these appear in the status bar
var msg2="Chapter 2";
var msg3="Chapter 3";
var msg4="Chapter 4";
var msg5="Chapter 5";


if (an == "Netscape") // this is the Netscape browser sniffer
    	 	{
     		if (navigator.appVersion.indexOf("Macintosh") == -1) 
          		{
          		cssFile='winnnlgfl.css';
          		currentStyle='Windows Netscape';
          		} 
     		else 
          		{
          		cssFile='macnnlgfl.css';
          		currentStyle='Macintosh Netscape';
          		}
     		}
     		

if (an == "Microsoft Internet Explorer") // this is the MSIE browser sniffer
     		{
         	if (av.indexOf("Macintosh") == -1) 
               	{
				cssFile='winielgfl.css';
               	currentStyle='Windows Explorer';
				//alert('style sheet : ' + cssFile);
               	} 
          	else 
               	{
               	cssFile='macielgfl.css';
               	currentStyle='Macintosh Explorer';
               	}
    		}


function init() // loads the appropriate style sheet and images
	{
	/*l=document.URL;
	if(l.indexOf("ch3")==-1)
		{
		ss=cssFile;  	// loads the appropriate style sheet
		}
	else
		{
		ss="s"+cssFile; // special styles for Chapter 3
		}
	//ss=cssFile;
	*/ 
	ss=cssFile;  	// loads the appropriate style sheet
	//alert(ss);
	document.write("<link href='http://www.lancsngfl.ac.uk/shared/css/"+ss+"' rel='styleSheet' type='text/css'>");
	//document.write("hello fool");
	//alert("lllllll");
	//preLoadImages(7);
	}