function alternateImageNews(){
	if((current_image+1)<images_list.length) current_image = current_image + 1;
	else current_image = 0;
	new Effect.BlindUp('Pub2',{ x: 0, y: -200, afterFinish: function(){
		new Effect.BlindDown('Pub2',{ beforeStart: function (){
			document.getElementById("Pub2").src = images_list[current_image][0];
			document.getElementById("Pub2").style.marginTop = images_list[current_image][1] + "px";
			document.getElementById("Pub2").style.marginLeft = images_list[current_image][2] + "px";
			document.getElementById("Pub2").onclick = function(){
				//overLayerImage(document.getElementById("Pub2").src);
			}
		}});
	}});
	document.getElementById("News").scrollTop += 206;
	setTimeout("alternateImageNews()",10000);
}
var max_image_height = 500;
function overLayerImage(src){
	if(src!='hide'){
		getPageSize();
		getPageScroll();
		var margin_top = arrayPageScroll[1]+5;
		var image_height = arrayPageSize[3]-10;
		if(image_height>max_image_height){
			margin_top += (image_height-max_image_height)/2;
			image_height = max_image_height;
		}
		if(src!='update' && src!='resize'){
			document.getElementById("OverLayerOpacity").style.height = arrayPageSize[1] + "px";
			document.getElementById("OverLayer").style.height = arrayPageSize[1] + "px";
			document.getElementById("OverLayer").innerHTML = '<img src="'+src+'" id="OverLayerImage" alt="" onclick="overLayerImage(\'hide\');" />';
			new Effect.Appear("OverLayerOpacity", { from: 0.0, to: 0.75, duration: 0.5} );
			new Effect.Appear("OverLayer", { from: 0.0, to: 1.0, duration: 2.5} );
			document.getElementById("OverLayerImage").style.height = image_height + "px";
			window.onscroll = function() { overLayerImage('update'); }
			window.onresize = function() { overLayerImage('resize'); }
		}
		if(src=='resize') document.getElementById("OverLayerImage").style.height = image_height + "px";
		document.getElementById("OverLayerImage").style.marginTop = margin_top + "px";
	}else{
		new Effect.Fade("OverLayerOpacity", { from: 0.75, to: 0.0, duration: 2.5} );
		new Effect.Fade("OverLayer", { from: 1.0, to: 0.0, duration: 1.5, 
			afterFinish: function(effect) {
				document.getElementById("OverLayer").innerHTML = '';
			}
		});
		window.onscroll = function() { }
		window.onresize = function() { }
	}
}

function getPageSize(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function getPageScroll(){
	var yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}