


willow.ready(function($) {
	
	//bulletin
	var bulloptions = {
		emButton: false
	};
	willow.getNews("11839",function(data){$('body').bulletin(data,bulloptions);},{"backlink":window.location});  
	
	
	//L1
	var options = {
		direction:"down",
		currentL1:0,
		showL3s: false,
		speed: 300
    };
	willow.getMenu("26099|25317|26100|28812|29401|133107|25417|25450",function(data){
		$('#nav').menu(data.menu,options);
    });
	
	
	//search	
	$("#search").pdSearch({showButton:true, showButtonClass:"searchSubmit",showButtonText:""});
	
	
	//photo
	/*
	$('#smPhotos_text').cycle({
		speed:700,
		timeout:5000,
		cleartype:0
	});
	$('#smPhotos_image').cycle({
		speed:700,
		timeout:5000
	});
	*/
	


	var photo_pause = 0;
	var thisInterval;

	var thisCaption = $("#smPhotos_text").cycle({
		speed:700,
		timeout:0,
		cleartype:0
	});
	
	var thisPhoto = $("#smPhotos_image").cycle({
		speed:700,
		timeout:0
	});

	$('#photo_prev').click(function(){
		if(photo_pause == 0){
			clearInterval(thisInterval);
			thisInterval = setInterval(function(){willow.rotateImages(thisPhoto,thisCaption);},5000);
		}
		thisCaption.cycle('prev');
		thisPhoto.cycle('prev');
	});
	
	$('#photo_next').click(function(){
		if(photo_pause == 0){
			clearInterval(thisInterval);
			thisInterval = setInterval(function(){willow.rotateImages(thisPhoto,thisCaption);},5000);
		}
		thisCaption.cycle('next');
		thisPhoto.cycle('next');
	});
	
	$('#photo_PlayPause').click(function(){	
		if(photo_pause == 0){
			photo_pause = 1;
			clearInterval(thisInterval);
			$("#photo_PlayPause a").css('background','url(/images/photo_play.png)');
			
		}else{
			photo_pause = 0;
			thisInterval = setInterval(function(){willow.rotateImages(thisPhoto,thisCaption);},5000);
			$('#photo_PlayPause a').css('background','url(/images/photo_pause.png)');
		}
	});
	

	thisInterval = setInterval(function(){willow.rotateImages(thisPhoto,thisCaption);},5000);
});	

willow.rotateImages = function(photoObj,captionObj){
	photoObj.cycle('next');
	captionObj.cycle('next');
}


