var isNav4 = (!document.all && document.layers);
var isNav6 = (!document.all && document.getElementById);
var isIE4 = (document.all && !document.getElementById);
var isIE5 = (document.all && document.getElementById);
var timer;
var popwin;
function getClientHeight() {
	if (self.innerHeight) return self.innerHeight; else
	if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight; else
	if (document.body) return document.body.clientHeight;
	}
function getScrollTop() {
	if (self.pageYOffset) return self.pageYOffset; else
	if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop; else
	if (document.body) return document.body.scrollTop;
	}
function getPageHeight() {
	var h1=document.body.scrollHeight;
	var h2=document.body.offsetHeight;
	if (h1>h2) return h1; else return h2;
	}
function showcase(pic) {
	var sc = (document.all) ? document.all.showcase : document.getElementById('showcase');
	sc.style.height=getPageHeight() + 'px';
	if (navigator.userAgent.indexOf("Firefox")!=-1) sc.setAttribute('onclick','javascript:blue(0);',0);
	var scrP=getScrollTop();
	var scrPos=scrP+50;
	neu='<img src="' + pic + '" style="margin:6px;border:1px solid #AFE938" /><br />';
	if (document.all) {
		document.all.showcontent.style.top=scrPos + 'px';
		document.all.showpic.innerHTML=neu;
		} else
	if (document.getElementById) {
		document.getElementById('showcontent').style.top=scrPos + 'px';
		document.getElementById('showpic').innerHTML=neu;
		}
	blue(1);
	}
function videocase(video) {
	var sc = (document.all) ? document.all.showcase : document.getElementById('showcase');
	sc.style.height=getPageHeight()+'px';
	sc.removeAttribute("onclick", 0);
	var scrP=getScrollTop();
	var scrPos=scrP+50;
	neu='<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'+video+'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+video+'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
	if (document.all) {
		document.all.showcontent.style.top=scrPos+'px';
		document.all.showpic.innerHTML=neu;
		} else
	if (document.getElementById) {
		document.getElementById('showcontent').style.top=scrPos+'px';
		document.getElementById('showpic').innerHTML=neu;
		}
	blue(1);
	}
function showc(c) {
	if (isNav4) document.layers[c].visibility="show"; else
	if (isNav6) document.getElementById(c).style.visibility="visible"; else
	if (isIE4 || isIE5) document.all[c].style.visibility="visible";
	}
function hidec(c) {
	if (isNav4) document.layers[c].visibility="hide"; else
	if (isNav6) document.getElementById(c).style.visibility="hidden"; else
	if (isIE4 || isIE5) document.all[c].style.visibility="hidden";
	}
function interval(id) { clearTimeout(timer); timer=setTimeout('menuShow(\''+id+'\')', 800); }
function menuShow(id) {
	menuHide(); div='m'+id;
	if(isNav4) document.layers[div].visibility='show'; else
	if(isNav6) document.getElementById(div).style.visibility='visible'; else
	if(isIE4 || isIE5) document.all[div].style.visibility='visible';
	}
function menuHide(){
	obj=new Array('index','search','toplist','member','community','help');
	for (i=0; i<obj.length; i++) {
		div='m'+obj[i];
		if (isNav4) document.layers[div].visibility='hide'; else
		if (isNav6) document.getElementById(div).style.visibility='hidden'; else
		if (isIE4 || isIE5) document.all[div].style.visibility='hidden';
		}
	}
function blue(what) {
	if (what=='1') {
		if(isNav4) document.layers['showcase'].visibility='show'; else
		if(isNav6) document.getElementById('showcase').style.visibility='visible'; else
		if(isIE4 || isIE5) document.all['showcase'].style.visibility='visible';
		} else {
		if(isNav4) document.layers['showcase'].visibility='hide'; else
		if(isNav6) document.getElementById('showcase').style.visibility='hidden'; else
		if(isIE4 || isIE5) document.all['showcase'].style.visibility='hidden';
		}
	}
function openwindow(url,winname,w,h,settings) {
	var popwin=window.open(url,winname,'width='+w+',height='+h+','+settings);
	if (popwin.opener==null) popwin.opener=self;
	if (popwin.focus!=null) popwin.focus();
	}
function opencentered(theURL,winName,winWidth,winHeight,features) {
	var w=(screen.width-winWidth)/2;
	var h=(screen.height-winHeight)/2-60;
	features=features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
	window.open(theURL,winName,features);
	}
function smilies(winForm,winElement) {
	url='./?tpl=smilies&wf='+winForm+'&we='+winElement;
	return(openwindow(url,'Smilies',525,410,'resizable=no,scrollbars=yes,status=no'));
	}
function counter(field,countfield,maxlimit) {
	if (field.value.length>maxlimit) field.value=field.value.substring(0,maxlimit);
	else countfield.value=maxlimit-field.value.length;
	}
function initTransfer() {
	if (document.all) {
		document.all['loading'].style.display='inline';
		document.all['btn'].style.display='none';
		} else {
		document.getElementById('loading').style.display='inline';
		document.getElementById('btn').style.display='none';
		}
	}
function selectall(formobj,what) {
	el=document.forms[formobj].elements;
	for (var i=0;i<el.length;i++) {
		if (el[i].type.toLowerCase()=="checkbox") el[i].checked=(what=='0') ? false : true;
		}
	}

