//Shadow Variables
var shadowDepth=6; //In Pixels
var shadowColor='#000000'; //Shadow Color
var addShadows=new Function(); //Function variable for addLoadEvents
var shadowContainer='contentLayer'; //Container Layer for shadows
var searchClass='shadow'; //Search for this Class
var shadowClass='shadow2'; //Shadow Class

function returnObjById(id){
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}

// addLoadEvent created by: Simon Willison 
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
// Modified by Christopher Donnelly 01/28/2007 to save the passed 
// function into a variable for use after moving or resizing images.
function addLoadEvent(arg){
	addShadows=arg;
	var oldonload=window.onload;
	if(typeof window.onload!='function') window.onload=addShadows;
	else{
		window.onload=function(){
			if(oldonload) oldonload();
			addShadows();
		}
	}
}


addLoadEvent(
	function() {
		// Created by: Michael Burt
		// http://galaxydefense.ga.funpic.org/
		// Modified by : Christopher Donnelly 01/28/2007 to append Child objects within container objects 
		var a=document.all?document.all:document.getElementsByTagName('*');
		var b=returnObjById(shadowContainer);
		for(var i=0;i<a.length;i++){
			if (a[i].className==searchClass){
				for (x=0;x<shadowDepth;x++){
					var newSd=document.createElement('DIV');
					newSd.className=shadowClass;
					newSd.style.background=shadowColor;
					newSd.style.width=a[i].offsetWidth+'px';
					newSd.style.height=a[i].offsetHeight+'px';
					newSd.style.left=a[i].offsetLeft+x+'px';
					newSd.style.top=a[i].offsetTop+x+'px';
					b.appendChild(newSd);
				}
			}
		}
	}
);

function removeShodows(){
	var b = returnObjById(shadowContainer);
	var i=b.childNodes.length;
	for(var i=b.childNodes.length;i>=0;i--){
		if(b.childNodes[i]!=null){
			if(b.childNodes[i].className==shadowClass) b.removeChild(b.childNodes[i]);
		}
	}
}

function showHideInfo(arg){
	var tableLayerObj=returnObjById(arg+'Block');
	if(prevTableObj){
		prevTableObj.style.display="none";
	}
	if(tableLayerObj!=prevTableObj){
		tableLayerObj.style.display="block";
		prevTableObj=tableLayerObj;
	}
}
