function doresize () 
	{location.reload();return false;}
if(document.layers)window.captureEvents(Event.RESIZE); window.onresize=doresize;

var  js10 = (document.images)?false:true; // NN2.x
var  js11 = (document.images) && ((window.screen)?false:true); // NN3.x
var  ie = ((document.all) && (window.offscreenBuffering)) ? true : false; // IE >= 4.x
var  isNS = ((document.captureEvents) && (!document.getElementById)) ? true : false; // NN4.x
var  mz = ((document.getElementById) && (!document.all) && (document.documentElement)) ? true : false; // NN6/MZ
var  op = ((document.getElementById) && (navigator.userAgent.indexOf('Opera') != -1)) ?true : false;
var isMacIE = ( (navigator.userAgent.indexOf("IE 4") > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );

scrollStep=3

timerUp=""
timerDown=""

y=0; weiter=0;

function toTop(id){
document.getElementById(id).scrollTop=0
}

function scrollDivDown(id){
clearTimeout(timerDown) 
document.getElementById(id).scrollTop+=scrollStep
timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}

function scrollDivUp(id){
clearTimeout(timerUp)
document.getElementById(id).scrollTop-=scrollStep
timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

function toBottom(id){
document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight
}

function stopMe(){
clearTimeout(timerDown) 
clearTimeout(timerUp)
}

function initializeScrollbar() 
{
br=0;
	if (ie)        
	{
	br=2;
	schicht='document.all["';stil='"].style';
	}
	if (isNS)        	
	{
	schicht='document.layers.scrollWindowDiv.document.layers["';stil='"]';
	}
	if (mz)
	{
	schicht='document.getElementById("';stil='").style';
	}
	if(op) 
	{
	schicht='document.getElementById("';stil='").style';
	}
	/* elsewindow.location.href="controlling.html"; // nur NN und IE !!!*/
}

function moveIt(wen,wert) 
{
test=y;  // Hilfsvariable
y+=wert;
divHeight = document.getElementById('scrollContentDiv').offsetHeight;
ScrollLimit = divHeight-240;
if (y < -ScrollLimit || y > 1) 
	{
	y=test;
	eval(schicht+wen+stil+'.top="'+y+'"');
}
else 
	{
	eval(schicht+wen+stil+'.top="'+y+'"');
	}
}

function scrollen(wert) 
{
moveIt('scrollContentDiv',wert);
a=wert;
if ((weiter)&&(y<10)) setTimeout("scrollen(a)",1);
}

function gone()
{   
if(isNS)
	{   
	document.scrollWindowDiv.document.scrollContentDiv.moveTo(20,0); 
	y=0;
	}   
if(ie)   
	{   
	scrollContentDiv.style.pixelLeft=20;   
	scrollContentDiv.style.pixelTop=0;
	y=0;
	}   
if(mz)
	{   
	document.getElementById("scrollContentDiv").style.left="20px";    
	document.getElementById("scrollContentDiv").style.top="0px";
	y=0;
	}
if(op)
	{   
	scrollContentDiv.style.pixelLeft=20;   
	scrollContentDiv.style.pixelTop=0;
	y=0;
	}
}

function add_smiley(kind) {
	to = document.forms.inserttext.content;
	
	//IE
	if (document.selection) {
		 to.focus();
		 sel = document.selection.createRange();
		 sel.text = ':'+kind+':';
	}
	//MOZILLA/NETSCAPE
	else if (to.selectionStart || to.selectionStart == '0') {
		 var startPos = to.selectionStart;
		 var endPos = to.selectionEnd;
		 to.value = to.value.substring(0, startPos) + ':'+kind+':' + to.value.substring(endPos, to.value.length); // smiley-code: ":smiley:"
	} 
	else {
		 to.value += ':'+kind+':';
	}
	to.focus()
}

