NexxarLib.downloadManager={textLayerStyle:"",subNodeCounter:{},add:function(a){if(!this.subNodeCounter[a]){this.subNodeCounter[a]=1}else{this.subNodeCounter[a]++}return this},showLayer:function(d){if(!d||!d.id){return}var a=d.id.replace(/^[^0-9]*([0-9]+)[^0-9]*$/,"$1");if(!this.subNodeCounter[a]||this.subNodeCounter[a]<=0){return}var b=this.subNodeCounter[a];if(b>1){$("#li"+a).removeClass("initialState").removeClass("closed").removeClass("openedSingle").removeClass("opened").addClass("opened")}else{$("#li"+a).removeClass("initialState").removeClass("closed").removeClass("openedSingle").removeClass("opened").addClass("openedSingle")}$("#ulULLevel"+a).css("display","block");$("#ulLevel"+a).slideDown("normal",function(){if(d.id!="treeIconClosed"+a){$("#treeIconClosed"+a+"ID").css("display","none")}else{$(d).css("display","none")}$("#treeIconOpened"+a+"ID").css("display","block").parent().toggleClass("forceRedraw")});var c=$.cookies.get("gb2008_ssrDLStateen");if(!c||c.match(/[^+0-9]/)){c=""}$.cookies.set("gb2008_ssrDLStateen",c+"+"+a);return true},hideLayer:function(d){if(!d||!d.id){return}var a=d.id.replace(/^[^0-9]*([0-9]+)[^0-9]*$/,"$1");if(!this.subNodeCounter[a]||this.subNodeCounter[a]<=0){return}$("#ulLevel"+a).slideUp("normal",function(){$("#li"+a).removeClass("initialState").removeClass("closed").removeClass("openedSingle").removeClass("opened").addClass("closed");$("#l2t"+a).css("display","inline")});if(d.id!="treeIconOpened"+a){$("#treeIconOpened"+a+"ID").css("display","none")}else{$(d).css("display","none")}$("#treeIconClosed"+a+"ID").css("display","block").parent().toggleClass("forceRedraw");var b=$.cookies.get("gb2008_ssrDLStateen");if(!b||b.match(/[^+0-9]/)){b=""}else{var e=b.split("+");b="";for(var c=0;c<e.length;c++){if(e[c]!=a&&String(e[c]).length>0){b+="+"+e[c]}}}$.cookies.set("gb2008_ssrDLStateen",b);return true},restoreLayerState:function(){var e="div.content div.filelist div.ulLevel2 {display: none; }div.content div.filelist div.treeIcons img.treeIconClosed {display: block;} div.content div.filelist div.treeIcons img.treeIconOpened {display: none;} div.content div.filelist li.initialState div.level2text {display: inline;} ";var f=$.cookies.get("gb2008_ssrDLStateen");if(!f||f.match(/[^+0-9]/)){f=[]}else{f=f.split("+")}var c=[];for(var b in this.subNodeCounter){var d=(f.length>0&&($.inArray(b,f)<0))?true:false;if(!d&&this.subNodeCounter[b]>0){e+="div.content div.filelist li.initialState div#l2t"+b+" span.seeAllNote {display: none;} "}if(!d){c[c.length]=b}}f=c;for(var a=0;a<f.length;a++){if(String(f[a]).length>0){e+="div.content div.filelist div#ulLevel"+f[a]+" {display: block;} div.content div.filelist img#treeIconClosed"+f[a]+"ID {display: none;} div.content div.filelist img#treeIconOpened"+f[a]+"ID {display: block;} "}}$("head").append('<style type="text/css">'+e+"</style>")},hideOrShowFileLink:function(a,b){if(/file..=([-_a-zA-Z0-9]+\.(?:pdf|xls))/.test(jQuery(a).attr("href"))){var c=RegExp.$1;if(!b||b!="show"){$("div.filelist a[href*='="+c+"'][href*='collection.php?action=add']").css("display","none").parent().children("span.separator").css("display","none")}else{$("div.filelist a[href*='="+c+"'][href*='collection.php?action=add']").css("display","inline").parent().children("span.separator").css("display","inline")}}},handleFile:function(a,c){if(/file..=([-_a-zA-Z0-9]+\.(?:pdf|xls))/.test(jQuery(a).attr("href"))){var b=RegExp.$1;$.getJSON(jQuery(a).attr("href")+"&xmlhttp=1",function(f){$("#fileLibraryPaneContainer").html(f.html).find("a[href*='collection.php?action=del']").click(function(){return NexxarLib.downloadManager.handleFile(this,false)});if(c){var e=false;for(var d=0;f.addedFiles&&d<f.addedFiles.length;d++){if(f.addedFiles[d].file==b){e=true;break}}if(e){NexxarLib.downloadManager.hideOrShowFileLink(a,"hide")}}else{NexxarLib.downloadManager.hideOrShowFileLink(a,"show")}});return false}}};$(document).ready(function(){NexxarLib.downloadManager.restoreLayerState();$("#filelist li.level2Padding").mouseover(function(){if(NexxarLib.downloadManager.currentHighlightedListItem){$(NexxarLib.downloadManager.currentHighlightedListItem).removeClass("highlightmouseover")}NexxarLib.downloadManager.currentHighlightedListItem=$(this);NexxarLib.downloadManager.currentHighlightedListItem.addClass("highlightmouseover")}).mouseout(function(b){var a=$(this);if(!a.children().pixelIsInside(b.pageX,b.pageY)){a.removeClass("highlightmouseover")}}).children(".level2Content").mouseover(function(){if(NexxarLib.downloadManager.currentHighlightedListItem){$(NexxarLib.downloadManager.currentHighlightedListItem).removeClass("highlightmouseover")}NexxarLib.downloadManager.currentHighlightedListItem=$(this).parent("li.level2Padding");NexxarLib.downloadManager.currentHighlightedListItem.addClass("highlightmouseover")}).mouseout(function(b){var a=$(this).parent("li.level2Padding");if(!a.pixelIsInside(b.pageX,b.pageY)&&!a.children().pixelIsInside(b.pageX,b.pageY)){a.removeClass("highlightmouseover")}});$("#filelist li.level2 div.level2text").each(function(){var a=$(this).attr("id").replace(/l2t/,"");$(this).html("<span class='subListJuggler' id='linkToggle"+a+"' onclick='NexxarLib.downloadManager.showLayer(this); return false;' title='expand the list'>"+$(this).attr("rev")+"<span class='seeAllNote'> (click to see all)</span></span><div class='level2textSpacer'></div>"+$(this).html())});$("#filelist li.level1 div.level1text").each(function(){var a=$(this).parents("li").eq(0).find("ul:first").eq(0).attr("id");$(this).click(function(){$("#"+a).slideToggle("normal");return false}).attr("title","shrink to hide or extend to show the sub list").css("cursor","pointer")});$("#fileLibraryPaneContainer a[href*='collection.php?action=del']").each(function(){$(this).click(function(){return NexxarLib.downloadManager.handleFile(this,false)});NexxarLib.downloadManager.hideOrShowFileLink(this,"hide")});$("div.filelist a[href*='collection.php?action=add']").click(function(){return NexxarLib.downloadManager.handleFile(this,true)})});