<!--

var oldimg = false;
var pagetitle = null;

function rel() {
	location.reload();
}

function calcHeight() {
  //find the height of the internal page
  var the_height=document.getElementById('forumframe').contentWindow.document.body.scrollHeight;
  //var the_height = '100%';

  //change the height of the iframe
  document.getElementById('forumframe').height=the_height;
      
  if (navigator.appName=="Netscape") {
  	var fhoehe=self.innerHeight;
  	var choehe = fhoehe - 148;
	var middleheight=the_height + 130;
	  document.getElementById("rightcontent").style.height = middleheight+"px";
	  document.getElementById("bg_forum").height = middleheight;
	  if (document.getElementById("bg_forum").height <= choehe) {
	  	document.getElementById("rightcontent").style.height = choehe+"px";
	  }
  }
  
}


function centerwindow(file,winname,fwidth,fheight,scrolling,resizeable){
  var win = null;
  var winl = (screen.width-fwidth)/2;
  var wint = (screen.height-fheight)/2;
  var settings  ='height='+fheight+',';
      settings +='width='+fwidth+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scrolling+',';
      settings +='resizable='+resizeable+'';
  win=window.open(file,winname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function showimg(was) {
	if ( oldimg ) document.getElementById(oldimg).style.visibility='hidden';
	if ( was ) document.getElementById(was).style.visibility='visible';
	oldimg = was;
}

function ie_png (what) {
	if (/MSIE [56].*Windows/.test(navigator.userAgent)) {
		// fucked-up browser (Internet Explorer for Windows)
		var blank = new Image;
		blank.src = '../images/blank.gif';
		var img = what;
		var src = img.src;
		if (!/\.png$/.test(src))
			return (false);
		var s = img.runtimeStyle;
		s.width = img.offsetWidth + "px";
		s.height = img.offsetHeight + "px";
		s.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
		img.src = blank.src;
	}
}

var bilder=new Array('../images/startseite1.jpg',
           '../images/startseite2.jpg'
           );

var intervall=4000;
var bildzaehler=0;

function switchopener () {
	if (!(document.images)) {return;}
	 document.openerimage.src=bilder[bildzaehler];
	 bildzaehler++;
	 if (bildzaehler == bilder.length) { bildzaehler = 0; }
	 setTimeout("switchopener();",intervall);
}

var bannerintervall=2500;
var swapbanner0=1;
var swapbanner1=false;

function switchbanner() {
	if ( swapbanner0 != false ) {
		document.getElementById('swapbanner0_'+swapbanner0).style.display='none';
		if ( swapbanner0 == 1 ) swapbanner0=2; else swapbanner0=1;
		document.getElementById('swapbanner0_'+swapbanner0).style.display='block';
	}
	if ( swapbanner1 != false ) {
	    document.getElementById('swapbanner1_'+swapbanner1).style.display='none';
		if ( swapbanner1 == 1 ) swapbanner1=2; else swapbanner1=1;
		document.getElementById('swapbanner1_'+swapbanner1).style.display='block';
	}
	setTimeout("switchbanner();",bannerintervall);
}

function hidebody () {
	pagetitle = document.title;
	document.title = document.title+' - This site is currently loading... Please wait...';
}

function showbody () {
	document.body.style.visibility='visible';
	document.title = pagetitle;
}

function daysuntil() {
	var date1 = new Date();
	var date2 = new Date(2009,3,30, date1.getHours(), date1.getMinutes(), date1.getSeconds());
	// The number of milliseconds in one day
    var ONE_DAY = 1000 * 60 * 60 * 24

    // Convert both dates to milliseconds
    var date1_ms = date1.getTime()
    var date2_ms = date2.getTime()

    // Calculate the difference in milliseconds
    var difference_ms = Math.abs(date1_ms - date2_ms)
    
    // Convert back to days and return
    return Math.round(difference_ms/ONE_DAY)
}

function attachFields() {
	for ( j = 0; j < document.forms.length; j++ ) {
		if ( document.forms[j].name != 'link' ) {
			areas = document.forms[j].elements;
			for ( i = 0; i < areas.length; i++ ) {
				if ( areas[i].type=='textarea' ) {
					areas[i].onselect = function () { storeCaret(this) };
					areas[i].onclick = function () { storeCaret(this) };
					areas[i].onkeyup = function () { storeCaret(this) };
				}
			}
		}
	}
}

function storeCaret (textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
     
function insertAtCaret (where, text) {
	textEl = document.getElementById(where);
	if ( typeof(textEl.caretPos) != "undefined" ) {
		if (textEl.createTextRange && textEl.caretPos) {
			var caretPos = textEl.caretPos;
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		}
	} else if ( textEl.selectionStart || textEl.selectionStart==0 ) {
		textEl.value =
		textEl.value.substring(0, textEl.selectionStart) +
		text +
		textEl.value.substring(textEl.selectionStart, textEl.value.length);
		textEl.focus();
	}  else textEl.value  += text;
	textEl.focus();
	return (false);
}
-->
