var i_news = 0;
var helpcontent      = "";

function deleteContent()
{
  document.getElementById("contactform").test2.value = "";
  this.value = "";
  alert("test");
}

function showCustomer()
{
  document.getElementById("BoxHeader").innerHTML = '<a href="../customer/index.html">' + header_customer + '</a>';
  document.writeln('<a href="../customer/index.html">');
  document.writeln('<img src="../../images/customer/customer.gif" border="0">');
  document.writeln('</a>');
}


function showTesten()
{
  if (i_news > 1) i_news = 0;
  document.getElementById("NewsHeader").innerHTML             = news[i_news].header;
  document.getElementById("NewsHeader").style.backgroundColor = news[i_news].bgcolor;
  document.getElementById("NewsHeader").style.color           = "#FFFFFF";
  document.getElementById("NewsText").innerHTML               = news[i_news].link + news[0].text + "<br>" + news[i_news].image + "<br>" + news[1].text + "</a>";
//  document.getElementById("NewsText").style.backgroundImage   = news[i_news].image;
  i_news = i_news + 1;
  window.setTimeout("showTesten()",4000);
}

function showHelpTopic()
{
  helpwindow.helpcontent.location.href = helpcontent;
}

function openHelp(product,topic)
{
  if (!product) product = "nf";
  helpwindow = window.open('../' + product + '_help/index.html','dialog','status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=720,height=600');
  helpwindow.focus();
  if (!topic) topic = "introduction";
  helpcontent = '../' + product + '_help/' + topic + '.html';
  window.setTimeout("showHelpTopic()",500);
}


function showNcDemo(filename,folder)
{
  if (!folder) folder = "";
  window.open(folder + '../demo/' + filename,'demo','menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=820,height=620,left=0,top=0')
}


function cookie_write(sName,sValue,nValid)
{
  if (!nValid) nValid = 1000*60*60*24*365;
  var jetzt           = new Date();
  var expire          = new Date(jetzt.getTime() + nValid);
  document.cookie     = sName + "=" + sValue + ";" + " expires=" + expire.toGMTString() + ";";
}


function cookie_read(sName)
{
  var start  = 0;
  var end    = 0;
  var search = sName + "=";
  var cookie = "error";
  if (document.cookie) 
  {
    start = document.cookie.indexOf(search)
    if (start != -1)
    {
      start += search.length;
      end    = document.cookie.indexOf(";",start);
      if (end == -1) end = document.cookie.length;
      cookie = document.cookie.substring(start,end)
    }
  }
  return cookie;
}

function showInMainWindow(urlInMainWindow)
{
  urlInMainWindow = "http://www.utomi.com/" + urlInMainWindow;
  if (!top.opener)
  {
    window.open(urlInMainWindow,'utomi','menubar=yes,resizable=yes,scrollbars=yes,status=yes,location=yes,width=800,height=700,left=100,top=100')
  }
  else
  {
    top.opener.location.href = urlInMainWindow;
    top.opener.focus();
  }
}

function writeWerbung()
{
  document.getElementById(sElement).innerHTML = sWerbung.substr(0,iCounter);
  if (iCounter == sWerbung.length)
  {
    iCounter = 0;
    window.setTimeout("writeWerbung()",iWait*30);
  }
  else
  {
    iCounter++;
    window.setTimeout("writeWerbung()",iWait);
  }
}