// JavaScript Document
 var milisec=0 
 var seconds=5
 var konec=0
 var start=0

function countDown(){ 
start = 1;
 if (milisec<=0){ 
    milisec=9 
    seconds-=1 
 } 
 if (seconds<=-1){ 
    milisec=0 
    seconds+=1 
 } 
 else 
    milisec-=1 
	document.getElementById('countDownDiv').innerHTML = seconds+"."+milisec;
	if(seconds == 0 && milisec == 0 ){
			hideLightBox('light');
			seconds = 5;			
			konec = 0;
			start = 0;
	}
	else
    	setTimeout("countDown()",100) 
}

function setLightBoxHeight(divN){
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  
document.getElementById('fade').style.height = myHeight + getScrollXY();
document.getElementById(divN).style.top = (50 + getScrollXY())+"px";
} 

function getScrollXY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}

function showLightBox(divName){
	setLightBoxHeight(divName);
	document.getElementById(divName).style.display='block';
	document.getElementById('fade').style.display='block';
}

function hideLightBox(divName){
	document.getElementById(divName).style.display='none';
	document.getElementById('fade').style.display='none'
}
var isIE = document.all ? true : false;
document.onmousemove = getMousePosition;

function getMousePosition(e) {
	var _x;
	var _y;
	if (!isIE) {
		_x = e.pageX;
		_y = e.pageY;
	}
	if (isIE) {
		_x = event.clientX + document.body.scrollLeft;
		_y = event.clientY + document.body.scrollTop;
	}
	posX = _x;
	posY = _y;
	
	/*
	if(posY < (5+getScrollXY()) && posX < 500){
		showLightBox('light');
		if(start == 0)
			countDown();
	}*/
	return true;
}