﻿// JScript File

<!--
            
            var scrollID;
            
            var transitionID;
            var endID;
            var transitionSteps = 10;
            var transitionDuration = 500;
            var transitionTween = 0.2; // 0.25 = ease out, 2 = ease in, 1 = linear
            
            function scrollToVideoRec( start, end, step, steps, duration ) {
               if (step <= steps) {
                    var newPos = start + parseInt((end - start) * Math.pow(step/steps, transitionTween) );
                    window.scrollTo( 0, newPos );
                    clearTimeout( scrollID );
                    scrollID = setTimeout( "scrollToVideoRec( " + start + ", " + end + ", " + (step + 1) + ", " + steps + ", " + duration + ");", parseInt( duration / steps ) );
                    
                }
            }
            
            function scrollToVideo() {
                scrollToVideoRec( 0, 295, 0, 10, 200 );
            }
            
            function scrollToTop() {
                scrollToVideoRec( 295, 0, 0, 10, 200 );
            }
            
            function newColor( startColor, endColor, step, steps ) { 
				var redStart, greenStart, blueStart;
				var redEnd, greenEnd, blueEnd;
				var redStep, greenStep, blueStep;
				var redStepHex, greenStepHex, blueStepHex;
				
				var stepAmount = Math.pow(step / steps, transitionTween);
				redStart = parseInt( startColor.substr( 1, 2 ), 16 );
				greenStart = parseInt( startColor.substr( 3, 2 ), 16 );
				blueStart = parseInt( startColor.substr( 5, 2 ), 16 );
				
				redEnd = parseInt( endColor.substr( 1, 2 ), 16 );
				greenEnd = parseInt( endColor.substr( 3, 2 ), 16 );
				blueEnd = parseInt( endColor.substr( 5, 2 ), 16 );
				
				redStep = redStart + parseInt(stepAmount * (redEnd - redStart) );
				greenStep = greenStart + parseInt(stepAmount * (greenEnd - greenStart) );
				blueStep = blueStart + parseInt(stepAmount * (blueEnd - blueStart) );
				
				redStepHex = (redStep > 16) ? redStep.toString( 16 ) : "0" + redStep.toString( 16 );
				greenStepHex = (greenStep > 16) ? greenStep.toString( 16 ) : "0" + greenStep.toString( 16 );
				blueStepHex = (blueStep > 16) ? blueStep.toString( 16 ) : "0" + blueStep.toString( 16 );
				
				//alert( startColor + ", " + endColor + ", " + steps + ", " + step + " => " + "#" + redStepHex + greenStepHex + blueStepHex );
				return "#" + redStepHex + greenStepHex + blueStepHex;
            }
            
            function transitionaliseAll( IDArray, startColorArray, endColorArray, styleArray, step, steps, duration  ) {
                var theItem;
                var atransitionID;
                if (step <= steps) {
                    for ( var i = 0; i < IDArray.length; i++ ) {

                        theItem = document.getElementById( IDArray[i] );
                        theItem.style[styleArray[i]] = newColor( startColorArray[i], endColorArray[i], step, steps );
                    }
                    //clearTimeout( transitionID );
                    atransitionID = setTimeout( "transitionaliseAll( " + textualiseArray( IDArray ) + ", " + textualiseArray( startColorArray ) + ", " + textualiseArray( endColorArray ) + ", " + textualiseArray( styleArray ) + ", " + (step + 1) + ", " + steps + ", " + duration + " );", parseInt( duration / steps ) );
                }
            }

            function highlightAllUp( IDArray, startColorArray, endColorArray, styleArray, step, steps, duration ) {
                transitionaliseAll( IDArray, startColorArray, endColorArray, styleArray, step, steps, duration );
            }
            
            function highlightAllDown( IDArray, startColorArray, endColorArray, styleArray, step, steps, duration ) {
                transitionaliseAll( IDArray, endColorArray, startColorArray, styleArray, step, steps, duration );
            }
            
            function highlightAll( IDArray, startColorArray, endColorArray, styleArray, upDuration ) {
                
                highlightAllUp( IDArray, startColorArray, endColorArray, styleArray, 0, transitionSteps, transitionDuration );
                endID = setTimeout( "highlightAllDown( " + textualiseArray( IDArray ) + ", " + textualiseArray( startColorArray ) + ", " + textualiseArray( endColorArray ) + ", " + textualiseArray( styleArray ) + ", 0, transitionSteps, transitionDuration );", (upDuration + transitionDuration) );
            }
            
            // used to pass arrays as a string using setTimeout
            function textualiseArray( theArray ) {
                return "new Array( \"" + theArray.join( "\", \"" ) + "\" )";
            }
            
            function highlightID( IDArray, startColorArray, endColorArray, styleArray, theDuration ) {
                var doIt = true;
                for (var i = 0; i < IDArray.length; i++ ) {
                    if (document.getElementById(IDArray[i])){
                    } else {
                        doIt = false;
                    }
                }
                
                if (doIt) {
                    highlightAll( IDArray, startColorArray, endColorArray, styleArray, theDuration );
                }
            }
            
            function highlightCategories( theDuration ) {
                highlightID( new Array( 'categories', 'categories_header', 'categories_header_text' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            
            function highlightInnovationAward( theDuration ) {
                highlightID( new Array( 'category_1', 'category_header_1', 'category_text_1' ), new Array( '#FFFFFF', '#333333', '#333333' ), new Array( '#000000', '#ff9933', '#FFFFFF'), new Array( 'backgroundColor', 'color', 'color' ), theDuration );
            }

            function highlightCustomerAward( theDuration ) {
                highlightID( new Array( 'category_2', 'category_header_2', 'category_text_2' ), new Array( '#FFFFFF', '#333333', '#333333' ), new Array( '#000000', '#ff9933', '#FFFFFF'), new Array( 'backgroundColor', 'color', 'color' ), theDuration );
            }
            
            function highlightPeopleAward( theDuration ) {
                highlightID( new Array( 'category_3', 'category_header_3', 'category_text_3' ), new Array( '#FFFFFF', '#333333', '#333333' ), new Array( '#000000', '#ff9933', '#FFFFFF'), new Array( 'backgroundColor', 'color', 'color' ), theDuration );
            }
            
            function highlightPerformanceAward( theDuration ) {
                highlightID( new Array( 'category_4', 'category_header_4', 'category_text_4' ), new Array( '#FFFFFF', '#333333', '#333333' ), new Array( '#000000', '#ff9933', '#FFFFFF'), new Array( 'backgroundColor', 'color', 'color' ), theDuration );
            }
            
            function highlightIntegrationAward( theDuration ) {
                highlightID( new Array( 'category_5', 'category_header_5', 'category_text_5' ), new Array( '#FFFFFF', '#333333', '#333333' ), new Array( '#000000', '#ff9933', '#FFFFFF'), new Array( 'backgroundColor', 'color', 'color' ), theDuration );
            }
            
            function highlightFeedback( theDuration ) {
                highlightID( new Array( 'feedback_box', 'feedback_header', 'feedback_headertext' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            function highlightLastYear( theDuration ) {
                highlightID( new Array( 'last_years_winners', 'last_years_winners_header_box', 'last_years_winners_header' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            function highlightKeyDates( theDuration ) {
                highlightID( new Array( 'key_dates', 'key_dates_header_box', 'key_dates_header' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            function highlightCall( theDuration ) {
                highlightID( new Array( 'call', 'call_header', 'call_text' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            function highlightVideo( theDuration ) {
                highlightID( new Array( 'currentVideo', 'video_header', 'video_header_text' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            function highlightNews( theDuration ) {
                highlightID( new Array( 'currentNews', 'news_header', 'news_header_text' ), new Array( '#E7E7E7', '#E7E7E7', '#ff9933' ), new Array( '#000000', '#000000', '#ff9933'), new Array( 'borderColor', 'backgroundColor', 'color' ), theDuration );
            }
            
            //-->