    function toggle_row( id )
    {
            if( document.getElementById( "row_" + id ).style.display == 'none' )
            {
                   if( document.getElementById( "img_" + id ) ) document.getElementById( "img_" + id ).src = "./template/images/minus.gif";
                   document.getElementById( "row_" + id ).style.display = "";
            }
            else
            {
                if( document.getElementById( "img_" + id ) ) document.getElementById( "img_" + id ).src = "./template/images/plus.gif";
                   document.getElementById( "row_" + id ).style.display = "none";
            }
    }
    
    function gallery_popup( id, pic )
    {
        popup_width = 711;
        popup_height = 650;
        popup_left = (screen.width / 2) - (popup_width / 2);
        popup_top = 10;
        popup = window.open('gallery_popup.php?id='+id+'&file='+pic, 'Bilddetails', 'toolbar = no, location = no, scrollbars = yes, width = ' + popup_width + ', height = ' + popup_height + ', left = ' + popup_left + ', top = ' + popup_top + ', alwaysRaised = true');
        popup.focus();
    }
    
    function partyguide_dayover( item )
    {
        item.style.border = '1px #DD6600 solid';
        if( navigator.appName == "Microsoft Internet Explorer" )
            item.style.cursor = 'hand';
        else
            item.style.cursor = 'pointer';
    }
    
    function partyguide_dayout( item )
    {
        item.style.border = '1px #262626 solid';
    }
    
    function atroxler_popup( )
    {
        document.getElementById( "atroxler_popup" ).style.top = 100;
        document.getElementById( "atroxler_popup" ).style.left = Math.floor(screen.weight/2 - 250);
        document.getElementById( "atroxler_popup" ).style.visibility = "visible";
    }
	
	function defined(w){ return typeof w != 'undefined'; }
	
	function getRect( id )
	{
		var r = { top:0, left:0, width:0, height:0 };

		if(!id) return r;
		var o = document.getElementById(id);

		if(!o) return r;

		if(defined(o.offsetTop))
		{
			r.height = o.offsetHeight;
			r.width = o.offsetWidth;
			r.left = r.top = 0;
			while (o && o.tagName != 'BODY')
			{
				r.top  += parseInt( o.offsetTop );
				r.left += parseInt(o.offsetLeft );
				o = o.offsetParent;
			}
		}
		else if(o && defined(o.pageX) )
		{
			r.left = o.pageX;
			r.top = o.pageY;
			r.height = o.height || o.clip.height;
			r.width = o.width || o.clip.width;
		}
		return r;
	}
    
    
    // Helpline messages
    help_0 = "Alle offenen TextCode-Tags schließen";
    help_1 = "Text in fett: [b]Text[/b]";
    help_2 = "Text in kursiv: [i]Text[/i]";
    help_3 = "Unterstrichener Text: [u]Text[/u]";
    help_4 = "Linksbündiger Text: [left]Text[/left]";
    help_5 = "Zentrierter Text: [center]Text[/center]";
    help_6 = "Rechtsbündiger Text: [right]Text[/right]";
    help_7 = "Liste: [list]Text[/list]";
    help_8 = "Geordnete Liste: [list=]Text[/list]";
    help_9 = "Nächster Listenpunkt: [*]Text";
    help_10 = "Zitat: [quote]Text[/quote]";
    help_11 = "Code anzeigen: [code]Code[/code]";
    help_12 = "URL einfügen: [url]http://URL[/url] oder [url=http://url]URL Text[/url]";
    help_13 = "Bild einfügen: [img]http://URL_des_Bildes[/img]";
    help_14 = "Schriftfarbe: [color=red]Text[/color] Tipp: Ebenfalls verwendbar: color=#FF0000";
    help_15 = "Schriftgröße: [size=x-small]Kleiner Text[/size]";
    
    // Startup variables
    var imageTag = false;
    var listTag = false;
    var sel_text = false;
    
    // Check for Browser & Platform for PC & IE specific bits
    var clientPC = navigator.userAgent.toLowerCase(); // Get client info
    var clientVer = parseInt(navigator.appVersion); // Get browser version
    
    var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
    var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                    && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                    && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
    var is_moz = 0;
    
    var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
    var is_mac = (clientPC.indexOf("mac")!=-1);
    
    tc_open = new Array('','[b]','[i]','[u]','[left]','[center]','[right]','[list]','[list=]','[*]','[quote]','[code]','[url]','[img]','[color=','[size=');
    tc_close = new Array('','[/b]','[/i]','[/u]','[/left]','[/center]','[/right]','[/list]','[/list]','','[/quote]','[/code]','[/url]','[/img]','[/color]','[/size]');
    tc_active = new Array();
    
    // Replacement for arrayname.length property
    function getarraysize(thearray)
    {
        for (i = 0; i < thearray.length; i++)
        {
            if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
                return i;
        }
        return thearray.length;
    }
    
    // Replacement for arrayname.push(value) not implemented in IE until version 5.5
    // Appends element to the array
    function arraypush(thearray,value)
    {
        thearray[ getarraysize(thearray) ] = value;
    }
    
    
    // Replacement for arrayname.pop() not implemented in IE until version 5.5
    // Removes and returns the last element of an array
    function arraypop(thearray)
    {
        thearraysize = getarraysize(thearray);
        retval = thearray[thearraysize - 1];
        delete thearray[thearraysize - 1];
        return retval;
    }
    
    // Shows the help messages in the helpline window
    function helpline(help_num)
    {
        document.posting.helpbox.value = eval( "help_" + help_num );
    }

	function add_textcode(tc_num)
	{
		var textarea = document.posting.posting_text;

		textarea.focus();
		donotinsert = false;
		sel_text = false;
		tc_last = 0;
		
		if( tc_num == 0 )
		{
			while( tc_active[0] )
			{
				src_num = arraypop(tc_active);
				textarea.value += tc_close[src_num];
				if( src_num == 7 || src_num == 8 )
				{
					document.posting.addtextcode7.src = './template/images/forum_posting_list.gif';
					document.posting.addtextcode8.src = './template/images/forum_posting_lista.gif';
					document.posting.addtextcode9.src = './template/images/forum_posting_listdot0.gif';
				}
				else
				{
					img_src = eval('document.posting.addtextcode' + src_num + '.src');
					eval('document.posting.addtextcode' + src_num + '.src ="' + img_src.substr(0,(img_src.length-5)) + '.gif"');
				}
			}
			imageTag = false;
			listTag = false;
			textarea.focus();
			return;
		}

		if( (clientVer >= 4) && is_ie && is_win )
		{
			sel_text = document.selection.createRange().text;
			if( sel_text )
			{
				if( (tc_num == 14) || (tc_num == 15) )
				{
					document.selection.createRange().text = tc_open[tc_num] + eval('document.posting.addtextcode' + tc_num + '_value.value') + ']' + sel_text + tc_close[tc_num];
				}
				else if( tc_num != 9 )
				{
					document.selection.createRange().text = tc_open[tc_num] + sel_text + tc_close[tc_num];
				}
				else if( listTag == true )
				{
					document.selection.createRange().text = tc_open[tc_num] + sel_text + tc_close[tc_num];
				}
				textarea.focus();
				sel_text = '';
				return;
			}
		}
		else if( textarea.selectionEnd && (textarea.selectionEnd - textarea.selectionStart > 0) )
		{
			selLength = textarea.textLength;
			selStart = textarea.selectionStart;
			selEnd = textarea.selectionEnd;
			if( selEnd == 1 || selEnd == 2 ) selEnd = selLength;

			s1 = (textarea.value).substring(0,selStart);
			s2 = (textarea.value).substring(selStart, selEnd)
			s3 = (textarea.value).substring(selEnd, selLength);
			textarea.value = s1 + tc_open[tc_num] + s2 + tc_close[tc_num] + s3;
			if( (tc_num == 14) || (tc_num == 15) )
			{
				textarea.value = s1 + tc_open[tc_num] + eval('document.posting.addtextcode' + tc_num + '_value.value') + ']' + s2 + tc_close[tc_num] + s3;
			}
			else if( tc_num != 9 )
			{
				textarea.value = s1 + tc_open[tc_num] + s2 + tc_close[tc_num] + s3;
			}
			else if( listTag == true )
			{
				textarea.value = s1 + tc_open[tc_num] + s2 + tc_close[tc_num] + s3;
			}
			return;
		}

		
		donotinsert = false;
		for( i = 0; i < tc_active.length; i++)
		{
			if( (tc_active[i] == tc_num) || ( (tc_num == 7 || tc_num == 8) && (tc_active[i] == 7 || tc_active[i] == 8) ) )
			{
				tc_last = i;
				donotinsert = true;
			}
		}

		if(donotinsert)
		{
			while(tc_active[tc_last])
			{
				src_num = arraypop(tc_active);
				textarea.value += tc_close[src_num];
				if( src_num == 7 || src_num == 8 )
				{
					document.posting.addtextcode7.src = './template/images/forum_posting_list.gif';
					document.posting.addtextcode8.src = './template/images/forum_posting_lista.gif';
					document.posting.addtextcode9.src = './template/images/forum_posting_listdot0.gif';
					listTag = false;
				}
				else
				{
					img_src = eval('document.posting.addtextcode' + src_num + '.src');
					eval('document.posting.addtextcode' + src_num + '.src ="' + img_src.substr(0,(img_src.length-5)) + '.gif"');
				}
				imageTag = false;
			}
			textarea.focus();
			return;
		}
		else
		{
			if( imageTag && (tc_num != 13) )
			{
				textarea.value += tc_close[13];
				lastValue = arraypop(tc_active);
				document.posting.addtextcode13.src = './template/images/forum_posting_img.gif';
				imageTag = false;
			}

			if( tc_num != 9 ) textarea.value += tc_open[tc_num];
			
			if( (tc_num == 14) || (tc_num == 15) )
			{
				textarea.value += eval('document.posting.addtextcode' + tc_num + '_value.value') + ']'
			}
			
			if( (tc_num == 7) || (tc_num == 8) )
			{
				document.posting.addtextcode7.src = './template/images/forum_posting_list0.gif';
				document.posting.addtextcode8.src = './template/images/forum_posting_lista0.gif';
				document.posting.addtextcode9.src = './template/images/forum_posting_listdot.gif';
				arraypush( tc_active, tc_num );
				listTag = true;
			}
			else if( tc_num != 9 )
			{
				img_src = eval('document.posting.addtextcode' + tc_num + '.src');
				eval('document.posting.addtextcode'+tc_num+'.src = "' + img_src.substr(0,(img_src.length-4)) + '0.gif"');
				arraypush( tc_active, tc_num );
			}
			else if( listTag == true )
			{
				textarea.value += tc_open[tc_num];
			}
			
			if( (tc_num == 13) && (imageTag == false) ) imageTag = true;
			textarea.focus();
			return;
		}
	}
	
function checkForm()
{
	formErrors = false;

	if( document.posting.posting_text.value.length < 2 )
	{
		formErrors = "Du musst zu deinem Beitrag einen Text eingeben.";
	}

	if( formErrors )
	{
		alert( formErrors );
		return false;
	}
	else
	{
		bbstyle(0);
		//formObj.preview.disabled = true;
		//formObj.submit.disabled = true;
		return true;
	}
}
	
/*

function emoticon(text) {
	var txtarea = document.post.message;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}

*/function getPageSize(){var xScroll, yScroll;if (window.innerHeight && window.scrollMaxY) {	xScroll = window.innerWidth + window.scrollMaxX;yScroll = window.innerHeight + window.scrollMaxY;} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer MacxScroll = document.body.scrollWidth;yScroll = document.body.scrollHeight;} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and SafarixScroll = document.body.offsetWidth;yScroll = document.body.offsetHeight;}var windowWidth, windowHeight;if (self.innerHeight) {	// all except Explorerif(document.documentElement.clientWidth){windowWidth = document.documentElement.clientWidth; } else {windowWidth = self.innerWidth;}windowHeight = self.innerHeight;} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict ModewindowWidth = document.documentElement.clientWidth;windowHeight = document.documentElement.clientHeight;} else if (document.body) { // other ExplorerswindowWidth = document.body.clientWidth;windowHeight = document.body.clientHeight;}	// for small pages with total height less then height of the viewportif(yScroll < windowHeight){pageHeight = windowHeight;} else { pageHeight = yScroll;}// for small pages with total width less then width of the viewportif(xScroll < windowWidth){	pageWidth = windowWidth;		} else {pageWidth = xScroll;}return [pageWidth,pageHeight];}