function writename() {
	var z = document.title;
	x2 = z.split(':');
	document.write(	x2[x2.length-1] );
	}


function switchimages(w,what) {
	document.images[w].src=what;}
//	 if (window.focus) {self.focus()} ;//workaround for explorer bug

//<!--

// psHover and ps- prefixed functions are for
// rollovers. 
// Generated by PageSpinner, www.optima-system.com
var gNumImages = 0;
var lastButton="";
	hoverSrc	=	new Array(gNumImages);
	normalSrc	=	new Array(gNumImages);
	clickSrc	=	new Array(gNumImages);
	imgStatusText = new Array(gNumImages);


function psHover(bName) 
{
	if (document.images) 
	{
		if (lastButton != "")
			psNormal(lastButton);

		lastButton=bName;
		if (!document.images[bName])
			return false;

		document.images[bName].src = hoverSrc[bName];
		if (clickSrc[bName])
		{
			tmpImage = new Image();
			tmpImage.src = clickSrc[bName];
			delete tmpImage;
		}
		if (imgStatusText[bName] != "")
		{ self.status = imgStatusText[bName]; return true; }
	}
	return false;
};

function psClick(bName) 
{
	if (document.images) 
	{
		lastButton=bName;
		if (!document.images[bName] || clickSrc[bName]=="")
			return true;

		document.images[bName].src = clickSrc[bName];
	}
	return true;
};

function psNormal(bName)
{
	if(document.images && bName != "")
	{
		if (document.images[bName])
			document.images[bName].src = normalSrc[bName];

		if (imgStatusText[bName] != "")
		{	self.status = ""; return true; }
	}
	return false;
}

function psRegImages(bName, normalSource, hoverSource, clickSource, width, height, statusText)
{
	if (document.images) 
	{
		gNumImages++;
		normalSrc[bName] = normalSource;
		hoverSrc[bName] = hoverSource;
		clickSrc[bName] = clickSource;
		imgStatusText[bName] = statusText;
	}
}



function altwindow(x,w,h)  {
	if (w==null) {w=0};
	if (w<1 ) {w=640;};
	if (h==null) {h=0};
		if (h<1) {h=460;};
	var attributes='toolbar=no,location=no,width=' + w + ',scrollbars=yes,height='+ h +  ', resizable=yes';
	altWindow=window.open(x,'altWindow',attributes);
	if (window.select) {altWindow.select() };
	if (window.focus) {altWindow.focus() };
	}


function defwindow(x) {
//			if (window.defWindow) {defWindow.close()}
	defWindow=window.open(x,'defWindow','toolbar=no,location=no,width=400,height=360,resizable=yes,scrollbars=yes') //
	//nuWindow.focus();
	if (window.select) {defWindow.select() };
	if (window.focus) {defWindow.focus() };

}

function mainwindow(x) {
	//		if (window.moduleWindow) {moduleWindow.close()}
	thewidth = screen.width - 32;
	theheight= screen.height-72;
	if (thewidth > 640) {thewidth=686;} else {thewidth=640;};
	if (theheight > 600) {theheight=480;} else {theheight=462;};
	moduleWindow=window.open(x,'moduleWindow','toolbar=yes,location=no,width='+thewidth + ',scrollbars=yes,height=' + theheight + ',resizable=yes') //
	//alert(thewidth + ' ' + theheight);
	//if (moduleWindow) {moduleWindow.focus();};
	//if (window.moduleWindow && window.moveTo) { moduleWindow.moveTo(0, 0)}
	//moduleWindow.select();
	if (window.select) {moduleWindow.select() };
	if (window.focus) {moduleWindow.focus() };
	}
	
function moviewindow(x) {
	//if (window.movieWindow) {movieWindow.close()}

	movieWindow=window.open('','movieWindow','toolbar=no,location=no,width=560,height=420,resizable=yes');

	movieWindow.document.write('<HTML>');
	movieWindow.document.write('<HEAD>');
	movieWindow.document.write('<title>Click the CLOSE BOX of this window when through viewing</title>');
	movieWindow.document.write('</head>');

	movieWindow.document.write('<frameset rows="*,36" border="0" frameborder="no" framespacing="0" rows="2">');


	movieWindow.document.write('<frame name="map" src="');
	movieWindow.document.write(x);
	movieWindow.document.write('"Auto" margintop="0" marginleft="0" marginbottom="0" marginright="0" ');
	movieWindow.document.write('topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">');
	movieWindow.document.write('<frame name="mapwindow" src="movie_anchor.htm" marginheight="0" marginwidth="0" frameborder="no" scrolling="no">');

	movieWindow.document.write('</frameset>');
	movieWindow.document.write('</HTML>');
	movieWindow.document.close();
	//movieWindow.focus()
	if (window.select) {movieWindow.select() };
	if (window.focus) {movieWindow.focus() };
}


function mapwindow(x) {
	//	if (window.mapWindow) {mapWindow.close()}

	mapWindow=window.open('','mapWindow','toolbar=no,location=no,width=560,height=420,resizable=yes');

	mapWindow.document.write('<HTML>');
	mapWindow.document.write('<HEAD>');
	mapWindow.document.write('<title>Click the CLOSE BOX of this window when through viewing</title>');
	mapWindow.document.write('</head>');

	mapWindow.document.write('<frameset rows="36,*" border="0" frameborder="no" framespacing="0" rows="2">');

	mapWindow.document.write('<frame name="mapwindow" src="map_close_helper.htm" marginheight="0" marginwidth="0" frameborder="no" scrolling="no">');

	mapWindow.document.write('<frame name="map" src="');
	mapWindow.document.write(x);
	mapWindow.document.write('"Auto" margintop="0" marginleft="0" marginbottom="0" marginright="0" ');
	mapWindow.document.write('topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">');

	mapWindow.document.write('</frameset>');
	mapWindow.document.write('</HTML>');
	mapWindow.document.close();
	//mapWindow.focus();
	if (window.select) {mapWindow.select() };
	if (window.focus) {mapWindow.focus() };
	}



function mediawindow(x,w,h) {
	if (w<0 ) {w=600;};
	if (h<0) {h=460;};
	var attributes='toolbar=no,location=no,width=' + w + ',scrollbars=no,height='+ h +  ', resizable=yes';
	mediaWindow=window.open(x,'mediaWindow',attributes);
	//mediaWindow.focus();
	if (window.select) {mediaWindow.select() };
	if (window.focus) {mediaWindow.focus() };
	}

function bclwindow(x)  {
	bclWindow=window.open(x,'bclWindow','toolbar=no,location=no,width=600,scrollbars=yes,height=420');
//bclWindow.focus();
	if (window.select) {bclWindow.select() };
	if (window.focus) {bclWindow.focus() };
}




// autowindow is a very handy function:
// you can set h and w parameters to whatever maximum values you like.
// here, we've specified w=640 and h=460, 
// which should fit most monitors without too much trouble.

function autowindow(x,w,h)  {
//			if (window.autoWindow) {autoWindow.close()}

	if (w==null) {w=0};
	if (w<1 ) {w=640;};
	if (h==null) {h=0};
		if (h<1) {h=460;};
	var attributes='toolbar=no,location=no,width=' + w + ',scrollbars=yes,height='+ h +  ', resizable=yes';
	//alert(x + ' autoWindow' + ' ' + attributes);
	autoWindow=window.open(x,'autoWindow',attributes);
	//autoWindow.focus();
	if (window.select) {autoWindow.select() };
	if (window.focus) {autoWindow.focus() };
}

//------- Browser info, etc. for pop-ups
//Determine the browser type for popup stuff:
var isNew=0;
var isNS4=0;
var isIE4=0;
var brow= ( (navigator.appName) + (parseInt(navigator.appVersion))) ;
if (parseInt(navigator.appVersion) >=5) {isNew=1;}
else if (brow =="Netscape4") 
		{isNS4=1;}
else if (brow =="Microsoft Internet Explorer4")
		{isIE4=1;}
//alert("brow: " + brow + " navigator.appVersion: " +  navigator.appVersion);

if (isNS4 ||  isIE4 || isNew)
	{docObj=(isNS4) ? 'document' : 'document.all';
	styleObj=(isNS4) ? '' : '.style'; }

function checkDOM(elementName) {
	if (isNS4 ||  isIE4 || isNew)
		{dom=eval(docObj + '.' + elementName + styleObj);
			dom.left=120;
			dom.top=120;
			alert('This browser uses the ' + dom + ' Document Object Model.'); }
	}

// This function is from DHTML book, unused
function togvis(currElem) {
	dom=eval(docObj + "." + currElem + styleObj);
	state = dom.visibility;
	if (state=="visible" || state == "show")
		{dom.visibility = "hidden";}
		else {dom.visibility = "visible";}
	}
		//	document.write('This browser uses the ' + docObj + styleObj + ' Document Object Model.<BR>'); 

	
//showPopUp will show only the desired object, hides everything else
var theLastElem = '';	
function showPopUp (currElem) {
 	if (brow.indexOf("Microsoft") > -1) 
	{
		if (currElem != "hideAll") 			
			{ thething = docObj   + "." + currElem + styleObj;
			dom=eval(thething);
 			dom.visibility = "visible";};

			if (theLastElem > '') 
				 {	thelastthing = docObj + "." + theLastElem + styleObj;
				lastdom = eval(thelastthing);
				lastdom.visibility = "hidden"	;}
 
			if (currElem != "hideAll") 			
		{theLastElem = currElem;};
		}
		
	if (brow.indexOf("Netscape") > -1) 
			{domlength=document.layers.length;

			for (var i=0; i<domlength; i++) {
				thename =document.layers[i].name;
				if (thename==currElem) 
					{ vis="show" ;} 
				else {vis="hide";};
			document.layers[i].visibility=   vis;
				}
			}
	}


function nada () {
if (brow.indexOf("Microsoft")> -1 ) 
	{divisions=document.all.tags("DIV"); 
			alert("Divisions: " + divisions[1].name);
			alert("document.all.length: " + document.all.length);
			domlength=divisions.length;
		
			for (var i=0; i<domlength; i++) {
			alert("Divisions: " + divisions[i].style.id);
				thename =divisions[i].style.name;
				if (thename==currElem) 
					{ vis="visible" ;} 
					else {vis="hidden";};
				document.all.thename.style.visibility = vis;
				};
			}
			
			}
			
			
//given 3 values, pass them along to the NavigationFooter (if it's active)
function setnavigation(nextprev) {
	convertHrefTargs();
	if (parent.navigationfooter)
		{parent.navigationfooter.setNavFooter(nextprev);
		// parent.navigationfooter.setBackLocation(document.location);
		}
	}
//This is used to temporarily "blank" the footer
function sethidenextprev() {
	if (parent.navigationfooter)
		{parent.navigationfooter.hidenextprev();
		}
	}


function swapimage (imgsrc,imagefile) {
	var 		a=document.images.length;
	document.images[imgsrc].src=imagefile;
	return true;
	}
	//newimage, changeImages, and preloadimages are from
	//Adobe ImageStyler v. 2
	// and are included here to prevent JS errors
	
	function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		//something = newImage("images/something.gif");
		preloadFlag = true;
	}
}



//convertHrefTargs
//This function runs through all of the HREF links on a page, looking
//for javascripts which are TARGETs.
// We're doing this so that we can supply a javascript
//as a TARGET rather than as a direct link, which makes maintenance of 
//a site much easier. That is, we have a lot of places where we'd like
//to make a HREF link be a javascript, which works fine, but unfortunately
//linkchecking software does NOT check for links which are javascripted.
//By doing this at runtime, we avoid having to mess with manual linkchecking
//during development-- just use the format
//A HREF="documentlinkname.htm" TARGET="javascriptfunction(@);"
//	where documentlinkname.htm is whatever HTML document to use,
// and javascriptfunction(@); is whatever function you want to call
//	and @ is the place you want the HTML document (documentlinkname.htm) placed.
// This allows your function to pass the HTML document as a variable, if applicable.
//Thus, A HREF="mydocument.htm" TARGET="autowindow(@,500,300);"
//	becomes (at Runtime):
//		A HREF="autowindow('mydocument.htm',500,300);"
// as you would want it. TARGET becomes null.
//But if your HTML LinkChecker software discovers that you've moved your HREF
//and you need to track it down, then you can fix it as you normally would.
//
function convertHrefTargs () {
	var q = "'";
	var L=document.links.length;
	var targ='';
	//alert(L + ' links on this page.');
	//format is "javascript:autowindow(@,200,200);"
	// We replace the @ character with the data in the link
	for (var i=0; i<L; i++) {
		thelink=document.links[i].href;
		targ=document.links[i].target;
		document.status=(targ + "\r" + thelink);
		if (targ>'') {
		if (targ.indexOf('javascript:')>-1) {
			targArray=targ.split('@');
			NewLink=targArray[0] + q + thelink + q + targArray[1];
			document.links[i].href=NewLink;
			document.links[i].target = '';
			document.status=('Revised target: ' + NewLink);
			}
			}
		}
	}
	
	
/// This handler looks for "NEXT.HTM" and replaces it with your NewLink
function setNext (NewLink) {
	var q = "'";
	var L=document.links.length;
	var targ='';
	//alert(L + ' links on this page.');
	//format is "javascript:autowindow(@,200,200);"
	// We replace the @ character with the data in the link
	for (var i=0; i<L; i++) {
		thelink=document.links[i].href;
		document.status=(targ + "\r" + thelink);
		if (thelink.indexOf('NEXT.HTM')>-1) {
document.links[i].href=NewLink;
			document.status=('Revised target: ' + NewLink);
			}
		}
		
		
	if (document.images.NEXT ) {document.images.NEXT.src="images/btn-next.gif"}
	//	alert(document.images.NEXT.src);
	}
	
	
	