
function showImage(inIndex) {
	elementOffset = $(inIndex).positionedOffset().toArray();
	new Effect.Move('bigimage_container', { x: -(elementOffset[0]), y: 0, mode: 'absolute', duration: 0.5 });
	thumbId = 't'+inIndex;
	changeThumb(thumbId);
}

function changeThumb(inID) {
	var ts = $$('#thumbs div.thumb a.selected');
	if (ts[0]) { 
		ts[0].removeClassName('selected'); 
	}
	$(inID).addClassName('selected'); 
}

function startNews() {
	offset = $('newsBox').getWidth()+$('news').getWidth();
	rollTime = offset / 50;
	$('news').setStyle({ left: '0' });
	new Effect.Move('news', { x: -offset, y: 3, mode: 'absolute', transition: Effect.Transitions.linear, duration: rollTime, afterFinish: function(){
    	startNews();
       	}
    }); 
}


function checkShadow() {
	if (window.innerHeight) {
		windowHeigth = window.innerHeight;
	} else {
		windowHeigth = document.documentElement.offsetHeight;
	}
	contentHeight = $('content').getHeight();
	if (contentHeight>(windowHeigth)) {
		$('masthead').addClassName('shadow');
	} else {
		$('masthead').removeClassName('shadow');
	}
}


function setLanguage(suffix) {
   
  new Ajax.Request("?ctrl=updateLang", {
      method: "post",
      parameters: {'suffix':suffix },
      success: window.location.reload()
  });
  
}

