$(document).ready(function(){	
	//Slider
	$(function(){
		// Set starting slide to 1
		var startSlide = 1;
		// Get slide number if it exists
		if (window.location.hash) {
			startSlide = window.location.hash.replace('#','');
		}
		// Initialize Slides
		$('#slides').slides({
			preload: true,
			preloadImage: '../../style/loading.gif',
			generatePagination: true,
			play: 8000,
			pause: 8000,
			hoverPause: true,
			// Get the starting slide
			start: startSlide,
			animationComplete: function(current){
				// Set the slide number as a hash
				window.location.hash = '#' + current;
			}
		});
	});
	
	//jQuery slidePanel
	$(".btnSlideLogin").click(function(){
		$("#panelSlideLogin").slideToggle("slow");
		$(this).toggleClass("activeSlideLogin"); return false;
	});
	//jQuery slidePanel2
	$(".btnSlideDownloads").click(function(){
		$("#panelSlideDownloads").slideToggle("fast"); $(this).toggleClass("activeSlideDownloads"); return false;
	});
	
	//ThumbnailScroller
	window.onload=function(){ 
		$("#tS2").thumbnailScroller({ 
			scrollerType:"hoverAccelerate", //values: "hoverPrecise", "hoverAccelerate", "clickButtons"
			scrollerOrientation:"horizontal", //values: "horizontal", "vertical"
			scrollSpeed:2, //value: milliseconds
			scrollEasing:"easeOutCirc", //easing type
			scrollEasingAmount:600, //value: milliseconds
			acceleration:4, //value: integer
			scrollSpeed:800, //value: milliseconds
			noScrollCenterSpace:10, //value: pixels
			autoScrolling:0, //value: integer
			autoScrollingSpeed:2000, //value: milliseconds
			autoScrollingEasing:"easeInOutQuad", //easing type
			autoScrollingDelay:500 //value: milliseconds
		});
	};
	
//jQuery-ui-1.8.17.custom
	//jQuery accordion
	$(".accordion").accordion({
		disabled: false,
		//collapsible: true,
		active: false,
		animated: true,
		autoHeight: false,
		clearStyle: true,
		collapsible: true,
		event: 'click',
		fillSpace: false,
		header: 'h6',
		navigation: false
	});
	
	//jQuery Tabs
	$('#tabs').tabs();


	//jQuery Dialog			
	$('#dialog').dialog({
		autoOpen: false,
		width: 600,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}, 
			"Cancel": function() { 
				$(this).dialog("close"); 
			} 
		}
	});
	
	//jQuery Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});

	//jQuery Datepicker
	$('#datepicker').datepicker({
		inline: true
	});
	
	//jQuery Slider
	$('#slider').slider({
		range: true,
		values: [17, 67]
	});
	
	//jQuery Progressbar
	$("#progressbar").progressbar({
		value: 20 
	});
	
	//jQuery hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
});
