﻿//Newsticker
var pos, timer;

function newsticker() {
	pos = 680;
	moveNewsticker();
}

function moveNewsticker() {
	timer = 0;
	timer = setTimeout("moveNewsticker()",10);
	var obj = document.getElementById("newstext");
	obj.style.left = pos+'px';
	pos--;
	var w = obj.offsetWidth;
	if(pos == (w*-1)){
		pos = 680;
	}
}

function stopNewsticker() {
	clearTimeout(timer);
}

window.onload = newsticker;

function openPopup() {
	var w = pic.width;
	var h = pic.height;
	var t = (screen.height/2)-(h/2);
	var l = (screen.width/2)-(w/2);
	var bp = document.getElementById('bp');
	bp.style.width = w;
	bp.style.height = h;
	var popup =	document.getElementById('popup');
	popup.style.display = "block";
	popup.style.position = "absolute";
	popup.style.left = (l<0) ? '0px' : l+'px';
	popup.style.top = (t<0) ? '0px' : (t-10)+'px';
	popup.style.width = w;
	popup.style.height = (h+20);
	popup.style.zIndex = "99";
	popup.style.border = "2px solid #FF7100";
	return false;
}

function closePopup() {
	document.getElementById('popup').style.display = "none";
}