
//inhouse

function popwin(URL,name,width,height) {
   HorizPos = 0;
   VertPos = 0;
   if(screen){
	   HorizPos = (screen.width-width) / 2;
	   VertPos = (screen.height-height) / 2;
   }
   varPopupWin=window.open(URL, name,'width='+width+',height='+height+',left='+HorizPos+',top='+VertPos+',scrollbars=yes,toolbar=no,menubar=no,resizeable=no');
   varPopupWin.focus(); 
}


function Revelate(theContainer) {
	this._objectId;
	this.theContainerID = theContainer;
	this._containerObj = false;
	this.closeAll = false;
	this.tagSwap = "<dd>";
	this.openTracker = new Array();
	this.openTracker["story1"] = "story1";
	this._debug = true;
	this._execute = true;
	this.hideClass = "hide";
	this._constructor = function() { 
		if((this._containerObj = document.getElementById(this.theContainerID))==false) {
			this._execute = false;
			if(this._debug) {
				alert('could not detect the container in which you have instantiated this class!');
			}
		}
	}
	this.show = function(theOpen) {
		this._objectId = theOpen;
		if(this._execute) {
				if(this.openTracker[theOpen]) {
					this.hide(theOpen);
				} else {
					if(theObj = document.getElementById(this._objectId)) {
						if(this.closeAll==true) {
							this.closeAll();
						}
						this.trackOpen(theObj.className);
						tempS = theObj.className;
						tempS = tempS.replace(this.hideClass,"")
						theObj.className = this._trim(tempS);
					} else if(this._debug) {
						alert('could not detect the object in which you wish to show!');
					}
				}
			
			
		}
	}
	this.trackOpen = function(theClassName) {
		this.openTracker[this._objectId] = theClassName;
	}
	this.closeAll = function() {
		for(openJ in this.openTracker) {
			if(theTempO = document.getElementById(openJ)) {
				if(this.openTracker[openJ].length>0) {
					theTempO.className = this.hideClass;
				} else {
					theTempO.className = " " + this.hideClass;
				}
				delete this.openTracker[openJ];
			}
			
		}
	}
	this.hide = function(theClose) {
		if(this.closeAll) {
			this.closeAll();
		}
		if(theTempO = document.getElementById(theClose)) {
			if(this.openTracker[theClose]) {
				theTempO.className = this.hideClass;
			} else {
				theTempO.className = " " + this.hideClass;
			}
			delete this.openTracker[theClose];
		}
	}
	this._trim = function(sInString) {
	  sInString = sInString.replace( /^\s+/g, "" );// strip leading
	  return sInString.replace( /\s+$/g, "" );// strip trailing
	}
}

sfHover = function() {
	var sfEls = document.getElementById("navi").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}


if (window.attachEvent) window.attachEvent("onload", sfHover);

myRevelation = new Revelate("deadlybees");
