//****************************************************************************************
// All of the onLoad functions will be called here
//****************************************************************************************
function onBrowserLoad(){
	checkCookieExists('content_size')
}

//****************************************************************************************
// Function that grabs the name of the link to diplay in the status bar - very simple deal
// to make the page a bit cleaner
//****************************************************************************************
function dspSimpleStatus(this_obj,where){
        flag = this_obj.name.replace(/_/g, ' ')
		if(where != undefined){
			document.getElementById('icon_sub').innerHTML = flag
		}
	   	window.status = flag
  }
  
//****************************************************************************************
// Function that sets the status bar to blank on the mouseout event
//****************************************************************************************
function undspSimpleStatus(){
    document.getElementById('icon_sub').innerHTML = ''
	window.status = ''
}


//****************************************************************************************
// Open New Window
//****************************************************************************************
function openWin(URLtoOpen, windowName, h, w) {
	window.open(URLtoOpen,windowName,'toolbar=no,width=' + w + ',height=' + h + ',location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0')
}

//****************************************************************************************
// Cookie Expiration
//****************************************************************************************
var date = new Date();
var days = 365
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = date.toGMTString();

//****************************************************************************************
// Get Cookie Name & Value
//****************************************************************************************
function getCookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

//****************************************************************************************
// Set the Cookie Name & Value
//****************************************************************************************
function setCookie(name,value) {
	var path = '/'
	var domain = ''
	var secure = null
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}


//****************************************************************************************
// See if the cookie exists
//****************************************************************************************
function checkCookieExists(name){
	if( getCookie(name) != undefined ){
		font_increase(getCookie(name))
	}
}

//****************************************************************************************
// Page Control Functions
// Print Page
//****************************************************************************************
function print_page(){
	window.print();
}

//****************************************************************************************
// Increase content font size
//****************************************************************************************
function font_increase(fsize){
	if(fsize == 1){
		nfsize = '9';
	}else if(fsize == 2){
		nfsize = '11';
	}else if(fsize == 3){
		nfsize = '12';
	}else if(fsize == 4){
		nfsize = '14'
	}
	document.getElementById('content').style.fontSize = nfsize + "pt";
	setCookie('content_size',fsize)

}

//****************************************************************************************
// Email Encryption to keep the spammer at bay
//****************************************************************************************
// <!-- 752174548
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/ 


function hear(appearance,sponge,approval) {
	appearance += ' ';
	var coal = appearance.length;
	var drawing = 0;
	var speech = '';
	for(var sword = 0; sword < coal; sword++) {
		drawing = 0;
		while(appearance.charCodeAt(sword) != 32) {
			drawing = drawing * 10;
			drawing = drawing + appearance.charCodeAt(sword)-48;
			sword++;
		}
	speech += String.fromCharCode(shave(drawing,sponge,approval));
	}
	parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+speech;
}

function know(star,language,largato) {
	star += ' ';
	var bow = star.length;
	var lion = 0;
	for(var hand = 0; hand < bow; hand++) {
		lion = 0;
		while(star.charCodeAt(hand) != 32) {
			lion = lion * 10;
			lion = lion + star.charCodeAt(hand)-48;
			hand++;
		}
	document.write(String.fromCharCode(shave(lion,language,largato)));
	}
}

function shave(mass,doctor,monkey) {
	if (monkey % 2 == 0) {
		orange = 1;
		for(var level = 1; level <= monkey/2; level++) {
			nest = (mass*mass) % doctor;
			orange = (nest*orange) % doctor;
		}
	} else {
		orange = mass;
		for(var bunny = 1; bunny <= monkey/2; bunny++) {
			nest = (mass*mass) % doctor;
			orange = (nest*orange) % doctor;
		}
	}
return orange;
}



document.observe('dom:loaded', function(){ 
	checkCookieExists('content_size')
})
// -->
