var Helper=function(){function n(){}return n.updateQueryStringParameter=function(n,t,i){var r=new RegExp("([?|&])"+t+"=.*?(&|$)","i"),u=n.indexOf("?")!==-1?"&":"?";return n.match(r)?n.replace(r,"$1"+t+"="+i+"$2"):n+u+t+"="+i},n.showMessage=function(n,t){t===void 0&&(t="messageArea");$("#"+t).html(n).dialog({autoOpen:!0,show:"fade",hide:"fade",buttons:{OK:function(){$(this).dialog("close")}},width:380})},n.showInPopup=function(n,t,i,r,u,f,e,o,s){var h;h=$("#"+o).html();$("#"+o).append('<img class="wait" src="'+e+'"/>');$("#"+o).dialog({title:f,position:[t,i],width:r,height:u,dialogClass:s,close:function(){$("#"+o).html(h)}});$.get(n,function(n){$("#"+o).html(n)})},n.popupContent=function(n,t){var i="imagebutton_"+n,f="content_"+n,e=$("#"+i).offset().left+$("#"+i).width(),o=$("#"+i).offset().top+$("#"+i).height(),r=$("#"+f).clone(),u;r.addClass("popup");r.attr("id","clone_"+n);u="clone_"+n;$("#"+u).dialog("isOpen")===!0?$("#"+u).remove():r.dialog({show:"slide",hide:"slide",title:t,position:[e,o],width:600,minHeight:300,maxHeight:600,close:function(){$(this).remove()}})},n.isValidISSN=function(n){var t,r,i;if(n=n.replace(/[^\dX]/gi,""),n.length!=8)return!1;for(t=n.split(""),t[7].toUpperCase()=="X"&&(t[7]=String.fromCharCode(10)),r=0,i=0;i<t.length;i++)r+=(8-i)*parseInt(t[i]);return r%11==0},n.isValidISBN=function(n){if(n.match(/[^0-9xX\.\-\s]/)||(n=n.replace(/[^0-9xX]/g,""),n.length!=10&&n.length!=13))return!1;var t=0;return n.length==10?(t=(11-(10*parseInt(n.charAt(0))+9*parseInt(n.charAt(1))+8*parseInt(n.charAt(2))+7*parseInt(n.charAt(3))+6*parseInt(n.charAt(4))+5*parseInt(n.charAt(5))+4*parseInt(n.charAt(6))+3*parseInt(n.charAt(7))+2*parseInt(n.charAt(8)))%11)%11,t==10?n.charAt(9)=="x"||n.charAt(9)=="X"?!0:!1:parseInt(n.charAt(9))==t?!0:!1):(t=10-(1*parseInt(n.charAt(0))+3*parseInt(n.charAt(1))+1*parseInt(n.charAt(2))+3*parseInt(n.charAt(3))+1*parseInt(n.charAt(4))+3*parseInt(n.charAt(5))+1*parseInt(n.charAt(6))+3*parseInt(n.charAt(7))+1*parseInt(n.charAt(8))+3*parseInt(n.charAt(9))+1*parseInt(n.charAt(10))+3*parseInt(n.charAt(11)))%10,t==10?parseInt(n.charAt(12))==0?!0:!1:parseInt(n.charAt(12))==t?!0:!1)},n.isValidUrl=function(n){return n.match(/^http(?:s)?\:\/\/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi)!=null},n.getHostName=function(n){var t,i;return t=document.createElement("a"),t.href=n,i=t.port,i=="80"&&(i=""),t.protocol+"//"+t.hostname+(i?":"+i:"")},n.getPathName=function(n){var t;return t=document.createElement("a"),t.href=n,t.pathname},n.getAllButHostName=function(n){var t,i;t=document.createElement("a");t.href=n;i=t.port;i=="80"&&(i="");var u=t.protocol+"//"+t.hostname+(i?":"+i:""),r=u.length;return t.href.substr(r+1,t.href.length-r)},n.htmlEscape=function(n){return String(n).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},n}()