/*
        -------------------------------------------------------------------------------------------------------
        Properties:	News page onLoadHandler
        Overview:	This function will get triggered once the content has loaded.
        -------------------------------------------------------------------------------------------------------
*/
jQuery(document).ready(function(){

        //Top Content Link Animations  
    	jQuery("#incominglinks .link").hover
        (
                function () 
                {
        		jQuery(this).prevAll().dequeue().fadeTo(500,0.4);
        		jQuery(this).nextAll().dequeue().fadeTo(500,0.4);
                },
                function() 
                {
        		jQuery(this).prevAll().dequeue().fadeTo(500,1,function(){if (jQuery.browser.msie) this.style.removeAttribute('filter')});
        		jQuery(this).nextAll().dequeue().fadeTo(500,1,function(){if (jQuery.browser.msie) this.style.removeAttribute('filter')});
        	}
        );
});



/*
        -------------------------------------------------------------------------------------------------------
        Properties:	Top Overlay Interaction
        Overview:	This function will operate the labs overlay posited at the top of the screen.
        -------------------------------------------------------------------------------------------------------
*/
var curSelected = 0;
var curTotal = 1;
function scrollTopOverlay(strDir)
{
        if (strDir=="right")
        {
            curSelected++;  
        }
        //alert("hi");
        if (strDir=="left")
        {
                curSelected--;
        }
        
        if (curSelected>curTotal)
        {
              curSelected=0;  
        }
        
        if (curSelected<0)
        {
               curSelected=curTotal; 
        }
        
        jQuery("#scrollContentJS").animate({marginLeft: -(650*curSelected)}, {duration: 600, easeMethod: 'easeout'});
}

/*
        -------------------------------------------------------------------------------------------------------
        Functions:	TTI News: Functions
        Overview:	These functions and properties operates the news fading	& overlays
        -------------------------------------------------------------------------------------------------------
*/
        function NewsStyleOverlay()
        {
                var newOverlay = new Overlay();
                newOverlay.width = 435;
                newOverlay.height = 245;
                newOverlay.className = "NewsStyleOverlay";
                newOverlay.fade = false;
                newOverlay.Generate();
                
                //Insert Content
                var htmlContent = "";
                htmlContent += "<div style='width:100%;padding-top:70px;text-align:center'><img  style='height:124px;width:153px' onclick='parseNewsStyleOption(0)' src='"+TTI_domain+"images/news/summary.jpg' /><img  style='height:124px;width:153px' onclick='parseNewsStyleOption(1)' src='"+TTI_domain+"images/news/default.jpg' /></div>";
                
                newOverlay.InsertContent(htmlContent);
        }
        
        function parseNewsStyleOption(intOption)
        {
                //Clear Old Cookie
                if (intOption==0 || intOption==1)
                {
                        Cookie.Erase("ttiNewsStyle");
                }
                
                //Summary Option Selected
                if (intOption==0)
                {
                        Cookie.Create("ttiNewsStyle","0");
                }
                
                //Default Option Selected
                if (intOption==1)
                {
                        Cookie.Create("ttiNewsStyle","1");  
                }
                
                ///Reload Document
                document.location = document.location;
        }
        
        
