function imgOn(imageName,path)
{
  imageOn = new Image;
  imageOn.src = "main/" + path + "/" + imageName + "_on.gif";
  document.images[imageName].src = imageOn.src;
  return true;
}

function imgOff(imageName,path)
{
  imageOff = new Image;
  imageOff.src = "main/" + path + "/" + imageName + "_off.gif";
  document.images[imageName].src = imageOff.src;
  return true;
}

function confirmDelete(message, target)
{
  check = confirm(message);
  if(check == true)
  {
    self.location.href = target;
  }
}

/*
function preload()
{
  if (document.images)
  {
    if (!document.picture) document.picture = new Array();
    var i,j = document.picture.length, a = preload.arguments;
    for (i=0; i<a.length; i++)
    if (a[i].indexOf("#") != 0)
    {
      document.picture[j] = new Image;
      document.picture[j++].src = a[i];
    }
  }
}
*/

function put_footbag()
{document.editor.content.value = document.editor.content.value + '<span class="textitalic">footbag.ch</span>';}

function put_italic()
{document.editor.content.value = document.editor.content.value + '<i></i>';}

function put_bold()
{document.editor.content.value = document.editor.content.value + '<b></b>';}

function put_preformatted()
{document.editor.content.value = document.editor.content.value + '<pre></pre>';}

function put_break()
{document.editor.content.value = document.editor.content.value + '<br>\n';}

function put_link_intern()
{document.editor.content.value = document.editor.content.value + '<a href=""></a>';}

function put_link_extern()
{document.editor.content.value = document.editor.content.value + '<a href="http://" target=_blank></a>';}

function put_image()
{document.editor.content.value = document.editor.content.value + '<center><img src="news/" border="1" class="bordercolor"></center>';}

function put_imageleft()
{document.editor.content.value = document.editor.content.value + '<img src="news/" border="1" class="imageleft">';}

function put_imageright()
{document.editor.content.value = document.editor.content.value + '<img src="news/" border="1" class="imageright">';}

function put_table()
{document.editor.content.value = document.editor.content.value + '\n<table border=0 cellspacing=0 cellpadding=0>\n  <tr>\n    <td></td>\n    <td></td>\n    <td></td>\n  </tr>\n</table>\n';}

function popUp(windowWidth, windowHeight)
{
  var top = (screen.availHeight-windowHeight)/2;
  var left = (screen.availWidth-windowWidth)/2;
  var viewerPage = "news_help.php";
  var windowName = "news_help";
  var parameters = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+windowWidth+",height="+windowHeight+",top="+top+",left="+left;
  window.open(viewerPage, windowName, parameters);
}

var copytoclip=1
function HighlightAll(theField)
{
  var tempval=eval("document."+theField)
  tempval.focus()
  tempval.select()
  if (document.all&&copytoclip==1)
  {
    therange=tempval.createTextRange()
    therange.execCommand("Copy")
    window.status="Contents copied to clipboard!"
    setTimeout("window.status=''",2000)
  }
}

function popUpWindow(page)
{
  var top = (screen.availHeight-windowHeight)/2;
  var left = (screen.availWidth-windowWidth)/2;
  var windowWidth = 400;
  var windowHeight = 400;
  var viewerPage = page;
  var windowName = "popUp";
  var parameters = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+windowWidth+",height="+windowHeight+",top="+top+",left="+left;
  window.open(viewerPage, windowName, parameters);
}

function confirmDelete(message, target)
{
  check = confirm(message);
  if(check == true)
  {
    document.location.href = target;
  }
  else
    return false;
}

