
	/*
	** content
	*/
	function showContent () 
	{
		$('div#content div.content-content')
			.hide()
				.fadeIn('slow');
	}
	
	/*
	** fullBackground
	*/
	function initFullBackground () 
	{
		$('#background').fullBg();
	}

	/*
	** top
	*/
	function initTop () 
	{
		$('div#top a').attr('href', 'javascript:;');
	 	$('div#top a').click (
			function(){ 
				$('body').scrollTo(0, 500);
			}
		);
	}

	/*
	** events
	*/
	function initEvents () 
	{
		$('ul.events li').hover(
			function() {
				removeHoverThumbnails();
				hideThumbnails();

				$(this).addClass('hover');
				$(this).removeClass('hide');
			},
			function() {
				removeHoverThumbnails();
				showThumbnails();
			}
		);
	}

	function removeHoverThumbnails () 
	{
		$('ul.events li').each(
			function(index) {
		    	$(this).removeClass('hover');
		  	}
		);
	}

	function hideThumbnails () 
	{
		$('ul.events li').each(
			function(index) {
		    	$(this).addClass('hide');
		  	}
		);
	}

	function showThumbnails () 
	{
		$('ul.events li').each(
			function(index) {
		    	$(this).removeClass('hide');
		  	}
		);
	}
	
	/*
	** modal
	*/
	var closeModalAjax = function (hash)
	{
		var $modalWindow = $(hash.w);
		$modalWindow.fadeOut('fast', function()
		{
			hash.o.remove();
		});
	};

	var openModalAjax = function (hash)
	{
		var $modalWindow = $(hash.w);
		$modalWindow.fadeIn('fast');
	}

	function initModalAjax (jqModalWindowName)
	{
		$('#' + jqModalWindowName).remove();

		//
		var html = '<div id="' + jqModalWindowName + '" class="jqmWindowAjax jqmWindow">'
		html += '<div class="jqmClose"><span>close</span></div>'
		html += '<div class="jqmContent"></div>'
		html += '</div>'
		$('body').append(html);

		//
		var t = $('#' + jqModalWindowName + ' div.jqmContent');
	    $('#' + jqModalWindowName).jqm(
		{
			overlay: 85,
			trigger: 'a.trigger-' + jqModalWindowName,
			ajax: '@href',
			target: t,
			onHide: closeModalAjax,
			onShow: openModalAjax
	    });
	}


	/*
	** on load
	*/
	$(function() 
	{
		initFullBackground();
		initTop();
		initEvents();
		showContent();
	});
