// 1k DOM API - http://timmorgan.info/1k/
/*
	HTMLElement gE ( string id )                               // get element
	HTMLElement cE ( [string tag] )                            // create element
	HTMLElement aC ( HTMLElement elm [, HTMLElement parent] )  // append child
	void        sE ( HTMLElement elm )                         // show element
	void        hE ( HTMLElement elm )                         // hide element
	void        sZ ( HTMLElement elm, int/string zIndex )      // set z-index
	void        sX ( HTMLElement elm, int/string xPos )        // set x position
	void        sY ( HTMLElement elm, int/string yPos )        // set y position
	void        sW ( HTMLElement elm, int/string width )       // set width
	void        sH ( HTMLElement elm, int/string height )      // set height
	void        sC ( HTMLElement elm, int/string top,          // set clipping
					 int/string right, int/string bottom, int/string left )
	void        wH ( HTMLElement elm, string html )            // write html
	void        sB ( HTMLElement elm, string backgroundColor ) // set background color
	void        aE ( HTMLElement elm, string eventName,        // add event listener
					 function eventHandler )
*/
d=document;
function gE(e){return d.getElementById(e)};
function cE(t){return d.createElement(t||'div')};
function aC(e,p){return (p||d.body).appendChild(e)};
function sE(e){e.style.visibility='visible'};
function hE(e){e.style.visibility='hidden'};
function sZ(e,z){e.style.zIndex=z};
function sX(e,x){e.style.left=px(x)};
function sY(e,y){e.style.top=px(y)};
function sW(e,w){e.style.width=px(w)};
function sH(e,h){e.style.height=px(h)};
function sC(e,t,r,b,l){e.style.clip='rect('+t+' '+r+' '+b+' '+l+')'};
function wH(e,h){e.innerHTML=h};
function sB(e,b){e.style.background=b};
function aE(e,ev,f){ev=ev.replace(/^(on)?/,'on');if(!e[ev+'c'])e[ev+'c']=[];e[ev+'c'][e[ev+'c'].length]=f;if(!e[ev])e[ev]=function(v){v=v||event;if(!v.currentTarget)v.currentTarget=e;if(!v.target)v.target=v.currentTarget;for(i=0;i<e[ev+'c'].length;i++)e[ev+'c'][i](v)}};
function px(n){return(typeof n=='string')?n:n+'px'};

/***************************************************************/
/********************** SIMPLE IMAGE SWAP **********************/
function switchImage(objImage, imgSrc) 
{
  objImage.src = imgSrc;
}
/***************************************************************/
/***************************************************************/

/***************************************************************
 ***************************************************************
 ***************************************************************/
/***************** random content object ***********************/

function randomContent()
{
	this.numChunks = 0;
	this.chunks = new Array();
	
	this.init = randomContent_init;
	this.getContent = randomContent_getContent;
	this.addContent = randomContent_addContent;
	this.displayChunks = randomContent_displayChunks;
}

function randomContent_displayChunks()
{
	strAlert = "";
	for(i=0; i < this.numChunks; i++)
	{	
		strAlert = strAlert + i + "->" + this.chunks[i] + "\n\n";
	}
	
	alert(strAlert);
}

function randomContent_init()
{
	this.numChunks = this.chunks.length;
}

function randomContent_getContent()
{
	intRandom = Math.round(Math.random()*(this.numChunks-1));
	
	document.write(this.chunks[intRandom]);
}

function randomContent_addContent(content)
{
	this.chunks[this.numChunks] = content;
	
	this.numChunks = this.numChunks + 1;
}
			
/***************************************************************
 ***************************************************************
 ***************************************************************/
 
 /***************************************************************
 ***************************************************************
 ***************************************************************/
/*********** FONT SIZE ****************/

function changeFontSize(sizeDifference){
	currentFontSize = parseInt(currentFontSize) + parseInt(sizeDifference);

	if(currentFontType == 1){ // currentFontType is a global that is declared in 'initialize.js'
		if(currentFontSize > 14){
			currentFontSize = 14;
		}else if(currentFontSize < 8){
			currentFontSize = 8;
		}
	}else{
		if(currentFontSize > 19){
			currentFontSize = 19;
		}else if(currentFontSize < 8){
			currentFontSize = 8;
		}
	}
	setFontSize(currentFontSize);
	saveSettings();
}

function setFontSize(fontSize, save){
	//var stObj = (document.getElementById) ? document.getElementById('ContentArea') : document.all('Content');
	document.body.style.fontSize = fontSize + 'pt';
	
	if(save)
	{
		currentFontSize = fontSize;
		saveSettings();
	}
}

/***************************************************************
 ***************************************************************
 ***************************************************************/
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
/***************************************************************
 ***************************************************************
 ***************************************************************/
 
 var oHideTimer_MoreInformation
 
 function showMoreInformation()
 {
	 gE("More_Information").style.display = "block";
	 cleartimerMoreInformation();
 }
 
 function setTimerMoreInformation()
 {
	  oHideTimer_MoreInformation = setTimeout('hideMoreInformation()', 2000);
 }

 
 function hideMoreInformation()
 {
 	gE("More_Information").style.display = "none";
 }
 
function cleartimerMoreInformation()
{
	clearTimeout(oHideTimer_MoreInformation);
}
 
 
 function init()
 {
	 gE("global_nav").style.display = "block";
 }
//function MoreInformation()
//{
//	this.numChunks = 0;
//	this.chunks = new Array();
//	
//	var oHideTimer;
//	
//	this.init = randomContent_init;
//	this.show = showMoreInformation;
//	this.setTimer = timerMoreInformation;
//	this.clearTimer = cleartimerMoreInformation;
//	this.hide = hideMoreInformation;
//}

 
 
 
 
 
 
 
 
 
 
 
 