// footer for all pages
function isNull(obj){return (obj==null)||(obj==undefined)
}
function footer(prev,next,dtd) {
 if(isNull(dtd)) dtd='html';
 with(document){
	SteadyLinks(prev,next);
	write('<p align="center" >');
//	write('<img src="images/xbrowser.png" height="31" width="103"');
//	write(' alt="Cross-browser award by Laszlo Naszodi"> &nbsp;');
	write('This page has been tested with IE 6.0 and 7.0, Netscape 7.1 Opera 7.21 and FF 1.0,1.5, 2.0.');
	write(' &nbsp;<img src="images/');
	if(dtd.toLowerCase()=='html')	write('valid-html40.png" alt="Valid HTML 4.0!"');
	if(dtd.toLowerCase()=='xhtml')	write('valid-xhtml10.png" alt="Valid XML"');
	write(' height="31" width="88"><\/p>');
 }
}//end function footer()

function SteadyLinks(prev, next) {
 with(document){
	writeln('<div class="SteadyLinks">');
	if(prev>''){
		write('<a class="button" href="cover.html">&nbsp;&lt;&lt; <\/a>&nbsp;'); 
		write('<a class="button" href="'+prev+'">&nbsp;&lt; Prev <\/a>&nbsp;')
	} 
	write('<a class="button" href="TOC.html" id="TOC">&nbsp;Contents <\/a>&nbsp;'); 
	if(next>''){
   		write('<a class="button" href="'+next+'">&nbsp;Next &gt; <\/a>&nbsp;'); 
		write('<a class="button" href="backcover.html">&nbsp;&gt;&gt; <\/a>')
	}
	writeln('<\/div>');
	var url=''+document.location;
	if(url.indexOf('TOC') != -1){
 	  with(getElementById('TOC').style){
		border="thin inset";
		color="black";
		background="#ddd"
	  }//end with
	}//end if
 }//end with
}//end function SteadyLinks()

function storefooter(withvalid) {
//withvalid==null: show second line as if withvalid was 'HTML'
//withvalid==false:don't show second line
//withvalid=='HTML':show second line with valid-HTML logo
//withvalid=='XML':show second line with valid-XML logo
if (isNull(withvalid)) withvalid='HTML';
 with(document){
 //about line
	write('<div id="footer" style="width:760px">');
	write('<div class="aboutline" style="font-size:12px">');
	write('| Webmaster: <a href="http://www.scriptwell.net/resum_us.htm" target="_blank">'); 
	write('LN</a> | Email: ');
	write('<a href="mailto:lasz@scriptwell.net">lasz@scriptwell.net</a> | Home: ');
	write('<a href="http://www.scriptwell.net/" ');
	write('target="_top">www.scriptwell.net</a> |'); 

	lastModifiedDate();
	write('<\/div>');
  if(withvalid!=false){
  //x-browser and valid html line
//	write('<img src="images/xbrowser.png" alt="Cross-Browser Award" height="31" width="103" \/> &nbsp;');
	write('<span style="vertical-align:super;font-size:12px">');
	write('This page has been tested with  IE 6.0 and 7.0, Netscape 7.1 Opera 7.21 and FF 1.0,1.5, 2.0.');
	write('<\/span>');
	if(withvalid.toLowerCase()=='html')
		write('&nbsp;<img src="images/valid-html40.png" alt="Valid HTML 4.0!" height="31" width="88">');
	if(withvalid.toLowerCase()=='xhtml')
		write('&nbsp;<img src="images/valid-xhtml10.png" alt="Valid XML" height="31" width="88">');
	write('<\/div>');
  }//end if
 }//end with
}//end function storefooter()

function date_Monddyyyy(date) {
var d=date.getDate();//does not work in NS6
var m=date.getMonth()+1;
var y=date.getYear();

// handle different year values returned by IE and NS in the year 2000.
if(y>=2000)y -=2000;//IE
if(y>= 100)y -= 100;
// could use splitString() here but the following method is more compact
var mmm=
(1==m)?'Jan':(2==m)?'Feb':(3==m)?'Mar':( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
(7==m)?'Jul':(8==m)?'Aug':(9==m)?'Sep':(10==m)?'Oct':(11==m)?'Nov':'Dec';
return ""+mmm+" "+(d<10?"0"+d:d)+", "+"20"+(y<10?"0"+y:y);
}  //end function date_Monddyyyy(date) *********************

function date_lastmodified() {// get last modified date of the current document.
var s="Unknown";
var lmd=document.lastModified;
var d1;
if(0!=(d1=Date.parse(lmd))){//Nescape provides today's date
	s=""+date_Monddyyyy(new Date(d1));
}
return s;
} //end function date_lastmodified() ******************

function lastModifiedDate(){
// writes the last modified date of the center page
var str=document.lastModified;
if (document.all) {//IE
	str=date_lastmodified() ;
}
else {//not (document.all) like in NS6.
	if (str.indexOf(",")!=str.lastIndexOf(",")) {//cut the day:
		str=str.substring(str.indexOf(",")+2,str.length);
	}
	str=str.substring(0,str.length-9);//cut time
}
if(str.indexOf(":")>0) {// hour: in string
	colonLoc = str.indexOf(":");
	str=str.substring(0, colonLoc - 3);
}

document.write(' Updated: '+str+'&nbsp;|');
} //end function lastModifiedDate() **********
