


jQuery(document).ready(function () {
	
	var content_h = jQuery('#site-container').height();
	jQuery('#site-shadow').css('height',content_h + 'px');
	jQuery("#search-input").focus(function() {
		jQuery("#search-input").css("background","#ffffff");
	});	
	jQuery("#search-input").blur(function() {
		if(jQuery("#search-input").val()=='') 
			jQuery("#search-input").css("background","#fff url(/fls/24100/site_graphics/search-bg.png) 0px 1px no-repeat");
	});

	jQuery("#Login_ID").focus(function() {
		jQuery("#Login_ID").css("background","#ffffff");
	});	
	jQuery("#Login_ID").blur(function() {
		if(jQuery("#Login_ID").val()=='') 
			jQuery("#Login_ID").css("background","#fff url(/fls/24100/site_graphics/enews-input-bg.png) no-repeat");
	});
/*rotator*/	

	jQuery('#rot-main').cycle({ 
		fx:     'fade', 
		speed:  1000, 
		timeout: 5000, 
		pager:  '#navbutton',
		next:   '#next', 
		prev:   '#prev',
		// callback fn that creates a thumbnail to use as pager anchor 
		pagerAnchorBuilder: function(idx) { 
			var tab = jQuery("#ButtonValue"+idx).attr("value");
			if(idx==0)
				return '<div class="button first"><a href="#">' + tab + '</a></div>'; 
			return '<div class="button"><a href="#">' + tab + '</a></div>'; 
		}
	});

// redefine Cycle's updateActivePagerLink function 
	jQuery.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
		jQuery("#navbutton").children().css('background', 'url(/fls/24100/site_graphics/rotatorbutton-off.png) no-repeat');
		jQuery(pager).find('a').removeClass('activeSlide')
			.filter('a:eq('+currSlideIndex+')').addClass('activeSlide').parent().css('background', 'url(/fls/24100/site_graphics/rotatorbutton-on.png) no-repeat');
	};
/*rotator video setup*/
	jQuery('#rotator .play-button').click(function(){
		jQuery('#rotator .main-image').fadeOut(500,function(){
			jQuery('#neulion-video').show();
			jQuery('#rotator .close-button').show();
			var clip_id = jQuery('#rotator .clip-id').html();
			neulionPlayer(clip_id);
		});
	});
	jQuery('#rotator .close-button').click(function(){
		jQuery('#neulion-video').fadeOut(500,function(){
			jQuery('#rotator .main-image').fadeIn(250);
		});	
		jQuery(this).hide();
	});


/*article video setup*/
	jQuery('.article .play-button').click(function(){
		jQuery('.article .image').fadeOut(500,function(){
			jQuery('#neulion-video').show();
			jQuery('.article .close-button').show();
			var clip_id = jQuery('.article .clip-id').html();
			neulionPlayer(clip_id);
		});
	});
	jQuery('.article .close-button').click(function(){
		jQuery('#neulion-video').fadeOut(500,function(){
			jQuery('.article .image').fadeIn(250);
		});	
		jQuery(this).hide();
	});

	jQuery("#videos .slider").easySlider({
		speed: 1000,
		prevId: "video-prevId",
		nextId: "video-nextId",
		prevText: "",
		nextText: "",
		continuous: true,
		w:504
	});


});


function PauseRotator() {
	jQuery('#rot-main').cycle('pause');
}

function ResumeRotator(){
	jQuery('#rot-main').cycle('resume');
}



