function scrollUp(containerId) {
	var container = $(containerId);
	var offset = container.positionedOffset().top;
	var newOffset = offset-150;
	var parentHeight = container.ancestors()[0].getHeight();
	if( container.getHeight() < parentHeight ) {
		newOffset = 0;
	} else if( newOffset <  parentHeight -container.getHeight()) {
		newOffset = parentHeight -container.getHeight();
	} 
	newOffset = newOffset -offset;
	new Effect.Move(containerId, {y: newOffset, duration: 0.5});
	//container.style.top = newOffset+"px";
}

function scrollDown(containerId) {
	var container = $(containerId);
	var offset = container.positionedOffset().top;
	
	var newOffset = offset+150;
	if( newOffset > 0) {
		newOffset = 0;
	}
	newOffset = newOffset -offset;
	new Effect.Move(containerId, {y: newOffset, duration: 0.5});
	//container.style.top = newOffset+"px";
}

function loadPage(pageName, artNum) {
	var container = $("content");
	container.style.top = 0;
	container.innerHTML = "";
	var loader = $("ajaxLoader");
	loader.show();
	new Ajax.Request("/kampanjer/template/art_vegas.jsp", {
			method: 'get',
			encoding: 'ISO-8859-1',
			parameters: "pageName="+pageName+"&articleNum="+artNum,
			/*onComplete: function(response) {
					alert(response.responseText);
				},*/
			onFailure: function(response) {
					loader.hide();
					container.innerHTML = response.responseText;
				},
			onSuccess: function(response) {
					loader.hide();
					container.innerHTML = response.responseText;
				}
			});
}

function toggleImage(imgId, newImage) {
	var img = $(imgId);
	img.src = newImage;
}

function switchToMovie() {
	$("movieBanner").hide();
	var topMovie = $("topMovie");
	var objElem = topMovie.down("object");
	objElem.show();
	//var embedElem = objElem.down("embed");
	//embedElem.show();
}

