window.CIOC={};function CheckAll(){for(var a=document.RecordList,b=a.elements.length,d=0;d<b;d++){var c=a.elements[d];if(c.name=="IDList")c.checked=true}}function ClearAll(){for(var a=document.RecordList,b=a.elements.length,d=0;d<b;d++){var c=a.elements[d];if(c.name=="IDList")c.checked=false}}function add_class(a,b){if(a)if(!RegExp("\\b"+b+"\\b").test(a.className)){if(a.className)b=" "+b;a.className+=b}}
function remove_class(a,b){if(a){for(var d=a.className.split(" "),c=[],h=0;h<d.length;h++){var f=d[h];f!=b&&c.push(f)}a.className=c.join(" ")}}function hide(a){add_class(a,"NotVisible")}function show(a){remove_class(a,"NotVisible")}function openWin(a,b){popWin=window.open(a,b,"toolbar=no,width=490,height=485,location=no,scrollBars=yes,resizable=no,titlebar=yes");popWin.focus()}
function openWinL(a,b){popWin=window.open(a,b,"toolbar=no,width=650,height=520,location=no,scrollBars=yes,resizable=no,titlebar=yes");popWin.focus()}function openWinXL(a,b){popWin=window.open(a,b,"toolbar=no,width=755,height=550,location=no,scrollBars=yes,resizable=no,titlebar=yes");popWin.focus()}jQuery(function(a){var b={sm:openWin,lg:openWinL,xl:openWinXL};a("a.poplink").live("click",function(){var d=a(this).data("popargs");(b[d.size||"sm"]||openWin)(this.href,d.name||"popwin");return false})});
(function(){var a=jQuery,b={},d=function(e){if(e!==null&&typeof e!=="undefined")a("#myListCount").text(e);else if(e=a("#myListCount").text())e=parseInt(e,10);e?b.myListLink.show():b.myListLink.hide()},c=function(e){a.each(e,function(m,p){a("#added_to_list_"+p).show();a("#add_to_list_"+p).hide()})},h=function(e){return function(m){if(m.fail)alert(m.errinfo);else{if(m.ids)d(a.grep(m.ids,g[b.domain]).length);else m.count?d(m.count):d(0);c([e])}}},f=function(e){e=a(e.currentTarget).data("id");a.ajax({success:h(e),
dataType:"json",error:function(){alert("Error")},data:{id:e},type:"POST",url:b.current_list_url})},n=function(e){return function(m){if(m.fail)alert(m.errinfo);else{m=true;if(e){var p=a("#results_table #remove_from_list_"+e);if(!p.length){m=false;p=a("#results_container #remove_from_list_"+e)}p.parent().parent().remove()}p=false;if((p=m?a("#results_table tr").length===1:a("#results_container > p").length===0)||!e){a("#records_ui").hide();a("#no_records_message").show()}}}},l=function(e){e=a(e.currentTarget).data("id");
a.ajax({success:n(e),dataType:"json",error:function(){alert("Error")},data:{ID:e,RemoveItem:b.domain},type:"POST",url:b.current_list_url})},i=function(){a.ajax({success:n(),dataType:"json",error:function(){alert("Error")},data:{ID:"all",RemoveItem:b.domain},type:"POST",url:b.current_list_url})},g={CIC:function(e){return/^[A-Za-z]{3}[0-9]{4,5}$/.test(e)},VOL:function(e){return/^[1-9][0-9]*$/.test(e)}},o=function(e){if(e.fail)j();else if(e.inrequest){var m=a.grep(e.ids,g[b.domain]);c(m);d(m.length);
(e=e.previous_ids)&&a.each(e,function(p,r){a("#ct_added_to_previous_request_"+r).show()});a(".ListUI img").prop("src",function(p,r){return r.replace("list","referral")});a("#list_header_text").hide();a("#ct_header_text").show();b.current_list_url=b.ct_update_url;q()}else j()},j=function(){var e=function(){b.list_view_mode||c(b.already_added||[]);b.current_list_url=b.list_view_mode&&b.list_view_mode==="ct"?b.ct_update_url:b.list_update_url;d((b.already_added||[]).length);q()};!b.list_view_mode&&!b.has_session?
a.ajax({dataType:"json",error:null,url:b.list_update_url,data:{SessionTest:"on"},type:"POST",success:function(m){m.has_session&&e()}}):e()},q=function(){a(".HideListUI").delegate(".add_to_list","click",f).delegate(".remove_from_list","click",l).removeClass("HideListUI");a("#remove_all_from_list").click(i);a.browser.msie&&a.browser.msie<"8.0"&&a(".ListUI").removeClass("FixIE")};window.init_list_adder=function(e){b=e;b.myListLink=a("#myListLink").parent(":hidden").add("#myListLink");e.in_request?a.ajax({success:o,
dataType:"json",error:null,type:"POST",url:e.in_request}):j()}})();if(!this.JSON)this.JSON={};
(function(){function a(g){return g<10?"0"+g:g}function b(g){h.lastIndex=0;return h.test(g)?'"'+g.replace(h,function(o){var j=l[o];return typeof j==="string"?j:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+g+'"'}function d(g,o){var j,q,e,m,p=f,r,k=o[g];if(k&&typeof k==="object"&&typeof k.toJSON==="function")k=k.toJSON(g);if(typeof i==="function")k=i.call(o,g,k);switch(typeof k){case "string":return b(k);case "number":return isFinite(k)?String(k):"null";case "boolean":case "null":return String(k);
case "object":if(!k)return"null";f+=n;r=[];if(Object.prototype.toString.apply(k)==="[object Array]"){m=k.length;for(j=0;j<m;j+=1)r[j]=d(j,k)||"null";e=r.length===0?"[]":f?"[\n"+f+r.join(",\n"+f)+"\n"+p+"]":"["+r.join(",")+"]";f=p;return e}if(i&&typeof i==="object"){m=i.length;for(j=0;j<m;j+=1){q=i[j];if(typeof q==="string")if(e=d(q,k))r.push(b(q)+(f?": ":":")+e)}}else for(q in k)if(Object.hasOwnProperty.call(k,q))if(e=d(q,k))r.push(b(q)+(f?": ":":")+e);e=r.length===0?"{}":f?"{\n"+f+r.join(",\n"+f)+
"\n"+p+"}":"{"+r.join(",")+"}";f=p;return e}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
h=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,n,l={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;if(typeof JSON.stringify!=="function")JSON.stringify=function(g,o,j){var q;n=f="";if(typeof j==="number")for(q=0;q<j;q+=1)n+=" ";else if(typeof j==="string")n=j;if((i=o)&&typeof o!=="function"&&(typeof o!=="object"||typeof o.length!=="number"))throw Error("JSON.stringify");return d("",
{"":g})};if(typeof JSON.parse!=="function")JSON.parse=function(g,o){function j(e,m){var p,r,k=e[m];if(k&&typeof k==="object")for(p in k)if(Object.hasOwnProperty.call(k,p)){r=j(k,p);if(r!==undefined)k[p]=r;else delete k[p]}return o.call(e,m,k)}var q;g=String(g);c.lastIndex=0;if(c.test(g))g=g.replace(c,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(g.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){q=eval("("+g+")");return typeof o==="function"?j({"":q},""):q}throw new SyntaxError("JSON.parse");}})();
function get_form_values(a){var b={};jQuery(a).find("input,select,textarea").each(function(){if(this.name){b[this.name]||(b[this.name]=[]);if(this.nodeName.toLowerCase()==="select"){var d=b[this.name];$(this).find("option").each(function(){this.selected&&d.push(this.value)})}else this.nodeName.toLowerCase()==="input"&&(this.type==="checkbox"||this.type==="radio")&&!this.checked||b[this.name].push(this.value||"")}});return b}
function restore_form_values(a,b){var d=jQuery;d(a).find("input,select,textarea").each(function(){if(this.name){var c=b[this.name];if(!(typeof c=="undefined"||c===null))if(this.nodeName.toLowerCase()==="input"&&(this.type==="checkbox"||this.type==="radio"))this.checked=c.length>1?d.inArray(this.value,c)>=0:c.length==0?false:this.value===c[0];else if(this.nodeName.toLowerCase()==="select")d(this).find("option").each(function(){this.selected=c.length>1?d.inArray(this.value,c)>=0:c.length==0?false:this.value===
c[0]});else this.value=c.length?c[0]:""}})}
function init_cached_state(a){var b=jQuery;a=a||"#EntryForm";onbeforeunload_fns=[];onbeforerestorevalues_fns=[];window.onbeforeunload=function(){var d={form_values:get_form_values(a)};b.each(onbeforeunload_fns,function(c,h){h(d)});document.getElementById("cache_form_values").value=JSON.stringify(d)};window.cache_register_onbeforeunload=function(d){onbeforeunload_fns.push(d)};window.cache_register_onbeforerestorevalues=function(d){onbeforerestorevalues_fns.push(d)};window.restore_cached_state=function(){var d=
document.getElementById("cache_form_values");if(d.value){var c=JSON.parse(d.value);b.each(onbeforerestorevalues_fns,function(h,f){f(c)});restore_form_values(a,c.form_values)}}}
(function(a){function b(d){return d&&d.constructor===Number?d+"px":d}a.fn.bgiframe=a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":
b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){a(this).children("iframe.bgiframe").length===0&&this.insertBefore(document.createElement(c),this.firstChild)})}:function(){return this};a.fn.bgIframe=a.fn.bgiframe})(jQuery);
(function(){var a=function(c){c=c.toLowerCase();c=c.replace(RegExp("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]","g"),"a");c=c.replace(RegExp("\u00e6","g"),"ae");c=c.replace(RegExp("\u00e7","g"),"c");c=c.replace(RegExp("[\u00e8\u00e9\u00ea\u00eb]","g"),"e");c=c.replace(RegExp("[\u00ec\u00ed\u00ee\u00ef]","g"),"i");c=c.replace(RegExp("\u00f1","g"),"n");c=c.replace(RegExp("[\u00f2\u00f3\u00f4\u00f5\u00f6]","g"),"o");c=c.replace(RegExp("\u009c","g"),"oe");c=c.replace(RegExp("[\u00f9\u00fa\u00fb\u00fc]","g"),
"u");return c=c.replace(RegExp("[\u00fd\u00ff]","g"),"y")};window.string_ci_ai=a;var b=function(c,h,f,n,l){f=f||"value";n=n||"";l=l||"";return function(i,g){if(h.term&&RegExp(n+c.ui.autocomplete.escapeRegex(h.term)+l,"i").test(i.term)&&h.content&&h.content.length<13){var o=RegExp(n+c.ui.autocomplete.escapeRegex(i.term)+l,"i");g(c.grep(h.content,function(j){return o.test(a(j[f]))}));return true}return false}};window.default_cache_search_fn=b;var d=function(c,h,f,n,l){f=f||{};l=l||b(c,f,n||"value");
return function(i,g,o){i.term=a(i.term);if(f.term===i.term&&f.content)g(f.content);else l(i,g)||c.ajax({url:o||h,dataType:"json",data:i,cache:false,success:function(j){f.term=i.term;f.content=j;g(j)}})}};window.create_caching_source_fn=d;window.init_community_autocomplete=function(c,h,f,n){var l=c("#"+h).autocomplete({focus:function(){return false},source:d(c,f),minLength:n}).keypress(function(i){if(i.keyCode=="13"){i.preventDefault();l.autocomplete("close")}})}})();
(function(){function a(d){return function(c,h){if(d.term&&RegExp(b.ui.autocomplete.escapeRegex(d.term),"i").test(c.term)&&d.content&&d.content.length<13&&d.content.length>1){for(var f=[],n=c.term.split(/\s+/),l=0;l<n.length;l++)n[l]&&f.push(RegExp(b.ui.autocomplete.escapeRegex(n[l]),"i"));h(b.grep(d.content,function(i){var g=true;i=string_ci_ai(i.value);for(var o=0;o<f.length;o++){g=g&&f[o].test(i);if(!g)return false}return g}));return true}return false}}var b=jQuery;window.init_find_box=function(d){var c=
{},h=create_caching_source_fn(b,null,c,null,a(c));b("#STerms").autocomplete({focus:function(){return false},source:function(f,n){var l=b("input[name=SType]:checked").prop("value"),i=d[l];if(i){if(c.type&&c.type!==l){delete c.type;delete c.term;delete c.content}h(f,function(g){c.type=l;n(g)},i)}},minLength:4})}})();
(function(){window.init_grouped_quicklist=function(){$(".fix-group-single option").each(function(){var a=$(this).data("group");if(a)this.value=a});$(".fix-group-multi").each(function(){var a=$(this),b=a.data("group");b&&$("<option>").attr("value",b).data("group",b).insertAfter(a.find("option:first")).text('${_("(any value)")|n}')});$(".fix-group-single, .fix-group-multi").live("change",function(){var a=this.name.replace("_GRP","");this.name=$(this).find("option:selected").data("group")?a+"_GRP":a});
cache_register_onbeforeunload(function(a){var b={};$(".fix-group-single, .fix-group-multi").each(function(){b[this.id]=this.name});a.QuickList=b});cache_register_onbeforerestorevalues(function(a){var b=a.QuickList;b&&$(".fix-group-single, .fix-group-multi").each(function(){var d=b[this.id];if(d)this.name=d})})}})();
(function(){window.init_bsearch_tabs=function(a){var b=$(".make-me-tabbed");if(b.length){a.InlineMode="on";b.find("ul:first a").each(function(d,c){var h=$(c).attr("href"),f=jQuery.extend({},a);if(h[0]!="#"){h=h.split("?");if(h.length>1){var n=h[1],l=f,i,g=/\+/g,o=/([^&=]+)=?([^&]*)/g;n=n||window.location.search.substring(1);for(l=l||{};i=o.exec(n);)l[decodeURIComponent(i[1].replace(g," "))]=decodeURIComponent(i[2].replace(g," "));h=h[0]}if(f)h=h+"?"+jQuery.param(f);c.href=h}});b.tabs().css("overflow",
"auto");cache_register_onbeforeunload(function(d){d.last_tab=b.tabs("option","selected")});cache_register_onbeforerestorevalues(function(d){d.last_tab&&b.tabs("option","selected",d.last_tab)})}}})();

