function initTopSlideShow()
{
    // ------------- sponsors hover
		$('#slider').cycle({
			fx: 'scrollHorz',
			timeout: 5000,
			speed: '1000',
			next: '#slider-next',
			prev: '#slider-prev',
			pause: 1,
			pager: '#slider-pager'
		});



}
function initPrettyPhoto()
{
		$("a[rel^='prettyPhoto']").prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			opacity: 0.80, /* Value between 0 and 1 */
			showTitle: true, /* true/false */
                        gallery_markup: '<div class="pp_gallery"> \
								\
							</div>',
                        theme: 'facebook' /* light_rounded / dark_rounded / light_square / dark_square / facebook */
		});
}
function initLightBox()
{

    // lightbox
    $("a[rel^='gal']").prettyPhoto({
            show_title: false,
            theme: 'dark_square',
            overlay_gallery: false
    });
}
function initMenu()
{
	$('#navigation ul').hide();
	$('#navigation ul:first').show();
	$('#navigation li a').click(function()
	{
		var checkElement = $(this).next();
				if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				return false;
				}
				if((checkElement.is('ul')) && (!checkElement.is(':visible')))
				{
					$('#navigation ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
					return false;
				}
	}
	);
}
///////////////////////////////////
function initColorBox()
{
	//$("a[rel='example1']").colorbox();
	$("a[rel='example1']").colorbox({transition:"fade"});

	// Tabs
	$('#tabs').tabs();


	// Dialog
	$('#dialog').dialog({
		autoOpen: false,
		width: 600,
		buttons: {
			"Ok": function() {
				$(this).dialog("close");
			},
			"Cancel": function() {
				$(this).dialog("close");
			}
		}
	});
	// Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});
	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); },
		function() { $(this).removeClass('ui-state-hover'); }
	);
}
function initTextSlider()
{
                    //create scroller for each element with "horizontal_scroller" class...
                $('.horizontal_scroller').SetScroller({	velocity: 	 60,
                        direction: 	 'horizontal',
                        startfrom: 	 'right',
                        loop:		 'infinite',
                        movetype: 	 'linear',
                        onmouseover: 'pause',
                        onmouseout:  'play',
                        onstartup: 	 'play',
                        cursor: 	 'pointer'
                });
}

function initSubNav()
{

    // ------------- display sub navigation
    $('ul#navigation li').find("ul").hide();
    //$('ul#navigation li').find("ul").css('opacity', 0.9);
    $("ul#navigation li").hover(function() {
            $(this).find("ul").show();
    }, function() {
            $(this).find("ul").hide();
    });

}
$(document).ready(function()
{
	//initMenu();
	initSubNav();  
	initTopSlideShow();
	initPrettyPhoto();
	initColorBox();	

        
});
$(window).load(function()
{
	initTextSlider();	
});
