
document.write('<div id="notice"></div>');
var notice = null;

/*
*  Lehe kerimine
*/
function scrollPageNotice(top) {
	if (notice == null) return;
	
	var current_top = parseInt(notice.style.top);
	var speed = 6;
	var speed_half = parseInt(speed / 2);
			
	if (current_top < top - speed_half) current_top = current_top + speed;
	if (current_top > top + speed_half) current_top = current_top - speed;
	
	notice.style.top = current_top;
}

/*
*  Hiire liigutamine
*/
function mouseMoveNotice(x, y) {
	if (notice == null) return;
	
	if ((x > parseInt(notice.style.left)) && 
		(x < parseInt(notice.style.left) + parseInt(notice.style.width)) &&
		(y > parseInt(notice.style.top)) && 
		(y < parseInt(notice.style.top) + parseInt(notice.style.height))) {
		
		notice.style.visibility = "hidden";		
	} else {
		notice.style.visibility = "visible";		
	}
}

/*
*  Üldraamistik teatise kuvamiseks/varjamiseks
*/
function showNotice(content, width, height) {
	if (old) return;	
	
	notice = getObject("notice");
	
	writeObjectContent(notice, content);
			
	notice.style.left = 10;
	notice.style.top = 10;
	notice.style.width = width;
	notice.style.height = height;
	notice.style.visibility = "visible";
}


function hideNotice() {	
	if (old) return;	
		
	writeObjectContent(notice, "");	
	
	notice.style.visibility = "hidden";
	notice.style.width = 0;
	notice.style.height = 0;		
	notice.style.left = -1000;
	notice.style.top = -1000;
}

/*
*  Liigub kursoril eest ära ja tagasi
*/
function noticeMoveAway() {
	
	notice_prev_top = notice.style.top;
	notice_prev_left = notice.style.left;
	
	notice.style.top = 400;
}

function noticeMoveBack() {
	
	notice.style.top = notice_prev_top;
	notice.style.left = notice_prev_left;
}
