var ShowProgress=false;$().ready(function(){$("#Title,#Issue").keypress(function(a){if(CharInvalid2(String.fromCharCode(a.which))){return false}});$("#Title,#Issue").change(function(){if(CharInvalid2($(this).val())){$(this).val("")}});$("#StartDate,#EndDate").datepicker({beforeShow:customRange});$("#View").change(function(){var c="";c=$(this).find(":selected").val();var b=$("#CurrentPage").val();var a=$.query(b).set("View",c).toString();document.location.href="/Search"+a});$("#PageSize").change(function(){var c="";c=$(this).find(":selected").text();var b=$("#CurrentPage").val();var a=b.replace("PageSize="+$.query(b).get("PageSize"),"PageSize="+c);a=a.replace("PageNumber="+$.query(b).get("PageNumber"),"PageNumber=1");document.location.href=a});$("#NewLabel").keypress(function(a){if(CharInvalid(String.fromCharCode(a.which))){return false}});$("#btnInventoryComics").click(function(){var b=GetCheckedItems(".IssueID");var a=$.trim($("#NewLabel").val());if(b.length>0){if(a!=""&&($("#LabelList option").length-2)>=MaxNumberOfLabels){ShowStatusMsg("You have reached the maximum limit of "+MaxNumberOfLabels+" labels.");return}if(a!=""){if(CharInvalid(a)){return}}$("#btnInventoryComics").attr("value","Please wait...").attr("disabled","true");var c="/Search/InventoryComics";$.post(c,{Issues:b.join(","),LabelID:$("#LabelList").val(),NewLabel:$("#NewLabel").val(),__RequestVerificationToken:$.getAntiForgeryTokenString()},function(d){if(d=="Not Authorized"){$("#btnInventoryComics").attr("value","Inventory Comic(s)").removeAttr("disabled");$("#SignInMsg").load("/Content/html/SignInMsg.html",function(){var e=$("#btnInventoryComics").offset().top-100;var f=$("#btnInventoryComics").offset().left-60;$("#SignInMsg").css({top:e,left:f}).fadeIn(500)})}else{if(d=="Issue(s) Added"){window.location.href=window.location.href}else{if(d=="Maximum Reached!"){$("#btnInventoryComics").attr("value","Inventory Comic(s)").removeAttr("disabled");ShowStatusMsg("You have reached the maximum issue limit of "+MaxNumberOfUserIssues+"issues with your free account.")}else{if(d==""){$("#btnInventoryComics").attr("value","Inventory Comic(s)").removeAttr("disabled");ShowStatusMsg("Nothing has been inventoried.\n\rPlease try again.")}}}}})}});$("#SignInMsg").click(function(){$("#SignInMsg").fadeOut(500)});$("#SelectAll").click(function(){$(".IssueID:enabled").each(function(){$(this).attr("checked","checked");FlashCheckedItem(this,".Issue")})});$("#SelectNone").click(function(){$(".IssueID:enabled").each(function(){$(this).removeAttr("checked");FlashCheckedItem(this,".Issue")})});$(".IssueID").click(function(){FlashCheckedItem(this,".Issue")});$("#Title").focus();$("#NewLabel").watermark({html:"Create a new Label!",cls:"watermarked"});$("#StartDate").watermark({html:"Start Date",cls:"watermarked"});$("#EndDate").watermark({html:"End Date",cls:"watermarked"})});$.getAntiForgeryTokenString=function(){return $(document.getElementsByName("__RequestVerificationToken")).val()};function customRange(a){return{minDate:(a.id=="EndDate"?$("#StartDate").datepicker("getDate"):null),maxDate:(a.id=="StartDate"?$("#EndDate").datepicker("getDate"):null)}};new function(d){var c=d.separator||"&";var b=d.spaces===false?false:true;var a=d.suffix===false?"":"[]";jQuery.query=function(e){var f=function(g){var h=this;h.keys={};if(g.queryObject){jQuery.each(g.keys,function(j,k){h.destructiveSet(j,k)})}else{var i=""+g;i=i.replace(/^\?/,"");i=i.replace(/[;&]$/,"");if(b){i=i.replace("+"," ")}jQuery.each(i.split(/[&;]/),function(){var k=this.split("=")[0];var n=this.split("=")[1];var j,m=null,l=null;if(/^-?[0-9]+\.[0-9]+$/.test(n)){n=parseFloat(n)}else{if(/^-?[0-9]+$/.test(n)){n=parseInt(n)}}if(/\[([^\] ]+)\]$/.test(k)){l=Object,hashkey=k.replace(/^.+\[([^\] ]+)\]$/,"$1"),k=k.replace(/\[([^\] ]+)\]$/,"")}else{if(/\[\]$/.test(k)){l=Array,k=k.replace(/\[\]$/,"")}}n=n||true;if(!l&&h.has(k)){l=Array,h.destructiveSet(k,h.has(k,Array)?h.keys[k]:[h.keys[k]])}if(!l){h.destructiveSet(k,n)}else{if(l==Object){j=h.keys[k]||{},j[hashkey]=n,h.destructiveSet(k,j)}else{if(l==Array){j=h.keys[k]||[],j.push(n),h.destructiveSet(k,j)}}}})}return h};f.prototype={queryObject:true,has:function(g,h){var i=this.keys;return !!h?i[g]!=undefined&&i[g]!==null&&i[g].constructor==h:i[g]!=undefined&&i[g]!==null},get:function(g){var h=(g==undefined)?this.keys:this.keys[g];if(h.constructor==Array){return h.slice(0)}else{if(h.constructor==Object){return jQuery.extend({},h)}else{return h}}},destructiveSet:function(g,h){if(h==undefined||h===null){this.destructiveRemove(g)}else{this.keys[g]=h}return this},set:function(g,h){return this.copy().destructiveSet(g,h)},destructiveRemove:function(g){if(typeof this.keys[g]!="undefined"){delete this.keys[g]}return this},remove:function(g){return this.copy().destructiveRemove(g)},destructiveEmpty:function(){var g=this;jQuery.each(g.keys,function(h,i){delete g.keys[h]});return g},copy:function(){return new f(this)},empty:function(g){return this.copy().destructiveEmpty()},toString:function(){var j=0,k=[],h=this,g=function(m,i,l){m.push(i);if(l!==true){m.push("=");m.push(encodeURIComponent(l))}};jQuery.each(this.keys,function(l,m){var n=[];if(m!==false){if(j++==0){n.push("?")}if(h.has(l,Object)){var i=[];jQuery.each(m,function(p,o){var q=[];g(q,l+"["+p+"]",o);i.push(q.join(""))});n.push(i.join(c))}else{if(h.has(l,Array)){var i=[];jQuery.each(m,function(p,o){var q=[];g(q,l+a,o);i.push(q.join(""))});n.push(i.join(c))}else{g(n,l,m)}}}k.push(n.join(""))});return k.join(c)}};if(typeof e!="undefined"||jQuery.trim(e)!=""){return new f(e.split("?")[1])}else{return new f(location.search)}}}(jQuery.query||{});(function($){$.extend($,{clearwatermarks:function(){$("[wmwrap='true']").find("input,textarea").watermark({remove:true})},addwatermarks:function(){$("[watermark]").each(function(num,el){$(el).watermark($(el).attr("watermark"))})},watermark:function(o){o.el=$(o.el);if(o.remove){if(o.el.parent().attr("wmwrap")=="true"){o.el.parent().replaceWith(o.el)}}else{if(o.el.parent().attr("wmwrap")!="true"){o.el=o.el.wrap("<span wmwrap='true' style='position:relative;'/>");var l=$("<label/>");if(o.html){l.html(o.html)}if(o.cls){l.addClass(o.cls)}if(o.css){l.css(o.css)}l.css({position:"absolute",left:"3px",top:parseInt(o.el.css("paddingTop")),display:"inline",cursor:"text"});if(o.el.is("TEXTAREA")){if($.browser.msie){l.css("width",o.el.width())}if($.browser.mozilla||$.browser.safari){l.css("top","")}}if(!o.cls&&!o.css){l.css("color","#ccc")}var focus=function(){l.hide()};var blur=function(){if(!o.el.val()){l.show()}else{l.hide()}};var click=function(){o.el.focus()};if(o.inherit){if(typeof o.inherit=="string"){l.css(o.inherit,o.el.css(o.inherit))}else{for(var x=0;x<o.inherit.length;x++){l.css(o.inherit[x],o.el.css(o.inherit[x]))}}}o.el.focus(focus).blur(blur);l.click(click);o.el.before(l);if(o.el.val()){l.hide()}}}return o.el}});$.fn.watermark=function(o){return this.each(function(){if(typeof (o)=="string"){try{o=eval("("+o+")")}catch(ex){o={html:o}}}o.el=this;return $.watermark(o)})}})(jQuery);$().ready(function(){$.addwatermarks()});
