browserNaming();

function openlgImg(theURL,W,H) {
var X=Math.ceil((screen.width-W)/2);
var Y=Math.ceil((screen.height-H)/2);
var s=",width="+ W +",height="+ H +",left="+X+",top="+Y;
var lgImg=window.open(theURL,"bigger","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1"+s,true);
lgImg.focus();
return lgImg;
}

var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);
function printit() {
 if (pr) 
    window.print()
  else if (da && !mac) 
    vbPrintPage()
  else 
    alert('Sorry, your browser does not support this feature. Please print using the menu on your browser.');
}
if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln(' OLECMDID_PRINT = 6');
  writeln(' OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln(' OLECMDEXECOPT_PROMPTUSER = 1');
  writeln(' On Error Resume Next');
  writeln(' WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}

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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.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);
  if(!x && document.getElementById) x=document.getElementById(n); 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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// THIS CODE was modified by Tim Fadden, from the mutated, modified, and re-done code of the K10kª semi-bald posse (which was done in 1997-2002).  You guys are AWESOME!
//
// ----------------------------------------------------------------------

// CHECK CLIENT BROWSER & PLATFORM
// original code from http://developer.apple.com/internet/_javascript/
//
// USAGE:	browserNaming();
// NOTES:	call it from within an external JS document
// RESULT:	browserNew = true/false
//			browserName = IE/NS/Opera
//			browserNameLong = IE5/etc
//			Macintosh = true/false
// WORKS:	everything

	var its;
	var browserName;
	var browserNameLong;
	var browserNew;
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser version
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versions of mozilla aren't navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// workaround for IE5 which reports itself as version 4.0
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// is it a DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// need the name, too
		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		// and the number
		browserNameLong = browserName + its.major;
	
	}


// DOM / SET PROPERTY
// original code from http://www.alistapart.com/
//
// NOTES:	given an id and a property (as strings), set the given property of that id to the value provided.
// WORKS:	ie5+, ns6+, opera5+

	function setIdProperty(id,property,value) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}

	
// MOVE LAYERS TO POSITION BASED ON INNER WIDTH OF BROWSER WINDOW, MINUS CONSTANT (valpx)
// original code by Tim Fadden
// USAGE:	move('layer number'); valpx=new Array('value','value');
// WORKS:	ie4+, ns4+, opera

	valpx=new Array('','250','190','129','38','153','56','153','153','56','93','93','153','-60','-158','-60','-158','-60','-166','-254','30','92','56');
	
	function move(id) {
		if(browserName == "IE") {
			var moveval=document.body.clientWidth/2;}
		else {
			var moveval=window.innerWidth/2;}
		if(browserNew && browserName == "NS" && window.innerWidth<1000) moveval=(window.innerWidth/2)-7;
		var movepx=(moveval-valpx[id])+"px";
		if (browserNew) {
			setIdProperty("base"+id,"left",movepx);
			setIdProperty("nav"+id,"left",movepx);}
		else {
			if (browserName == "NS") { document.layers["base"+id].left = ((window.innerWidth/2)-valpx[id])*.986;
					document.layers["nav"+id].left = ((window.innerWidth/2)-valpx[id])*.986; }
			else { document.all["base"+id].style.pixelLeft = (document.body.clientWidth/2)-valpx[id];
					document.all["nav"+id].style.pixelLeft = (document.body.clientWidth/2)-valpx[id]; }
		}
	}


// HIDE LAYERS
// USAGE:	hide('layer number');
// WORKS:	ie4+, ns4+, opera

	function hide(id) {
		if (browserNew) {
			setIdProperty("base"+id,"visibility","hidden");
			setIdProperty("nav"+id,"visibility","hidden");
		}
		else {
			if (browserName == "NS") { document.layers["base"+id].visibility = "hide";
					document.layers["nav"+id].visibility = "hide"; }
			else { document.all["base"+id].style.visibility = "hidden";
					document.all["nav"+id].style.visibility = "hidden"; }
		}
	}
	
	
// HIDE OPEN LAYERS
// USAGE:	show('layer number');
// WORKS:	ie4+, ns4+, opera	

	function hideOpenLayers(lid) {
	for (var i=1; i<=11; i++ ){
			if (lid!=i){
				hide(i);
			}
		}
	}

	
// SHOW LAYERS
// USAGE:	show('layer number');
// WORKS:	ie4+, ns4+, opera

	function show(id) {
		move(id);
		if (browserNew) {
			setIdProperty("base"+id,"visibility","visible");
			setIdProperty("nav"+id,"visibility","visible");
		}
		else {
			if (browserName == "NS") { document.layers["base"+id].visibility = "show";
					document.layers["nav"+id].visibility = "show"; }
			else { document.all["base"+id].style.visibility = "visible";
					document.all["nav"+id].style.visibility = "visible"; }
		}
	}
	
	
// HIDE LAYERS TIMER, ENABLES clearTimeout()
// USAGE:	hideTimer('layer number');
// WORKS:	ie4+, ns4+, opera

var myTimeout=0;
var myTimeout2=0;
var myTimeout3=0;
var myTimeout4=0;

	function hideTimer(id){
	if (id<=4) myTimeout=setTimeout('hide("'+id+'")',100);
	if (id==5||id==7||id==8||id==10||id==11||id==12||id==13||id==15||id==17||id==20||id==21) myTimeout2=setTimeout('hide("'+id+'")',10);
	if (id==6||id==9||id==14||id==16||id==22) myTimeout3=setTimeout('hide("'+id+'")',10);
	if (id==18||id==19) myTimeout4=setTimeout('hide("'+id+'")',99);
	}
	

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}