// VARIABLES

var heightNT;
var startNT = true;

// images preload
// mnu1_pre = new Image;     
// mnu1_pre.src ='/img/' + lang + '/mnu1_.gif'

function init() {
  if (home_page) jsNTInit();
}

// NEWS TICKER

function jsNTInit() {
  heightNT = layerGetContentHeight("ntContentDiv","ntWindowDiv");
  layerSetY("ntContentDiv",165,"ntWindowDiv");
  layerCaptureEvent("ntWindowDiv","mouseover","function test() { startNT = false; }")
  layerCaptureEvent("ntWindowDiv","mouseout","function test() { startNT = true; }")
  scrollNT();
}

function scrollNT() {
  if (startNT) {
    if (layerGetY("ntContentDiv","ntWindowDiv") > -heightNT) layerSetY("ntContentDiv",layerGetY("ntContentDiv","ntWindowDiv") - 3,"ntWindowDiv");
    else layerSetY("ntContentDiv",165,"ntWindowDiv");
  }
  setTimeout("scrollNT()", 100);
}

// Netscape resize bug fix

if (document.layers) {
  widthCheck = window.innerWidth
  heightCheck = window.innerHeight
  window.onResize = resizeFix
}

function resizeFix() {
  if (widthCheck != window.innerWidth || heightCheck != window.innerHeight) {
    document.location.href = document.location.href;
  }
}

// Image popup

function imagePopup(url) {
  var image_popup = window.open(url,"image_popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=550');
  image_popup.focus();
}
