
function addSmiley(text)
{if(document.set_post.text.createTextRange&&document.set_post.text.caretPos){var caretPos=document.set_post.text.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?text+' ':text;}
else document.set_post.text.value+=text;document.set_post.text.focus(caretPos)}
function hex(i)
{if(i<0)
return"00";else if(i>255)
return"ff";else
return""+hexArray[Math.floor(i/16)]+hexArray[i%16];}
function createColorTable(array,max_r,max_g,max_b,min_r,min_g,min_b)
{for(i=0;i<array.length;++i)
{var r=Math.floor(max_r*((step-i)/step)+min_r*(i/step));var g=Math.floor(max_g*((step-i)/step)+min_g*(i/step));var b=Math.floor(max_b*((step-i)/step)+min_b*(i/step));array[i]="#"+hex(r)+hex(g)+hex(b);}}
function fade(elementNr,faktor,colortable)
{var e=fadeArray[elementNr];if(e.typ&1)
e.element.style.backgroundColor=""+colortables[colortable][Math.round(e.i)];if((e.typ&1)&&(e.element.style.backgroundColor==""))
e.element.style.background=""+colortables[colortable][Math.round(e.i)];if(e.typ&2)
e.element.style.color=""+colortables[colortable][Math.round(e.i)];if((!e.direction&&e.i>0)||(e.direction&&e.i<step-1))
{if(e.direction)
e.i+=faktor;else
e.i-=faktor;if(e.i<0){e.i=0;}
else if(e.i>step-1){e.i=step-1;}
setTimeout("fade("+elementNr+","+faktor+", "+colortable+");",step);}}
function Objekt()
{this.element=0;this.i=0;this.direction=0;this.typ=1;}
function fadein(nr,element,faktor,fadetyp,colortable)
{var e=fadeArray[nr];if(e.element==0)
e.element=element;e.direction=1;e.typ=fadetyp;fade(nr,faktor,colortable);}
function fadeout(nr,faktor,colortable)
{fadeArray[nr].direction=0;fade(nr,faktor,colortable);}