$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:500,
		pauseTime:6000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:false, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:true, //Use thumbnails for Control Nav
		controlNavThumbsFromRel:true, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});

						Cufon.replace('.font25',
			{fontFamily: 'DIN Next Rounded LT Pro'}
			);		
			Cufon.replace('.font20',
			{fontFamily: 'DIN Next Rounded LT Pro'}
			);
});

	$(function() {
		$("#questions").accordion(
			{ 
			active: 'none',
			autoHeight: false,
			icons: { 'header': 'collaps ', 'headerSelected': 'expand ' } }
		);
	});

$('#slider').load(function() {
					Cufon.refresh('.font25');		
			Cufon.refresh('.font20');
});

			$(function()
			{
				// this initialises the demo scollpanes on the page.
			$('#pane1').jScrollPane({showArrows:true, scrollbarWidth: 13, arrowSize: 13, scrollbarMargin: 10});
			});


$(document).ready(function()
{
			Cufon.replace('.font13', 
			{hover: {color: '#EFB400'}},
			{fontFamily: 'DIN Next Rounded LT Pro'}
			);
			Cufon.replace('.font13Mhover',
			{fontFamily: 'DIN Next Rounded LT Pro'}
			);			
			Cufon.replace('.font2-15',
			{fontFamily: 'DIN Next LT Pro'}
			);
			Cufon.replace('.font2-13',
			{fontFamily: 'DIN Next LT Pro'}
			);
			
			Cufon.replace('.font2-16',
			{fontFamily: 'DIN Next LT Pro'}
			);		
			Cufon.replace('.fontWS-16',
			{fontFamily: 'Arial',
			fontSize: '16px',
			textShadow: '#111 1px 1px' ,
			fontWeight: '700'}
			);		
			
			
			Cufon.replace('h1',
			{fontFamily: 'Arial',
			fontSize: '16px',
			textShadow: '#111 1px 1px' ,
			fontWeight: '700',
			color:"#fff"}
			);		
			Cufon.replace('h2',
			{fontFamily: 'DIN Next LT Pro'}
			);
			Cufon.replace('.font25',
			{fontFamily: 'DIN Next Rounded LT Pro'}
			);		
			Cufon.replace('.font20',
			{fontFamily: 'DIN Next Rounded LT Pro'}
			);
			  $('.Items').selectbox();
			  $('.Items4').selectbox();
			//Execute the slideShow
	slideShow();
			
});

function slideShow() {

	//Set the opacity of all images to 0
	$('#gallery a').css({opacity: 0.0});
	
	//Get the first image and display it (set it to full opacity)
	$('#gallery a:first').css({opacity: 1.0});
	

	
	//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('gallery()',4000);
	
}

function gallery() {
	
	//if no IMGs have the show class, grab the first image
	var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));

	//Get next image, if it reached the end of the slideshow, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));	
	

	
	//Set the fade in effect for the next image, show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	

	
	
}

//DIN Next Rounded LT Pro

	//		Cufon.replace('h1', { fontFamily: 'Vegur' });
	//		Cufon.replace('h2', { fontFamily: 'Myriad Pro' });

