NetvSmpEvents = function() {
	
	var self = this;

	this.init = function(lang) {
		self.lang = lang;
	};
	
	this.getMoreItems = function(linkObj,url){
		$(linkObj).text(( (self.lang == 1) ? "Chargement":"Laden")+" ...");
		$.ajax({
			url: url,
			success: function(html) {
				$(linkObj).parents('.morelink-block-outer').hide().after(html).remove();
				initAllLinkObserve();
			}
		});
	};
}

var events = new NetvSmpEvents();

function scrollToEventcontent(menuid){
	$(document).ready(function() {
		var scrollToOffset = $('#'+menuid).parents('td:first').offset().top;
		$('html, body').animate({ scrollTop: scrollToOffset}, {complete: function(){}});
	});
}

function showEventcontentSub(menuid,isInit){
	var visible = false;
	if(isInit && checkIfEventBrowserIE7OrLower()){
		//ie6 & ie7 bugfixing
		visible = true;
	}
	if($('#'+menuid).is(':visible') || visible){
		if(isInit || checkIfEventBrowserIE7OrLower()){
			$('#'+menuid).hide();
		}
		else{
			$('#'+menuid).slideUp();
		}
		$('#link-'+menuid).removeClass('txnetvsmpeventscontent-act');
	}
	else{
		if(isInit || checkIfEventBrowserIE7OrLower()){
			$('#'+menuid).show();
		}
		else{
			$('#'+menuid).slideDown();
		}
		$('#link-'+menuid).addClass('txnetvsmpeventscontent-act');
	}
}

if(current_location_hash==undefined){
	var current_location_hash = {};
}
function checkIfEventAnkerThenShow() {
	if (current_location_hash.netvsmpevents != window.location.hash) {
		current_location_hash.netvsmpevents = window.location.hash;
		var id = 'eventcontent-uid-'+current_location_hash.netvsmpevents.substring(2);
		if($('#'+id).attr("id")){
			showEventcontentSub(id,true);
		}
	}
}
function checkIfEventBrowserIE7OrLower() {
	if ($.browser.msie && $.browser.version.substr(0,1)<=7) { 
		return true;
	}
	return false;
}

jQuery(document).ready(function($) {
	setInterval("checkIfEventAnkerThenShow();", 500);
});
