// <!--
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Declare global variables
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var zindex = 100
var ie4 = document.all
var ns4 = document.layers
var ns6 = document.getElementById&&!document.all
var opr = navigator.userAgent.indexOf("Opera")
var mac = navigator.userAgent.indexOf("Mac")
var dd = true


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Pop New Window
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function new_window(theURL,winName,width,height) {
	var new_window
	new_window = window.open(theURL, winName, 'height='+height+',width='+width+',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
	new_window.focus();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Navigator App. Type & Version
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//alert(navigator.appVersion);

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) {
		index_06_over = newImage("/images/index_06-over.jpg");
		index_07_over = newImage("/images/index_07-over.jpg");
		index_08_over = newImage("/images/index_08-over.jpg");
		index_08_index_07_over = newImage("/images/index_08-index_07_over.jpg");
		index_09_index_08_over = newImage("/images/index_09-index_08_over.jpg");
		index_09_over = newImage("/images/index_09-over.jpg");
		index_10_over = newImage("/images/index_10-over.jpg");
		preloadFlag = true;
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Changes menu background color
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function menuButton(idButton,idLink,intColor){
	if(intColor == '1'){
		curmenuID=ns6? $(idButton).bgColor="ffffff" : eval(idButton).bgColor="ffffff"
		curmenuID=ns6? $(idLink).style.color="333366" : eval(idLink).style.color="333366"
	} else {
		curmenuID=ns6? $(idButton).bgColor="cccccc" : eval(idButton).bgColor="cccccc"
		curmenuID=ns6? $(idLink).style.color="333366" : eval(idLink).style.color="333366"
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// File download
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function DownloadFile(strFile) {
	window.open('/zips/'+strFile, 'DownloadFile', 'height=100,width=100,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Changes the Page Status
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function changeStatus(strStatus){
	window.status = strStatus
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// TRACKS MOUSE POSITION FOR POPUP PLACEMENT
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var isNav = (navigator.appName.indexOf("Netscape") != -1);
function handlerMM(e){
	x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
	y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){
	document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Layer Pop-Up
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function pop_it(e,whichone, intTop, intLeft){
	curmenuID=ns6? document.getElementById(whichone).id : eval(whichone).id

	if (window.themenu&&themenu.id!=curmenuID)
		themenuStyle.visibility=ns4?"hide" : "hidden"

	themenu=ns6? document.getElementById(whichone): eval(whichone)
	themenuStyle=(ns6||ie4)? themenu.style : themenu

//	themenuoffsetX=(ie4&&opr==-1)? document.body.scrollLeft : 200;
//	themenuoffsetY=(ie4&&opr==-1)? document.body.scrollTop : 400;

	themenuStyle.left = intLeft;
	themenuStyle.top = intTop;
	
	hiddenconst=(ns6||ie4)? "hidden" : "hide"
	if (themenuStyle.visibility==hiddenconst){
		if(dd == true) {
			themenuStyle.visibility=(ns6||ie4)? "visible" : "show"
			themenuStyle.zIndex=zindex++
		}
	}
	else {
		hidemenu()
	}
	dd = true;
	return false
}

function hidemenu(){
	if ((ie4||ns6)&&window.themenu)
		themenuStyle.visibility="hidden"
	else if (ns4)
		themenu.visibility="hide"
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Scrolling Menu Below Here
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Decalre vars
window.onerror = null;
var topMargin = 100;
var slideTime = 1200;

function layerObject(id,left) {
	if (ns6) {
		this.obj = document.getElementById(id).style;
		this.obj.left = left;
		return this.obj;
	} else if(ie4) {
		this.obj = document.all[id].style;
		this.obj.left = left;
		return this.obj;
	} else if(ns4) {
		this.obj = document.layers[id];
		this.obj.left = left;
		return this.obj;
   }
}

function layerSetup() {
	floatLyr = new layerObject('float_menu', 37);
	window.setInterval("main()", 10)
}

function floatObject() {
	if (ns4 || ns6) {
		findHt = window.innerHeight;
	} else if(ie4) {
		findHt = document.body.clientHeight;
   }
} 

function main() {
	if (ns4) {
		this.currentY = document.layers["float_menu"].top;
		this.scrollTop = window.pageYOffset;
		mainTrigger();
	} else if(ns6) {
		this.currentY = parseInt(document.getElementById('float_menu').style.top);
		this.scrollTop = scrollY;
		mainTrigger();
	} else if(ie4) {
		this.currentY = float_menu.style.pixelTop;
		this.scrollTop = document.body.scrollTop;
		mainTrigger();
   }
}

function mainTrigger() {
	var newTargetY = this.scrollTop + 20;
	if ( newTargetY < this.topMargin ) {
		newTargetY = this.topMargin;
	}
	if ( this.currentY != newTargetY ) {
		if ( newTargetY != this.targetY ) {
			this.targetY = newTargetY;
			floatStart();
		}
		animator();
   }
}

function floatStart() {
	var now = new Date();
	this.A = this.targetY - this.currentY;
	this.B = Math.PI / ( 2 * this.slideTime );
	this.C = now.getTime();

	if (Math.abs(this.A) > this.findHt) {
		this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
		this.A = this.A > 0 ? this.findHt : -this.findHt;
	} else {
		this.D = this.currentY;
   }
}

function animator() {
	var now = new Date();
	var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
	newY = Math.round(newY);
	if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
		if ( ie4 )document.all.float_menu.style.pixelTop = newY;
		if ( ns4 )document.layers["float_menu"].top = newY;
		if ( ns6 )document.getElementById('float_menu').style.top = newY + "px";
   }
}

function float_start() {
	if(ns6||ns4) {
		pageWidth = innerWidth;
		pageHeight = innerHeight;
	} else if(ie4) {
		pageWidth = document.body.clientWidth;
		pageHeight = document.body.clientHeight;
   }
	layerSetup();
	floatObject();
}
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Scrolling Menu Above Here
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//-->
