window.onload = function() {
	if (document.getElementById("newsScroller")) {
		boxes = 0;
		boxes_array = document.getElementById("newsScroller").getElementsByTagName("div");
		for (var i = 0; i <  boxes_array.length; i++) {
			var tag = boxes_array[i];
			if (tag.className == "itemNews") boxes++;
		}
		startTop = parseInt(getStyle("newsScroller","height"));
		curTop = startTop;
		startId = 0;
		nextId = startId;
		delay = 6000;
		slideNews();
	}
	
	if (document.getElementById("Map")) {
		var tags = document.getElementById("Map").getElementsByTagName("area");
		for (var i = 0; i <  tags.length; i++) {
			var tag = tags[i];
			tag.onmouseover = function() {
				thisId = this.id;
				var coords = document.getElementById(thisId).coords;
				var alt = document.getElementById(thisId).alt;
				var coordsArray = coords.split(",");
				var leftC = parseInt(coordsArray[0]);
				var topC = parseInt(coordsArray[1]);
				//alert(leftC);
				document.getElementById("map_tag").innerHTML = alt;
				document.getElementById("map_tag").style.left = leftC + 15 + "px";
				document.getElementById("map_tag").style.top = topC + "px";
				document.getElementById("map_tag").style.display = "block";
			}
			tag.onmouseout = function() {
				thisId = this.id;
				document.getElementById("map_tag").style.display = "none";
			}
		}
	}
	
}

function formcheck() {
	value = document.app.page.value;
	if (value == "") {
		return false;	
	}
}

function slideNews() {
	nextId++;
	if (nextId > boxes) {
		nextId = 1;	
	}
	for (n = 1; n <=boxes; n++) {
		d = document.getElementById("news_" + n);
		if (d) {
			d.style.display = "none";
		}
	}
	d = document.getElementById("news_" + nextId);
	if (d) {
		d.style.top = startTop + "px";
		d.style.display = "block";
	}
	slideBox();
}
function slideBox() {
	curTop = curTop-5;
	if (d) {
		d.style.top = curTop + "px";
		slideTimer = setTimeout("slideBox()", 10);
	}
	if (curTop == 0) {
		clearTimeout(slideTimer);
		curTop = startTop;
		setTimeout("slideNews()", delay);
	}
}
function getStyle(el,styleProp) {
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}