
function header()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('           codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="450"');
document.write('            height="110">');
document.write('              <param name="movie" value="header/header.swf" />');
document.write('              <param name="quality" value="high" />');
document.write('              <param name="wmode" value="transparent" />');
document.write('              <param name="bgcolor" value="#FFFFFF" />');
document.write('              <embed src="header/header.swf" quality="high" wmode="transparent" bgcolor="#FFFFFF" width="450" height="110"');
document.write('              type="application/x-shockwave-flash"');
document.write('              pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />');
document.write('            <\/object>');
}




/***************************************************************************************
        Nested list collapsing script written by Mark Wilton-Jones - 21/11/2003
Version 2.2.0 - this script takes existing HTML nested UL or OL lists, and collapses them
            Updated 13/02/2004 to allow links in root of expanding branch
                  Updated 09/09/2004 to allow state to be saved
          Updated 07/10/2004 to allow page address links to be highlighted
Updated 28/11/2004 to allow you to force expand/collapse links to use just the extraHTML
****************************************************************************************

Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use
_________________________________________________________________________

You can put as many lists on the page as you like, each list may have a different format.

To use:
_________________________________________________________________________

Inbetween the <head> tags, put:

	<script src="PATH TO SCRIPT/listCollapse.js" type="text/javascript" language="javascript1.2"></script>
_________________________________________________________________________

Define the HTML. Note that to correctly nest lists, child OLs or ULs should be children of an LI element,
not direct descendents of their parent OL/UL. The text used to expand the branch should be written
between the <li> tag and the <UL/OL/A> tag, and should only contain HTML that is permitted inside an 'A'
element. Note; Opera 7 will lose any style attributes you define in this text - use classes instead.

<ul id="someID">
	<li>Book 1
		<ul>
			<li><a href="someHref">Chapter 1</a></li>
			<li><a href="someHref">Chapter 2</a></li>
		</ul>
	</li>
	<li><a href="elsewhere.html">Book 2</a>
		<ul>
			<li><a href="someHref">Chapter 1</a></li>
			<li><a href="someHref">Chapter 2</a></li>
		</ul>
	</li>
	<li>Book 3
		<ul>
			<li><a href="someHref">Chapter 1</a></li>
			<li>Cha<span class="doMore">pt</span>er 2
				<ul>
					<li><a href="someHref">Sub 1</a></li>
					<li><a href="someHref">Sub 2</a></li>
				</ul>
			</li>
		</ul>
	</li>
</ul>
________________________________________________________________________
Now you need to trigger the collapsing, using <body onload, window.onload or by putting the collapse
commands in a script just before the </body> tag. If using either onload technique, you must not use
any other scripts that rely on the onload event.

compactMenu(theRootID,shouldAutoCollapse,extraHTML[,useMinimalLink]);
  oID = string: ID of root nest element, must be a UL or OL; this will not be collapsed, but any child
  UL/OLs will be (note, if the root nest element is a UL, all child lists should be ULs - the same is
  true for OLs; if the root nest element is OL, all child lists should be OLs)
  shouldAutoCollapse = bool: auto-collapse unused branches
  extraHTML = string: HTML to insert to collapsible branches - usually '± '
  useMinimalLink = bool: normally the expand/collapse link will use both extraHTML and the original list
  item text - if the list item text is already a link, this will not be included - set this option to
  true to force the script to use only the extraHTML as the link, even if the rest of the list item is
  not a link - this option will only be respected if you also provide some extraHTML

eg 1.
<body onload="compactMenu('someID',true,'± ');">

eg 2.
<script type="text/javascript" language="javascript1.2"><!--
window.onload = function () { compactMenu('someID',false,'± '); }
//--></script>

eg 3.
<script type="text/javascript" language="javascript1.2"><!--
compactMenu('someID',true,'± ');
//--></script>
</body>

stateToFromStr(theRootID);
  oID = string: ID of root nest element, must be a UL or OL; returns a string representing all expanding
  branches - can be used with my cookie script to save state when unloading the page
stateToFromStr(theRootID,stringRepresentation);
  oID = string: ID of root nest element, must be a UL or OL;
  stringRepresentation = string: string representation of expanded branches, as created above
  must be called _after_ collapsing the list - values can be recovered from cookies using my cookie script
note: this facility will not be able to take changes in the list structure into account - use session cookies
or short-term cookies to avoid longer term structure change problems

selfLink(theRootID,newClass,shouldExpandBranch);
  theRootID = string: ID of root nest element, must be a UL or OL;
  newClass = string: new class name to add to any existing class names
  shouldExpandBranch = bool: expand branches to show the first matching link
  allows you to highlight links to the current page that appear in the list
  must be called _after_ collapsing the list
  address hash and port are not included in the comparison - links containing href="#" are always ignored

My cookie script is available on http://www.howtocreate.co.uk/jslibs/
	<body onload="compactMenu('someID',true,'± ');stateToFromStr(theRootID,retrieveCookie('menuState'));"
	onunload="setCookie('menuState',stateToFromStr(theRootID),31536000);">
____________________________________________________________________________________________________*/
var openLists = [], oIcount = 0;
function compactMenu(oID,oAutoCol,oPlMn,oMinimalLink) {
	if( !document.getElementsByTagName || !document.childNodes || !document.createElement ) { return; }
	var baseElement = document.getElementById( oID ); if( !baseElement ) { return; }
	compactChildren( baseElement, 0, oID, oAutoCol, oPlMn, baseElement.tagName.toUpperCase(), oMinimalLink && oPlMn );
}
function compactChildren( oOb, oLev, oBsID, oCol, oPM, oT, oML ) {
	if( !oLev ) { oBsID = escape(oBsID); if( oCol ) { openLists[oBsID] = []; } }
	for( var x = 0, y = oOb.childNodes; x < y.length; x++ ) { if( y[x].tagName ) {
		//for each immediate LI child
		var theNextUL = y[x].getElementsByTagName( oT )[0];
		if( theNextUL ) {
			//collapse the first UL/OL child
			theNextUL.style.display = 'none';
			//create a link for expanding/collapsing
			var newLink = document.createElement('A');
			newLink.setAttribute( 'href', '#' );
			newLink.onclick = new Function( 'clickSmack(this,' + oLev + ',\'' + oBsID + '\',' + oCol + ',\'' + escape(oT) + '\');return false;' );
			//wrap everything upto the child U/OL in the link
			if( oML ) { var theHTML = ''; } else {
				var theT = y[x].innerHTML.toUpperCase().indexOf('<'+oT);
				var theA = y[x].innerHTML.toUpperCase().indexOf('<A');
				var theHTML = y[x].innerHTML.substr(0, ( theA + 1 && theA < theT ) ? theA : theT );
				while( !y[x].childNodes[0].tagName || ( y[x].childNodes[0].tagName.toUpperCase() != oT && y[x].childNodes[0].tagName.toUpperCase() != 'A' ) ) {
					y[x].removeChild( y[x].childNodes[0] ); }
			}
			y[x].insertBefore(newLink,y[x].childNodes[0]);
			y[x].childNodes[0].innerHTML = oPM + theHTML.replace(/^\s*|\s*$/g,'');
			theNextUL.MWJuniqueID = oIcount++;
			compactChildren( theNextUL, oLev + 1, oBsID, oCol, oPM, oT, oML );
} } } }
function clickSmack( oThisOb, oLevel, oBsID, oCol, oT ) {
	if( oThisOb.blur ) { oThisOb.blur(); }
	oThisOb = oThisOb.parentNode.getElementsByTagName( unescape(oT) )[0];
	if( oCol ) {
		for( var x = openLists[oBsID].length - 1; x >= oLevel; x-=1 ) { if( openLists[oBsID][x] ) {
			openLists[oBsID][x].style.display = 'none'; if( oLevel != x ) { openLists[oBsID][x] = null; }
		} }
		if( oThisOb == openLists[oBsID][oLevel] ) { openLists[oBsID][oLevel] = null; }
		else { oThisOb.style.display = 'block'; openLists[oBsID][oLevel] = oThisOb; }
	} else { oThisOb.style.display = ( oThisOb.style.display == 'block' ) ? 'none' : 'block'; }
}
function stateToFromStr(oID,oFStr) {
	if( !document.getElementsByTagName || !document.childNodes || !document.createElement ) { return ''; }
	var baseElement = document.getElementById( oID ); if( !baseElement ) { return ''; }
	if( !oFStr && typeof(oFStr) != 'undefined' ) { return ''; } if( oFStr ) { oFStr = oFStr.split(':'); }
	for( var oStr = '', l = baseElement.getElementsByTagName(baseElement.tagName), x = 0; l[x]; x++ ) {
		if( oFStr && MWJisInTheArray( l[x].MWJuniqueID, oFStr ) && l[x].style.display == 'none' ) { l[x].parentNode.getElementsByTagName('a')[0].onclick(); }
		else if( l[x].style.display != 'none' ) { oStr += (oStr?':':'') + l[x].MWJuniqueID; }
	}
	return oStr;
}
function MWJisInTheArray(oNeed,oHay) { for( var i = 0; i < oHay.length; i++ ) { if( oNeed == oHay[i] ) { return true; } } return false; }
function selfLink(oRootElement,oClass,oExpand) {
	if(!document.getElementsByTagName||!document.childNodes) { return; }
	oRootElement = document.getElementById(oRootElement);
	for( var x = 0, y = oRootElement.getElementsByTagName('a'); y[x]; x++ ) {
		if( y[x].getAttribute('href') && !y[x].href.match(/#$/) && getRealAddress(y[x]) == getRealAddress(location) ) {
			y[x].className = (y[x].className?(y[x].className+' '):'') + oClass;
			if( oExpand ) {
				oExpand = false;
				for( var oEl = y[x].parentNode, ulStr = ''; oEl != oRootElement && oEl != document.body; oEl = oEl.parentNode ) {
					if( oEl.tagName && oEl.tagName == oRootElement.tagName ) { ulStr = oEl.MWJuniqueID + (ulStr?(':'+ulStr):''); } }
				stateToFromStr(oRootElement.id,ulStr);
} } } }
function getRealAddress(oOb) { return oOb.protocol + ( ( oOb.protocol.indexOf( ':' ) + 1 ) ? '' : ':' ) + oOb.hostname + ( ( typeof(oOb.pathname) == typeof(' ') && oOb.pathname.indexOf('/') != 0 ) ? '/' : '' ) + oOb.pathname + oOb.search; }

/****************************************************************************************
                 Script to read and write cookies from JavaScript
                     Written by Mark Wilton-Jones, 31/12/2001
*****************************************************************************************

Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use

This script allows you to store and retrieve cookies easily using JavaScript. Cookies
are variables that can be stored on a user's computer and be picked up by any other web
pages in the correct domain. Cookies are set to expire after a certain length of time.

Be warned that many users will not permit cookies on their computers. Do not make your
web sites rely on them. This script provides a return value that says if they accepted
or rejected a cookie.

To use:
_________________________________________________________________________

Inbetween the <head> tags, put:

	<script src="PATH TO SCRIPT/cookie.js" type="text/javascript" language="javascript"></script>

To store a cookie, use:

	var cookieAccepted = setCookie( cookieName, cookieValue[, lifeTime[, path[, domain[, isSecure]]]] )

		cookieName is the name of the cookie (as a string) and can contain any characters.

		cookieValue is the value that the cookie stores (as a string) and can contain any characters.

		lifeTime is the amount of time in seconds that you want the cookie to last for (after which
		the user's computer will delete it). The default is until the browser is closed.

		path gives the path or directories that the cookie should be accessible from. The default is
		the current path. Alter this using ../ (up one directory) / starting at the base directory
		and subdirectoryName/ to start from the currentDirectory/subdirectoryName/

		domain gives the domain that the cookie is accessible from. This must have at least one . in it
		and in many browsers it must have at least two. The default is the current domain.

		isSecure can be true or false and says whether or not the cookie is only accessible on sites
		with a secure (https) connection.

If the user rejected the cookie, cookieAccepted will be false. In Opera, if cookies are on prompt,
the failure responce is received immediately, even if the user then accepts the cookie.

To retrieve a cookie, use:

	var myCookie = retrieveCookie( cookieNameAsAString );

To modify a cookie, simply set it again with the new settings;

To delete a cookie, use:

	var cookieDeletePermitted = setCookie( cookieNameAsAString, '', 'delete' );

	or set lifeTime to a less than 0 value.

If the user rejected the attempt to delete the cookie, cookieDeletePermitted will be false.
_______________________________________________________________________________________*/

function retrieveCookie( cookieName ) {
	/* retrieved in the format
	cookieName4=value; cookieName3=value; cookieName2=value; cookieName1=value
	only cookies for this domain and path will be retrieved */
	var cookieJar = document.cookie.split( "; " );
	for( var x = 0; x < cookieJar.length; x++ ) {
		var oneCookie = cookieJar[x].split( "=" );
		if( oneCookie[0] == escape( cookieName ) ) { return unescape( oneCookie[1] ); }
	}
	return null;
}

function setCookie( cookieName, cookieValue, lifeTime, path, domain, isSecure ) {
	if( !cookieName ) { return false; }
	if( lifeTime == "delete" ) { lifeTime = -10; } //this is in the past. Expires immediately.
	/* This next line sets the cookie but does not overwrite other cookies.
	syntax: cookieName=cookieValue[;expires=dataAsString[;path=pathAsString[;domain=domainAsString[;secure]]]]
	Because of the way that document.cookie behaves, writing this here is equivalent to writing
	document.cookie = whatIAmWritingNow + "; " + document.cookie; */
	document.cookie = escape( cookieName ) + "=" + escape( cookieValue ) +
		( lifeTime ? ";expires=" + ( new Date( ( new Date() ).getTime() + ( 1000 * lifeTime ) ) ).toGMTString() : "" ) +
		( path ? ";path=" + path : "") + ( domain ? ";domain=" + domain : "") + 
		( isSecure ? ";secure" : "");
	//check if the cookie has been set/deleted as required
	if( lifeTime < 0 ) { if( typeof( retrieveCookie( cookieName ) ) == "string" ) { return false; } return true; }
	if( typeof( retrieveCookie( cookieName ) ) == "string" ) { return true; } return false;
}

function PopupPic(sPicURL) {
     window.open( "popup.html?"+sPicURL, "",  
     "resizable=1,HEIGHT=200,WIDTH=200");
   } 



function extracheck(obj)
{
	return !obj.disabled;
}




//-->


function ubbc(open, end, middle){
    var tArea = document.form.content;
    var isIE = (document.all)? true : false;
    var open = (open)? open : "";
    var end = (end)? end : "";
	var car_pos = 0;

    if(isIE){
        tArea.focus();
        var curSelect = document.selection.createRange();
        if(arguments[2]){
            curSelect.text = open + arguments[2] + "]" + curSelect.text + end;
        } else {
            curSelect.text = open + curSelect.text + end;
			
        }
    } else if(!isIE && typeof tArea.selectionStart != "undefined"){
		var scroll_pos = tArea.scrollTop;
        var selStart = tArea.value.substr(0, tArea.selectionStart);
        var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length);
        var curSelection = tArea.value.replace(selStart, '').replace(selEnd, '');
        if(arguments[2]){
            tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd;
        } else {
            tArea.value = selStart + open + curSelection + end + selEnd;
			var car_pos = selStart.length + open.length + curSelection.length + end.length;
			setCaretPosition(tArea, car_pos);
        }
    } else {
        tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end;
    }
	tArea.focus();
}




function ubbc(open, end){
    var tArea = document.form.content;
    var isIE = (document.all)? true : false;
    var open = (open)? open : "";
    var end = (end)? end : "";
	
    if(isIE){
        tArea.focus();
        var curSelect = document.selection.createRange();
        if(arguments[2]){
            curSelect.text = open + arguments[2] + "]" + curSelect.text + end;
        } else {
            curSelect.text = open + curSelect.text + end;
			
        }
    } else if(!isIE && typeof tArea.selectionStart != "undefined"){
		var scroll_pos = tArea.scrollTop;
        var selStart = tArea.value.substr(0, tArea.selectionStart);
        var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length);
        var curSelection = tArea.value.replace(selStart, '').replace(selEnd, '');
        if(arguments[2]){
            tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd;
			var car_pos = selStart.length + open.length + arguments[2].length + 1 + curSelection.length + end.length;
			setCaretPosition(tArea, car_pos);
			tArea.scrollTop = scroll_pos;
        } else {
            tArea.value = selStart + open + curSelection + end + selEnd;
			var car_pos = selStart.length + open.length + curSelection.length + end.length;
			setCaretPosition(tArea, car_pos);
			tArea.scrollTop = scroll_pos;
			
        }
		
    } else {
        tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end;
    }
	tArea.focus();
	
	
}
function setCaretPosition(ctrl, pos)
{

	if(ctrl.setSelectionRange)
	{
		ctrl.focus();
		ctrl.setSelectionRange(pos,pos);
	}
	else if (ctrl.createTextRange) {
		var range = ctrl.createTextRange();
		range.collapse(true);
		range.moveEnd('character', pos);
		range.moveStart('character', pos);
		range.select();
	}
}
function togglePic() {
	  
	  
	  	  
		  if (document.form.picture[1].checked)
		  		{ 
				
				document.form.image.disabled = false;
				} else {
				 
				document.form.image.disabled = true;
				document.form.image.value = "";
				}
			}
			
function togglePic2() {
	  
	  
	  	  
		  if (document.form.picture[2].checked)
		  		{ 
				
				document.form.image.disabled = false;
				} else {
				 
				document.form.image.disabled = true;
				document.form.image.value = "";
				}
			}
			
function disableIt(obj,obj2)
{	
	
	obj.disabled = !(obj.disabled);
	obj2.disabled = !(obj2.disabled);
	var z = (obj.disabled) ? 'disabled' : 'enabled';
	var y = (obj2.disabled) ? 'disabled' : 'enabled';
	
}







/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function MenuOrderWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
// -->

  	function go()
{
	box = document.forms[0].navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}



// change speed of slide here
var slide_in_speed = 600;	// millisecond duration of slide into view
var slide_out_speed = 500;// millisecond duration of slide out of view

function initGlideLayers() {
  var glideLyrs = new Array();
  
  // Set up your layers here
  // arguments: id, left=0 (offset calculated based on width), top
  glideLyrs[0] = new dynObj('glideDiv0', 0, 220);
  glideLyrs[1] = new dynObj('glideDiv1', 0, 220);
  glideLyrs[2] = new dynObj('glideDiv2', 0, 220);
  glideLyrs[3] = new dynObj('glideDiv3', 0, 220);
  glideLyrs[4] = new dynObj('glideDiv4', 0, 220);
  glideLyrs[5] = new dynObj('glideDiv5', 0, 220);
  glideLyrs[6] = new dynObj('glideDiv6', 0, 220);
  glideLyrs[7] = new dynObj('glideDiv7', 0, 220);
  glideLyrs[8] = new dynObj('glideDiv8', 0, 220);
  glideLyrs[9] = new dynObj('glideDiv9', 0, 220);
  
  for (var i=0; glideLyrs[i]; i++) {
		// hold original left position 
		glideLyrs[i].xOff = -(glideLyrs[i].w + 150);
		glideLyrs[i].shiftTo( glideLyrs[i].xOff, glideLyrs[i].y );
		glideLyrs[i].show();
  }
 
}

var curGlideLyr;
function slideEm(id) {
  var oldLyr, newLyr;
  // if link for current layer clicked, slide it out of view 
	if (curGlideLyr == id) { 
    oldLyr = dynObj.getInstance(curGlideLyr);
		oldLyr.slideTo(oldLyr.xOff, null, slide_out_speed, -1);
    curGlideLyr = ""; return; 
  }
	// if layer currently in view, set up to slide new one into view
	// after current one slides away
	if (curGlideLyr) {
    oldLyr = dynObj.getInstance(curGlideLyr);
		oldLyr.onSlideEnd = function() { 
			dynObj.holder[curGlideLyr].slideTo(40, null, slide_in_speed, -1); 
			this.onSlideEnd = function() { if (this.el) this.el = null } 
		}
		// slide current layer out of view
		oldLyr.slideTo(oldLyr.xOff, null, slide_out_speed, -1);
	} else { 	// if no layer currently in view
    newLyr = dynObj.getInstance(id);
    newLyr.slideTo(40, null, slide_in_speed, -1);
  }
	curGlideLyr = id;
}
