﻿var ow;
var pr;
var t1;
var t2;
var x = 1;

function ctrPg()
{
  // Firefox, Opera, NN
  if (window.innerWidth > 800)
  {
    ow = parseInt((window.innerWidth-800)/2,10);
    pr = parseInt((window.innerWidth-320)/2,10);
  }
  // IE6+
  else
  {
    if (document.body.clientWidth > 800)
    {
      ow = parseInt((document.body.clientWidth-800)/2,10);
      pr = parseInt((document.body.clientWidth-320)/2,10);
    }
  }
  document.getElementById("main").style.left = ow + "px";
  document.getElementById("prtInstr").style.left = pr + "px";
  document.getElementById("prtNote").style.left = pr + "px";
  document.getElementById("inp1").style.left = (ow + 226) + "px";
}

function init()
{
  ctrPg();
  ti1 = setTimeout("note()",3000);
  ti2 = setTimeout("note()",8000);
  
}

function prtPrep()
{
  document.getElementById("main").style.left = 0;
  document.getElementById("inp1").style.left = 226 + "px";
  document.getElementById("prtInstr").style.display = "none";
}

function note()
{
  switch(x)
  {
    case 1:
      document.getElementById("prtNote").style.display = "block";
      break;
    case 2:
      document.getElementById("prtNote").style.display = "none";
  }
  x++;
}

function showPrt()
{
  document.getElementById("prtInstr").style.display = "block";
}

function closePrt(s)
{
  switch(s)
  {
    case "p":
      document.getElementById("main").style.left = 0;
      document.getElementById("inp1").style.left = 226 + "px";
      break;
    case "v":
      ctrPg();
      break;
  }
  document.getElementById("prtInstr").style.display = "none";
}

