/**
 * tmbase.de V4.1
 * ütf-8 release
 */

function div_ref_style(id) {
	if      (document.layers)         return document.layers[id];              
	else if (document.all)            return document.all[id].style;           
	else if (document.getElementById) return document.getElementById(id).style;
	else                              return null;        
}

function div_ref_class(id) {
	if      (document.layers)         return document.layers[id];              
	else if (document.all)            return document.all[id];           
	else if (document.getElementById) return document.getElementById(id);
	else                              return null; 
}

// show/hide 5 divs @ once
function changenav(tabid) {
	activetab  = tabid;
	selected   = 'tab' + tabid;
	selected2  = 'ntab' + tabid;

	changetab('tab1', 'ntab1', 0);
	changetab('tab2', 'ntab2', 0);
	changetab('tab3', 'ntab3', 0);
	changetab('tab4', 'ntab4', 0);
	changetab('tab5', 'ntab5', 0);
	changetab(selected, selected2, 1);
}

// show/hide div for single divs
function changetab(id, sel, stat) {
	div_ref_style(id).display = stat ? 'block' : 'none';
	div_ref_class(sel).className = stat ? 'selected' : '';
}

function showhide(id, stat) {
	div_ref_style(id).display = stat ? 'block' : 'none';
}

function rCPrefresh() {
	self.location.href='index.php?t=' + activetab;
}

function popUpW(wintype, winname, width, height) {
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;
	xpos = (ScreenWidth/2)-(width/2);
	ypos = (ScreenHeight/2)-(height/2);

	var popUped;
	popUped=window.open(wintype, winname, 'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ width +',height='+ height +',left='+ xpos +',top='+ ypos); 
	popUped.window.focus(); 
}

function checkUncheckAll(theElement) {
	var theForm = theElement.form, z = 0;
	for(z=0; z<theForm.length;z++){
      		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	 		theForm[z].checked = theElement.checked;
		}
	}
}

function qsecu(text, url1, url2) {
	var input;
	input=confirm (text);
	if (input==true) {
		if(url1 != "") {
			self.location.href=url1;
		}
	} else {
		if(url2 != "") {
			self.location.href=url2;
		}
	}
}

function pchat(chatclear) {
	window.scrollTo(0,99999);
	if(chatclear) {
		parent.document.chatinput.reset();
	}
}
