function klappe_news(id)
{
  var klappText = document.getElementById('k' + id);
  var klappBild = document.getElementById('pic' + id);

  if (klappText.style.display == 'none') {
    klappText.style.display = 'block';
    klappBild.src = 'pic/minus.gif';
  }
  else {
    klappText.style.display = 'none';
    klappBild.src = 'pic/plus.gif';
  }
}

function Post()
{
document.compose.action = "?action=post"
document.compose.target = "";
document.compose.submit();
return true;
}

function Preview()
{
document.compose.action = "?action=preview"
document.compose.target = "";
document.compose.submit();
return true;
}

function closeit(box)
{
  document.getElementById(box).style.display="none";
}

function showit(box)
{
  document.getElementById(box).style.display="block";
}

function log_out()
{
    ht = document.getElementsByTagName("html");
    ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
    if (confirm(l_logout))
    {
        return true;
    }
    else
    {
        ht[0].style.filter = "";
        return false;
    }
}
var l_logout="Are you sure, you want to logout?";

function are_you_sure(text) 
{
    if (confirm(text))
    {
        return true;
    }
    else
    {
        return false;
    }
}


var checkflag = "false";
function check(field) {
  if (checkflag == "false") {
    for (i = 0; i < field.length; i++) {
      field[i].checked = true;
    }
    checkflag = "true";
    return "Uncheck All";
  } else {
    for (i = 0; i < field.length; i++) {
      field[i].checked = false;
    }
    checkflag = "false";
    return "Check All";
  }
}

function SmileIT(smile,form,text){
  document.forms[form].elements[text].value = document.forms[form].elements[text].value+" "+smile+" ";
  document.forms[form].elements[text].focus();
}
function PopMoreSmiles(form,name) {
  link='moresmiles.php?form='+form+'&text='+name
  newWin=window.open(link,'moresmile','height=500,width=450,resizable=no,scrollbars=yes');
  if (window.focus) {
    newWin.focus()
  }
}

function PopCustomSmiles(form,name) {
  link='moresmilies_custom.php?form='+form+'&text='+name
  newWin=window.open(link,'moresmile','height=600,width=400,resizable=yes,scrollbars=yes');
  if (window.focus) {
    newWin.focus()
  }
}

function mySubmit() {
  setTimeout('document.shbox.reset()',100);
}

function refrClock(){
  var d=new Date();
  var s=d.getSeconds();
  var m=d.getMinutes();
  var h=d.getHours();
  var day=d.getDay();
  var date=d.getDate();
  var month=d.getMonth();
  var year=d.getFullYear();
  var am_pm;
  if (s<10) {s="0" + s}
  if (m<10) {m="0" + m}
  if (h>12) {h-=12;am_pm = "PM"}
  else {am_pm="AM"}
  if (h<10) {h="0" + h}
  document.getElementById("clock").innerHTML=h + ":" + m + ":" + s + " " + am_pm;
//  setTimeout("refrClock()",1000);
}

