
var pf = function positionFooter(){
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  cont = document.getElementById('container');
  if(cont.clientHeight < myHeight){
	  cont.style.height = myHeight+"px";
	  foot = document.getElementById('footer');
	  head = document.getElementById('header');
	  foot.style.position = "absolute";
	  foot.style.top = (myHeight - foot.offsetHeight) + "px";
  }

}


function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function fileLinks() {
    var fileLink;
    if (document.getElementsByTagName('a')) {
        for (var i = 0; (fileLink = document.getElementsByTagName('a')[i]); i++) {
            if (fileLink.href.indexOf('.pdf') != -1) {
                fileLink.setAttribute('target', '_blank');
                fileLink.className = 'pdfLink';
            }
            if (fileLink.href.indexOf('.doc') != -1) {
                fileLink.setAttribute('target', '_blank');
                fileLink.className = 'docLink';
            }
            if (fileLink.href.indexOf('.zip') != -1) {
                fileLink.setAttribute('target', '_blank');
                fileLink.className = 'zipLink';
            }
            if (fileLink.href.indexOf('.rar') != -1) {
		fileLink.setAttribute('target', '_blank');
		fileLink.className = 'rarLink';
            }
            if (fileLink.href.indexOf('doesthatevencompile.com') == -1 &&
            	fileLink.href.indexOf('javascript:') == -1 &&
            	fileLink.href.indexOf('dogself.com:') == -1
            ) {
	    		fileLink.setAttribute('target', '_blank');
	    		fileLink.className = 'externalLink';
            }
        }
    }
}

function expandText(thistag){
   styleObj=document.getElementById(thistag).style;
   if(styleObj.display=='none'){styleObj.display='';}
   else {styleObj.display='none';}
}


	Event.observe(window, 'load', fileLinks, false);
	Event.observe(window, 'load', pf, false);
