//** Dynamic Drive Equal Columns Height script v1.01 (Nov 2nd, 06)
//** http://www.dynamicdrive.com/style/blog/entry/css-equal-columns-height-script/

var ddequalcolumns=new Object()
//Input IDs (id attr) of columns to equalize. Script will check if each corresponding column actually exists:
ddequalcolumns.columnswatch=["leftcolumn", "mainContent"]

ddequalcolumns.setHeights=function(reset){
	var tallest=0
	var resetit=(typeof reset=="string")? true : false
	for (var i=0; i<this.columnswatch.length; i++){
		if (document.getElementById(this.columnswatch[i])!=null){
			if (resetit)
			document.getElementById(this.columnswatch[i]).style.height="auto"
			if (document.getElementById(this.columnswatch[i]).offsetHeight>tallest)
			tallest=document.getElementById(this.columnswatch[i]).offsetHeight
		}
	}
if (tallest>0){
for (var i=0; i<this.columnswatch.length; i++){
if (document.getElementById(this.columnswatch[i])!=null)
document.getElementById(this.columnswatch[i]).style.height=tallest+"px"
}
}
}

ddequalcolumns.resetHeights=function(){
this.setHeights("reset")
}

ddequalcolumns.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
}

ddequalcolumns.dotask(window, function(){ddequalcolumns.setHeights()}, "load")
ddequalcolumns.dotask(window, function(){if (typeof ddequalcolumns.timer!="undefined") clearTimeout(ddequalcolumns.timer); ddequalcolumns.timer=setTimeout("ddequalcolumns.resetHeights()", 200)}, "resize")

// Password code. Who knows what pages are there?
function loadpage(){
	document.location.href=document.frm.pswd.value + ".html"
}
//In case they press enter rather than clicking the button
function enterPressed(e){

	if(e){
	e = e 
	} else {
	e = window.event
	} 

	if(e.which){ 
	var keycode = e.which
	} else {
	var keycode = e.keyCode 
	}

	if(keycode == 13) {
	document.location.href=document.frm.pswd.value + ".html"
	}
}

//Preload Images
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//Pop ups
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function hidediv() { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById('hideshow').style.visibility = 'hidden'; 
	} 
	else { 
		if (document.layers) { // Netscape 4 
		document.hideshow.visibility = 'hidden'; 
		} 
	else { // IE 4 
		document.all.hideshow.style.visibility = 'hidden'; 
		} 
	} 
} 

function showdiv() { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById('hideshow').style.visibility = 'visible'; 
	} 
	else { 
		if (document.layers) { // Netscape 4 
		document.hideshow.visibility = 'visible'; 
		} 
	else { // IE 4 
	document.all.hideshow.style.visibility = 'visible'; 
		} 
	} 
} 
/*<div id="hideshow" ..etc> 
My content 
</div> 
and this to call the javascript to hide it 
<a href="javascript:hidediv()">hide div</a> 
and this to show it 
<a href="javascript:showdiv()">show div</a> */


