function openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function piloly_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function email_output(user, domain, tld, type, text, get, tag) {
	email = user+'@'+domain+'.'+tld;
	if(!text) text = email;
	if(tag) tag = ' '+tag;
	email = '<a href="mailto:'+email+get+'"'+tag+'>';
	if(type == 'all') email = email+text+'</a>';
	document.write(email);
}

function showhide(id) {
	if(document.getElementById) {
		el = document.getElementById(id);
		if(el && el.style) {
			el.style.display = (el.style.display != '') ? '' : 'none';
		}
	}
}

function event_add(obj, type, fn) {
 	if(obj.attachEvent) {
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type, fn, false);
	}
}

function voteAjaxSendRequest(typ, id, wert) {
	this.typ = typ;
	this.id = id;
	this.http_request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	this.http_request.onreadystatechange = voteAjaxHandleResponse;
	this.http_request.open('get', '/forum/post.ajax.php?typ='+typ+'&id='+id+'&wert='+wert, true);
	this.http_request.send(null);
}

function voteAjaxHandleResponse() {
	if((http_request.readyState == 4) && (http_request.status == 200)) {
		document.getElementById('ajaxvote'+typ+id).innerHTML = http_request.responseText;
	}
}

/* Dropdownmenu */
sfHover = function() {
	if(document.getElementById("dropdownmenu")) {
		var sfEls = document.getElementById("dropdownmenu").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);


/* Usermenu */
usermenusfHover = function() {
	if(document.getElementById("usermenu")) {
		var sfEls = document.getElementById("usermenu").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" usermenusfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" usermenusfhover\\b"), "");
			}
		}
	}
}
if(window.attachEvent) window.attachEvent("onload", usermenusfHover);