function findElements(name,tag){
	e=new Array();
	if (tag) e=(document.getElementsByTagName)?document.getElementsByTagName(name):null;
	else e=(document.getElementsByName)?document.getElementsByName(name):null;
	return e;
}
function findElement(id){
	e=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:(document.layers)?document.layers[id]:null;
	if (!e) e=findElements(id,true)[0];
	if (!e) e=findElements(id)[0];
	if (e) e.css=(e.style)?e.style:e;
	return e;
}
function writeLayer(id,data){
	obj=findElement(id);
	if (obj&&typeof obj.innerHTML!="undefined") obj.innerHTML=data;
}
function showLayer(id){
	obj=findElement(id);
	if (obj){
		if (obj.style) obj=obj.style;
		obj.visibility="visible";
		obj.display="block";
	}
}
function getPos(id){
	obj=findElement(id);
	pos=new Object();
	pos.x=false;
	pos.y=false;
	try{
		if (obj.x&&obj.y){
			pos.x=obj.x;
			pos.y=obj.y;
		}else{
			if(obj.offsetParent){
				pos.x+=obj.offsetLeft;
				pos.y+=obj.offsetTop;
				while(obj=obj.offsetParent){
					pos.x+=obj.offsetLeft;
					pos.y+=obj.offsetTop;
				}
			}
		}
		return pos;
	}catch(e){
		return pos;
	}
}
function scroll(delta,id){
	obj=findElement(id);
	rnd=Math.round(obj.scrollHeight/10);
	if (delta>0) obj.scrollTop=obj.scrollTop-rnd;
	else obj.scrollTop=obj.scrollTop+rnd;
}
function wheel(e){
	var delta=0;
	if (!e) e=window.event;
	if (e.wheelDelta){
		delta=e.wheelDelta/120;
		if (window.opera) delta=-delta;
	}else if (e.detail) delta=-e.detail/3;
	if (!window.scroller||!delta) return;
	else scroll(delta,window.scroller);
	if (e.preventDefault) e.preventDefault();
	e.returnValue=false;
}
function clearWheel(){
	window.scroller=null;
	d=document.documentElement;
	d.onkeydown=null;
	d.onmousewheel=null;
	if (window.removeEventListener) window.removeEventListener('DOMMouseScroll', wheel, false);
}
function mouseWheel(id,keyDn){
	window.scroller=id;
	d=document.documentElement;
	if (keyDn) d.onkeydown=function(e){
		if (!e) e=window.event;
		if (window.event) c=e.keyCode;
		else c=e.which;
		switch(c){
			case 32:
				killEvent(e);
			break;
			case 38:
				scroll(1,window.scroller);
				killEvent(e);
			break;
			case 40:
				scroll(-1,window.scroller);
				killEvent(e);
			break;
			default:break;
		}
	};
	if (window.addEventListener) window.addEventListener('DOMMouseScroll', wheel, false);
	else d.onmousewheel=wheel;
}
var onloadArray=new Array();
var bodyOnload=false;
var bodyLoaded=false;
function add_onload(functionName){
	if (bodyOnload!=true){
		if (findElements('BODY',true)[0]!=null){
			var doc_body=findElements('BODY',true)[0];
			if (typeof(doc_body.onload)=="function"&&doc_body.onload.toString().indexOf('executeFunctions')==-1) onloadArray[onloadArray.length]=doc_body.onload;
			bodyOnload=true;
		}
	}
	onloadArray[onloadArray.length]=functionName;
	window.onload=executeFunctions;
}
function executeFunctions(){
	for (var i in onloadArray){
		if (typeof(onloadArray[i])=="function") onloadArray[i].apply();
		else eval(onloadArray[i]);
	}
	bodyLoaded=true;
}
function randomString(){
	var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length=8;
	var randomstr='';
	for (var i=0; i<string_length; i++){
		var rnum=Math.floor(Math.random() * chars.length);
		randomstr += chars.substring(rnum,rnum+1);
	}
	return randomstr;
}
function popupWindow(location,width,height,resizable,scrollbars,status){
	if (width==null||width==undefined) width=800;
	if (height==null||height==undefined) height=531;
	if (resizable==null||resizable==undefined) resizable='no';
	if (scrollbars==null||scrollbars==undefined) scrollbars='no';
	if (status==null||status==undefined) status='no';
	var rndStr=randomString();
	new_window=window.open(location,rndStr,"fullscreen=no,width="+width+",height="+height+",top="+Math.round((screen.availHeight/2)-(height/2))+",left="+Math.round((screen.availWidth/2)-(width/2))+",resizable="+resizable+",scrollbars="+scrollbars+",status="+status+",location=no,toolbar=no,menubar=no,directories=no,titlebar=no,personalbar=no");
	if (new_window) return false;
	else return true;
}
function showBio(){
	img=location.href;
	img=img.substring(img.indexOf('?')+1,img.length);
	showLayer(img);
}
function showImg(){
	img=location.href;
	img=img.substring(img.indexOf('?')+1,img.length);
	findElement('image').src=img;
	window.opener=self;
	self.focus();
}
function closeWin(){
	window.opener=self;
	self.close();
}
var imgArray=new Array();
function setupHSRC(){
	if (!document.getElementById) return;
	var images=findElements('IMG',true);
	for (var i=0; i<images.length; i++){
		if (images[i].getAttribute('psrc')) images[i].setAttribute('src',images[i].getAttribute('psrc'));
		if (images[i].getAttribute('hsrc')){
			imgArray.push(images[i].getAttribute('hsrc'));
			images[i].onmouseover=function(){
				this.oSRC=this.getAttribute('src');
				if (this.oSRC.indexOf("!.gif")>-1) this.oSRC=this.getAttribute('psrc');
				this.setAttribute('src',this.getAttribute('hsrc'));
			};
			images[i].onmouseout=function(){
				if (this.oSRC) this.setAttribute('src',this.oSRC);
			};
		}
	}
	preloadImages(imgArray);
}
function preloadImages(img){
	preload=new Array();
	for (var i=0; i<img.length; i++){
		preload[i]=new Image();
		preload[i].src=img[i];
	}
}
var pngArray=new Array();
var blank="img/!.gif";
function addPngImage(e){
	fixPNG(e);
	e.attachEvent("onpropertychange",function(){propertyChanged();});
}
function fixPNG(e){
	e.runtimeStyle.behavior="none";
	e.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.src+"')";
	e.PSRC=e.src;
	e.src=blank;
}
function propertyChanged(){
	var e=event.srcElement;
	var pName=event.propertyName;
	if (pName!=="src"||RegExp(blank).test(e.src)) return;
	else fixPNG(e);
}
function setPos(id,x){
	obj=findElement(id);
	if (obj&&isFinite(x)) obj.css.marginLeft=x+"px";
}
function setHeader(){
	if (getPos('ds').x!==getPos('main').x) setPos('main',getPos('ds').x);
}
function setBG(){
	window.onresize=setHeader;
	setHeader();
	setupHSRC();
	mouseWheel('holder',true);
}
add_onload('setBG()');
