<!--
// -----------------------------------------------------------------------------
//
// Globals
//
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
//
// -----------------------------------------------------------------------------
//
// Variables
//
var fW = "980";
var fH = "800";
var fW_num = 980;
var fH_num = 800;
var eW = "100%";
var eH = "100%";
var bkgColor = "FFFFFF";
var shackDir = "nickshack/"
//
// 2009/01/07 Banner 3 was replaced by Banner2 being 600px high
var banner2 = {w:120, h:600};
//
var scrollbar_w = 19;
//
// -----------------------------------------------------------------------------
//
// Functions
//
function setAsHomePage() {
  // To do.
}
// --------------------------------------------------
// Replace Content (to do with Flash detection)
// --------------------------------------------------
function replaceContent(swf) {
  var replaceContentWith = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
  + 'width="'+ eW +'" height="'+ eH +'"'
  + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
  + '<param name="movie" value="'+ shackDir +'flash/'+ swf +'" />'
  + '<param name="quality" value="high" /><param name="bgcolor" value="#'+ bkgColor +'" />'
  + '<embed src="'+ shackDir +'flash/'+ swf +'" quality="high" bgcolor="#'+ bkgColor +'" '
  + 'width="'+ eW +'" height="'+ eH +'" name="downloadCancelled" align="middle"'
  + 'play="true"'
  + 'loop="false"'
  + 'quality="high"'
  + 'allowScriptAccess="sameDomain"'
  + 'type="application/x-shockwave-flash"'
  + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
  + '<\/embed>'
  + '<\/object>';
  document.getElementById("playerProductInstall").innerHTML = replaceContentWith;
}
// ------------------------
// Resize Stuff
// ------------------------
function onLoadFlashContainer() {
  document.getElementById("flashcontainer").style.width = "100%";
  document.getElementById("flashcontainer").style.height = "100%";
  onResizeFunction();
}
//
function getWinSize() {
  var winH, winW, temp;
  if (parseInt(navigator.appVersion)>3) {
    if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth;
      winH = document.body.offsetHeight;
    } else {
      winW = window.innerWidth;
      winH = window.innerHeight;
    }
  }
  return {h: winH, w: winW};
}
//
function onResizeFlashContainer() {
  var winSize = getWinSize();
  var w = winSize.w < fW_num? fW_num : "100%";
  var h = winSize.h < fH_num? fH_num : "100%";
  if (navigator.appName.indexOf("Microsoft") != -1) document.body.overflow = (w > fW_num) ? "auto" : "scroll";
  document.getElementById("flashcontainer").style.width = (w != "100%") ? w+"px" : w;
  document.getElementById("flashcontainer").style.height = (h != "100%") ? h+"px" : h;
}
//
function onResizeBanners() {
  var path_banner1 = document.getElementById("banner1");
  var path_banner2 = document.getElementById("banner2");
  //
  var winSize = getWinSize();
  //alert( winSize.w + '|' + winSize.h );
  var w = winSize.w < fW_num? fW_num : winSize.w;
  var h = winSize.h < fH_num? fH_num : winSize.h;
  //
  var scrollbar_hoz = (w == fW_num) ? true : false;
  var scrollbar_vert = (h == fH_num) ? true : false;
  //
  //alert(navigator.appName.indexOf("Microsoft"));
  if (navigator.appName.indexOf("Microsoft") == -1) {
    //pj 2009/01 removed: path_banner1.style.position = "fixed";
    //bb 2009/01 changed: path_banner2.style.position = "fixed";
    path_banner2.style.position = "absolute"; 
    if(path_banner2.offsetLeft  < 860){
      path_banner2.style.left = 860+'px';
    } else {
      path_banner2.style.left = 'auto';
    }
  }
  //pj 2009/01 removed: path_banner2.style.top = Math.floor(h / 2)+"px";
}
//
function onResizeFunction() {
  onResizeFlashContainer();
  onResizeBanners();
}
//
function turnBanners(what) {
  var banners = [];
  banners.push(document.getElementById("banner1"));
  banners.push(document.getElementById("banner2"));
  //
  for (var b = 0; b < banners.length; b++) {
    banners[b].style.visibility = (what == "on") ? "visible" : "hidden";
  }
  //
  delete b;
  delete banners;
}
//
var elbanner1, elbanner2;
var yBanner1, yBanner2;
//
function shackScroll() {
  var yOffset;
  yOffset = window.scrollY ;
  //elbanner1.style.top= -yOffset+"px";
  //elbanner2.style.top= (yBanner2-yOffset)+"px";
}
function shackLoad(){
  //window.onscroll = scroll;
  //
  var d = document;
  var id = "banner1";
  elbanner1 = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  var id = "banner2";
  elbanner2 = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  //
  yBanner2 = getPixelTop(elbanner2);
}
//
function getPixelTop(el){
  sty = window.getComputedStyle(el, "");
  str = new String (sty.top)
  str = str.substr(0,str.length-2);
  return Number(str);
}
// -----------------------------------------------------------------------------
// -->