//GreyBox configuration
//Use animation?
var GB_ANIMATION = true;
var GB_IMG_DIR = "img/";

//Clicking on the transparent overlay closes the GreyBox window?
var GB_overlay_click_close = false;

//Demo change headline - look more in demoiframe
//$ function is like getElementById
function changeHeadline(text){
	AJS.getElement('headline').innerHTML = text;
}

function GetWebPage(channel, id) {
	var pars = 'channel=' + channel + '&id=' + id;
	var url = 'newsview.php';
	var AjaxNews = new Ajax.Updater( 
						'mainnews', url, 
						{ 
							method: 'post', 
							parameters: pars, 
							onLoading: ShowLoading, 
							onComplete: NewsOut 
						}			);
	
}

function NewsOut() {
	Element.hide('loading');
	Element.show('spacer');
	new Effect.Highlight('mainnews');

}


function GetMarquee(channel, type) {
	var url = 'marqueeview.php';
	var pars = 'channel=' + channel + '&type=' + type;
	var AjaxMarquee = new Ajax.Updater( 
						'marquee', url, 
						{ 
							method: 'post', 
							parameters: pars, 
							onLoading: ShowLoading, 
							onComplete: MarqueeOut 
						}				);
}

function ShowLoading () {
	Element.hide('spacer');
	Element.show('loading');
}

function MarqueeOut () {
	Element.hide('loading');
	Element.show('spacer');
	document.all.newsMarquee.direction='right';
	document.all.newsMarquee.scrollAmount=5;	
}

function OpenPrintWindow(page) {
	newwindow=window.open(page,'name','height=500,width=600,scrollbars=yes,status=no,menubar=no,screenX=100,resizable=yes,screenY=100');
	if (window.focus) {newwindow.focus()}
}
