/*
If you use a DOCTYPE that puts Explorer 6 in standards compliant mode, some properties 
of document.body are reassigned to document.documentElement. In Explorer 5 the 
properties still belong to document.body. Checking if the documentElement exists is not 
enough, since it exists in all W3C DOM compatible browsers, so we also have to see if 
it has the property we are trying to access.

For more info on this topic visit http://www.xs4all.nl/~ppk/js/doctypes.html
*/

var Browser = {
	w3c : document.getElementById,
	iex : document.all,
	scrollLoop : false,    // boolean
	scrollInterval : null, // setInterval id
	currentBlock : null,   // object reference
	getWindowHeight : function(){
		if(this.iex) return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
		else return window.innerHeight;
	},
	getScrollLeft : function(){
		if(this.iex) return (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		else return window.pageXOffset;
	},
	getScrollTop : function(){
		if(this.iex) return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		else return window.pageYOffset;
	},
	getElementYpos : function(el){
		var y = 0;
		while(el.offsetParent){
			y += el.offsetTop
			el = el.offsetParent;
		}
		return y;
	},
	scroll : function(num){
		if(!this.w3c){
			location.href = "#"+this.anchorName+num;
			return;
		}
		if(this.scrollLoop){
			clearInterval(this.scrollInterval);
			this.scrollLoop = false;
			this.scrollInterval = null;
		}
		if(this.currentBlock != null) this.currentBlock.className = this.offClassName;
		this.currentBlock = document.getElementById(this.blockName+num);
		this.currentBlock.className = this.onClassName;
		var doc = document.getElementById(this.containerName);
		var documentHeight = this.getElementYpos(doc) + doc.offsetHeight;
		var windowHeight = this.getWindowHeight();
		var ypos = this.getElementYpos(this.currentBlock);
		if(ypos > documentHeight - windowHeight) ypos = documentHeight - windowHeight;
		this.scrollTo(0,ypos);
	},
	scrollTo : function(x,y){
		if(this.scrollLoop){
			var left = this.getScrollLeft();
			var top = this.getScrollTop();
			if(Math.abs(left-x) <= 1 && Math.abs(top-y) <= 1){
				window.scrollTo(x,y);
				clearInterval(this.scrollInterval);
				this.scrollLoop = false;
				this.scrollInterval = null;
			}else{
				window.scrollTo(left+(x-left)/2, top+(y-top)/2);
			}
		}else{
			this.scrollInterval = setInterval("Browser.scrollTo("+x+","+y+")",100);
			this.scrollLoop = true;
		}
	}
};

/*
using the following line, IE/PC returns an incorrect number when getting the document height.
var document_height = document.all ? document.body.offsetHeight : window.document.height;
To fix this problem, a container div is wrapped around the content so the correct height 
can be determined.
*/

// Edit these variables

Browser.containerName = "container"; // The id name of the div containing the content
Browser.anchorName    = "anchor";    // The alpha portion of the anchor names
Browser.blockName     = "d";     // The alpha portion of the content blocks
Browser.onClassName   = "active";    // The CSS class name for the 'on' state
Browser.offClassName  = "visited";   // The CSS class name for the 'off' state

//

function Is () 
{   // convert all characters to lowercase to simplify testing 
    var agt=navigator.userAgent.toLowerCase(); 

    // *** BROWSER VERSION *** 
    // Note: On IE5, these return 4, so use is.ie5up to detect IE5. 
    this.major = parseInt(navigator.appVersion); 
    this.minor = parseFloat(navigator.appVersion); 

    this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)); 
    this.nav2 = (this.nav && (this.major == 2)); 
    this.nav3 = (this.nav && (this.major == 3)); 
    this.nav4 = (this.nav && (this.major == 4)); 
    this.nav4up = (this.nav && (this.major >= 4)); 
    this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); 
    this.nav5 = (this.nav && (this.major == 5)); 
    this.nav5up = (this.nav && (this.major >= 5));

    this.ie = (agt.indexOf("msie") != -1); 
    this.ie3 = (this.ie && (this.major < 4)); 
    this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
    this.ie4up = (this.ie  && (this.major >= 4)); 
    this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
    this.ie5up = (this.ie  && !this.ie3 && !this.ie4);
	
	this.opera = (agt.indexOf("opera") != -1); 

    // *** PLATFORM *** 
    this.win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) ); 
    this.mac = (agt.indexOf("mac")!=-1); 
    this.linux = (agt.indexOf("inux")!=-1); 
} 

var is = new Is();
function unblur() {
this.blur();
}

	function blurLinks() {
		if (!document.getElementById) return;
		theLinks = document.getElementsByTagName("a");
		for(i=0; i<theLinks.length; i++) {
			theLinks[i].onfocus = unblur;
		}
		theMaps = document.getElementsByTagName("area");
		for(i=0; i<theMaps.length; i++) {
			theMaps[i].onfocus = unblur;
		}
	}
	
	function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function SwitchImage_Inline(imgName,imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function SpamShield(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
	}

// -------------------------------------------------------------------------
// HERE BEGINS THE CSS INFORMATION FOR MAC USERS WITH NETSCAPE
// -------------------------------------------------------------------------
if ((is.nav4) && (is.mac))
	{ SITE_CSS = '<style type="text/css">' +
	'</style>';
		}
// -------------------------------------------------------------------------
// HERE BEGINS THE CSS INFORMATION FOR WINDOWS USERS WITH IE 4+
// AND NETSCAPE 6 & OPERA ON ALL PLATFORMS.
// -------------------------------------------------------------------------
else if (((is.ie4up) && (is.win)) || (is.nav5up) || (is.opera))
	{ SITE_CSS = '<style type="text/css">' +
'.textfield { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); background-color: #f7f7f7; border-top: 1px solid rgb(124,124,124); border-left: 1px solid rgb(195,195,195); border-bottom: 1px solid rgb(221,221,221); border-right: 1px solid rgb(195,195,195); width: 100%; height: 20px; cursor: text; }'+
'textarea { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); background-color: #f7f7f7; border-top: 1px solid rgb(124,124,124); border-left: 1px solid rgb(195,195,195); border-bottom: 1px solid rgb(221,221,221); border-right: 1px solid rgb(195,195,195); width: 100%; height: 100px; cursor: text; }'+
'select { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); width: 100%; height: 20px; cursor: default; }'+
'select.insideLegend { font: 11pxArial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); margin-left: 5px; margin-bottom: 5px; width: 90%; height: 20px; cursor: default; }'+
	'</style>';
		}
// -------------------------------------------------------------------------
// HERE BEGINS THE CSS INFORMATION FOR MAC USERS WITH IE
// -------------------------------------------------------------------------
if ((is.ie4up) && (is.mac))
	{ SITE_CSS = '<style type="text/css">' +
'.textfield { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); background-color: #f7f7f7; border-top: 1px solid rgb(124,124,124); border-left: 1px solid rgb(195,195,195); border-bottom: 1px solid rgb(221,221,221); border-right: 1px solid rgb(195,195,195); width: 100%; height: 20px; cursor: text; }'+
'textarea { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); background-color: #f7f7f7; border-top: 1px solid rgb(124,124,124); border-left: 1px solid rgb(195,195,195); border-bottom: 1px solid rgb(221,221,221); border-right: 1px solid rgb(195,195,195); width: 100%; height: 100px; cursor: text; }'+
'select { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); width: 100%; height: 20px; cursor: default; }'+
'select.insideLegend { font: 11pxArial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); margin-left: 5px; margin-bottom: 5px; width: 90%; height: 20px; cursor: default; }'+
	'</style>';
		}
// -------------------------------------------------------------------------
// HERE BEGINS THE CSS INFORMATION FOR ALL OTHER VISITORS
// -------------------------------------------------------------------------
else { SITE_CSS = '<style type="text/css">' +
'.textfield { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); background-color: #f7f7f7; border-top: 1px solid rgb(124,124,124); border-left: 1px solid rgb(195,195,195); border-bottom: 1px solid rgb(221,221,221); border-right: 1px solid rgb(195,195,195); width: 100%; height: 20px; cursor: text; }'+
'textarea { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); background-color: #f7f7f7; border-top: 1px solid rgb(124,124,124); border-left: 1px solid rgb(195,195,195); border-bottom: 1px solid rgb(221,221,221); border-right: 1px solid rgb(195,195,195); width: 100%; height: 100px; cursor: text; }'+
'select { font: 11px/15px Arial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); width: 100%; height: 20px; cursor: default; }'+
'select.insideLegend { font: 11pxArial, Helvetica, Verdana, sans-serif; color: rgb(51,51,51); margin-left: 5px; margin-bottom: 5px; width: 90%; height: 20px; cursor: default; }'+
	'</style>';
		}
// -------------------------------------------------------------------------
	document.write(SITE_CSS)