var cache={};var Newscom=new Object();Newscom.header={initLogin:function(){$("input#lgnSbmt").click(function(){document.lgnFrm.submit()});$("input#lgnSbmt2").click(function(){document.lgnFrm2.submit()});$(".imgLinkLoginClass").click(function(a){a.preventDefault();$("#request_uri").val($(this).attr("inputPath"));$("#lgnDiv").dialog("open");$("#username").focus()});$("#lgnRegLink").click(function(){$(location).attr("href","/nc/registration/regWizStart.action")});$("#lgnLink").click(function(b){b.preventDefault();$("#lgnDiv").dialog("open");$("#username").focus()});$("#dtllogin").click(function(b){b.preventDefault();$("#lgnDiv").dialog("open");$("#username").focus()});$("#lgnDiv").dialog({resizable:false,autoOpen:false,modal:true,position:"center",width:300,close:function(){window.location=jQuery.query.set("usererror","").set("poplogin","")},Cancel:function(){$(this).dialog("close")}}).keypress(function(b){if(b.keyCode==13){document.lgnFrm.submit()}})},initSrch:function(){var b=$("#srchOptions");$("#srchBox").click(function(a){a.stopPropagation()});$("body").click(function(){b.addClass("hidden")});$(".noRightClick").bind("contextmenu",function(){alert("Sorry, but this image is copyrighted; it is illegal to copy or save it.");return false});b.removeClass("hidden").position({my:"left top",at:"left bottom",of:"#search",offset:"2 2",collision:"none none"}).addClass("hidden");$(".advhelp").click(function(a){window.scrollTo(0,0);a.stopPropagation();b.removeClass("hidden").position({my:"left top",at:"left bottom",of:"#search",offset:"0 8",collision:"none none"})});$("#search").focus(function(){b.removeClass("hidden").position({my:"left top",at:"left bottom",of:"#search",offset:"0 8",collision:"none none"})})},initSrchSup:function(){var b={};$("#search").example($.i18n.prop("sharesearchexample")+"...").autocomplete({focus:function(c,a){return false},source:function(f,a){if(b.term==f.term&&b.content){a(b.content)}if(new RegExp(b.term).test(f.term)&&b.content&&b.content.length<13){var e=new RegExp($.ui.autocomplete.escapeRegex(f.term),"i");a($.grep(b.content,function(c){return e.test(c.value)}))}$.ajax({url:"/cgi-bin/jsonSuggestion",dataType:"json",data:f,timeout:3000,success:function(c){b.term=f.term;b.content=c;a(c)}})},minLength:3});$("#daterng").daterangepicker({onOpen:function(){var a=$("#daterng");var d=$(".ui-daterangepickercontain");d.css("top",a.offset().top+a.outerHeight()+1);d.css("left",a.offset().left)},presetRanges:[{text:$.i18n.prop("Today"),dateStart:"today",dateEnd:"today"},{text:$.i18n.prop("Yesterday"),dateStart:"yesterday",dateEnd:"yesterday"},{text:$.i18n.prop("Last_7_days"),dateStart:"today-7days",dateEnd:"today"},{text:$.i18n.prop("Last_30_days"),dateStart:"today-30days",dateEnd:"today"},{text:$.i18n.prop("Last_year"),dateStart:"today-1year",dateEnd:"today"},{text:$.i18n.prop("Year_to_date"),dateStart:function(){var a=Date.parse("today");a.setMonth(0);a.setDate(1);return a},dateEnd:"today"}],datepickerOptions:{changeMonth:true,changeYear:true,maxDate:new Date(),altFormat:"mm-dd-yy"}});$("#ui-datepicker-div").click(function(a){a.stopPropagation()})}};(function(b){b.fn.example=function(a,g){var h=b.isFunction(a);var f=b.extend({},g,{example:a});return this.each(function(){var c=b(this);if(b.metadata){var d=b.extend({},b.fn.example.defaults,c.metadata(),f)}else{var d=b.extend({},b.fn.example.defaults,f)}if(!b.fn.example.boundClassNames[d.className]){b(window).unload(function(){b("."+d.className).val("")});b("form").submit(function(){b(this).find("."+d.className).val("")});b.fn.example.boundClassNames[d.className]=true}if(b.browser.msie&&!c.attr("defaultValue")&&(h||c.val()==d.example)){c.val("")}if(c.val()==""&&this!=document.activeElement){c.addClass(d.className);c.val(h?d.example.call(this):d.example)}c.focus(function(){if(b(this).is("."+d.className)){b(this).val("");b(this).removeClass(d.className)}});c.blur(function(){if(b(this).val()==""){b(this).addClass(d.className);b(this).val(h?d.example.call(this):d.example)}})})};b.fn.example.defaults={className:"example"};b.fn.example.boundClassNames=[]})(jQuery);(function(b){b.fn.imgProtect=function(){return this.each(function(){var a=b(this);var d=b("<div></div>").css({position:"absolute",width:a.width(),height:a.height(),top:a.css("top"),left:a.css("left")}).addClass("protectImg");a.after(d)})}})(jQuery);jQuery.fn.daterangepicker=function(v){var I=jQuery(this);var H=jQuery.extend({presetRanges:[{text:$.i18n.prop("Today"),dateStart:"today",dateEnd:"today"},{text:$.i18n.prop("Last_7_days"),dateStart:"today-7days",dateEnd:"today"},{text:$.i18n.prop("Month_to_date"),dateStart:function(){return Date.parse("today").moveToFirstDayOfMonth()},dateEnd:"today"},{text:$.i18n.prop("Year_to_date"),dateStart:function(){var a=Date.parse("today");a.setMonth(0);a.setDate(1);return a},dateEnd:"today"},{text:$.i18n.prop("previous_month"),dateStart:function(){return Date.parse("1 month ago").moveToFirstDayOfMonth()},dateEnd:function(){return Date.parse("1 month ago").moveToLastDayOfMonth()}}],presets:{specificDate:$.i18n.prop("specific_date"),allDatesBefore:$.i18n.prop("all_dates_before"),allDatesAfter:$.i18n.prop("all_dates_after"),dateRange:$.i18n.prop("daterange")},rangeStartTitle:$.i18n.prop("startdate"),rangeEndTitle:$.i18n.prop("enddate"),nextLinkText:$.i18n.prop("next"),prevLinkText:$.i18n.prop("prev"),doneButtonText:$.i18n.prop("done"),earliestDate:Date.parse("-15years"),latestDate:Date.parse("+15years"),rangeSplitter:"-",dateFormat:"mm/dd/yy",closeOnSelect:true,arrows:false,posX:I.offset().left,posY:I.offset().top+I.outerHeight(),appendTo:"body",onClose:function(){},onOpen:function(){},onChange:function(){},datepickerOptions:null},v);var F={onSelect:function(){if(C.find(".ui-daterangepicker-specificDate").is(".ui-state-active")){C.find(".range-end").datepicker("setDate",C.find(".range-start").datepicker("getDate"))}var a=K(C.find(".range-start").datepicker("getDate"));var b=K(C.find(".range-end").datepicker("getDate"));if(I.length==2){I.eq(0).val(a);I.eq(1).val(b)}else{I.val((a!=b)?a+" "+H.rangeSplitter+" "+b:a)}if(H.closeOnSelect){if(!C.find("li.ui-state-active").is(".ui-daterangepicker-dateRange")&&!C.is(":animated")){B()}}H.onChange()},defaultDate:+0};I.change(H.onChange);H.datepickerOptions=(v)?jQuery.extend(F,v.datepickerOptions):F;var z,A=Date.parse("today");var x,D;if(I.size()==2){x=Date.parse(I.eq(0).val());D=Date.parse(I.eq(1).val());if(x==null){x=D}if(D==null){D=x}}else{x=Date.parse(I.val().split(H.rangeSplitter)[0]);D=Date.parse(I.val().split(H.rangeSplitter)[1]);if(D==null){D=x}}if(x!=null){z=x}if(D!=null){A=D}var C=jQuery('<div class="ui-daterangepicker ui-widget ui-helper-clearfix ui-widget-content ui-corner-all"></div>');var t=(function(){var a=jQuery('<ul class="ui-widget-content"></ul>').appendTo(C);jQuery.each(H.presetRanges,function(){jQuery('<li class="ui-daterangepicker-'+this.text.replace(/ /g,"")+' ui-corner-all"><a href="#">'+this.text+"</a></li>").data("dateStart",this.dateStart).data("dateEnd",this.dateEnd).appendTo(a)});var b=0;jQuery.each(H.presets,function(d,c){jQuery('<li class="ui-daterangepicker-'+d+" preset_"+b+' ui-helper-clearfix ui-corner-all"><span class="ui-icon ui-icon-triangle-1-e"></span><a href="#">'+c+"</a></li>").appendTo(a);b++});a.find("li").hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")}).click(function(){C.find(".ui-state-active").removeClass("ui-state-active");jQuery(this).addClass("ui-state-active").clickActions(C,y,G);return false});return a})();function K(c){if(!c.getDate()){return""}var d=c.getDate();var a=c.getMonth();var b=c.getFullYear();a++;var e=H.dateFormat;return jQuery.datepicker.formatDate(e,c)}jQuery.fn.restoreDateFromData=function(){if(jQuery(this).data("saveDate")){jQuery(this).datepicker("setDate",jQuery(this).data("saveDate")).removeData("saveDate")}return this};jQuery.fn.saveDateToData=function(){if(!jQuery(this).data("saveDate")){jQuery(this).data("saveDate",jQuery(this).datepicker("getDate"))}return this};function u(){if(C.data("state")=="closed"){C.data("state","open");C.fadeIn(300);H.onOpen()}}function B(){if(C.data("state")=="open"){C.data("state","closed");C.fadeOut(300);H.onClose()}}function J(){if(C.data("state")=="open"){B()}else{u()}}C.data("state","closed");jQuery.fn.clickActions=function(c,b,e){if(jQuery(this).is(".ui-daterangepicker-specificDate")){e.hide();b.show();c.find(".title-start").text(H.presets.specificDate);c.find(".range-start").restoreDateFromData().show(400);c.find(".range-end").restoreDateFromData().hide(400);setTimeout(function(){e.fadeIn()},400)}else{if(jQuery(this).is(".ui-daterangepicker-allDatesBefore")){e.hide();b.show();c.find(".title-end").text(H.presets.allDatesBefore);c.find(".range-start").saveDateToData().datepicker("setDate",H.earliestDate).hide(400);c.find(".range-end").restoreDateFromData().show(400);setTimeout(function(){e.fadeIn()},400)}else{if(jQuery(this).is(".ui-daterangepicker-allDatesAfter")){e.hide();b.show();c.find(".title-start").text(H.presets.allDatesAfter);c.find(".range-start").restoreDateFromData().show(400);c.find(".range-end").saveDateToData().datepicker("setDate",H.latestDate).hide(400);setTimeout(function(){e.fadeIn()},400)}else{if(jQuery(this).is(".ui-daterangepicker-dateRange")){e.hide();b.show();c.find(".title-start").text(H.rangeStartTitle);c.find(".title-end").text(H.rangeEndTitle);c.find(".range-start").restoreDateFromData().show(400);c.find(".range-end").restoreDateFromData().show(400);setTimeout(function(){e.fadeIn()},400)}else{e.hide();c.find(".range-start, .range-end").hide(400,function(){b.hide()});var a=(typeof jQuery(this).data("dateStart")=="string")?Date.parse(jQuery(this).data("dateStart")):jQuery(this).data("dateStart")();var d=(typeof jQuery(this).data("dateEnd")=="string")?Date.parse(jQuery(this).data("dateEnd")):jQuery(this).data("dateEnd")();c.find(".range-start").datepicker("setDate",a).find(".ui-datepicker-current-day").trigger("click");c.find(".range-end").datepicker("setDate",d).find(".ui-datepicker-current-day").trigger("click")}}}}return false};var y=jQuery('<div class="ranges ui-widget-header ui-corner-all ui-helper-clearfix"><div class="range-start"><span class="title-start">Start Date</span></div><div class="range-end"><span class="title-end">End Date</span></div></div>').appendTo(C);y.find(".range-start, .range-end").datepicker(H.datepickerOptions);y.find(".range-start").datepicker("setDate",z);y.find(".range-end").datepicker("setDate",A);var G=jQuery('<button class="btnDone ui-state-default ui-corner-all">'+H.doneButtonText+"</button>").click(function(){C.find(".ui-datepicker-current-day").trigger("click");B()}).hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")}).appendTo(y);jQuery(this).click(function(){J();return false});y.css("display","none").find(".range-start, .range-end, .btnDone").css("display","none");jQuery(H.appendTo).append(C);C.wrap('<div class="ui-daterangepickercontain"></div>');if(H.posX){C.parent().css("left",H.posX)}if(H.posY){C.parent().css("top",H.posY)}if(H.arrows&&I.size()==1){var E=jQuery('<a href="#" class="ui-daterangepicker-prev ui-corner-all" title="'+H.prevLinkText+'"><span class="ui-icon ui-icon-circle-triangle-w">'+H.prevLinkText+"</span></a>");var w=jQuery('<a href="#" class="ui-daterangepicker-next ui-corner-all" title="'+H.nextLinkText+'"><span class="ui-icon ui-icon-circle-triangle-e">'+H.nextLinkText+"</span></a>");jQuery(this).addClass("ui-rangepicker-input ui-widget-content").wrap('<div class="ui-daterangepicker-arrows ui-widget ui-widget-header ui-helper-clearfix ui-corner-all"></div>').before(E).before(w).parent().find("a").click(function(){var b=y.find(".range-start").datepicker("getDate");var c=y.find(".range-end").datepicker("getDate");var a=Math.abs(new TimeSpan(b-c).getTotalMilliseconds())+86400000;if(jQuery(this).is(".ui-daterangepicker-prev")){a=-a}y.find(".range-start, .range-end ").each(function(){var d=jQuery(this).datepicker("getDate");if(d==null){return false}jQuery(this).datepicker("setDate",d.add({milliseconds:a})).find(".ui-datepicker-current-day").trigger("click")});return false}).hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")})}jQuery(document).click(function(){if(C.is(":visible")){B()}});C.click(function(){return false}).hide();return this};Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(f){var h=Date.CultureInfo.monthNames,g=Date.CultureInfo.abbreviatedMonthNames,j=f.toLowerCase();for(var k=0;k<h.length;k++){if(h[k].toLowerCase()==j||g[k].toLowerCase()==j){return k}}return -1};Date.getDayNumberFromName=function(g){var j=Date.CultureInfo.dayNames,h=Date.CultureInfo.abbreviatedDayNames,k=Date.CultureInfo.shortestDayNames,l=g.toLowerCase();for(var m=0;m<j.length;m++){if(j[m].toLowerCase()==l||h[m].toLowerCase()==l){return m}}return -1};Date.isLeapYear=function(b){return(((b%4===0)&&(b%100!==0))||(b%400===0))};Date.getDaysInMonth=function(d,c){return[31,(Date.isLeapYear(d)?29:28),31,30,31,30,31,31,30,31,30,31][c]};Date.getTimezoneOffset=function(d,c){return(c||false)?Date.CultureInfo.abbreviatedTimeZoneDST[d.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[d.toUpperCase()]};Date.getTimezoneAbbreviation=function(e,g){var h=(g||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,f;for(f in h){if(h[f]===e){return f}}return null};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.compareTo=function(b){if(isNaN(this)){throw new Error(this)}if(b instanceof Date&&!isNaN(b)){return(this>b)?1:(this<b)?-1:0}else{throw new TypeError(b)}};Date.prototype.equals=function(b){return(this.compareTo(b)===0)};Date.prototype.between=function(f,e){var d=this.getTime();return d>=f.getTime()&&d<=e.getTime()};Date.prototype.addMilliseconds=function(b){this.setMilliseconds(this.getMilliseconds()+b);return this};Date.prototype.addSeconds=function(b){return this.addMilliseconds(b*1000)};Date.prototype.addMinutes=function(b){return this.addMilliseconds(b*60000)};Date.prototype.addHours=function(b){return this.addMilliseconds(b*3600000)};Date.prototype.addDays=function(b){return this.addMilliseconds(b*86400000)};Date.prototype.addWeeks=function(b){return this.addMilliseconds(b*604800000)};Date.prototype.addMonths=function(d){var c=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+d);this.setDate(Math.min(c,this.getDaysInMonth()));return this};Date.prototype.addYears=function(b){return this.addMonths(b*12)};Date.prototype.add=function(c){if(typeof c=="number"){this._orient=c;return this}var d=c;if(d.millisecond||d.milliseconds){this.addMilliseconds(d.millisecond||d.milliseconds)}if(d.second||d.seconds){this.addSeconds(d.second||d.seconds)}if(d.minute||d.minutes){this.addMinutes(d.minute||d.minutes)}if(d.hour||d.hours){this.addHours(d.hour||d.hours)}if(d.month||d.months){this.addMonths(d.month||d.months)}if(d.year||d.years){this.addYears(d.year||d.years)}if(d.day||d.days){this.addDays(d.day||d.days)}return this};Date._validate=function(g,h,f,e){if(typeof g!="number"){throw new TypeError(g+" is not a Number.")}else{if(g<h||g>f){throw new RangeError(g+" is not a valid value for "+e+".")}}return true};Date.validateMillisecond=function(b){return Date._validate(b,0,999,"milliseconds")};Date.validateSecond=function(b){return Date._validate(b,0,59,"seconds")};Date.validateMinute=function(b){return Date._validate(b,0,59,"minutes")};Date.validateHour=function(b){return Date._validate(b,0,23,"hours")};Date.validateDay=function(f,e,d){return Date._validate(f,1,Date.getDaysInMonth(e,d),"days")};Date.validateMonth=function(b){return Date._validate(b,0,11,"months")};Date.validateYear=function(b){return Date._validate(b,1,9999,"seconds")};Date.prototype.set=function(c){var d=c;if(!d.millisecond&&d.millisecond!==0){d.millisecond=-1}if(!d.second&&d.second!==0){d.second=-1}if(!d.minute&&d.minute!==0){d.minute=-1}if(!d.hour&&d.hour!==0){d.hour=-1}if(!d.day&&d.day!==0){d.day=-1}if(!d.month&&d.month!==0){d.month=-1}if(!d.year&&d.year!==0){d.year=-1}if(d.millisecond!=-1&&Date.validateMillisecond(d.millisecond)){this.addMilliseconds(d.millisecond-this.getMilliseconds())}if(d.second!=-1&&Date.validateSecond(d.second)){this.addSeconds(d.second-this.getSeconds())}if(d.minute!=-1&&Date.validateMinute(d.minute)){this.addMinutes(d.minute-this.getMinutes())}if(d.hour!=-1&&Date.validateHour(d.hour)){this.addHours(d.hour-this.getHours())}if(d.month!==-1&&Date.validateMonth(d.month)){this.addMonths(d.month-this.getMonth())}if(d.year!=-1&&Date.validateYear(d.year)){this.addYears(d.year-this.getFullYear())}if(d.day!=-1&&Date.validateDay(d.day,this.getFullYear(),this.getMonth())){this.addDays(d.day-this.getDate())}if(d.timezone){this.setTimezone(d.timezone)}if(d.timezoneOffset){this.setTimezoneOffset(d.timezoneOffset)}return this};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.isLeapYear=function(){var b=this.getFullYear();return(((b%4===0)&&(b%100!==0))||(b%400===0))};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(e,d){var f=(e-this.getDay()+7*(d||+1))%7;return this.addDays((f===0)?f+=7*(d||+1):f)};Date.prototype.moveToMonth=function(f,e){var d=(f-this.getMonth()+12*(e||+1))%12;return this.addMonths((d===0)?d+=12*(e||+1):d)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};Date.prototype.getWeekOfYear=function(s){var l=this.getFullYear(),p=this.getMonth(),n=this.getDate();var d=s||Date.CultureInfo.firstDayOfWeek;var o=7+1-new Date(l,0,1).getDay();if(o==8){o=1}var q=((Date.UTC(l,p,n,0,0,0)-Date.UTC(l,0,1,0,0,0))/86400000)+1;var k=Math.floor((q-o+7)/7);if(k===d){l--;var m=7+1-new Date(l,0,1).getDay();if(m==2||m==8){k=53}else{k=52}}return k};Date.prototype.isDST=function(){return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(d){var e=this.getTimezoneOffset(),f=Number(d)*-6/10;this.addMinutes(f-e);return this};Date.prototype.setTimezone=function(b){return this.setTimezoneOffset(Date.getTimezoneOffset(b))};Date.prototype.getUTCOffset=function(){var c=this.getTimezoneOffset()*-10/6,d;if(c<0){d=(c-10000).toString();return d[0]+d.substr(2)}else{d=(c+10000).toString();return"+"+d.substr(1)}};Date.prototype.getDayName=function(b){return b?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(b){return b?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(f){var e=this;var d=function d(a){return(a.toString().length==1)?"0"+a:a};return f?f.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(a){switch(a){case"hh":return d(e.getHours()<13?e.getHours():(e.getHours()-12));case"h":return e.getHours()<13?e.getHours():(e.getHours()-12);case"HH":return d(e.getHours());case"H":return e.getHours();case"mm":return d(e.getMinutes());case"m":return e.getMinutes();case"ss":return d(e.getSeconds());case"s":return e.getSeconds();case"yyyy":return e.getFullYear();case"yy":return e.getFullYear().toString().substring(2,4);case"dddd":return e.getDayName();case"ddd":return e.getDayName(true);case"dd":return d(e.getDate());case"d":return e.getDate().toString();case"MMMM":return e.getMonthName();case"MMM":return e.getMonthName(true);case"MM":return d((e.getMonth()+1));case"M":return e.getMonth()+1;case"t":return e.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return e.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};Date.now=function(){return new Date()};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var b={};b[this._dateElement]=this;return Date.now().add(b)};Number.prototype.ago=function(){var b={};b[this._dateElement]=this*-1;return Date.now().add(b)};(function(){var v=Date.prototype,B=Number.prototype;var j=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),k=("january february march april may june july august september october november december").split(/\s/),q=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),s;var t=function(a){return function(){if(this._is){this._is=false;return this.getDay()==a}return this.moveToDayOfWeek(a,this._orient)}};for(var w=0;w<j.length;w++){v[j[w]]=v[j[w].substring(0,3)]=t(w)}var u=function(a){return function(){if(this._is){this._is=false;return this.getMonth()===a}return this.moveToMonth(a,this._orient)}};for(var y=0;y<k.length;y++){v[k[y]]=v[k[y].substring(0,3)]=u(y)}var x=function(a){return function(){if(a.substring(a.length-1)!="s"){a+="s"}return this["add"+a](this._orient)}};var A=function(a){return function(){this._dateElement=a;return this}};for(var z=0;z<q.length;z++){s=q[z].toLowerCase();v[s]=v[s+"s"]=x(q[z]);B[s]=B[s+"s"]=A(s)}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};(function(){Date.Parsing={Exception:function(a){this.message="Parse error at '"+a.substring(0,10)+" ...'"}};var k=Date.Parsing;var q=k.Operators={rtoken:function(a){return function(c){var b=c.match(a);if(b){return([b[0],c.substring(b[0].length)])}else{throw new k.Exception(c)}}},token:function(a){return function(b){return q.rtoken(new RegExp("^s*"+b+"s*"))(b)}},stoken:function(a){return q.rtoken(new RegExp("^"+a))},until:function(a){return function(e){var d=[],b=null;while(e.length){try{b=a.call(this,e)}catch(c){d.push(b[0]);e=b[1];continue}break}return[d,e]}},many:function(a){return function(e){var b=[],d=null;while(e.length){try{d=a.call(this,e)}catch(c){return[b,e]}b.push(d[0]);e=d[1]}return[b,e]}},optional:function(a){return function(d){var c=null;try{c=a.call(this,d)}catch(b){return[null,d]}return[c[0],c[1]]}},not:function(a){return function(c){try{a.call(this,c)}catch(b){return[null,c]}throw new k.Exception(c)}},ignore:function(a){return a?function(c){var b=null;b=a.call(this,c);return[null,b[1]]}:null},product:function(){var c=arguments[0],b=Array.prototype.slice.call(arguments,1),a=[];for(var d=0;d<c.length;d++){a.push(q.each(c[d],b))}return a},cache:function(a){var c={},b=null;return function(e){try{b=c[e]=(c[e]||a.call(this,e))}catch(d){b=c[e]=d}if(b instanceof k.Exception){throw b}else{return b}}},any:function(){var a=arguments;return function(d){var c=null;for(var e=0;e<a.length;e++){if(a[e]==null){continue}try{c=(a[e].call(this,d))}catch(b){c=null}if(c){return c}}throw new k.Exception(d)}},each:function(){var a=arguments;return function(d){var f=[],c=null;for(var e=0;e<a.length;e++){if(a[e]==null){continue}try{c=(a[e].call(this,d))}catch(b){throw new k.Exception(d)}f.push(c[0]);d=c[1]}return[f,d]}},all:function(){var a=arguments,b=b;return b.each(b.optional(a))},sequence:function(c,b,a){b=b||q.rtoken(/^\s*/);a=a||null;if(c.length==1){return c[0]}return function(w){var s=null,h=null;var f=[];for(var x=0;x<c.length;x++){try{s=c[x].call(this,w)}catch(g){break}f.push(s[0]);try{h=b.call(this,s[1])}catch(d){h=null;break}w=h[1]}if(!s){throw new k.Exception(w)}if(h){throw new k.Exception(h[1])}if(a){try{s=a.call(this,s[1])}catch(e){throw new k.Exception(s[1])}}return[f,(s?s[1]:w)]}},between:function(c,b,d){d=d||c;var a=q.each(q.ignore(c),b,q.ignore(d));return function(e){var f=a.call(this,e);return[[f[0][0],r[0][2]],f[1]]}},list:function(c,b,a){b=b||q.rtoken(/^\s*/);a=a||null;return(c instanceof Array?q.each(q.product(c.slice(0,-1),q.ignore(b)),c.slice(-1),q.ignore(a)):q.each(q.many(q.each(c,q.ignore(b))),px,q.ignore(a)))},set:function(c,b,a){b=b||q.rtoken(/^\s*/);a=a||null;return function(d){var s=null,g=null,h=null,e=null,I=[[],d],f=false;for(var G=0;G<c.length;G++){h=null;g=null;s=null;f=(c.length==1);try{s=c[G].call(this,d)}catch(D){continue}e=[[s[0]],s[1]];if(s[1].length>0&&!f){try{h=b.call(this,s[1])}catch(C){f=true}}else{f=true}if(!f&&h[1].length===0){f=true}if(!f){var F=[];for(var H=0;H<c.length;H++){if(G!=H){F.push(c[H])}}g=q.set(F,b).call(this,h[1]);if(g[0].length>0){e[0]=e[0].concat(g[0]);e[1]=g[1]}}if(e[1].length<I[1].length){I=e}if(I[1].length===0){break}}if(I[0].length===0){return I}if(a){try{h=a.call(this,I[1])}catch(E){throw new k.Exception(I[1])}I[1]=h[1]}return I}},forward:function(b,a){return function(c){return b[a].call(this,c)}},replace:function(a,b){return function(d){var c=a.call(this,d);return[b,c[1]]}},process:function(a,b){return function(d){var c=a.call(this,d);return[b.call(this,c[0]),c[1]]}},min:function(b,a){return function(d){var c=a.call(this,d);if(c[0].length<b){throw new k.Exception(d)}return c}}};var l=function(a){return function(){var e=null,b=[];if(arguments.length>1){e=Array.prototype.slice.call(arguments)}else{if(arguments[0] instanceof Array){e=arguments[0]}}if(e){for(var c=0,d=e.shift();c<d.length;c++){e.unshift(d[c]);b.push(a.apply(null,e));e.shift();return b}}else{return a.apply(null,arguments)}}};var m="optional not ignore cache".split(/\s/);for(var p=0;p<m.length;p++){q[m[p]]=l(q[m[p]])}var n=function(a){return function(){if(arguments[0] instanceof Array){return a.apply(null,arguments[0])}else{return a.apply(null,arguments)}}};var o="each any all".split(/\s/);for(var j=0;j<o.length;j++){q[o[j]]=n(q[o[j]])}}());(function(){var m=function(b){var a=[];for(var c=0;c<b.length;c++){if(b[c] instanceof Array){a=a.concat(m(b[c]))}else{if(b[c]){a.push(b[c])}}}return a};Date.Grammar={};Date.Translator={hour:function(a){return function(){this.hour=Number(a)}},minute:function(a){return function(){this.minute=Number(a)}},second:function(a){return function(){this.second=Number(a)}},meridian:function(a){return function(){this.meridian=a.slice(0,1).toLowerCase()}},timezone:function(a){return function(){var b=a.replace(/[^\d\+\-]/g,"");if(b.length){this.timezoneOffset=Number(b)}else{this.timezone=a.toLowerCase()}}},day:function(b){var a=b[0];return function(){this.day=Number(a.match(/\d+/)[0])}},month:function(a){return function(){this.month=((a.length==3)?Date.getMonthNumberFromName(a):(Number(a)-1))}},year:function(a){return function(){var b=Number(a);this.year=((a.length>2)?b:(b+(((b+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)))}},rday:function(a){return function(){switch(a){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break}}},finishExact:function(d){d=(d instanceof Array)?d:[d];var c=new Date();this.year=c.getFullYear();this.month=c.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var b=0;b<d.length;b++){if(d[b]){d[b].call(this)}}this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")}var a=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){a.set({timezone:this.timezone})}else{if(this.timezoneOffset){a.set({timezoneOffset:this.timezoneOffset})}}return a},finish:function(e){e=(e instanceof Array)?m(e):[e];if(e.length===0){return null}for(var a=0;a<e.length;a++){if(typeof e[a]=="function"){e[a].call(this)}}if(this.now){return new Date()}var d=Date.today();var f=null;var q=!!(this.days!=null||this.orient||this.operator);if(q){var h,b,c;c=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";h=(Date.getDayNumberFromName(this.weekday)-d.getDay());b=7;this.days=h?((h+(c*b))%b):(c*b)}if(this.month){this.unit="month";h=(this.month-d.getMonth());b=12;this.months=h?((h+(c*b))%b):(c*b);this.month=null}if(!this.unit){this.unit="day"}if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1}if(this.unit=="week"){this.unit="day";this.value=this.value*7}this[this.unit+"s"]=this.value*c}return d.add(this)}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour}if(this.weekday&&!this.day){this.day=(d.addDays((Date.getDayNumberFromName(this.weekday)-d.getDay()))).getDate()}if(this.month&&!this.day){this.day=1}return d.set(this)}}};var g=Date.Parsing.Operators,n=Date.Grammar,o=Date.Translator,k;n.datePartDelimiter=g.rtoken(/^([\s\-\.\,\/\x27]+)/);n.timePartDelimiter=g.stoken(":");n.whiteSpace=g.rtoken(/^\s*/);n.generalDelimiter=g.rtoken(/^(([\s\,]|at|on)+)/);var j={};n.ctoken=function(a){var b=j[a];if(!b){var f=Date.CultureInfo.regexPatterns;var c=a.split(/\s+/),d=[];for(var e=0;e<c.length;e++){d.push(g.replace(g.rtoken(f[c[e]]),c[e]))}b=j[a]=g.any.apply(null,d)}return b};n.ctoken2=function(a){return g.rtoken(Date.CultureInfo.regexPatterns[a])};n.h=g.cache(g.process(g.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),o.hour));n.hh=g.cache(g.process(g.rtoken(/^(0[0-9]|1[0-2])/),o.hour));n.H=g.cache(g.process(g.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),o.hour));n.HH=g.cache(g.process(g.rtoken(/^([0-1][0-9]|2[0-3])/),o.hour));n.m=g.cache(g.process(g.rtoken(/^([0-5][0-9]|[0-9])/),o.minute));n.mm=g.cache(g.process(g.rtoken(/^[0-5][0-9]/),o.minute));n.s=g.cache(g.process(g.rtoken(/^([0-5][0-9]|[0-9])/),o.second));n.ss=g.cache(g.process(g.rtoken(/^[0-5][0-9]/),o.second));n.hms=g.cache(g.sequence([n.H,n.mm,n.ss],n.timePartDelimiter));n.t=g.cache(g.process(n.ctoken2("shortMeridian"),o.meridian));n.tt=g.cache(g.process(n.ctoken2("longMeridian"),o.meridian));n.z=g.cache(g.process(g.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),o.timezone));n.zz=g.cache(g.process(g.rtoken(/^(\+|\-)\s*\d\d\d\d/),o.timezone));n.zzz=g.cache(g.process(n.ctoken2("timezone"),o.timezone));n.timeSuffix=g.each(g.ignore(n.whiteSpace),g.set([n.tt,n.zzz]));n.time=g.each(g.optional(g.ignore(g.stoken("T"))),n.hms,n.timeSuffix);n.d=g.cache(g.process(g.each(g.rtoken(/^([0-2]\d|3[0-1]|\d)/),g.optional(n.ctoken2("ordinalSuffix"))),o.day));n.dd=g.cache(g.process(g.each(g.rtoken(/^([0-2]\d|3[0-1])/),g.optional(n.ctoken2("ordinalSuffix"))),o.day));n.ddd=n.dddd=g.cache(g.process(n.ctoken("sun mon tue wed thu fri sat"),function(a){return function(){this.weekday=a}}));n.M=g.cache(g.process(g.rtoken(/^(1[0-2]|0\d|\d)/),o.month));n.MM=g.cache(g.process(g.rtoken(/^(1[0-2]|0\d)/),o.month));n.MMM=n.MMMM=g.cache(g.process(n.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),o.month));n.y=g.cache(g.process(g.rtoken(/^(\d\d?)/),o.year));n.yy=g.cache(g.process(g.rtoken(/^(\d\d)/),o.year));n.yyy=g.cache(g.process(g.rtoken(/^(\d\d?\d?\d?)/),o.year));n.yyyy=g.cache(g.process(g.rtoken(/^(\d\d\d\d)/),o.year));k=function(){return g.each(g.any.apply(null,arguments),g.not(n.ctoken2("timeContext")))};n.day=k(n.d,n.dd);n.month=k(n.M,n.MMM);n.year=k(n.yyyy,n.yy);n.orientation=g.process(n.ctoken("past future"),function(a){return function(){this.orient=a}});n.operator=g.process(n.ctoken("add subtract"),function(a){return function(){this.operator=a}});n.rday=g.process(n.ctoken("yesterday tomorrow today now"),o.rday);n.unit=g.process(n.ctoken("minute hour day week month year"),function(a){return function(){this.unit=a}});n.value=g.process(g.rtoken(/^\d\d?(st|nd|rd|th)?/),function(a){return function(){this.value=a.replace(/\D/g,"")}});n.expression=g.set([n.rday,n.operator,n.value,n.unit,n.orientation,n.ddd,n.MMM]);k=function(){return g.set(arguments,n.datePartDelimiter)};n.mdy=k(n.ddd,n.month,n.day,n.year);n.ymd=k(n.ddd,n.year,n.month,n.day);n.dmy=k(n.ddd,n.day,n.month,n.year);n.date=function(a){return((n[Date.CultureInfo.dateElementOrder]||n.mdy).call(this,a))};n.format=g.process(g.many(g.any(g.process(g.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(a){if(n[a]){return n[a]}else{throw Date.Parsing.Exception(a)}}),g.process(g.rtoken(/^[^dMyhHmstz]+/),function(a){return g.ignore(g.stoken(a))}))),function(a){return g.process(g.each.apply(null,a),o.finishExact)});var l={};var p=function(a){return l[a]=(l[a]||n.format(a)[0])};n.formats=function(b){if(b instanceof Array){var a=[];for(var c=0;c<b.length;c++){a.push(p(b[c]))}return g.any.apply(null,a)}else{return p(b)}};n._formats=n.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);n._start=g.process(g.set([n.date,n.time,n.expression],n.generalDelimiter,n.whiteSpace),o.finish);n.start=function(c){try{var b=n._formats.call({},c);if(b[1].length===0){return b}}catch(a){}return n._start.call({},c)}}());Date._parse=Date.parse;Date.parse=function(e){var d=null;if(!e){return null}try{d=Date.Grammar.start.call({},e)}catch(f){return null}return((d[1].length===0)?d[0]:null)};Date.getParseFunction=function(c){var d=Date.Grammar.formats(c);return function(e){var b=null;try{b=d.call({},e)}catch(a){return null}return((b[1].length===0)?b[0]:null)}};Date.parseExact=function(d,c){return Date.getParseFunction(c)(d)};var TimeSpan=function(n,s,v,q,w){var o="days hours minutes seconds milliseconds".split(/\s+/);var x=function(a){return function(){return this[a]}};var p=function(a){return function(b){this[a]=b;return this}};for(var t=0;t<o.length;t++){var y=o[t],z=y.slice(0,1).toUpperCase()+y.slice(1);TimeSpan.prototype[y]=0;TimeSpan.prototype["get"+z]=x(y);TimeSpan.prototype["set"+z]=p(y)}if(arguments.length==4){this.setDays(n);this.setHours(s);this.setMinutes(v);this.setSeconds(q)}else{if(arguments.length==5){this.setDays(n);this.setHours(s);this.setMinutes(v);this.setSeconds(q);this.setMilliseconds(w)}else{if(arguments.length==1&&typeof n=="number"){var u=(n<0)?-1:+1;this.setMilliseconds(Math.abs(n));this.setDays(Math.floor(this.getMilliseconds()/86400000)*u);this.setMilliseconds(this.getMilliseconds()%86400000);this.setHours(Math.floor(this.getMilliseconds()/3600000)*u);this.setMilliseconds(this.getMilliseconds()%3600000);this.setMinutes(Math.floor(this.getMilliseconds()/60000)*u);this.setMilliseconds(this.getMilliseconds()%60000);this.setSeconds(Math.floor(this.getMilliseconds()/1000)*u);this.setMilliseconds(this.getMilliseconds()%1000);this.setMilliseconds(this.getMilliseconds()*u)}}}this.getTotalMilliseconds=function(){return(this.getDays()*86400000)+(this.getHours()*3600000)+(this.getMinutes()*60000)+(this.getSeconds()*1000)};this.compareTo=function(b){var c=new Date(1970,1,1,this.getHours(),this.getMinutes(),this.getSeconds()),a;if(b===null){a=new Date(1970,1,1,0,0,0)}else{a=new Date(1970,1,1,b.getHours(),b.getMinutes(),b.getSeconds())}return(c<a)?-1:(c>a)?1:0};this.equals=function(a){return(this.compareTo(a)===0)};this.add=function(a){return(a===null)?this:this.addSeconds(a.getTotalMilliseconds()/1000)};this.subtract=function(a){return(a===null)?this:this.addSeconds(-a.getTotalMilliseconds()/1000)};this.addDays=function(a){return new TimeSpan(this.getTotalMilliseconds()+(a*86400000))};this.addHours=function(a){return new TimeSpan(this.getTotalMilliseconds()+(a*3600000))};this.addMinutes=function(a){return new TimeSpan(this.getTotalMilliseconds()+(a*60000))};this.addSeconds=function(a){return new TimeSpan(this.getTotalMilliseconds()+(a*1000))};this.addMilliseconds=function(a){return new TimeSpan(this.getTotalMilliseconds()+a)};this.get12HourHour=function(){return(this.getHours()>12)?this.getHours()-12:(this.getHours()===0)?12:this.getHours()};this.getDesignator=function(){return(this.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator};this.toString=function(b){this._toString=function(){if(this.getDays()!==null&&this.getDays()>0){return this.getDays()+"."+this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds())}else{return this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds())}};this.p=function(c){return(c.toString().length<2)?"0"+c:c};var a=this;return b?b.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g,function(c){switch(c){case"d":return a.getDays();case"dd":return a.p(a.getDays());case"H":return a.getHours();case"HH":return a.p(a.getHours());case"h":return a.get12HourHour();case"hh":return a.p(a.get12HourHour());case"m":return a.getMinutes();case"mm":return a.p(a.getMinutes());case"s":return a.getSeconds();case"ss":return a.p(a.getSeconds());case"t":return((a.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator).substring(0,1);case"tt":return(a.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator}}):this._toString()};return this};Date.prototype.getTimeOfDay=function(){return new TimeSpan(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};var TimePeriod=function(B,I,J,y,A,E,H){var C="years months days hours minutes seconds milliseconds".split(/\s+/);var F=function(a){return function(){return this[a]}};var M=function(a){return function(b){this[a]=b;return this}};for(var z=0;z<C.length;z++){var K=C[z],L=K.slice(0,1).toUpperCase()+K.slice(1);TimePeriod.prototype[K]=0;TimePeriod.prototype["get"+L]=F(K);TimePeriod.prototype["set"+L]=M(K)}if(arguments.length==7){this.years=B;this.months=I;this.setDays(J);this.setHours(y);this.setMinutes(A);this.setSeconds(E);this.setMilliseconds(H)}else{if(arguments.length==2&&arguments[0] instanceof Date&&arguments[1] instanceof Date){var v=B.clone();var w=I.clone();var x=v.clone();var G=(v>w)?-1:+1;this.years=w.getFullYear()-v.getFullYear();x.addYears(this.years);if(G==+1){if(x>w){if(this.years!==0){this.years--}}}else{if(x<w){if(this.years!==0){this.years++}}}v.addYears(this.years);if(G==+1){while(v<w&&v.clone().addDays(Date.getDaysInMonth(v.getYear(),v.getMonth()))<w){v.addMonths(1);this.months++}}else{while(v>w&&v.clone().addDays(-v.getDaysInMonth())>w){v.addMonths(-1);this.months--}}var D=w-v;if(D!==0){var N=new TimeSpan(D);this.setDays(N.getDays());this.setHours(N.getHours());this.setMinutes(N.getMinutes());this.setSeconds(N.getSeconds());this.setMilliseconds(N.getMilliseconds())}}}return this};function rollimg(b,a){document[b].src=a}$(function(){$("div[id^=tabs]").tabs();$("div[id^=resourcetabs]").tabs();$("[id^=tablink]").click(function(){var a=$(this).attr("id").match(/[\d]+$/);$("#tabp-"+a).load("/nc/getTabContent.action?tId="+a)})});this.tooltip=function(){xOffset=10;yOffset=20;$(".gridview").hover(function(a){this.t=this.title;this.title="";$("body").append("<p id='tooltip'>"+this.t+"</p>");$("#tooltip").css("top",(a.pageY-xOffset)+"px").css("left",(a.pageX+yOffset)+"px").fadeIn("fast")},function(){this.title=this.t;$("#tooltip").remove()});$(".gridview").mousemove(function(a){$("#tooltip").css("top",(a.pageY-xOffset)+"px").css("left",(a.pageX+yOffset)+"px")})};$(document).ready(function(){if($.browser.msie){if($.browser.version<8){$("#_spring_security_remember_me").hide().parent().hide()}}$("[id^=tabp-]").each(function(){var a=$(this).attr("id").match(/[\d]+$/);$(this).load("/nc/getTabContent.action?tId="+a+"&init=true")});tooltip();$("#salesinfo").mouseover(function(){$("#info").css("width","155px").css("z-index","5000").show();$("#salesinfo").css("text-decoration","underline")});$("#salesinfo").mouseout(function(){if($(this).attr("id")!="info"){$("#salesinfo").css("text-decoration","none");$("#info").hide()}});$("#allfeatures").click(function(){if($("#allfeatures").is(":checked")){$(".featurewarning").css("color","black")}});$("#allfeaturesfeature").click(function(){if($("#allfeaturesfeature").is(":checked")){$(".featurewarning").css("color","red")}});if($(".gridcheckbox").is(":checked")){$(".lghtboxSubmit").removeAttr("disabled").addClass("linkcolor").unbind("click").click(function(){addToLb()});$(".newlghtboxSubmit").removeAttr("disabled").addClass("linkcolor").unbind("click").click(function(){createNewLb()});$(".smarttagSubmit").addClass("linkcolor").removeAttr("disabled");$(".smarttagLbSubmit").addClass("linkcolor").removeAttr("disabled");$(".newLightboxInput").show();$(".smarttagInput").show()}else{$(".lghtboxSubmit").removeClass("linkcolor").attr("disabled","disabled");$(".newlghtboxSubmit").unbind("click").removeClass("linkcolor").attr("disabled","disabled");$(".smarttagSubmit").removeClass("linkcolor");$(".smarttagLbSubmit").removeClass("linkcolor");$(".checkIt").attr("checked",false);$(".newLightboxInput").hide();$(".smarttagInput").hide()}$(".gridcheckbox").click(function(){if($(".gridcheckbox").is(":checked")){$(".lghtboxSubmit").removeAttr("disabled").addClass("linkcolor").unbind("click").click(function(){addToLb()});$(".newlghtboxSubmit").removeAttr("disabled").addClass("linkcolor").unbind("click").click(function(){createNewLb()});$(".smarttagSubmit").addClass("linkcolor").unbind("click").click(function(){confirmTag("addToLightboxForm","addTOTheLightboxs","result")});$(".smarttagLbSubmit").addClass("linkcolor").unbind("click").click(function(){confirmTag("removeFromLightboxForm","addTOTheLightboxs","result")});$(".newLightboxInput").show();$(".smarttagInput").show()}else{$(".lghtboxSubmit").removeClass("linkcolor").attr("disabled","disabled");$(".newlghtboxSubmit").unbind("click").removeClass("linkcolor").attr("disabled","disabled");$(".smarttagSubmit").removeClass("linkcolor").unbind("click");$(".smarttagLbSubmit").removeClass("linkcolor").unbind("click");$(".checkIt").attr("checked",false);$(".newLightboxInput").hide();$(".smarttagInput").hide()}})});var ray={ajax:function(a){this.show("load")},show:function(a){this.getID(a).style.display=""},getID:function(a){return document.getElementById(a)}};function checkaccess(a){var b="featuresNotSubscribed["+a+"].subscription";document.getElementById(b).checked=true}function checkaccesssubscribed(a){var b="featuresSubscribed["+a+"].subscription";document.getElementById(b).checked=true}function moneyFormat(a){var b=a.value;if(!IsOnlyNumeric(b)){alert("Please enter only Numeric value for the Price");a.value="0"}}function IsOnlyNumeric(b){var d="0123456789";var c=true;var a;for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false}}return c}function checkAllFeatures(){var a=document.getElementById("counter").value;a++;var b=true;if(document.getElementById("checkIt1").checked==false){b=false}for(i=0;i<a;i++){var c="featuresNotSubscribed["+i+"].subscription";document.getElementById(c).checked=b}}function checkAllFeaturesSubscribed(){var a=document.getElementById("countersubscribed").value;a++;var b=true;if(document.getElementById("checkIt1subscribed").checked==false){b=false}for(i=0;i<a;i++){var c="featuresSubscribed["+i+"].subscription";document.getElementById(c).checked=b}}function checkAllViewOnly(){var a=document.getElementById("counter").value;a++;var b=true;if(document.getElementById("checkvIt1").checked==false){b=false}for(i=0;i<a;i++){var c="featuresNotSubscribed["+i+"].viewOnly";document.getElementById(c).checked=b;if(b==true){var c="featuresNotSubscribed["+i+"].subscription";document.getElementById(c).checked=b}}}function checkAllViewOnlySubscribed(){var a=document.getElementById("countersubscribed").value;a++;var b=true;if(document.getElementById("checkvIt1subscribed").checked==false){b=false}for(i=0;i<a;i++){var c="featuresSubscribed["+i+"].viewOnly";document.getElementById(c).checked=b;if(b==true){var c="featuresSubscribed["+i+"].subscription";document.getElementById(c).checked=b}}}function saveComment(b){balloon.hideTooltip();var c="featuresNotSubscribed["+b+"].subComments";var a=document.getElementById(c).value;newComment=prompt("Please Enter a comment for this subscription.",a);if(newComment!=null){document.getElementById(c).value=newComment}}function saveCommentSubscribed(b){balloon.hideTooltip();var c="featuresSubscribed["+b+"].subComments";var a=document.getElementById(c).value;newComment=prompt("Please Enter a comment for this subscription.",a);if(newComment!=null){document.getElementById(c).value=newComment}}function showComment(c,b){var d="featuresNotSubscribed["+b+"].subComments";var a=document.getElementById(d).value;balloon.showTooltip(c,a,0,250)}function showCommentSubscribed(c,b){var d="featuresSubscribed["+b+"].subComments";var a=document.getElementById(d).value;balloon.showTooltip(c,a,0,250)}function goManageUsers(c,b){var a=confirm("Navigating away from this page will cause any unsaved changes to be lost. Do you want to continue?");if(b){if(a){location.href="findUsersByCustomer?theCustomer.customer_no="+c}}else{location.href="findUsersByCustomer?theCustomer.customer_no="+c}}function goAddUser(b){var a=confirm("Navigating away from this page will cause any unsaved changes to be lost. Do you want to continue?");if(a){location.href="showAddTheUser?theuser.customer.customer_no="+b}}function selectLbA(){var a=document.getElementById("mlbname").value;document.getElementById("mlbname2").value=a}function selectLbB(){var a=document.getElementById("mlbname2").value;document.getElementById("mlbname").value=a}$(".checkIt").click(function(){if($(this).is(":checked")){$(".gridcheckbox").attr("checked",true)}else{$(".gridcheckbox").attr("checked",false)}});function checkAll(d,f){var a=false;if($(".checkIt").is(":checked")){a=true}if(!document.forms[d]){return}var c=document.forms[d].elements[f];if(!c){return}var e=c.length;if(typeof e=="undefined"){c.checked=a}else{for(var b=0;b<e;b++){c[b].checked=a}}}function chooseFormat(){var f=document.getElementById("jssearchaction").value;var a=document.getElementById("displayOutput").options[document.getElementById("displayOutput").selectedIndex].value;document.getElementById("dispOutput").value=a;var b=document.addToLightboxForm.eaCurrentPageNum.value;var c=document.addToLightboxForm.searchSet.value;var d=document.addToLightboxForm.search2String.value;var e=document.addToLightboxForm.search1String.value;document.location.href=f+"?dispOutput="+a+"&eaCurrentPageNum="+b+"&search2String="+d+"&search1String="+e}function chooseFormatfromimage(H){var b=document.getElementById("jssearchaction").value;document.getElementById("dispOutput").value=H;var j=document.addToLightboxForm.eaCurrentPageNum.value;var E=document.addToLightboxForm.searchSet.value;var a=document.addToLightboxForm.searchSetName.value;var m=document.addToLightboxForm.search2String.value;var n=document.addToLightboxForm.search1String.value;var h=document.addToLightboxForm.feature.value;var u="";var I=document.getElementById("loc").value;var s=document.getElementById("src").value;var q="";var F="";var K="";var J="";var C="";var v="";var B="";var o="";var y="";if(document.getElementById("actionsearch")!=null){q=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){F=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){K=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){J=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){C=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){v=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){B=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){o=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){y=document.getElementById("subjectsearch").value}var D="";if(document.getElementById("daterng")!=null){D=document.getElementById("daterng").value}var w="N";var l="N";var z="N";var t="N";if(document.getElementById("photo")!=null&&document.getElementById("photo").checked==true){w="Y"}if(document.getElementById("vid")!=null&&document.getElementById("vid").checked==true){l="Y"}if(document.getElementById("news")!=null&&document.getElementById("news").checked==true){z="Y"}if(document.getElementById("graph")!=null&&document.getElementById("graph").checked==true){t="Y"}var g="";var p="";var k="";var f="";var A="";var e="";if(document.getElementById("editorial")!=null&&document.getElementById("editorial").checked==true){g="true"}if(document.getElementById("creative")!=null&&document.getElementById("creative").checked==true){p="true"}if(document.getElementById("celebrity")!=null&&document.getElementById("celebrity").checked==true){k="true"}if(document.getElementById("presidential")!=null&&document.getElementById("presidential").checked==true){f="true"}if(document.getElementById("free")!=null&&document.getElementById("free").checked==true){A="true"}if(document.getElementById("cari")!=null&&document.getElementById("cari").checked==true){e="true"}var d="";var x="";if(document.getElementById("vChkBx")!=null&&document.getElementById("vChkBx").checked==true){d="Y"}if(document.getElementById("hChkBx")!=null&&document.getElementById("hChkBx").checked==true){x="Y"}var c="";if(document.getElementById("searchtype")!=null&&document.getElementById("searchtype").checked==true){c="refinesearch"}var G=document.getElementById("sort").value;if(document.getElementById("sort")!=null&&document.getElementById("sort").checked==true){G=document.getElementById("sort").value}if(H=="grid"){document.location.href=b+"?dispOutput="+H+"&eaCurrentPageNum="+j+"&search2String="+m+"&search1String="+n+"&searchtype="+c+"&searchSetName="+a+"&searchSet="+E+"&searchPhoto="+w+"&searchVideo="+l+"&searchText="+z+"&searchGraphics="+t+"&editorialtype="+g+"&creativetype="+p+"&celebtype="+k+"&prestype="+f+"&freetype="+A+"&carictype="+e+"&searchVT="+d+"&searchHZ="+x+"&bylinesearch="+u+"&locationsearch="+I+"&sourcesearch="+s+"&actionsearch="+q+"&postersearch="+F+"&attrsearch="+K+"&capwrisearch="+J+"&categorysearch="+C+"&scatssearch="+v+"&scodesearch="+B+"&specialsearch="+o+"&subjectsearch="+y+"&feature="+h+"&daterng="+D+"&sort="+G}if(H=="plain"){document.location.href=b+"?dispOutput="+H+"&eaCurrentPageNum="+j+"&search2String="+m+"&search1String="+n+"&searchtype="+c+"&searchSetName="+a+"&searchSet="+E+"&searchPhoto="+w+"&searchVideo="+l+"&searchText="+z+"&searchGraphics="+t+"&editorialtype="+g+"&creativetype="+p+"&celebtype="+k+"&prestype="+f+"&freetype="+A+"&carictype="+e+"&searchVT="+d+"&searchHZ="+x+"&bylinesearch="+u+"&locationsearch="+I+"&sourcesearch="+s+"&actionsearch="+q+"&postersearch="+F+"&attrsearch="+K+"&capwrisearch="+J+"&categorysearch="+C+"&scatssearch="+v+"&scodesearch="+B+"&specialsearch="+o+"&subjectsearch="+y+"&feature="+h+"&daterng="+D+"&sort="+G}}function all(){var a=document.getElementById("jsclearaction").value;var x=document.getElementById("search1String").value;var v=document.getElementById("search2String").value;var q=document.getElementById("navstartdate").value;var l=document.getElementById("navenddate").value;var j="";var u=document.getElementById("locationsearch").value;var h=document.getElementById("sourcesearch").value;var f="";var s="";var y="";var w="";var p="";var k="";var o="";var e="";var n="";if(document.getElementById("actionsearch")!=null){f=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){s=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){y=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){w=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){p=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){k=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){o=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){e=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){n=document.getElementById("subjectsearch").value}var t=document.getElementById("sort").value;var m="0";var g="0";var d="0";var b="0";var c="0";document.location.href=a+"?search1String="+x+"&search2String="+v+"&bylinesearch="+j+"&locationsearch="+u+"&sourcesearch="+h+"&actionsearch="+f+"&postersearch="+s+"&attrsearch="+y+"&capwrisearch="+w+"&categorysearch="+p+"&scatssearch="+k+"&scodesearch="+o+"&specialsearch="+e+"&subjectsearch="+n+"&lasthour="+m+"&last24hour="+g+"&last7days="+d+"&last30days="+b+"&last365days="+c+"&sort="+t+"&navstartdate="+q+"&navenddate="+l+"&eaCurrentPageNum=1&searchVideo=Y&searchPhoto=Y&searchGraphics=Y&searchText=Y&searchVT=width&searchHZ=height"}function photo(){var a=document.getElementById("jsclearaction").value;var x=document.getElementById("search1String").value;var v=document.getElementById("search2String").value;var q=document.getElementById("navstartdate").value;var l=document.getElementById("navenddate").value;var j="";var u=document.getElementById("locationsearch").value;var h=document.getElementById("sourcesearch").value;var f="";var s="";var y="";var w="";var p="";var k="";var o="";var e="";var n="";if(document.getElementById("actionsearch")!=null){f=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){s=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){y=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){w=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){p=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){k=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){o=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){e=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){n=document.getElementById("subjectsearch").value}var t=document.getElementById("sort").value;var m="0";var g="0";var d="0";var b="0";var c="0";document.location.href=a+"?search1String="+x+"&search2String="+v+"&bylinesearch="+j+"&locationsearch="+u+"&sourcesearch="+h+"&actionsearch="+f+"&postersearch="+s+"&attrsearch="+y+"&capwrisearch="+w+"&categorysearch="+p+"&scatssearch="+k+"&scodesearch="+o+"&specialsearch="+e+"&subjectsearch="+n+"&feature=${feature}&lasthour="+m+"&last24hour="+g+"&last7days="+d+"&last30days="+b+"&last365days="+c+"&sort="+t+"&navstartdate="+q+"&navenddate="+l+"&eaCurrentPageNum=1&searchVideo=N&searchPhoto=Y&searchGraphics=N&searchText=N&searchVT=width&searchHZ=height"}function video(){var a=document.getElementById("jsclearaction").value;var x=document.getElementById("search1String").value;var v=document.getElementById("search2String").value;var q=document.getElementById("navstartdate").value;var l=document.getElementById("navenddate").value;var j="";var u=document.getElementById("locationsearch").value;var h=document.getElementById("sourcesearch").value;var f="";var s="";var y="";var w="";var p="";var k="";var o="";var e="";var n="";if(document.getElementById("actionsearch")!=null){f=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){s=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){y=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){w=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){p=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){k=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){o=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){e=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){n=document.getElementById("subjectsearch").value}var t=document.getElementById("sort").value;var m="0";var g="0";var d="0";var b="0";var c="0";document.location.href=a+"?search1String="+x+"&search2String="+v+"&bylinesearch="+j+"&locationsearch="+u+"&sourcesearch="+h+"&actionsearch="+f+"&postersearch="+s+"&attrsearch="+y+"&capwrisearch="+w+"&categorysearch="+p+"&scatssearch="+k+"&scodesearch="+o+"&specialsearch="+e+"&subjectsearch="+n+"&feature=${feature}&lasthour="+m+"&last24hour="+g+"&last7days="+d+"&last30days="+b+"&last365days="+c+"&sort="+t+"&navstartdate="+q+"&navenddate="+l+"&eaCurrentPageNum=1&searchVideo=Y&searchPhoto=N&searchGraphics=N&searchText=N&searchVT=N&searchHZ=N"}function text(){var a=document.getElementById("jsclearaction").value;var x=document.getElementById("search1String").value;var v=document.getElementById("search2String").value;var q=document.getElementById("navstartdate").value;var l=document.getElementById("navenddate").value;var j="";var u=document.getElementById("locationsearch").value;var h=document.getElementById("sourcesearch").value;var f="";var s="";var y="";var w="";var p="";var k="";var o="";var e="";var n="";if(document.getElementById("actionsearch")!=null){f=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){s=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){y=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){w=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){p=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){k=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){o=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){e=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){n=document.getElementById("subjectsearch").value}var t=document.getElementById("sort").value;var m="0";var g="0";var d="0";var b="0";var c="0";document.location.href=a+"?dispOutput=plain&search1String="+x+"&search2String="+v+"&bylinesearch="+j+"&locationsearch="+u+"&sourcesearch="+h+"&actionsearch="+f+"&postersearch="+s+"&attrsearch="+y+"&capwrisearch="+w+"&categorysearch="+p+"&scatssearch="+k+"&scodesearch="+o+"&specialsearch="+e+"&subjectsearch="+n+"&feature=${feature}&lasthour="+m+"&last24hour="+g+"&last7days="+d+"&last30days="+b+"&last365days="+c+"&sort="+t+"&navstartdate="+q+"&navenddate="+l+"&eaCurrentPageNum=1&searchVideo=N&searchPhoto=N&searchGraphics=N&searchText=Y&searchVT=N&searchHZ=N"}function graphics(){var a=document.getElementById("jsclearaction").value;var x=document.getElementById("search1String").value;var v=document.getElementById("search2String").value;var q=document.getElementById("navstartdate").value;var l=document.getElementById("navenddate").value;var j="";var u=document.getElementById("locationsearch").value;var h=document.getElementById("sourcesearch").value;var f="";var s="";var y="";var w="";var p="";var k="";var o="";var e="";var n="";if(document.getElementById("actionsearch")!=null){f=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){s=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){y=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){w=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){p=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){k=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){o=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){e=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){n=document.getElementById("subjectsearch").value}var t=document.getElementById("sort").value;var m="0";var g="0";var d="0";var b="0";var c="0";document.location.href=a+"?search1String="+x+"&search2String="+v+"&bylinesearch="+j+"&locationsearch="+u+"&sourcesearch="+h+"&actionsearch="+f+"&postersearch="+s+"&attrsearch="+y+"&capwrisearch="+w+"&categorysearch="+p+"&scatssearch="+k+"&scodesearch="+o+"&specialsearch="+e+"&subjectsearch="+n+"&feature=${feature}&lasthour="+m+"&last24hour="+g+"&last7days="+d+"&last30days="+b+"&last365days="+c+"&sort="+t+"&navstartdate="+q+"&navenddate="+l+"&eaCurrentPageNum=1&searchVideo=N&searchPhoto=N&searchGraphics=Y&searchText=N&searchVT=N&searchHZ=N"}function AddToLightbox(){var a=document.getElementById("mlbname2").options[document.getElementById("mlbname2").selectedIndex].value;document.getElementById("mlbname").options[document.getElementById("mlbname").selectedIndex].value=a;document.addToLightboxForm.submit()}function addToLb(){if(!document.forms.addToLightboxForm){return}document.addToLightboxForm.submit()}function createNewLb(){if(!document.forms.addToLightboxForm){return}if((document.getElementById("lightbox.mlbname")==null||document.getElementById("lightbox.mlbname").value=="")&&(document.getElementById("lightbox.mlbnameb")==null||document.getElementById("lightbox.mlbnameb").value=="")){alert("Please enter a new lightbox name.");return}if((document.getElementById("lightbox.mlbname")==null||document.getElementById("lightbox.mlbname").value=="")&&(document.getElementById("lightbox.mlbnameb")!=null&&document.getElementById("lightbox.mlbnameb").value!="")){document.getElementById("lightbox.mlbname").value=document.getElementById("lightbox.mlbnameb").value}document.addToLightboxForm.action="addLightBox.action";document.addToLightboxForm.submit()}function toggleSets(G){var a=document.getElementById("jssearchaction").value;var J=document.getElementById("dispOutput").value;var h=document.addToLightboxForm.eaCurrentPageNum.value;var D=document.addToLightboxForm.searchSet.value;var l=document.addToLightboxForm.search2String.value;var m=document.addToLightboxForm.search1String.value;var g=document.addToLightboxForm.feature.value;var t="";var H=document.getElementById("loc").value;var q=document.getElementById("src").value;var p="";var E="";var K="";var I="";var B="";var u="";var A="";var n="";var x="";if(document.getElementById("actionsearch")!=null){p=document.getElementById("actionsearch").value}if(document.getElementById("postersearch")!=null){E=document.getElementById("postersearch").value}if(document.getElementById("attrsearch")!=null){K=document.getElementById("attrsearch").value}if(document.getElementById("capwrisearch")!=null){I=document.getElementById("capwrisearch").value}if(document.getElementById("categorysearch")!=null){B=document.getElementById("categorysearch").value}if(document.getElementById("scatssearch")!=null){u=document.getElementById("scatssearch").value}if(document.getElementById("scodesearch")!=null){A=document.getElementById("scodesearch").value}if(document.getElementById("specialsearch")!=null){n=document.getElementById("specialsearch").value}if(document.getElementById("subjectsearch")!=null){x=document.getElementById("subjectsearch").value}var C="";if(document.getElementById("daterng")!=null){C=document.getElementById("daterng").value}var v="N";var k="N";var y="N";var s="N";if(document.getElementById("photo")!=null&&document.getElementById("photo").checked==true){v="Y"}if(document.getElementById("vid")!=null&&document.getElementById("vid").checked==true){k="Y"}if(document.getElementById("news")!=null&&document.getElementById("news").checked==true){y="Y"}if(document.getElementById("graph")!=null&&document.getElementById("graph").checked==true){s="Y"}var f="";var o="";var j="";var e="";var z="";var d="";if(document.getElementById("editorial")!=null&&document.getElementById("editorial").checked==true){f="true"}if(document.getElementById("creative")!=null&&document.getElementById("creative").checked==true){o="true"}if(document.getElementById("celebrity")!=null&&document.getElementById("celebrity").checked==true){j="true"}if(document.getElementById("presidential")!=null&&document.getElementById("presidential").checked==true){e="true"}if(document.getElementById("free")!=null&&document.getElementById("free").checked==true){z="true"}if(document.getElementById("cari")!=null&&document.getElementById("cari").checked==true){d="true"}var c="";var w="";if(document.getElementById("vChkBx")!=null&&document.getElementById("vChkBx").checked==true){c="Y"}if(document.getElementById("hChkBx")!=null&&document.getElementById("hChkBx").checked==true){w="Y"}var b="";if(document.getElementById("searchtype")!=null&&document.getElementById("searchtype").checked==true){b="refinesearch"}var F=document.getElementById("sort").value;if(document.getElementById("sort")!=null&&document.getElementById("sort").checked==true){F=document.getElementById("sort").value}if(G=="on"){document.location.href=a+"?dispOutput="+J+"&eaCurrentPageNum="+h+"&search2String="+l+"&search1String="+m+"&searchtype="+b+"&searchPhoto="+v+"&searchVideo="+k+"&searchText="+y+"&searchGraphics="+s+"&editorialtype="+f+"&creativetype="+o+"&celebtype="+j+"&prestype="+e+"&freetype="+z+"&carictype="+d+"&searchSet=yes&searchVT="+c+"&searchHZ="+w+"&bylinesearch="+t+"&locationsearch="+H+"&sourcesearch="+q+"&actionsearch="+p+"&postersearch="+E+"&attrsearch="+K+"&capwrisearch="+I+"&categorysearch="+B+"&scatssearch="+u+"&scodesearch="+A+"&specialsearch="+n+"&subjectsearch="+x+"&feature="+g+"&daterng="+C+"&sort="+F}else{document.location.href=a+"?dispOutput="+J+"&eaCurrentPageNum="+h+"&search2String="+l+"&search1String="+m+"&searchtype="+b+"&searchPhoto="+v+"&searchVideo="+k+"&searchText="+y+"&searchGraphics="+s+"&editorialtype="+f+"&creativetype="+o+"&celebtype="+j+"&prestype="+e+"&freetype="+z+"&carictype="+d+"&searchSet=no&searchVT="+c+"&searchHZ="+w+"&bylinesearch="+t+"&locationsearch="+H+"&sourcesearch="+q+"&actionsearch="+p+"&postersearch="+E+"&attrsearch="+K+"&capwrisearch="+I+"&categorysearch="+B+"&scatssearch="+u+"&scodesearch="+A+"&specialsearch="+n+"&subjectsearch="+x+"&feature="+g+"&daterng="+C+"&sort="+F}}function hideImage(){$(this).removeClass("searchimagepopup");$("#imagepopup").remove()}function hidePopuptext(){$("#preview").remove()}function showPopup(g){$(this).addClass("searchimagepopup");$(this).css("cursor","progress");var f=$(this).find("img");var a=g.pageX;var k=0;var d=g.pageY;var h=0;if($(f).offset()!=null){a=$(f).attr("width");k=$(f).offset().left;d=$(f).attr("height");h=$(f).offset().top;a=(-1)*(a/2);d=(-1)*(d/2)}var j=$(this).attr("textPreview");if(j==null){j=""}j=j.replace(/\\/g,"");j=j.substring(0,120)+" ...";var c="";if($(this).parent().find(".imginfo").has(".setTotal").length){var b=$(this).parent().find(".imginfo").find(".setTotal").html();if(b>1){var l=$(this).parent().find(".imginfo").find(".setsLink").attr("href");c="<a href='"+l+'\'><div class="setTotal" style="background:#DDD;color:#333;top:-5px;right:-5px;"><span class="setTotalNum setTotalNumcwDouble photoSetBox photoBox" style="font-size:24pt;">'+b+"</span></div></a>"}}$(this).append("<div id='imagepopup' class='imagepopup'>"+c+"<a href='"+$(this).attr("linkpath")+"'><img id='ppimage' style='border:1px solid #000;' src='/nc/popupimgwatermark.action?inputPath="+$(this).attr("inputPath")+"'/></a><br><div id='textpreview'>"+j+"</div></div>");if(b>1){$("#textpreview").prepend("<span id='textsetspan'><b>Photo 1 of "+b+" in this photo set<br/>")}$("#ppimage").load(function(){$(this).parent().css("cursor","pointer");var q=$("#imagepopup");$(q).css("top",d+"px").css("left",a+"px");var o=h+d;var p=k+(a);var n=$(document).width();if($("#resultGrid").offset()!=null){n=$("#resultGrid").offset().left+$("#resultGrid").width()}var e=$(document).scrollTop();var m=$(window).height()+e;if(o<e){d=(-1)*(h-e)}else{if((h+d)+$(q).height()>m){var s=(h+d+$(q).height()+10)-m;d=d-s}}if(p<30){if(p<30&&p>=-40){a=a-p+36}else{a=a-p}}else{if((p+$(q).width())>(n-30)){a=a-((p+$(q).width())-n)}}$(this).parent().css("cursor","pointer");$(q).css("top",d+"px").css("left",a+"px").fadeIn("fast");$(this).parent().parent().css("cursor","pointer")})}function showPopuptext(f){xOffset=25;yOffset=25;var b=document.documentElement.clientWidth;var d=f.pageX;var a=f.pageY;$(".textpreview").bind("mouseover",function(c){d=c.pageX;a=c.pageY});var h=$(this).attr("textPreview");h=h.replace(/\\/g,"");this.t=this.title;this.title="";var g=(this.t!="")?"<br/>"+this.t:"";$("body").append("<div id='preview'><center><div id='previewimg'>&nbsp;</div><div id='textpreview'>"+h+"</div></center></div>");$("#preview").css("width","250px").css("height","150px");if((f.pageX+$("#preview").outerWidth())>($(window).width()-30)){$("#preview").css("left",(f.pageX-$("#preview").outerWidth(true)-yOffset+"px"))}else{$("#preview").css("left",(d+yOffset)+"px")}if((f.pageY-xOffset-$(window).scrollTop())<0){$("#preview").css("top",$(window).scrollTop()+5+"px").hide()}else{if(((f.pageY-xOffset)-$(window).scrollTop()+$("#preview").outerHeight(true))>$(window).height()){$("#preview").css("top",$(window).scrollTop()+$(window).height()-$("#preview").outerHeight(true)-5+"px").hide()}else{$("#preview").css("top",(a-xOffset)+"px").hide()}}$.doTimeout("imagepopup",500,function(){$("#preview").fadeIn("fast").css("z-index","100")});temp=$("#previewimg").html().replace(/(?:&nbsp;)/g,"");$("#previewimg").html(temp)}var imageconfig={sensitivity:50,interval:0,over:showPopup,timeout:0,out:hideImage};var textconfig={sensitivity:1,interval:0,over:showPopuptext,timeout:0,out:hidePopuptext};$(document).ready(function(){if($.browser.msie){if($.browser.version<8){return}}$("div[id^=showImg]").hoverIntent(imageconfig);$(".textpreview").hoverIntent(textconfig)});var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-21433801-1"]);_gaq.push(["_trackPageview"]);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".newscom.com/js/v2/ga.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)})();function confirmTag(h,b,l){if(document.getElementById("smartTagText").value==""||document.getElementById("smartTagText").value=="Insert smartTAG Here "){alert("You did not enter a Smart Tag. Please provide it.");document.getElementById("smartTagText").focus();return false}var f="false";var j=new Array();if(document.getElementById("altCheckbox")==null){var c=document.forms[h].elements[b];if(!c){return}var d=c.length;if(typeof d=="undefined"){if(c.checked==true){f="true"}}else{for(var e=0;e<d;e++){if(c[e].checked==true){f="true";break}}}if(f=="false"){alert("You must check at least one asset");return false}if(typeof d=="undefined"){if(c.checked==true){var g=c.value;j.push(g)}}else{for(var e=0;e<d;e++){if(c[e].checked==true){var k=c[e].value.indexOf(":");if(k>=0){var g=c[e].value.split(":");j.push(g[1])}else{j.push(c[e].value)}}}}}else{var a=document.getElementById("altCheckbox").value;j.push(a)}ajaxAddTAG(h,b,j,"smartTagText",l);$(".gridcheckbox").attr("checked",false);alert("Smart tags have been applied.");return true}function ajaxAddTAG(e,a,k,j,h){var f="AJAXsmartTag.action";var b="smartTagText="+getValue(j);var g="no";for(var d=0;d<k.length;d++){if(d==(k.length-1)){g="yes"}var c="tag_id="+k[d]+"&"+b;ajaxPost(f,c,function(l){showResponseText(e,a,l,h,g)})}}function getRequestObject(){if(window.ActiveXObject){return(new ActiveXObject("Microsoft.XMLHTTP"))}else{if(window.XMLHttpRequest){return(new XMLHttpRequest())}else{return(null)}}}function htmlInsert(b,a){document.getElementById(b).innerHTML=a}function getValue(a){return(escape(document.getElementById(a).value))}function ajaxPost(b,e,a,c){if(c===undefined){c=true}var d=getRequestObject();d.onreadystatechange=function(){a(d)};d.open("POST",b,c);d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(e)}function showResponseText(b,e,d,a,c){if((d.readyState==4)&&(d.status==200)){document.getElementById(a).style.display="";htmlInsert(a,d.responseText);if(c=="yes"){document.getElementById(a).innerHTML="* Adding smartTAGs makes it easy to edit and group content.";document.getElementById(a).style.display="";SetAllCheckBoxes(b,e,false)}}};
