/**
 * spotlight.min.js
 * $Revision: 1.2 $
 *
 *  spotlight.min.js -- aggregated and minified
 *  DO NOT EDIT THIS FILE -- edit the individual files and rebuild
 *
 * Supports homepage spotlight (minified) 
 * 
 *   (c) 1992-2011 Cisco Systems, Inc. All rights reserved.
 *   Terms and Conditions: http://cisco.com/en/US/swassets/sw293/sitewide_important_notices.html
 * 
 *
 * MANIFEST:
 *      /web/fw/j/homepage_frag/_spotlight.js 1.17 
 */

/*
 * BEGIN /web/fw/j/homepage_frag/_spotlight.js
 */
if(window.cdc===undefined){window.cdc={}}if(cdc.homepage===undefined){cdc.homepage={}}cdc.homepage.spotlight={};document.getElementById("spotlight").config={autoRotate:true,rotateInterval:7000};cdc.homepage.spotlight.load=function(){var E=jQuery("#spotlight");jQuery("#spbb li").live("click",function(){if(jQuery(this).hasClass("ct")){return false}F(C(this));return false});jQuery("#spbb li").live("keypress",function(I){if(I.which==13){if(jQuery(this).hasClass("ct")){return false}F(C(this))}});function F(I){var K=jQuery("#spc ul:first>li:visible")[0];if(typeof K=="undefined"){K=jQuery("#spc ul:first>li")[0]}if((typeof K.config!="undefined")&&(typeof K.config.beforeSwitchAway!="undefined")){var J=function(){A(I)};K.config.beforeSwitchAway(K,J)}else{A(I)}}function A(I){jQuery(".spotlight-vid-error").remove();E.find("#spbb li").removeClass("ct");E.find("#spc li").hide();E.find("#spc li .fadeIn").css("visibility","hidden").hide();var J=jQuery(D(I));J.addClass("ct");if((typeof I.config!="undefined")&&(typeof I.config.beforeActivateHandler!="undefined")){I.config.beforeActivateHandler(I)}jQuery(I).fadeIn("slow",function(){jQuery("#default-image").remove();var N=100;jQuery(".fadeIn",this).each(function(){var O=jQuery(this);setTimeout(function(){O.css("visibility","visible").fadeIn()},N);N=N+1000});if(typeof I.animationQueue!="undefined"){for(var L=0;L<I.animationQueue.length;L++){var M=function(){var P=I.animationQueue[L].effect;var O=I;return function(){P(O)}};if(I.animationQueue[L].delay){N+=I.animationQueue[L].delay}setTimeout(M(),N)}}if((typeof I.config!="undefined")&&(typeof I.config.afterActivateHandler!="undefined")){var M=function(){var P=I.config.afterActivateHandler;var O=I;return function(){P(O)}};setTimeout(M(),N)}});try{trackEvent.event("impression",{elementtype:"impression",element_name:J.attr("rel")||"panel"+(J.prev().length+1),content_container:"SL",action:"impression"})}catch(K){}}if(jQuery.browser.msie&&jQuery.browser.version<9){jQuery("#spbb").show()}else{jQuery("#spbb").fadeIn("slow")}var C=function(I){return jQuery("#spc li")[jQuery(I).prevAll().length]};var D=function(I){return jQuery("#spbb li")[jQuery(I).prevAll().length]};var H=100;var B=[];var G=function(){var J=this;B.push(setTimeout(function(){F(C(J))},H));var I=E[0].config.rotateInterval;if((typeof jQuery(C(this))[0].config!="undefined")&&(typeof jQuery(C(this))[0].config.autoAdvanceInterval!="undefined")){I=jQuery(C(this))[0].config.autoAdvanceInterval}H+=I};cdc.homepage.spotlight.cancelSeq=function(){for(var I=0;I<B.length;I++){clearTimeout(B[I])}};E.find("#spbb li").each(G).first().each(G);E.find("#spbb li").click(cdc.homepage.spotlight.cancelSeq).bind("keypress",function(I){if(I.which==13){cdc.homepage.spotlight.cancelSeq()}});E.find("#spbb li").attr("tabindex","0");setTimeout(function(){E.find("#spc li .swappable").each(function(){var I=jQuery(this);I.attr("src",I.attr("rel"));I.removeClass("swappable")})},100);(function(){var J,K,I,L,M=document.createElement("div"),O=(navigator.platform=="iPad");jQuery("#spotlight .expandVid[href*=#]").live("click",function(){cdc.homepage.spotlight.cancelSeq();jQuery(".spotlight-vid-error").remove();if(!J){J=jQuery("#spotlight");K=jQuery("#spotlight-container");I=K.outerHeight();L=J.outerWidth()}var T=this.href.indexOf("#"),U=this.href.substring(T+1),S=jQuery("#"+U),P=S.find(".spotlight-vid"),Q=S.find(".spotlight-vid-done"),R=cdc.homepage.spotlight.videoConfigs[U];K.css("height",I);P.fadeIn(300,function(){J.hide();var V=P.outerHeight();K.animate({height:V},500,function(){S.append('<span class="spotlight-vid-loading">loading...</span>\n<a href="#" class="spotlight-vid-close spotlight-closer">Close [X]</a>');var X=false;var W=cdc.homepage.myPlayer=cdc.homeVideoPlayer.create(jQuery.extend({width:L,height:V,title:"Homepage Video",flashPlayerSwf:"/web/fw/lib/t1m-video/videoplayer.swf",errorCallback:function(){cdc.util.ensureNamespace("cdc.local.wpx");cdc.local.wpx=jQuery.extend({HOMEPAGE_VIDEO_ERROR:"I'm sorry, we're having trouble delivering our full content experience to you. Please review <a href=\"http://www.cisco.com/web/help/browser.html\">Browser Help</a> for details."},cdc.local.wpx);N();S.append('<div class="spotlight-vid-error"><p>'+cdc.local.wpx.HOMEPAGE_VIDEO_ERROR+'</p><a href="#" class="spotlight-vid-error-close spotlight-closer">Close [X]</a></div>')},readyToStartCallback:function(Y){M=Y.getContainer();jQuery(M).addClass("spotlight-vid-unshowable");P.append(M);Y.play();if(O){jQuery(M).removeClass("spotlight-vid-unshowable").addClass("spotlight-vid-showable");S.find(".spotlight-vid-loading").remove()}},playCallback:function(){jQuery(M).removeClass("spotlight-vid-unshowable").addClass("spotlight-vid-showable");S.find(".spotlight-vid-loading").remove();try{if(!X){trackEvent.event("video",{campaign_page:"us home page",content_container:"SL",element_type:"video",video_player:W.config.type,element_name:W.config.title,action:"start",video_length:""+Math.round(W.config.duration),video_offset:"0"})}trackEvent.event("video",{campaign_page:"us home page",content_container:"SL",element_type:"video",video_player:W.config.type,element_name:W.config.title,action:"click play",video_length:""+Math.round(W.config.duration),video_offset:""+Math.round(W.getOffset())})}catch(Y){}X=true},doneCallback:function(){X=false;try{trackEvent.event("video",{campaign_page:"us home page",content_container:"SL",element_type:"video",video_player:W.config.type,element_name:W.config.title,action:"end",video_length:""+Math.round(W.config.duration),video_offset:""+Math.round(W.getOffset())})}catch(Y){}jQuery(M).addClass("spotlight-vid-unshowable");Q.css("height",V+"px").fadeIn(500)}},R))})});return false});function N(){var R=jQuery(".spotlight-vid-close[href]");var S=R.closest(".spotlight-vid-container");var P=S.find(".spotlight-vid");var Q=S.find(".spotlight-vid-done");var T=S.find(".spotlight-vid-loading");T.remove();R.fadeOut(300,function(){R.remove()});cdc.homepage.myPlayer.destroy();jQuery(M).remove();setTimeout(function(){K.animate({height:I},300,function(){J.show();P.fadeOut(200);Q.fadeOut(200)})},200);return false}jQuery(".spotlight-vid-close[href]").live("click",N);jQuery(".spotlight-vid-error-close").live("click",function(){jQuery(".spotlight-vid-error").remove();return false});jQuery(".spotlight-vid-replay").live("click",function(){var P=jQuery(this).closest(".spotlight-vid-container").find(".spotlight-vid-done");if(cdc.homepage.myPlayer){P.fadeOut(300);cdc.homepage.myPlayer.play()}return false});jQuery(".spotlight-vid-container *").each(function(){var P=this.style.backgroundImage;if(P){P=P.replace(/(^url\(['"]?)|(['"]?\)$)/g,"");setTimeout(function(){var Q=new Image();Q.src=P},100)}})})()};if(typeof window.addEventListener!="undefined"){window.addEventListener("load",cdc.homepage.spotlight.load,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",cdc.homepage.spotlight.load,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",cdc.homepage.spotlight.load)}}}if(typeof cdc!="undefined"&&typeof cdc.includer!="undefined"&&typeof cdc.includer.alreadyInPage=="object"){cdc.includer.alreadyInPage.push("/web/fw/j/homepage_frag/_spotlight.js")};
