$(document).ready(function(){activateMovieJump();$(".channel_list li a").each(function(B){$(this).click(function(){newClass="on-ch_"+(B+1);$("#channels").removeClass().addClass(newClass);$("#selected_info").empty();this.blur();return false})});$(".channel_set li a").each(function(B){$(this).append("<span class='play-instruct'>Click to Play</span>");$(this).hover(function(){$(this).find(".play-instruct").show();clipInfo=$(this).next(".clip_info").html();$("#selected_info").html(clipInfo)},function(){$(this).find(".play-instruct").hide()})});var A=$(".rating_app li div a").parent().parent().parent().parent().children("p.title");$(".rating_app li div a").click(function(){location.href=""});$(".rating_app li div a").hover(function(){$(A).text($(this).attr("title"))},function(){var C=$(this).parent().parent().parent().parent();var D=$(C).children().children().children().children("a.selected");if($(D).is("a.selected")){var B=$(D).find("a.selected");$(A).text($(D).attr("title"))}else{$(A).text($(A).attr("title"))}});navList()});

function activateMovieJump(){$("ul#cmd div.activate").hover(function(){$("#expand").css("top","0px").css("left","-92px");$("#drop_down_shim").css("width",$("#expand").outerWidth()-22).css("height",$("#expand").outerHeight()-22).show();$(".topwrap").css("width",$("#expand").outerWidth()+22);$(".bottomwrap").css("width",$("#expand").outerWidth()+22);$(".leftwrap").css("height",$("#expand").outerHeight());if($.browser.msie&&(typeof XMLHttpRequest=="function"||!window.XMLHttpRequest)){$(".rightwrap").css("height",$("#expand").outerHeight()+6).css("width",$("#expand").outerWidth()+6);var E=$("#movieDropDownContents").outerHeight();var C=$("#movieDropDownContents").outerWidth();var D="<IFRAME id='dropdown-cover' style='height:"+E+"px; width:"+C+"px; position: absolute;' src='javascript:false;' frameBorder='0' scrolling='no'></IFRAME>";$(D).insertBefore("#movieDropDownContents")}else{$(".rightwrap").css("height",$("#expand").outerHeight()).css("width",$("#expand").outerWidth())}$("#locationDropDown").removeClass("open");$("#location_search_field input.input_search").blur();$("#drop_down_shadow").show()},function(){$("#drop_down_shadow").hide();if($("#dropdown-cover")){$("#dropdown-cover").remove()}$("#expand").css("top","-9999px").css("left","-9999px")});if($("#location_search_field input.input_search").size()>0){var B=$("#HeaderContainer").offset();var A=$("#location_search_field input.input_search").offset();$("#locationDropDown").css("top",A.top+-B.top+19).css("left",A.left-B.left);$("#location_search_field input.input_search").focus(function(){if($("#locationDropDownContents").children().size()>0){$("#locationDropDown").toggleClass("open");$("#locationDropDown").hover(function(){$(this).show()},function(){$(this).removeClass("open")});$("#locationDropDownContents a").click(function(){$("#location_search_field input.input_search").attr("value",$(this).html());$("#locationDropDown").removeClass("open")})}})}}navList=function(){if(document.all&&document.getElementById){navRoot=document.getElementById("nav");for(i=0;navRoot!=null&&i<navRoot.childNodes.length;i++){node=navRoot.childNodes[i];if(node.nodeName=="LI"){node.onmouseover=function(){this.className+=" over";navCover()};node.onmouseout=function(){this.className=this.className.replace(" over","");navUnCover()}}}}};

function navCover(){if($.browser.msie&&(typeof XMLHttpRequest=="function"||!window.XMLHttpRequest)){if($("li.over > ul").size()>0){var B=$("li.over > ul");navHeight=B.height()+5;if($(B).parent().attr("id")=="nav_myfandango"){var A="<IFRAME id='nav-cover' style='height:"+navHeight+"px; left: -85px;' src='javascript:false;' frameBorder='0' scrolling='no'></IFRAME>"}else{var A="<IFRAME id='nav-cover' style='height:"+navHeight+"px;' src='javascript:false;' frameBorder='0' scrolling='no'></IFRAME>"}$(A).insertBefore(B)}}}

function navUnCover(){if($.browser.msie&&(typeof XMLHttpRequest=="function"||!window.XMLHttpRequest)){$("#nav-cover").remove()}}

function fieldClear(A){if(A.Val){if(A.value==""){A.value=A.Val;A.Val=null;A.first=null}else{A.Val=null}}else{if(!A.first){A.Val=A.value;A.value="";A.first="true"}}}

function RefreshAds(){var B=[];var A=[];$(".AdUnit").each(function(D){var C=$(this).html();var F=C.substring(C.indexOf("ord=")+4,C.indexOf("?"));var E=C.indexOf(F);while(E>=0){C=C.replace(F,GenerateRandomNumber());E=C.indexOf(F)}if(C!=$(this).html()){A[D]=this.id;B[D]=C;this.innerHTML=""}});for(i=0;i<B.length;i++){document.getElementById(A[i]).innerHTML=B[i]}}

function GenerateRandomNumber(){var B="0";var A=new Date();B+=A.getHours();B+="0";B+=A.getMinutes();B+=A.getSeconds();B+=B;return B}

function ReportToWss(C){if(C!=null){var F=(C+"");if(typeof (C)!="string"){F=$(C).attr("name")}var A=ToNameValueArray(F);if(A!=null){var D=A.lid;var B=A.lpos;if(D!=null&&D.length>0){if(B==null||B.length<=0){B=D}try{_hbLink(D,B)}catch(E){alert("WSS error:\n"+E)}}}}}

function ToNameValueArray(E){var A=new Array();if(E!=null&&typeof (E)=="string"){var B=E.split("&");if(B!=null&&B.length>0){for(var C=0;C<B.length;C++){var D=B[C].split("=");if(D!=null&&D.length>1){A[D[0]]=D[1]}}}}return A}

function WriteToContainer(A,D,C){var B=document.getElementById(A);var F=10;var E=500;if(C==null){C=0}if(B){B.innerHTML=D}else{if(C<=F){C++;D=D.replace(/"/g,'\\"');window.setTimeout('WriteToContainer("'+A+'","'+D+'",'+C+");",E)}}}

function addEvent(D,C,A){if(D.addEventListener){D.addEventListener(C,A,false);return true}else{if(D.attachEvent){var B=D.attachEvent("on"+C,A);return B}else{return false}}}

function removeEvent(E,D,B,A){if(E.removeEventListener){E.removeEventListener(D,B,A);return true}else{if(E.detachEvent){var C=E.detachEvent("on"+D,B);return C}else{alert("Handler could not be removed")}}}

function DisplayNewReleases(){$("#BestSellers").hide();$("#NewReleases").show();$("#BestSellersLink").removeClass();$("#NewReleasesLink").addClass("active");ReportToWss(newReleasesDiv)}

function DisplayBestSellers(){$("#BestSellers").show();$("#NewReleases").hide();$("#BestSellersLink").addClass("active");$("#NewReleasesLink").removeClass();ReportToWss(bestSellersDiv)}

function DisplayPreviousMonth(A){var B=document.getElementById("NextMnthLink");var C=document.getElementById("CurMnthLink");A.className="active";if(B!=undefined){B.className=""}if(C!=undefined){C.className=""}$("#PreviousMonth").show();$("#CurrentMonth").hide();$("#NextMonth").hide();ReportToWss(A)}

function DisplayCurrentMonth(A){var B=document.getElementById("NextMnthLink");var C=document.getElementById("PrevMnthLink");A.className="active";if(B!=undefined){B.className=""}if(C!=undefined){C.className=""}$("#PreviousMonth").hide();$("#CurrentMonth").show();$("#NextMonth").hide();ReportToWss(A)}

function DisplayNextMonth(A){var C=document.getElementById("PrevMnthLink");var B=document.getElementById("CurMnthLink");A.className="active";if(C!=undefined){C.className=""}if(B!=undefined){B.className=""}$("#PreviousMonth").hide();$("#CurrentMonth").hide();$("#NextMonth").show();ReportToWss(A)}var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gReturnFunc;var gPopupIsShown=false;var gDefaultPage="";var gHideSelects=false;var gReturnVal=null;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");if(!document.all){document.onkeypress=keyDownHandler}



function initPopUp(){theBody=document.getElementsByTagName("BODY")[0];popmask=document.createElement("div");popmask.id="popupMask";popcont=document.createElement("div");popcont.id="popupContainer";popcont.innerHTML='<div id="popupInner"><div id="popupTitleBar"><div id="popupTitle"></div><div id="popupControls"><img src="close.gif" onclick="hidePopWin(false);" id="popCloseBox" /></div></div><iframe src="'+gDefaultPage+'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe></div>';theBody.appendChild(popmask);theBody.appendChild(popcont);gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");var A=parseInt(window.navigator.appVersion.charAt(0),10);if(A<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true}$("a.submodal, a.submodal-width-height").click(function(){var C=400;var B=200;params=this.className.split("-");if(params.length==3){C=parseInt(params[1]);B=parseInt(params[2])}showPopWin(this.href,C,B,null);return false})}

function showPopWin(B,F,A,D,C){if(C==null||C==true){document.getElementById("popCloseBox").style.display="none"}else{document.getElementById("popCloseBox").style.display="none"}gPopupIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopupContainer.style.display="block";centerPopWin(F,A);var E=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.width=F+"px";gPopupContainer.style.height=(A+E+2)+"px";setMaskSize();gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)+"px";gPopFrame.style.height=(A)+"px";gPopFrame.src=B;gReturnFunc=D;if(gHideSelects==true){hideSelectBoxes()}window.setTimeout("setPopTitle();",600)}var gi=0;

function centerPopWin(G,A){if(gPopupIsShown==true){if(G==null||isNaN(G)){G=gPopupContainer.offsetWidth}if(A==null){A=gPopupContainer.offsetHeight}var E=document.getElementsByTagName("BODY")[0];var B=parseInt($(document).scrollTop(),10);var D=parseInt(E.scrollLeft,10);setMaskSize();var F=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);var C=$(window).height();var H=$(window).width();gPopupContainer.style.top=(B+((C-(A+F))/2))+"px";gPopupContainer.style.left=(D+((H-G)/2))+"px"}}$(window).resize(centerPopWin);$(window).scroll(centerPopWin);

function setMaskSize(){var B=document.getElementsByTagName("BODY")[0];var A=$(window).height();var C=$(window).width();if(A>B.scrollHeight){popHeight=A}else{popHeight=B.scrollHeight}if(C>B.scrollWidth){popWidth=C}else{popWidth=B.scrollWidth}gPopupMask.style.height=popHeight+"px";gPopupMask.style.width=popWidth+"px"}

function hidePopWin(A){gPopupIsShown=false;var B=document.getElementsByTagName("BODY")[0];B.style.overflow="";restoreTabIndexes();if(gPopupMask==null){return }gPopupMask.style.display="none";gPopupContainer.style.display="none";if(A==true&&gReturnFunc!=null){gReturnVal=window.frames.popupFrame.returnVal;window.setTimeout("gReturnFunc(gReturnVal);",1)}gPopFrame.src=gDefaultPage;if(gHideSelects==true){displaySelectBoxes()}}

function setPopTitle(){return ;if(window.frames.popupFrame.document.title==null){window.setTimeout("setPopTitle();",10)}else{document.getElementById("popupTitle").innerHTML=window.frames.popupFrame.document.title}}

function keyDownHandler(A){if(gPopupIsShown&&A.keyCode==9){return false}}

function disableTabIndexes(){if(document.all){var C=0;for(var B=0;B<gTabbableTags.length;B++){var D=document.getElementsByTagName(gTabbableTags[B]);for(var A=0;A<D.length;A++){gTabIndexes[C]=D[A].tabIndex;D[A].tabIndex="-1";C++}}}}

function restoreTabIndexes(){if(document.all){var C=0;for(var B=0;B<gTabbableTags.length;B++){var D=document.getElementsByTagName(gTabbableTags[B]);for(var A=0;A<D.length;A++){D[A].tabIndex=gTabIndexes[C];D[A].tabEnabled=true;C++}}}}

function hideSelectBoxes(){for(var A=0;A<document.forms.length;A++){for(var B=0;B<document.forms[A].length;B++){if(document.forms[A].elements[B].tagName=="SELECT"){document.forms[A].elements[B].style.visibility="hidden"}}}}

function displaySelectBoxes(){for(var A=0;A<document.forms.length;A++){for(var B=0;B<document.forms[A].length;B++){if(document.forms[A].elements[B].tagName=="SELECT"){document.forms[A].elements[B].style.visibility="visible"}}}}var place=0;var panes=0;var num=0;var placesInPane=5;var currPos=-1;var infoShowArray=new Array();var timeOutArray=new Array();var movieHeight=0;var movieWidth=560;$(function(){$(".movie-set .movie .image").each(function(A){if($(this).parent().height()>movieHeight){movieHeight=$(this).parent().height()}num++});movieHeight+="px";if(num>placesInPane){$("#upcoming").prepend("<div id='prev'><a id='lnkPrev' href='javascript:void(0)' name='&lid=NU_MDC_Scroll&lpos=NU_MDC_Back' onclick='ReportToWss(document.getElementById(\"lnkPrev\")); return false;'>previous</a></div>");$("#prev").click(function(){updateMoviePane("-");if(infoShowArray[currPos]){hideMovieInfo(currPos);clearTimeout(timeOutArray[currPos])}});$("#upcoming").prepend("<div id='next'><a  id='lnkNext' href='javascript:void(0)' name='&lid=NU_MDC_Scroll&lpos=NU_MDC_Next' onclick='ReportToWss(document.getElementById(\"lnkNext\")); return false;'>next</a></div>");$("#next").click(function(){updateMoviePane("+");if(infoShowArray[currPos]){hideMovieInfo(currPos);clearTimeout(timeOutArray[currPos])}});$("#next").show();panes=Math.ceil($(".movie").length/placesInPane);$("#upcoming").prepend("<ul id='moviePaneNav'></ul>");for(x=0;x<panes;x++){thisID="pane"+x;$("#moviePaneNav").append("<li><a href='#' id='"+thisID+"' name='&lid=NU_MDC_Scroll&lpos=NU_MDC_"+(x+1)+"' onclick='updateMoviePane("+x+');ReportToWss(document.getElementById("'+thisID+"\")); return false;'>"+parseInt(x+1)+"</a></li>")}$("#moviePaneNav a:first").addClass("selected");$("#moviePaneNav li:first").css("background","none")}});$(function(){});function showMovieInfo(A,C){var B={};B=$(A).offset({scroll:true});currPos=C;currLeft=B.left+80+"px";currTop=B.top+108+"px";currInfo=$(".movie-info").get(C);$(currInfo).css("top",currTop).css("left",currLeft).show();infoShowArray[C]=true;$(".movie-info .pointer, .movie-info .pointerRight").css("visibility","visible")}

function showMovieInfoBox(A,C){var B={};B=$(A).offset({scroll:true});currPos=C;currLeft=B.left+115+"px";currTop=B.top+-45+"px";currInfo=$(".movie-info-box").get(C);$(currInfo).css("top",currTop).css("left",currLeft).show();infoShowArray[C]=true;$(".movie-info-box .pointer, .movie-info-box .pointerRight").css("visibility","visible")}

function hideMovieInfo(A){$(currInfo).hide();infoShowArray[A]=false}

function showMovieInfoLeft(A,C){var B={};B=$(A).offset({scroll:true});currPos=C;currLeft=B.left-190+"px";currTop=B.top+108+"px";currInfo=$(".movie-info").get(C);$(currInfo).css("top",currTop).css("left",currLeft).show();infoShowArray[C]=true;$(".movie-info .pointer, .movie-info .pointerRight").css("visibility","visible")}

function updateMoviePane(A){if(typeof (A)=="number"){place=A}else{if(A=="+"){place++}else{if(A=="-"){place--}}}pxNew=movieWidth*place;$(".movie-set").animate({left:-pxNew},500,function(){updateMoviePaneNav()})}

function updateMoviePaneNav(){if(place==0){$("#prev").hide();$(".movie-set").css("left","1px")}else{$("#prev").show()}if(place==panes-1){$("#next").hide()}else{$("#next").show()}$("#moviePaneNav a").removeClass("selected");$("#moviePaneNav a").filter("#pane"+place).addClass("selected")};