function vidboxHoverSM(imgid){ 
	document.getElementById(imgid).src = 'fls/3400/site_graphics/play_overlayMed.png' ;
}

function vidboxUnHoverSM (imgid){
	document.getElementById(imgid).src = 'fls/3400/site_graphics/play_overlaytMed.png' ;
}


/*START ROTATOR*/
jQuery(document).ready(function()  { 





	jQuery("#rotator .subrotator .item").click(function() {
	  jumpto(this); 
	 });	
	 
	 if (jQuery("#rotator").length > 0) {
	  rotateTimer = setTimeout("rotate();", rotatorTime);
	 }	
	 jQuery('#RightColTabsBackground').show();
	 jQuery('#RightColContentBackground').show();
	 
	 
	 //////////////////////////////////////Log In Drop Down//////////////////////////////////////////////////////
jQuery("#DropDownTrigger").toggle(
      function () {
        jQuery('#DropDownSignIn').slideDown();
        jQuery("#DropDownTrigger").addClass('down');
        jQuery("#DropDownTrigger").removeClass('up');
      },
      function () {
        jQuery('#DropDownSignIn').slideUp();
        jQuery("#DropDownTrigger").addClass('up');
        jQuery("#DropDownTrigger").removeClass('down');
      }
    );
    
    
    /*START onDemand slider*/
 
   if(jQuery("#RotatorBoxOnDemand").length>0) {       
        
        jQuery('#scrollerOnDemand').show();
        jQuery('#scrollerOnDemand') 
        .cycle({
            fx:     'scrollHorz',  
            speed:  'slow', 
            timeout: 0,         
            prev:    '#GoPrevOnDemand',
            next:    '#GoNextOnDemand',            
            slideExpr: 'div.VODgroup'                                        
       });   
    } 
    
    /*START Featured slider*/
 
   if(jQuery("#RotatorBoxFeatured").length>0) {       
        
        jQuery('#scrollerFeatured').show();
        jQuery('#scrollerFeatured') 
        .cycle({
            fx:     'scrollHorz',  
            speed:  'slow', 
            timeout: 0,         
            prev:    '#GoPrevFeatured',
            next:    '#GoNextFeatured',            
            slideExpr: 'div.FEATgroup'                                        
       });   
    } 
});

var setRotate = true;
var rotateTimer = null;
var rotatorTime = 5000;


 function stopRotate() {
 if (rotateTimer)
  clearTimeout(rotateTimer);
 setRotate = false;
}

function startRotate() {
 setRotate = true;
 rotateTimer = setTimeout("rotate();", rotatorTime);
}

function toggleRotate() {
 if (setRotate)
  stopRotate();
 else
  startRotate(); 
}

function rotate() {
 if (setRotate) {
  activetab = jQuery("#rotator .subrotator .item.active"); 
  activeindex = jQuery("#rotator .subrotator .item").index(activetab);
  nextindex = activeindex + 1;
  if (nextindex == 8)
   nextindex = 0;
  jumpto(jQuery("#rotator .subrotator .item:eq("+nextindex+")"));
 }
}



function rotateForward() {
 activetab = jQuery("#rotator .subrotator .item.active"); 
 activeindex = jQuery("#rotator .subrotator .item").index(activetab);
 nextindex = activeindex + 1;
 if (nextindex == 8)
  nextindex = 0;
 jumpto(jQuery("#rotator .subrotator .item:eq("+nextindex+")"));
}

function rotateBack() {
 activetab = jQuery("#rotator .subrotator .item.active"); 
 activeindex = jQuery("#rotator .subrotator .item").index(activetab);
 nextindex = activeindex - 1;
 if (nextindex == -1)
  nextindex = 7;
 jumpto(jQuery("#rotator .subrotator .item:eq("+nextindex+")"));
}

function jumpto(tabobj) {
 tabindex = jQuery("#rotator .subrotator .item").index(tabobj);
 oldtab = jQuery("#rotator .subrotator .item.active"); 
 oldindex = jQuery("#rotator .subrotator .item").index(oldtab);
 
 if (tabindex != oldindex) {
  jQuery(tabobj).addClass('active');
  jQuery(oldtab).removeClass('active');
  
  jQuery("#rotator .story:eq("+oldindex+")").fadeOut(500);
  jQuery("#rotator .story:eq("+tabindex+")").fadeIn(500);
 }
 
 if (rotateTimer)
  clearTimeout(rotateTimer);
 if (setRotate)
  rotateTimer = setTimeout("rotate();", rotatorTime);
}



function showNeuLionVid(vidid){
	//rotatorStop();
	jQuery("#rotatorblack").show();
	jQuery("#NeulionVidContainer").show();
	neulionPlayer(vidid);
	stopRotate();
	playerRunning = true;
}

function hideNeuLionVid(){
	if (jQuery("#NeulionVidContainer").css('display') != 'none'){
		jQuery("#rotatorblack").hide();
		jQuery("#NeulionVidContainer").hide();
		slProxy("hide"); // handle Silverlight
		if (jQuery("#jtvshlembed") && document.getElementById('jtvshlembed').pauseVideo){
			document.getElementById('jtvshlembed').pauseVideo();
			playerRunning = false;
		}
		startRotate();
	}
}


//////////////////////////////////////////////END RYAn rotator///////////////////////////////////////////////



/*START SCHEDULE*/
 function getTop() {
	// get the top of the content
	var top = jQuery('#scroll-content').css('top');
	return trimPx(top);
}

function getHeight(id) {
	// get the height, including padding
	var height = jQuery(id).height();
	var paddingTop = trimPx(jQuery(id).css("padding-top"));
	var paddingBottom = trimPx(jQuery(id).css("padding-bottom"));

	return height + paddingTop + paddingBottom;
}

function trimPx(value) {
	// remove "px" from values
	var pos = value.indexOf("px");
	if (pos != 0)
		return parseInt(value.substring(0, pos));
	else
		return 0;
}

var container;
var content;
var hidden;	// # of pixels hidden by the container

function setScrollerDimensions() {
	container = getHeight("#scroll-container");
	content = getHeight("#scroll-content");
	hidden = content - container;
}

function resetScroller() {
	setScrollerDimensions();
	jQuery('#scroll-content').css('top', 0);
}


jQuery(document).ready(function() {
if(jQuery("#scroll-controls").length>0) {
  jQuery('#scroll-controls').show(); 
    
   jQuery('.up-arrow').fadeTo("slow", 0.60);
                
	setScrollerDimensions();

	jQuery('#scroll-controls a.up-arrow').click(function() {
		return false;
	});

	jQuery('#scroll-controls a.down-arrow').click(function() {
		return false;
	});
	
	jQuery('#scroll-controls a.down-arrow').hover(	
		function() {
			if (hidden > 0) {
				var current = getTop();
				jQuery('#scroll-content').animate({ top: -hidden }, Math.abs(current - hidden) * 5);
		
                
                jQuery('.down-arrow').fadeTo("slow", 0.60);
                jQuery('.up-arrow').fadeTo("slow", 1);

			}
		},
		function() {
			jQuery('#scroll-content').stop();
		}
	);

	jQuery('#scroll-controls a.up-arrow').hover(
		function() {
			if (hidden > 0) {
				var current = getTop();
				jQuery('#scroll-content').animate({ top: "0" }, Math.abs(current) * 5);
	
                jQuery('.up-arrow').fadeTo("slow", 0.60);
                jQuery('.down-arrow').fadeTo("slow", 1);
			}
		},
		function() {
			jQuery('#scroll-content').stop();
				
		}
	);
}
	});




	
 function getTop2() {
	// get the top of the content
	var top2 = jQuery('#scroll-content2').css('top');
	return trimPx2(top2);
}
function getHeight2(id) {
	// get the height, including padding
	var height2 = jQuery(id).height();
	var paddingTop2 = trimPx2(jQuery(id).css("padding-top"));
	var paddingBottom2 = trimPx2(jQuery(id).css("padding-bottom"));

	return height2 + paddingTop2 + paddingBottom2;
}

function trimPx2(value) {
	// remove "px" from values
	var pos3 = value.indexOf("px");
	if (pos3 != 0)
		return parseInt(value.substring(0, pos3));
	else
		return 0;
}	
	
	
var container2;
var content2;
var hidden2;	// # of pixels hidden by the container

function setScrollerDimensions2() {
	container2 = getHeight2("#scroll-container2");
	content2 = getHeight2("#scroll-content2");
	hidden2 = content2 - container2;
}

function resetScroller2() {
	setScrollerDimensions2();
	jQuery('#scroll-content2').css('top', 0);
}


jQuery(document).ready(function() {
if(jQuery("#scroll-controls2").length>0) {
  jQuery('#scroll-controls2').show(); 
    
   jQuery('.up-arrow').fadeTo("slow", 0.60);
                
	setScrollerDimensions2();

	jQuery('#scroll-controls2 a.up-arrow').click(function() {
		return false;
	});

	jQuery('#scroll-controls2 a.down-arrow').click(function() {
		return false;
	});
	
	jQuery('#scroll-controls2 a.down-arrow').hover(	
		function() {
			if (hidden2 > 0) {
				var current2 = getTop2();
				jQuery('#scroll-content2').animate({ top: -hidden2 }, Math.abs(current2 - hidden2) * 5);
		
                
                jQuery('.down-arrow').fadeTo("slow", 0.60);
                jQuery('.up-arrow').fadeTo("slow", 1);

			}
		},
		function() {
			jQuery('#scroll-content2').stop();
		}
	);

	jQuery('#scroll-controls2 a.up-arrow').hover(
		function() {
			if (hidden2 > 0) {
				var current2 = getTop2();
				jQuery('#scroll-content2').animate({ top: "0" }, Math.abs(current2) * 5);
	
                jQuery('.up-arrow').fadeTo("slow", 0.60);
                jQuery('.down-arrow').fadeTo("slow", 1);
			}
		},
		function() {
			jQuery('#scroll-content2').stop();
				
		}
	);
}
    	
    	
	});
///////////////////////////////////TABS Ajax See RightColTabs ///////////////////////////////////////

       
    	

	


jQuery.fn.fadeIn = function(speed, callback) { 
    return this.animate({opacity: 'show'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeOut = function(speed, callback) { 
    return this.animate({opacity: 'hide'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeTo = function(speed,to,callback) { 
    return this.animate({opacity: to}, speed, function() { 
        if (to == 1 && jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 














	
	/******************************************************************************
	START Twitter
******************************************************************************/

function getBaseUrl() {
	urlTokens = window.location.href.split('/');
	url = urlTokens[0]+'//'+urlTokens[2];	
	return url;
}



function addTwit(twitterText,twitterDate) {
	var start = twitterText.indexOf("http://");
	if(start>0) {
		for(var x=start;x<=twitterText.length;x++) {
			var currentCharacter = twitterText[x];	//non-IE browsers
			if(currentCharacter == 'undefined')
				currentCharacter = twitterText.charAt(x);	//IE only
			if(currentCharacter==" ") {
				var end = x;
				break;
			}	
			var end = x;
		}				
		var linkText = twitterText.substring(start,end); 
		var newLinkText = '<a target="_BLANK" class="twitter-link" href="'+linkText+'">'+linkText+'</a>';
		var twitterText = twitterText.replace(linkText,newLinkText); 
	}
	//List of twitter names to remove from start of twitter postings
	var replaceTwitterNames = new Array('bradleybraves:');
	for(x=0;x<replaceTwitterNames.length;x++) {
		twitterText = twitterText.replace(replaceTwitterNames[x],"");
	}

	jQuery("#tweets").append('<div class="tweet">'+twitterText+'</div><div class="tweet-time">'+twitterDate+'</div>');	
}

/******************************************************************************
	END Twitter
******************************************************************************/
	


/*END SCHEDULE*/






