// **************************************************************************************************************************

// **************************************************************************************************************************
$(document).ready(function(){
		// slider
		$('.slider').orbit({
		   animation: 'fade', //fade, horizontal-slide, vertical-slide
		   animationSpeed: 700, //how fast animations are
		   advanceSpeed: 5000, //if timer advance is enabled, time between transitions
		   startClockOnMouseOut: true, //if timer should restart on MouseOut
		   startClockOnMouseOutAfter: 3000, //how long after mouseout timer should start again
		   directionalNav: false, //manual advancing directional navs
		   captions: true, //if has a title, will be placed at bottom
		   captionAnimationSpeed: 800, //how quickly to animate in caption on load and between captioned and uncaptioned photos
		   timer: $timer //if the circular timer is wanted
		}); //orbit

		$('.scroll-pane').jScrollPane();
//*************************************************************************************************************************************

	if($.browser.msie){
		$('.title-activity').css({'font-size':'10px'});
		$('.description-activity').css({'font-size':'10px'});
	}

	if($.browser.webkit){
		$('.title-activity').css({'font-size':'10px'});
		$('.description-activity').css({'font-size':'10px'});
	}
	
	$('.activity').each(function(){

		var $activity = $(this);
		$activity.hover(
			function(){
				$activity.find('.title-activity').addClass('ffhide');
				$activity.find('div.info-activity').animate(
					{
					'height' : '40px',
					'marginTop' : '40px'
					},
					400,
					function(){
						//$activity.find('p.description-activity').fadeIn(1);
					}
				)
				$activity.find('p.description-activity').fadeIn(1);
				},
			function() {
				$activity.find('p.description-activity').hide();
				$activity.find('div.info-activity').animate(
					{
						'height' : '20px',
						'marginTop' : '60px'
					},
					400,
					function (){
						$activity.find('p.description-activity').hide();
					})
					$activity.find('.title-activity').removeClass('ffhide');
			})
		$activity.click(function(){
			var src = url_base+"lightbox.php?id="+$activity.attr('rel')+"&lg="+lang;
			$.modal('<iframe src="' + src + '" height="200" width="400" style="border:0">', {
				containerCss:{
					backgroundColor:"#fff",
					borderColor:"#78CFC9",
					height:200,
					padding:0,
					width:400,
					border: "1px solid",
					"border-radius": "10px",
					"-moz-border-radius": "10px",
					"-webkit-border-radius": "10px",
						"box-shadow": "3px 2px 0 #AEAEAE",
					"-moz-box-shadow": "3px 2px 0 #AEAEAE",
					"-webkit-box-shadow": "3px 2px 0 #AEAEAE"
				},
				overlayClose:true
			});
		})
	})// activity hover
//*************************************************************************************************************************************

	$('.title-activity').truncate({
	max_length: 25,
	more: ' ',
	less: ' '
	});

})

