var dom = (document.getElementById) ? true : false;
var moz = (dom && (navigator.appName=="Netscape")) ? true : false;

// Mozilla
function moveHintsN(e)
{
  xoff = window.pageXOffset + e.clientX + 10;
  document.getElementById('hints').style.left = xoff + "px";
  document.getElementById('hints').style.top = window.pageYOffset + e.clientY + 10 + "px";
  document.getElementById('hints').style.visibility = "visible";
}

function hideHintsN(e)
{
  document.onmousemove = null;
  document.onmouseout = null;
    document.getElementById('hints').style.visibility = "hidden";
}

// IE
function moveHints()
{
  if (moz) return;
    xoff = 0;
    yoff = 0;
  xoff += window.event.clientX + document.documentElement.scrollLeft + 10;
  yoff += window.event.clientY + document.documentElement.scrollTop + 10;
  document.getElementById('hints').style.left = xoff;
  document.getElementById('hints').style.top = yoff;
}

function hideHints()
{
  if (moz) return;
  document.getElementById('hints').style.visibility = "hidden";
}

function showHints(text)
{
  if (text == "") return;
  document.getElementById('hints').innerHTML = text;

  if (moz)
    { // for Mozilla
    document.onmousemove = moveHintsN;
    document.onmouseout = hideHintsN;
    return;
  }
    else
    { // for IE & Opera
    moveHints();
    document.getElementById('hints').style.visibility = "visible";
    }
}

function hide_id(nodeId)
{
    var node = document.getElementById(nodeId);
    if (node)
    {
        node.className=node.className.replace('showed', '');
        node.className += ' hidden';
    }
}

function show_id(nodeId)
{
    var node = document.getElementById(nodeId);
    if (node)
    {
        node.className=node.className.replace('hidden', '');
        node.className += ' showed';
    }
}

function setPrintCSS(isPrint) {
// By Akella cssing.org.ua
  if (document.getElementsByTagName)
      x = document.getElementsByTagName('link');
  else
  {
      return;
  }
  for (var i=0;i<x.length;i++) {
      if(x[i].title == 'printview'){x[i].disabled = !isPrint;}
      if(x[i].title == 'screenview'){x[i].disabled = isPrint;}
  }
}




// =====---- DEMO ----=====
var newwin;
function openVideo() {
  params = "toolbar=0,width=345,height=400,scrollbars=No";
  newwin = window.open("demo/video_demo.html","_blank",params);
  setTimeout('newwin.focus();',250);
}
function openVideo2(name)
    {
      params = "toolbar=0,width=450,height=380,scrollbars=no";
      url = "/video/" + name + ".html";
      newwin = window.open(url,"_blank",params);
      setTimeout('newwin.focus();',250);
    }
function openAudio() {
  params = "toolbar=0,width=345,height=140,scrollbars=No";
  newwin = window.open("demo/audio_demo.html","_blank",params);
  setTimeout('newwin.focus();',250);
}
function openCDDemo() {
  newwin = window.open("demo/cd_demo.html","_blank","toolbar=0,scrollbars=No,width=600,height=500");
  setTimeout('newwin.focus();',250);
}
