	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var is_ie6 = false;
	var is_ie7 = false;
	var is_ie8 = false;
	
	jQuery.each(jQuery.browser, function(i, val){
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="6.0"){is_ie6 = true;}
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="7.0"){is_ie7 = true;}
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="8.0"){is_ie8 = true;}
	});
	
	
	// Miracles :)
	$(document).ready(function(){
		$('div.menu-1 ul li:last').addClass('last');
		$('div.menu-3 ul li:last').addClass('last');
		$('div.events ul.events li:last').addClass('last');
		$('blockquote p:last').addClass('last');
		$('div.guests span.prev').hover(function(){
			$(this).addClass('hovered');
		}, function(){
			$(this).removeClass('hovered');
		});
		$('div.guests span.next').hover(function(){
			$(this).addClass('hovered');
		}, function(){
			$(this).removeClass('hovered');
		});
		$('div.menu-item table tr th h3').hover(function(){
			$(this).addClass('hovered');
		}, function(){
			$(this).removeClass('hovered');
		});
	});
	// -
	
	
	// Banners
	$(document).ready(function(){
		$('div.banner').each(function(){
			$(this).find('div.bn:first').addClass('active');
			$(this).find('div.bn').each(function(){$(this).css({'opacity':'0.0', 'display' : 'none'})});
			$(this).find('div.bn:first').css({'opacity':'1.0', 'display' : 'block'});
			if ($(this).find('div.bn').length > 1) {
				pages = '<ul class="pages">';
				for (i = 0; i < $(this).find('div.bn').length; i++) {
					pages = pages + '<li></li>';
				}
				pages = pages + '</ul>';
				$(this).append(pages);
			}
			$('div.banner ul.pages li:first').addClass('selected');
		});
		$('div.banner ul.pages li').click(function(){
			if (!$(this).hasClass('selected')) {
				$('div.banner ul.pages').find('li').removeClass('selected');
				$(this).addClass('selected');
				$(this).parent().parent().find('div.bn').each(function(){
					if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
						$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
					}
				});
				$(this).parent().parent().find('div.bn').eq($(this).index()).css({'display':'block'});
				$(this).parent().parent().find('div.bn').eq($(this).index()).animate({'opacity':'1.0'}, 300);
			}
		});
	});
	// -
	
	
	// Guests Bottom
	$(document).ready(function(){
		$('div.guests .next').click(function(){
			var new_pos = $('div.guests .logos').css('left').replace(/px/, '');
			new_pos = new_pos - 440;
			if (new_pos >= $('div.guests .overflow').width() - $('div.guests .logos').width()) {
				$('div.guests .logos').animate({'left' : new_pos + 'px'}, 500);
			} else {
				new_pos = $('div.guests .overflow').width() - $('div.guests .logos').width();
				$('div.guests .logos').animate({'left' : new_pos + 'px'}, 500);
			}
		});
		$('div.guests .prev').click(function(){
			var new_pos = $('div.guests .logos').css('left').replace(/px/, '');
			new_pos = parseInt(new_pos) + 440;
			if (new_pos <= 0) {
				$('div.guests .logos').animate({'left' : new_pos + 'px'}, 500);
			} else {
				new_pos = 0;
				$('div.guests .logos').animate({'left' : new_pos + 'px'}, 500);
			}
		});
	});
	// -
	
	
	// Managers
	$(document).ready(function(){
		$('div.managers div.col:first').addClass('active');
		$('div.managers').find('div.col').each(function(){$(this).css({'opacity':'0.0', 'display' : 'none'})});
		$('div.managers').find('div.col:first').css({'opacity':'1.0', 'display' : 'block'});
		if ($('div.managers div.col').length > 1) {
			pages = '<ul class="pages">';
			for (i = 0; i < $('div.managers div.col').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '</ul>';
			$('div.managers div.middle').append(pages);
		}
		$('div.managers ul.pages li:first').addClass('selected');
		$('div.managers ul.pages li').click(function(){
			if (!$(this).hasClass('selected')) {
				$('div.managers ul.pages').find('li').removeClass('selected');
				$(this).addClass('selected');
				$(this).parent().parent().find('div.col').each(function(){
					if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
						$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
					}
				});
				$(this).parent().parent().find('div.col').eq($(this).index()).css({'display':'block'});
				$(this).parent().parent().find('div.col').eq($(this).index()).animate({'opacity':'1.0'}, 300);
			}
		});
	});
	// -
	

	if ($("div.achievements_icons div.icons_container img").length > 4) {
		var icons_interval = '';
			function switch_achievements_icons() {
			$("div.achievements_icons div.icons_container img").eq(0).animate({'left' : '-71px', 'marginRight' : '-54px'}, 500, function() {
				$("div.achievements_icons div.icons_container").append($("div.achievements_icons div.icons_container img").eq(0));
				$("div.achievements_icons div.icons_container img:last").css({'left' : '0px', 'marginRight' : '17px'});
				//$("div.achievements_icons div.icons_container img").eq(0).remove();
			});
		}
		switch_achievements_icons();
		icons_interval = setInterval(switch_achievements_icons, 2500);
	}


	// Artists NEW (CYCLIC)
	$(document).ready(function(){
		if ($('div.artists ul.artists_stream li').length > 4) {
			var pos_animation = 0;
			var pos_step = 220;
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 1; i <= $('div.artists ul.artists_stream li').length; i++) {
				pages = pages + '<li style="cursor: default;"></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.artists div.pager').html(pages);
			
			var pos = parseInt($('div.artists ul.artists_stream').css('left').replace(/px/, ''));
			var pos_index = 0;
			//var pos_index = Math.round((- pos / pos_step) + 1.7);
			$('div.artists ul.pager li').eq(pos_index + 1).addClass('selected');
			/*$('div.artists ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.artists ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					var new_pos = parseInt($('div.artists ul.artists_stream').css('left').replace(/px/, ''));
					new_pos = - pos_step * ($(this).index() - 1);
					$('div.artists ul.artists_stream').animate({'left' : new_pos + 'px'}, 500);
				}
			});*/
			$('div.artists ul.pager li.prev').unbind("click");
			$('div.artists ul.pager li.prev').click(function(){
				if (pos_animation == 0) {
					if (0 < $('div.artists ul.pager').find('li.selected').prev().index()) {
						$('div.artists ul.pager').find('li.selected').prev().addClass('selected');
						$('div.artists ul.pager').find('li.selected:last').removeClass('selected');
					} else {
						$('div.artists ul.pager').find('li.selected:last').removeClass('selected');
						$('div.artists ul.pager').find('li:last').prev().addClass('selected');
					}
					pos_animation = 1;
					var new_pos = parseInt($('div.artists ul.artists_stream').css('left').replace(/px/, ''));
					new_pos = new_pos + pos_step;
					$('div.artists ul.artists_stream').animate({'left' : new_pos + 'px'}, 500, function(){
						$("div.artists ul.artists_stream").prepend($("div.artists ul.artists_stream li:last"));
						$('div.artists ul.artists_stream').css({'left' : (parseInt(new_pos) - parseInt(pos_step)) + 'px'});
						pos_animation = 0;
					});
				}
			});
			$('div.artists ul.pager li.next').unbind("click");
			$('div.artists ul.pager li.next').click(function(){
				if (pos_animation == 0) {
					if (($('div.artists ul.artists_stream li').length) > $('div.artists ul.pager').find('li.selected').next().index() - 1) {
						$('div.artists ul.pager').find('li.selected').next().addClass('selected');
						$('div.artists ul.pager').find('li.selected:first').removeClass('selected');
					} else {
						$('div.artists ul.pager').find('li.selected:first').removeClass('selected');
						$('div.artists ul.pager').find('li:first').next().addClass('selected');
					}
					pos_animation = 1;
					var new_pos = parseInt($('div.artists ul.artists_stream').css('left').replace(/px/, ''));
					new_pos = new_pos - pos_step;
					$('div.artists ul.artists_stream').animate({'left' : new_pos + 'px'}, 500, function(){
						$("div.artists ul.artists_stream").append($("div.artists ul.artists_stream li").eq(0));
						$('div.artists ul.artists_stream').css({'left' : (parseInt(new_pos) + parseInt(pos_step)) + 'px'});
						pos_animation = 0;
					});
				}
			});
		} else if ($('div.artists ul.artists_stream li').length != 0) {
			$('div.artists div.pager').html('');
		}
	});
	// -


/*	// Artists
	$(document).ready(function(){
		if ($('div.artists ul.artists_stream li').length > 4) {
			var pos_step = 220;
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 4; i <= $('div.artists ul.artists_stream li').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.artists div.pager').html(pages);
			
			var pos = parseInt($('div.artists ul.artists_stream').css('left').replace(/px/, ''));
			var pos_index = - pos / pos_step;
			$('div.artists ul.pager li').eq(pos_index + 1).addClass('selected');
			$('div.artists ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.artists ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					var new_pos = parseInt($('div.artists ul.artists_stream').css('left').replace(/px/, ''));
					new_pos = - pos_step * ($(this).index() - 1);
					$('div.artists ul.artists_stream').animate({'left' : new_pos + 'px'}, 500);
				}
			});
			$('div.artists ul.pager li.prev').unbind("click");
			$('div.artists ul.pager li.prev').click(function(){
				if (0 < $('div.artists ul.pager').find('li.selected').prev().index()) {
					new_pos = - pos_step * ($('div.artists ul.pager').find('li.selected').prev().index() - 1);
					$('div.artists ul.pager').find('li.selected').prev().addClass('selected');
					$('div.artists ul.pager').find('li.selected:last').removeClass('selected');
					$('div.artists ul.artists_stream').animate({'left' : new_pos + 'px'}, 500);
				}
			});
			$('div.artists ul.pager li.next').unbind("click");
			$('div.artists ul.pager li.next').click(function(){
				if (($('div.artists ul.artists_stream li').length - 3) > $('div.artists ul.pager').find('li.selected').next().index() - 1) {
					new_pos = - pos_step * ($('div.artists ul.pager').find('li.selected').next().index() - 1);
					$('div.artists ul.pager').find('li.selected').next().addClass('selected');
					$('div.artists ul.pager').find('li.selected:first').removeClass('selected');
					$('div.artists ul.artists_stream').animate({'left' : new_pos + 'px'}, 500);
				}
			});
		} else if ($('div.artists ul.artists_stream li').length != 0) {
			$('div.artists div.pager').html('');
		}
	});
	// -
	*/
	
	// Vacancies
	$(document).ready(function(){
		if ($('div.vacancies table td').length > 3) {
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 3; i <= $('div.vacancies table td').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.vacancies div.pager').html(pages);
			
			$('div.vacancies ul.pager li').eq(1).addClass('selected');
			$('div.vacancies ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.vacancies ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					var new_pos = parseInt($('div.vacancies table').css('left').replace(/px/, ''));
					new_pos = - 230 * ($(this).index() - 1);
					$('div.vacancies table').animate({'left' : new_pos + 'px'}, 500);
				}
			});
			$('div.vacancies ul.pager li.prev').unbind("click");
			$('div.vacancies ul.pager li.prev').click(function(){
				if (0 < $('div.vacancies ul.pager').find('li.selected').prev().index()) {
					$('div.vacancies ul.pager').find('li.selected').prev().addClass('selected');
					$('div.vacancies ul.pager').find('li.selected:last').removeClass('selected');
					var new_pos = parseInt($('div.vacancies table').css('left').replace(/px/, ''));
					new_pos = new_pos + 230;
					$('div.vacancies table').animate({'left' : new_pos + 'px'}, 500);
				}
			});
			$('div.vacancies ul.pager li.next').unbind("click");
			$('div.vacancies ul.pager li.next').click(function(){
				if (($('div.vacancies table td').length - 2) > $('div.vacancies ul.pager').find('li.selected').next().index() - 1) {
					$('div.vacancies ul.pager').find('li.selected').next().addClass('selected');
					$('div.vacancies ul.pager').find('li.selected:first').removeClass('selected');
					var new_pos = parseInt($('div.vacancies table').css('left').replace(/px/, ''));
					new_pos = new_pos - 230;
					$('div.vacancies table').animate({'left' : new_pos + 'px'}, 500);
				}
			});
		} else if ($('div.vacancies table td').length != 0) {
			$('div.vacancies div.pager').html('');
		}
	});
	// -
	
	
	// Photos in gallery
	$(document).ready(function(){
		$('div.gallery').find('div.page').each(function(){$(this).css({'opacity':'0.0', 'display' : 'none'})});
		$('div.gallery').find('div.page:first').css({'opacity':'1.0', 'display' : 'block'});
		if ($('div.gallery div.page').length > 1) {
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 0; i < $('div.gallery div.page').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.gallery div.pager').html(pages);
			
			$('div.gallery ul.pager li').eq(1).addClass('selected');
			$('div.gallery ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.gallery ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					$('div.gallery').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.gallery').find('div.page').eq($(this).index() - 1).css({'display':'block'});
					$('div.gallery').find('div.page').eq($(this).index() - 1).animate({'opacity':'1.0'}, 300);
				}
			});
			$('div.gallery ul.pager li.prev').unbind("click");
			$('div.gallery ul.pager li.prev').click(function(){
				if (0 < $('div.gallery ul.pager').find('li.selected').prev().index()) {
					$('div.gallery').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.gallery').find('div.page').eq($('div.gallery ul.pager').find('li.selected').prev().index() - 1).css({'display':'block'});
					$('div.gallery').find('div.page').eq($('div.gallery ul.pager').find('li.selected').prev().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.gallery ul.pager').find('li.selected').prev().addClass('selected');
					$('div.gallery ul.pager').find('li.selected:last').removeClass('selected');
				}
			});
			$('div.gallery ul.pager li.next').unbind("click");
			$('div.gallery ul.pager li.next').click(function(){
				if ($('div.gallery div.page').length > $('div.gallery ul.pager').find('li.selected').next().index() - 1) {
					$('div.gallery').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.gallery').find('div.page').eq($('div.gallery ul.pager').find('li.selected').next().index() - 1).css({'display':'block'});
					$('div.gallery').find('div.page').eq($('div.gallery ul.pager').find('li.selected').next().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.gallery ul.pager').find('li.selected').next().addClass('selected');
					$('div.gallery ul.pager').find('li.selected:first').removeClass('selected');
				}
			});
		} else if ($('div.gallery div.page').length != 0) {
			$('div.gallery div.pager').html('');
		}
	});
	// -
	
	
	// Logos in calients
	$(document).ready(function(){
		$('div.clients').find('div.page').each(function(){$(this).css({'opacity':'0.0', 'display' : 'none'})});
		$('div.clients').find('div.page:first').css({'opacity':'1.0', 'display' : 'block'});
		if ($('div.clients div.page').length > 1) {
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 0; i < $('div.clients div.page').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.clients div.pager').html(pages);
			
			$('div.clients ul.pager li').eq(1).addClass('selected');
			$('div.clients ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.clients ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					$('div.clients').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.clients').find('div.page').eq($(this).index() - 1).css({'display':'block'});
					$('div.clients').find('div.page').eq($(this).index() - 1).animate({'opacity':'1.0'}, 300);
				}
			});
			$('div.clients ul.pager li.prev').unbind("click");
			$('div.clients ul.pager li.prev').click(function(){
				if (0 < $('div.clients ul.pager').find('li.selected').prev().index()) {
					$('div.clients').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.clients').find('div.page').eq($('div.clients ul.pager').find('li.selected').prev().index() - 1).css({'display':'block'});
					$('div.clients').find('div.page').eq($('div.clients ul.pager').find('li.selected').prev().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.clients ul.pager').find('li.selected').prev().addClass('selected');
					$('div.clients ul.pager').find('li.selected:last').removeClass('selected');
				}
			});
			$('div.clients ul.pager li.next').unbind("click");
			$('div.clients ul.pager li.next').click(function(){
				if ($('div.clients div.page').length > $('div.clients ul.pager').find('li.selected').next().index() - 1) {
					$('div.clients').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.clients').find('div.page').eq($('div.clients ul.pager').find('li.selected').next().index() - 1).css({'display':'block'});
					$('div.clients').find('div.page').eq($('div.clients ul.pager').find('li.selected').next().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.clients ul.pager').find('li.selected').next().addClass('selected');
					$('div.clients ul.pager').find('li.selected:first').removeClass('selected');
				}
			});
		} else if ($('div.clients div.page').length != 0) {
			$('div.clients div.pager').html('');
		}
	});
	// -
	
	
	// Photos in photo-stream
	$(document).ready(function(){
		if ($('div.photo-stream ul.photo-stream li').length > 6) {
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			var pages_num = $('div.photo-stream ul.photo-stream li').length / 6;
			if ($('div.photo-stream ul.photo-stream li').length % 6 > 0) {
				pages_num = Math.floor(pages_num) + 1;
			}
			for (i = 0; i < pages_num; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.photo-stream div.pager').html(pages);
			
			$('div.photo-stream ul.pager li').eq(1).addClass('selected');
			$('div.photo-stream ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.photo-stream ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					$('div.photo-stream ul.photo-stream').animate({'left':'-' + (684 * ($(this).index() - 1)) + 'px'}, 500);
				}
			});
			$('div.photo-stream ul.pager li.prev').unbind("click");
			$('div.photo-stream ul.pager li.prev').click(function(){
				if (0 < $('div.photo-stream ul.pager').find('li.selected').prev().index()) {
					$('div.photo-stream ul.photo-stream').animate({'left':'-' + (684 * ($('div.photo-stream ul.pager').find('li.selected').prev().index() - 1)) + 'px'}, 500);
					$('div.photo-stream ul.pager').find('li.selected').prev().addClass('selected');
					$('div.photo-stream ul.pager').find('li.selected:last').removeClass('selected');
				}
			});
			$('div.photo-stream ul.pager li.next').unbind("click");
			$('div.photo-stream ul.pager li.next').click(function(){
				if (pages_num > $('div.photo-stream ul.pager').find('li.selected').next().index() - 1) {
					$('div.photo-stream ul.photo-stream').animate({'left':'-' + (684 * ($('div.photo-stream ul.pager').find('li.selected').next().index() - 1)) + 'px'}, 500);
					$('div.photo-stream ul.pager').find('li.selected').next().addClass('selected');
					$('div.photo-stream ul.pager').find('li.selected:first').removeClass('selected');
				}
			});
		} else if ($('div.photo-stream li').length != 0) {
			$('div.photo-stream div.pager').html('');
		}
	});
	// -
	

	// News NEW
	$(document).ready(function(){
		$('div.event_new').find('div.page').each(function(){$(this).css({'opacity':'0.0', 'display' : 'none'})});
		$('div.event_new').find('div.page:first').css({'opacity':'1.0', 'display' : 'block'});
		if ($('div.event_new div.page').length > 1) {
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 0; i < $('div.event_new div.page').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.event_new div.pager').html(pages);
			
			$('div.event_new ul.pager li').eq(1).addClass('selected');
			$('div.event_new ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.event_new ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					$('div.event_new').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.event_new').find('div.page').eq($(this).index() - 1).css({'display':'block'});
					$('div.event_new').find('div.page').eq($(this).index() - 1).animate({'opacity':'1.0'}, 300);
				}
			});
			$('div.event_new ul.pager li.prev').unbind("click");
			$('div.event_new ul.pager li.prev').click(function(){
				if (0 < $('div.event_new ul.pager').find('li.selected').prev().index()) {
					$('div.event_new').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.event_new').find('div.page').eq($('div.event_new ul.pager').find('li.selected').prev().index() - 1).css({'display':'block'});
					$('div.event_new').find('div.page').eq($('div.event_new ul.pager').find('li.selected').prev().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.event_new ul.pager').find('li.selected').prev().addClass('selected');
					$('div.event_new ul.pager').find('li.selected:last').removeClass('selected');
				}
			});
			$('div.event_new ul.pager li.next').unbind("click");
			$('div.event_new ul.pager li.next').click(function(){
				if ($('div.event_new div.page').length > $('div.event_new ul.pager').find('li.selected').next().index() - 1) {
					$('div.event_new').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.event_new').find('div.page').eq($('div.event_new ul.pager').find('li.selected').next().index() - 1).css({'display':'block'});
					$('div.event_new').find('div.page').eq($('div.event_new ul.pager').find('li.selected').next().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.event_new ul.pager').find('li.selected').next().addClass('selected');
					$('div.event_new ul.pager').find('li.selected:first').removeClass('selected');
				}
			});
		} else if ($('div.event_new div.page').length != 0) {
			$('div.event_new div.pager').html('');
		}
	});
	// -
	

	// News
	$(document).ready(function(){
		$('div.event').find('div.page').each(function(){$(this).css({'opacity':'0.0', 'display' : 'none'})});
		$('div.event').find('div.page:first').css({'opacity':'1.0', 'display' : 'block'});
		if ($('div.event div.page').length > 1) {
			pages = '<ul class="pager">';
			pages = pages + '<li class="prev"></li>';
			for (i = 0; i < $('div.event div.page').length; i++) {
				pages = pages + '<li></li>';
			}
			pages = pages + '<li class="next"></li>';
			pages = pages + '</ul>';
			$('div.event div.pager').html(pages);
			
			$('div.event ul.pager li').eq(1).addClass('selected');
			$('div.event ul.pager li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.event ul.pager').find('li').removeClass('selected');
					$(this).addClass('selected');
					$('div.event').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.event').find('div.page').eq($(this).index() - 1).css({'display':'block'});
					$('div.event').find('div.page').eq($(this).index() - 1).animate({'opacity':'1.0'}, 300);
				}
			});
			$('div.event ul.pager li.prev').unbind("click");
			$('div.event ul.pager li.prev').click(function(){
				if (0 < $('div.event ul.pager').find('li.selected').prev().index()) {
					$('div.event').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.event').find('div.page').eq($('div.event ul.pager').find('li.selected').prev().index() - 1).css({'display':'block'});
					$('div.event').find('div.page').eq($('div.event ul.pager').find('li.selected').prev().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.event ul.pager').find('li.selected').prev().addClass('selected');
					$('div.event ul.pager').find('li.selected:last').removeClass('selected');
				}
			});
			$('div.event ul.pager li.next').unbind("click");
			$('div.event ul.pager li.next').click(function(){
				if ($('div.event div.page').length > $('div.event ul.pager').find('li.selected').next().index() - 1) {
					$('div.event').find('div.page').each(function(){
						if (($(this).css('opacity') != '0.0') && ($(this).css('opacity') != '0')) {
							$(this).animate({'opacity':'0.0'}, 300, function(){$(this).css({'display' : 'none'})});
						}
					});
					$('div.event').find('div.page').eq($('div.event ul.pager').find('li.selected').next().index() - 1).css({'display':'block'});
					$('div.event').find('div.page').eq($('div.event ul.pager').find('li.selected').next().index() - 1).animate({'opacity':'1.0'}, 300);
					$('div.event ul.pager').find('li.selected').next().addClass('selected');
					$('div.event ul.pager').find('li.selected:first').removeClass('selected');
				}
			});
		} else if ($('div.event div.page').length != 0) {
			$('div.event div.pager').html('');
		}
	});
	// -
	
	
	// Menu Accordion
	$(document).ready(function(){
		$('div.menu-item table tr th h3').click(function(){
			if ($(this).hasClass('expanded')) {
				$(this).removeClass('expanded');
				$('div.menu-item').css({'height':'36px'});
			} else {
				$('div.menu-item table tr th h3').removeClass('expanded');
				$('div.menu-item').css({'height':'36px'});
				$(this).addClass('expanded');
				$('div.menu-item').each(function(){
					if ($(this).find('table tr th h3.expanded').length > 0) {
						$(this).css({'height':'auto'});
					}
				});
			}
		});
	});
	// -
	
	
	// Menu Types
	$(document).ready(function(){
		if (!$('div.menu-types').hasClass('nojs')) {
			/*$('div.menu-types ul li:first').addClass('selected');
			menu_type = '#menu' + $('div.menu-types ul li:first div.button em').html();
			$(menu_type).css({'display':'block'});*/
			$('div.menu-types ul li').click(function(){
				if (!$(this).hasClass('selected')) {
					$('div.menu-types ul li').removeClass('selected');
					$('div.menuprice').css({'display':'none'});
					$(this).addClass('selected');
					menu_type = '#menu' + $(this).find('div.button em').html();
					$(menu_type).css({'display':'block'});
				}
			});
		}
	});
	// -
	
	
	// Dropdown
	$(document).ready(function(){
		var expanded = false;
		var hovered = false;
		$('div.dropdown ul').css({'display':'none'});
		$('div.dropdown').click(function(){
			if ($(this).hasClass('expanded')) {
				$(this).removeClass('expanded');
				$(this).find('ul').slideUp(50);
				expanded = false;
			} else {
				$('div.dropdown').removeClass('expanded');
				$('div.dropdown ul').css({'display':'none'});
				$(this).addClass('expanded');
				$(this).find('ul').slideDown(150);
				expanded = true;
			}
		});
		$('div.dropdown ul li').hover(function(){
			$(this).addClass('hovered');
		}, function(){
			$(this).removeClass('hovered');
		});
		$('div.dropdown ul li').click(function(){
			$('div.expanded p.selected').text($(this).text());
			$('div.expanded input[type=hidden]').val($(this).attr('id'));
		});
		$('div.dropdown input[type=hidden]').each(function(){
			if ($(this).val() != '') {
				li_id = '#' + $(this).val();
				if ($(this).parent().find(li_id).length > 0) {
					$(this).parent().find('p.selected').text($(this).parent().find(li_id).text());
				}
			}
		});
		$('div.dropdown').hover(function(){
			hovered = true;
		}, function(){
			hovered = false;
		});
		$(document).click(function(){
			if (expanded && !hovered) {
				$('div.dropdown').removeClass('expanded');
				$('div.dropdown ul').slideUp(50);
			}
		});
	});
	
	
	// Hall Size Trackbar
	function blockEvent(event) {
		if (!event) {
			event = window.event;
		}
		if(event.stopPropagation) event.stopPropagation();
		else event.cancelBubble = true;
		if(event.preventDefault) event.preventDefault();
		else event.returnValue = false;
	}
	$(document).ready(function(){
		if ($(document).find('div.hall_sizes').length > 0) {
		var moving = false;
		var def_x = 0;
		var min_x = -20;
		var max_x = $('div.hall_sizes').width() - 27;
		selected_li = $('div.hall_sizes ul li.selected').position().left;
		$('div.hall_sizes span.pointer').css({'left':selected_li});
		$('div.hall_sizes span.pointer').mousedown(function(e){
			moving = true;
			def_x = e.pageX - parseFloat($('div.hall_sizes span.pointer').css('left'));
			blockEvent(e);
		});
		$(document).mouseup(function(e){
			if (moving) {
				pos = parseFloat($('div.hall_sizes span.pointer').css('left'));
				index = ($('div.hall_sizes').width() - pos) / parseFloat($('div.hall_sizes ul li').width());
				li_length = $('div.hall_sizes ul li').length;
				index = (parseFloat(li_length - index).toFixed(0));
				pos = index * 45;
				$('div.hall_sizes ul li').removeClass('selected');
				$('div.hall_sizes ul li').each(function(){
					li_index = $('div.hall_sizes ul li').index(this);
					if (li_index == index) {
						$(this).addClass('selected');
						url = $(this).find('a').attr('href');
						window.location = url;
					}
				});
				$('div.hall_sizes span.pointer').css({'left':pos});
			}
			moving = false;
			def_x = 0;
			pos_x = 0;
		});
		$(document).mousemove(function(e){
			if (moving) {
				pos_x = (e.pageX - def_x);
				if (pos_x < min_x) {
					$('div.hall_sizes span.pointer').css({'left':min_x});
				} else if (pos_x > max_x) {
					$('div.hall_sizes span.pointer').css({'left':max_x});
				} else {
					$('div.hall_sizes span.pointer').css({'left':pos_x});
				}
			}
		});
		}
	});
