// JQUERY FUNCTIONS
// website 		: Cloud 9 Dance
// developer 	: Lars Johansson | lars@agent-e.nl




	var specials_intervalFadeIn = false;
	$(document).ready(function(){

		$('.header').each(	
			function( intIndex ){		



				if($(this).attr('class') == 'header blank'){

					var setShadow_   = '';
					var setColor_	 = 'c3023d'; //042372			// 'c3023d'


				}else{

					var setShadow_   = true;
					var setColor_	 = '';			
	
				};
				
				
				

				var t = $(this).find('.title').text();
				$(this).find('.title').html('');
				$(this).find('.title').flash({
					src: '/sys/themes/public/cloud9dance/cloud9dance_theme/swf/header_small.swf',
					width: 175,
					height: 20,
					wmode: 'transparent',
					scale: 'noscale',
					flashvars: { txt: t, 
								 wmode: 'transparent',
								 setColor: setColor_,
								 setShadow: setShadow_								 
								 }
		
				});
			}						   
		);

//$('#right').hide();
//$('.article').hide();
//$('.article #detail').hide();
//$('.article #detail .details').hide();
	//	$('.article').hide(true,function(){
				//
		//		});					
						   
setTimeout(articleShow_,600);						   

//
		
		function articleShow_(){
	$('.article').show('fast',function(){
				$('.article #detail').show('fast',function(){
										
					$('.article #detail .details').show(100,function(){
																 
																 
					});									
				});		
			});							
		};
		

		$('.article .details h2').each(	
									   
									   	
			function( intIndex ){		

				var t = $(this).text();
				$(this).text('');
				$(this).css('margin-left','-8px').css('margin-bottom','-11px').css('margin-top','1px');					
				$(this).css('padding-left','4px').css('padding-bottom','0px');	
				
				$(this).flash({
					src: '/sys/themes/public/cloud9dance/cloud9dance_theme/swf/header_small.swf',
					width: 175,
					height: 20,
					wmode: 'transparent',
					scale: 'noscale',
					flashvars: { txt: t, 
								 wmode: 'transparent',
								 setColor: 'c3023d',
								 setShadow: ''								 
								 }
		
				});
				
				
				}						   
		);
	

		
		// NAVIGATION - Flash text replacement

		$('#nav ol li').each(	
			function( intIndex ){		

				var t = $(this).html();
				var l = $(this).text().length * 8;
				$(this).html('');
				$(this).flash({
					src: '/sys/themes/public/cloud9dance/cloud9dance_theme/swf/nav.swf',
					width: parseInt(l),
					height: 50,
					scale: 'noscale',
					wmode: 'transparent',
					menu: false,
					flashvars: { txt: t, 
								 css: '/sys/themes/public/cloud9dance/cloud9dance_theme/css/flash.css' }
		
				});

				$(this).css('padding-top','17px');

			}						   
		);		
		

		// specials
/*			
		$('#specials ol li').each(	
			function( intIndex ){		
				$(this).hide();
			}						   
		);
		
		$('#specials ol li img').each(	
			function( intIndex ){	
				$(this).attr('id','special_image_'+intIndex);
				$(this).hide();
			}						   
		);		
		
		//$('#left').hide();	
	//	$('#right').hide();	
		
 		var i_ = 0;		
		$('#specials ol li').each(	
			function( intIndex ){		
				$(this).show(600,function(){
					if(intIndex == 1){
						$('#specials img').each(	
							function( intIndex ){
								if(intIndex == 1){	
									setTimeout(specials_helper,100,intIndex);
								};
							}						   
						);	
					};									 
				});
			}						   
		);*/		
		
	var sliderPos 	= 0;	
	var sliderPos_x = 159;		

	$('#slider .next').click(function() {
			sliderPos++;
			$('.sliderwindow').scrollTo( '+='+sliderPos_x+'px', 500, { axis:'x' } ); 
	});
	
	$('#slider .prev').click(function() {
			sliderPos--;
			$('.sliderwindow').scrollTo( '-='+sliderPos_x+'px', 500, { axis:'x' } ); 
	});	




	});

function fin(){
$('#slider .next').hover(function() {
$('.sliderwindow').scrollTo( '+=159px', 10, { axis:'x', onAfter: fin } );
}, function() {

  $(this).removeClass('pretty-hover');
});
};


	function specials_helper(intIndex){

		setTimeout(specials_fadeIn1,10);
		setTimeout(specials_fadeIn2,100);

	};

	function specials_fadeIn1(){
	
		$('#special_image_0').fadeIn(300,function(){
				
		});


	};

	function specials_fadeIn2(ij){
	
		$('#special_image_1').fadeIn(300,function(){

			$('#left').show(100,function(){
			
				$('#right').show(100,function(){
					special_scroller();
				});					
			});	
		});


	};
			
			
	function special_scroller(){

			$('#specials  .img0').scrollTo( '+=430px', 18000, { axis:'y' } ); 
			$('#specials  .img1').scrollTo( '+=430px', 18000, { axis:'y' } ); 
	};




