function MakeArray(n) {
	this.length = n
	return this
}
monthNames = new MakeArray(12)
monthNames[1] = "january"
monthNames[2] = "february"
monthNames[3] = "march"
monthNames[4] = "april"
monthNames[5] = "may"
monthNames[6] = "june"
monthNames[7] = "july"
monthNames[8] = "august"
monthNames[9] = "september"
monthNames[10] = "october"
monthNames[11] = "november"
monthNames[12] = "december"
dayNames = new MakeArray(7)
dayNames[1] = "sunday"
dayNames[2] = "monday"
dayNames[3] = "tuesday"
dayNames[4] = "wednesday"
dayNames[5] = "thursday"
dayNames[6] = "friday"
dayNames[7] = "saturday"

function customDateString(oneDate) {
	ie4 = (navigator.userAgent.indexOf("MSIE") != -1) && (navigator.appVersion.charAt(0) == "4")
	var theDay = dayNames[oneDate.getDay() + 1]
	var theMonth = monthNames[oneDate.getMonth() + 1]
	var theYear = oneDate.getYear()
	if (!ie4) { theYear += 1900 }
	var calendar = '<FONT FACE="Verdana, Arial, Helvetica, sans-serif" SIZE="1" COLOR="#666666">'
	calendar += theDay + '<BR>'
	calendar += theMonth + '<BR>'
	calendar += '<FONT SIZE="1">' + oneDate.getDate() + '<BR>'
	calendar += '</FONT>' + theYear + '</FONT>'
	return calendar
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function BC_checkFlash(where,level) {
	//alert('here')
	/*flash4 = WM_pluginDetect('Flash 4', 'swf',
'application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash.4')
	flash5 = WM_pluginDetect('Flash 5', 'swf',
'application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash.5')
	if (flash4 || flash5) {
		return flashVersion(where,level)
	} else {*/
		return jsVersion(where,level)
	//}
}

function jsVersion(section,level) {
	text = ''
	if (section == "email") {
		text += '<a href="'
		text += level
		text += 'contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'email\',\'\',\''
		text += level
		text += 'images/email_on.gif\',1)"><img src="'
		text += level
		text += 'images/email.gif" width="235" height="32" border="0" name="email"></a>'
 	} else if (section == "nav") {
		text += '<a href="'
		text += level
		text += 'book/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'book\',\'\',\''
		text += level
		text += 'images/book_over.gif\',1)"><img src="'
		text += level
		text += 'images/book.gif" width="115" height="20" border="0" name="book"></a><br> <a href="'
		text += level
		text += 'author/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'author\',\'\',\''
		text += level
		text += 'images/author_over.gif\',1)"><img src="'
		text += level
		text += 'images/author.gif" width="115" height="20" border="0" name="author"></a><br> <a href="'
		text += level
		text += 'resources/quiz.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'quiz\',\'\',\''
		text += level
		text += 'images/quiz_over.gif\',1)"><img src="'
		text += level
		text += 'images/quiz.gif" width="115" height="20" border="0" name="quiz"></a><br> <a href="'
		text += level
		text += 'resources/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'related\',\'\',\''
		text += level
		text += 'images/related_over.gif\',1)"><img src="'
		text += level
		text += 'images/related.gif" width="115" height="20" border="0" name="related"></a>'
 	} else if (section == "whitedot") {
		text += '<img src="'
		text += level
		text += 'images/animated_cubes.gif" width="235" height="74" border="0"></td>'

 	} else if (section == "boximg") {
		text += '<tr>'
		text += '<td colspan="2" valign="top"><img src="'
		text += level
		text += 'images/sp.gif" width="55" height="1" border="0"><img src="'
		text += level
		text += 'images/greenphone_opti.gif" width="64" height="63" border="0" vspace="10"></td>'
		text += '</tr><tr>'
		text += '<td colspan="2" valign="top"><img src="'
		text += level
		text += 'images/sp.gif" width="55" height="1" border="0"><img src="'
		text += level
		text += 'images/redmouse_opti.gif" width="64" height="62" vspace="10" border="0"></td>'
		text += '</tr><tr>'
		text += '<td colspan="2" valign="top"><img src="'
		text += level
		text += 'images/sp.gif" width="55" height="1" border="0"><img src="'
		text += level
		text += 'images/test.gif" width="63" height="62"  vspace="10" border="0"></td>'
		text += '</tr>'

 	}
	return text
}

flashObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"'
flashPlug = 'quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"'

function flashVersion(section,level) {
	text = ''
	if (section == "email") {	
		text += flashObj+' width="235" height="49"><param name=movie value="'
		text += level
		text += 'images/6dotanime.swf"><param name=quality value=high><embed src="'
		text += level
		text += 'images/6dotanime.swf" '+flashPlug+' width="235" height="49"></embed></object>'
	} else if (section == "nav") {
		text += flashObj+' width="115" height="103"><param name=movie value="'
		text += level
		text += 'images/menubar_main.swf"><param name=quality value=high><embed src="'
		text += level
		text += 'images/menubar_main.swf" '+flashPlug+' width="115" height="103"></embed></object>'
 	} else if (section == "whitedot") {
		text += flashObj+' width="235" height="74">'
		text += '<param name=movie value="'
		text += level
		text += 'images/whitedotanime.swf">'
		text += '<param name=quality value=high>'
		text += '<embed src="'
		text += level
		text += 'images/whitedotanime.swf" '+flashPlug+' width="235" height="74">'
		text += '</embed></object>'

 	} else if (section == "boximg") {
		text += '<tr>'
		text += '<td colspan="2" valign="top"><img src="'
		text += level
		text += 'images/sp.gif" width="58" height="70" border="0">'+flashObj+' width="57" height="57">'
		text += '<param name=movie value="'
		text += level
		text += 'images/baseballbat.swf">'
		text += '<param name=quality value=high>'
		text += '<embed src="'
		text += level
		text += 'images/baseballbat.swf" '+flashPlug+' width="57" height="57">'
		text += '</embed></object></td></tr><tr>'
		text += '<td colspan="2" valign="top"><img src="'
		text += level
		text += 'images/sp.gif" width="58" height="75" border="0">'+flashObj+' width="56" height="56">'
		text += '<param name=movie value="'
		text += level
		text += 'images/mousegolfball.swf">'
		text += '<param name=quality value=high>'
		text += '<embed src="'
		text += level
		text += 'images/mousegolfball.swf" '+flashPlug+' width="56" height="56">'
		text += '</embed></object></td></tr><tr> '
		text += '<td colspan="2" valign="top"><img src="'
		text += level
		text += 'images/sp.gif" width="58" height="75" border="0">'+flashObj+' width="57" height="57">'
		text += '<param name=movie value="'
		text += level
		text += 'images/turnitText.swf">'
		text += '<param name=quality value=high>'
		text += '<embed src="'
		text += level
		text += 'images/turnitText.swf" '+flashPlug+' width="57" height="57">'
		text += '</embed></object></td></tr>'

 	}
	return text
}


