if(Drupal.jsEnabled){$(document).ready(function(){var comment_sent=0;$("#comment-form").submit(function(){if(comment_sent==0){comment_sent++}else{return false}})})}if(Drupal.jsEnabled){$(document).ready(function(){$("#paypal-link").click(function(){$("#paypal-tipjar").submit()})})}$.fn.htmlbox=function(){if(undefined===window.glob_ha){glob_ha=[]}var d={buttons:[],rows:[],images:[],dir:"./images/",output:"xhtml"};var xhtml='<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body>INITIAL_CONTENT</body></html>';if(!$(this).attr("id")){$(this).attr("id","jqha_"+glob_ha.length);d.id="jqha_"+glob_ha.length;glob_ha[glob_ha]=glob_ha}else{d.id=$(this).attr("id")}if(undefined===glob_ha[d.id]){glob_ha[d.id]=this}this.init=function(is_init){var exception;if($(this).size()===0){return this}if(undefined===is_init){setTimeout("glob_ha['"+d.id+"'].init(true)",250);return false}var w=$(this).width();var h=$(this).height();$(this).wrap("<div class='htmlbox' style='width: "+w+"px; height:"+h+"px;'><div class='htmlbox-area'></div></div>");$(this).parent().append(toolbar());$("."+d.id+"_tb").css("width",w-6+"px").find("button").each(function(){$(this).mouseover(function(){$(this).css("border","1px solid #BFCAFF").css("background-color","#EFF2FF")});$(this).mouseout(function(){$(this).css("border","1px solid #E9EAEF").css("background-color","transparent")})}).end().find("select").each(function(){$(this).css("border","1px solid #E9EAEF").css("background-color","transparent").css("margin","2px 2px 3px 2px");if($.browser.mozilla){$(this).css("padding","0").css("position","relative").css("top","-2px")}});try{var iframe=document.createElement("IFRAME");var doc=null;$(iframe).attr("width",w).css("height",h+"px").attr("id",d.id+"_html").css("border","none");$(this).parent().prepend(iframe)}catch(eIframe){alert("This rich text component is not supported by your browser.");$(this).show();return false}d.iframe=iframe;var idoc=iframe.contentWindow.document;if($.browser.msie===false){idoc.body.contentEditable=true}else{setTimeout(function(){try{$(idoc.body).css("border","none")}catch(exception){}},10)}$(idoc.body).css("font-size","75%");var text=$.trim($(this).val()).replace(/<script[^>]+>(?:(?!<\/script>)[\s\S])*?<\/script>/gi,"");text=xhtml.replace(/INITIAL_CONTENT/,($.browser.mozilla&&text==="")?"":text);if($.browser.mozilla){idoc.open("text/html","replace");idoc.write(text);idoc.close()}else{idoc.write(text)}try{idoc.designMode="on"}catch(e){$(idoc).focus(function(){self.designMode()})}var keyupHandler=function(e){var html=glob_ha[d.id].get_html();$("#"+d.id).val(html)};try{if(idoc.attachEvent){idoc.attachEvent("onkeyup",keyupHandler);idoc.attachEvent("onblur",keyupHandler)}else{idoc.addEventListener("keyup",keyupHandler,false);idoc.addEventListener("blur",keyupHandler,false)}}catch(exception){}try{$(idoc).keypress(function(e){if(e.keyCode){code=e.keyCode}else{if(e.which){code=e.which}}if(code===13){if(!$.browser.opera){try{var el=glob_ha[d.id].getEventElement(iframe.contentWindow,e);if(el.nodeName=="BODY"){glob_ha[d.id].cmd("formatblock","<p>")}}catch(exception){}}}})}catch(exception){}$(this).hide()};this.getEventElement=function(contentWindow,e){var eTarget;var selection;var range;if(window.getSelection){selection=contentWindow.getSelection();eTarget=(e&&e.type=="mouseup")?e.target:((selection.anchorNode.nodeName=="#text")?selection.anchorNode.parentNode:selection.anchorNode)}else{selection=contentWindow.document.selection;range=selection.createRange();eTarget=(e&&e.type=="mouseup")?e.srcElement:((selection.type=="Control")?range.item(0):selection.parentElement())}return eTarget};var toolbar=function(){var h="";var colors=["white","FFFFFF","ivory","FFFFF0","lightyellow","FFFFE0","yellow","FFFF00","snow","FFFAFA","floralwhite","FFFAF0","lemonchiffon","FFFACD","cornsilk","FFF8DC","seashell","FFF5EE","lavenderblush","FFF0F5","papayawhip","FFEFD5","blanchedalmond","FFEBCD","mistyrose","F FE4E1","bisque","FFE4C4","moccasin","FFE4B5","navajowhite","FFDEAD","peachpuff","FFDAB9","gold","FFD700","pink","FFC0CB","lightpink ","FFB6C1","orange","FFA500","lightsalmon","FFA07A","darkorange","FF8C00","coral","FF7F50","hotpink","FF69B4","tomato","FF6347","orangered","FF4500","deeppink","FF1493","magenta","FF00FF","fuchsia","FF00FF","red","FF0000","oldlace","FDF5E6","lightgoldenrodyellow","FAFAD2"," linen","FAF0E6","antiquewhite","FAEBD7","salmon","FA8072","ghostwhite","F8F8FF","mintcream","F5FFFA","whitesmoke","F5F5F5","beige"," F5F5DC","wheat","F5DEB3","sandybrown","F4A460","azure","F0FFFF","honeydew","F0FFF0","aliceblue","F0F8FF","khaki","F0E68C","lightcoral ","F08080","palegoldenrod","EEE8AA","violet","EE82EE","darksalmon","E9967A","lavender","E6E6FA","lightcyan","E0FFFF","burlywood","DEB887","plum","DDA0DD","gainsboro","DCDCDC","crimson","DC143C","palevioletred","DB7093","goldenrod","DAA520","orchid","DA70D6","thistle","D8BFD8","lightgrey","D3D3D3","tan","D2B48C","chocolate","D2691E","peru","CD853F","indianred","CD5C5C","mediumvioletred","C71585","silver","C0C0C0","darkkhaki","BDB76B","rosybrown","BC8F8F","mediumorchid","BA55D3","darkgoldenrod","B8860B","firebrick","B22222","powderblue","B0E0E6","lightsteelblue","B0C4DE","paleturquoise","AFEEEE","greenyellow","ADFF2F","lightblue","ADD8E6","darkgray","A9A9A9","brown","A52A2A","sienna","A0522D","yellowgreen","9ACD32","darkorchid","9932CC","palegreen","98FB98","darkviolet","9400D3","mediumpurple","9370DB","lightgreen","90EE90","darkseagreen","8FBC8F","saddlebrown","8B4513","darkmagenta","8B008B","darkred","8B0000","blueviolet","8A2BE2","lightskyblue","87CEFA","skyblue","87CEEB","gray","808080","olive","808000","purple","800080","maroon","800000","aquamarine","7FFFD4","chartreuse","7FFF00","lawngreen","7CFC00","mediumslateblue","7B68EE","lightslategray","778899","slategray","708090","olivedrab","6B8E23","slateblue","6A5ACD","dimgray","696969","mediumaquamarine","66CDAA","cornflowerblue","6495ED","cadetblue","5F9EA0","darkolivegreen","556B2F","indigo","4B0082","mediumturquoise","48D1CC","darkslateblue","483D8B","steelblue","4682B4","royalblue","4169E1","turquoise","40E0D0","mediumseagreen","3CB371","limegreen","32CD32","darkslategray","2F4F4F","seagreen","2E8B57","forestgreen","228B22","lightseagreen","20B2AA","dodgerblue","1E90FF","midnightblue","191970","cyan","00FFFF","aqua","00FFFF","springgreen","00FF7F","lime","00FF00","mediumspringgreen","00FA9A","darkturquoise","00CED1","deepskyblue","00BFFF","darkcyan","008B8B","teal","008080","green","008000","darkgreen","006400","blue","0000FF","mediumblue","0000CD","darkblue","00008B","navy","000080","black","000000"];for(var k=1;k<d.rows.length;k++){if(undefined===d.rows[k]){continue}var buttons=d.rows[k].split(",");h+="<div class='"+d.id+"_tb htmlbox-toolbar'>";var addToolbarItem=function(type,cmd,title,data,arg){switch(type){case"button":return'<button type="button" onclick="glob_ha[\''+d.id+"'].cmd('"+cmd+(arg!==undefined?"','"+arg:"")+'\')" title="'+title+'"><span class="'+data+'">&nbsp;</span></button>';case"select":return'<select id="'+d.id+"_"+cmd+'" onchange="glob_ha[\''+d.id+"'].cmd('"+cmd+"',this.options[this.selectedIndex].value);this.selectedIndex(0)\">"+data+"</select>";default:return""}};for(var i=0;i<(buttons.length+1);i++){var options,m;switch(d.buttons[buttons[i]]){case"cut":h+=addToolbarItem("button","cut","cut","cut");break;case"copy":h+=addToolbarItem("button","copy","copy","copy");break;case"paste":h+=addToolbarItem("button","cut","paste","paste");break;case"undo":h+=addToolbarItem("button","undo","undo","undo");break;case"redo":h+=addToolbarItem("button","redo","redo","redo");break;case"bold":h+=addToolbarItem("button","bold","bold","b");break;case"italic":h+=addToolbarItem("button","italic","italic","i");break;case"underline":h+=addToolbarItem("button","underline","undelrine","u");break;case"sup":h+=addToolbarItem("button","superscript","superscript","sup");break;case"sub":h+=addToolbarItem("button","subscript","subscript","sub");break;case"left":h+=addToolbarItem("button","justifyleft","align left","left");break;case"center":h+=addToolbarItem("button","justifycenter","align center","center");break;case"right":h+=addToolbarItem("button","justifyright","align right","right");break;case"justify":h+=addToolbarItem("button","justifyfull","justify","justify");break;case"ol":h+=addToolbarItem("button","insertorderedlist","ordered list","ol");break;case"ul":h+=addToolbarItem("button","insertunorderedlist","unordered list","ul");break;case"indent":h+=addToolbarItem("button","indent","indent","indent");break;case"outdent":h+=addToolbarItem("button","outdent","outdent","outdent");break;case"hyperlink":h+=addToolbarItem("button","createlink","hyperlink","hyperlink");h+=addToolbarItem("button","unlink","remove hyperlink","unlink");break;case"image":h+=addToolbarItem("button","insertimage","image","img");break;case"html":h+=addToolbarItem("button","html","html source","html");break;case"separator_dots":h+="<span class='separator_dots' title='separator_dots'>&nbsp;</span>";break;case"separator_basic":h+="<span class='separator_basic' title='separator_basic'>&nbsp;</span>";break;case"fontsize":h+=addToolbarItem("select","fontsize","font size",'<option value="" selected="selected">- font size -</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option>');break;case"fontfamily":h+=addToolbarItem("select","fontname","font name",'<option value="" selected="selected">- font -</option><option value="arial" style="font-family:arial;">Arial</option><option value="courier" style="font-family:courier;">Courier</option><option value="cursive" style="font-family:cursive;">Cursive</option><option value="georgia" style="font-family:georgia;">Georgia</option><option value="monospace" style="font-family:monospace;">Monospace</option><option value="tahoma" style="font-family:tahoma;">Tahoma</option><option value="verdana" style="font-family:verdana;">Verdana</option>');break;case"fontcolor":options='<option value="" selected="selected">- color -</option>';for(m=0;m<colors.length;m++){if(1===(m&1)){continue}options+="<option value='"+colors[m]+"' style='background:"+colors[m]+";color:"+colors[m]+";'>"+colors[m]+"</option>"}h+=addToolbarItem("select","fontcolor","font color",options);break;case"highlight":options='<option value="" selected="selected">- highlight -</option>';for(m=0;m<colors.length;m++){if(1===(m&1)){continue}options+="<option value='"+colors[m]+"' style='background:"+colors[m]+";color:"+colors[m]+";'>"+colors[m]+"</option>"}h+=addToolbarItem("select","backcolor","background color",options);break;case"headers":options='<option value="" selected="selected">- headers -</option>';for(m=1;m<=6;m++){options+="<option value='&lt;H"+m+"&gt;'>H"+m+"</option>"}h+=addToolbarItem("select","formatblock","Header format",options);break;case"p":h+=addToolbarItem("button","formatblock","p","paragraph","<P>");break;case"code":h+=addToolbarItem("button","formatblock","code","code","<CODE>");break;case"pre":h+=addToolbarItem("button","formatblock","preformatted","pre","<PRE>");break;default:break}}h+="</div>"}return h};this.cmd=function(cmd,arg1){d.iframe.contentWindow.focus();var idoc=d.iframe.contentWindow.document;if($.browser.mozilla){idoc.execCommand("styleWithCSS",false,false)}if(cmd==="html"){var text=this.get_html();if($("#"+d.id).is(":visible")){$("#"+d.id).hide();$("#"+d.id+"_html").show();if($.browser.opera){$(window).scrollTop($("body").scrollTop())}this.set_text(text)}else{$("#"+d.id).show();$("#"+d.id+"_html").hide();this.set_text(text);$("#"+d.id).focus()}}else{if(cmd==="createlink"){arg1=$.trim(prompt("Paste Web Address URL Here:","http://"));if(arg1!==""){idoc.execCommand(cmd,false,arg1)}else{idoc.execCommand(unlink,false,null)}}else{if(cmd==="insertimage"){idoc.execCommand(cmd,false,prompt("Paste Image URL Here:","http://"))}else{if(cmd==="fontsize"){idoc.execCommand(cmd,false,arg1)}else{if(cmd==="backcolor"){if($.browser.msie){idoc.execCommand("backcolor",false,arg1)}else{idoc.execCommand("hilitecolor",false,arg1)}}else{if(cmd==="fontcolor"){idoc.execCommand("forecolor",false,arg1)}else{if(cmd==="fontname"){idoc.execCommand(cmd,false,arg1)}else{if(cmd==="formatblock"){idoc.execCommand(cmd,false,arg1)}else{if(cmd==="cut"){if($.browser.msie===false){alert("Available in IExplore only.\nUse CTRL+X to cut text!")}else{d.iframe.contentWindow.document.execCommand("Cut")}}else{if(cmd==="copy"){if($.browser.msie===false){alert("Available in IExplore only.\nUse CTRL+C to copy text!")}else{d.iframe.contentWindow.document.execCommand("Copy")}}else{if(cmd==="paste"){if($.browser.msie===false){alert("Available in IExplore only.\nUse CTRL+V to paste text!")}else{d.iframe.contentWindow.document.execCommand("Paste")}}else{idoc.execCommand(cmd,false,null)}}}}}}}}}}}if($("#"+d.id).is(":visible")===false){$("#"+d.id).val(this.get_html())}return true};this.get_text=function(){if($("#"+d.id).is(":visible")){return $("#"+d.id).val()}var text;if($.browser.msie){text=d.iframe.contentWindow.document.body.innerText}else{var html=d.iframe.contentWindow.document.body.ownerDocument.createRange();html.selectNodeContents(d.iframe.contentWindow.document.body);text=html}return text};this.set_text=function(txt){var text=(undefined===txt)?"":txt;if($("#"+d.id).is(":visible")){$("#"+d.id).val(text)}else{text=text.replace(/<script[^>]+>(?:(?!<\/script>)[\s\S])*?<\/script>/gi,"");if($.browser.mozilla||$.browser.safari){if($.trim(text)===""){text="&nbsp;"}text=xhtml.replace(/INITIAL_CONTENT/,text);d.iframe.contentWindow.document.open("text/html","replace");d.iframe.contentWindow.document.write(text);d.iframe.contentWindow.document.close()}else{d.iframe.contentWindow.document.body.innerText="";if(text!==""){d.iframe.contentWindow.document.write(text)}}}return this};this._mozcleanup=function(){if($(this).size()===0){return this}var style=$(this).attr("style");if(style&&style.match(/font-weight:\s*bold\s*/i)){if($(this).attr("style").match(/font-style:\s*italic\s*/i)){$(this).replaceWith("<em><strong>"+this.innerHTML+"</strong></em>")}else{$(this).replaceWith("<strong>"+this.innerHTML+"</strong>")}}else{if(style&&style.match(/font-style:\s*italic\s*/i)){$(this).replaceWith("<em>"+this.innerHTML+"</em>")}else{$(this).replaceWith(this.innerHTML)}}};this._cleanup=function(){if($(this).size()===0){return this}if($(this).is("b")){$(this).replaceWith("<strong>"+this.innerHTML+"</strong>")}else{if($(this).is("i")){$(this).replaceWith("<em>"+this.innerHTML+"</em>")}}};this._word_cleanup=function(html){html=html.replace(/<[\/?]?(font|xml|del|ins|[ovwxp]:\w+)[^>]*?>/ig,"");html=html.replace(/(<[^>]*?)(?:\s+(?:class|lang|style|size|face|[ovwxp]:\w+)=(?:'[^']*'|"[^"]*"|[^\s>]+?))+([^>]*?>)/ig,"$1$2");html=html.replace(/(<[^>]*?)(?:\s+(?:class|lang|style|size|face|[ovwxp]:\w+)=(?:'[^']*'|"[^"]*"|[^\s>]+?))+([^>]*?>)/ig,"$1$2");return html};this.get_html=function(){var html;if($("#"+d.id).is(":visible")){html=$("#"+d.id).val()}else{html=d.iframe.contentWindow.document.body.innerHTML;if($.browser.msie){html=this._word_cleanup(html)}if(html.match(/<span[^>]*\s+style=[^>]*>/)){html=$(document.createElement("DIV")).html(html).find("span span").each(this._mozcleanup).end().find("span").each(this._mozcleanup).end().get(0).innerHTML}html=$(document.createElement("DIV")).html(html).find("i, b").each(this._cleanup).end().get(0).innerHTML;html=html.replace(/<(em|strong|span)[^>]*>(\s*)<\/\1>/ig,"$2").replace(/<\/(em|strong)><\1[^>]*>/ig,"").replace(/[\n\r]+/g," ")}if(typeof HTMLtoXML==="function"){html=HTMLtoXML(html)}return html};this.button=function(name,row){d.buttons[d.buttons.length]=name;if(undefined===row){if(undefined===d.rows[1]){d.rows[1]=""}d.rows[1]=d.rows[1]+","+(d.buttons.length-1)}else{if(undefined===d.rows[row]){d.rows[row]=""}d.rows[row]=d.rows[row]+","+(d.buttons.length-1)}return this};this.separator=function(type,row){if(undefined===type){type="basic"}return this.button("separator_"+type,row)};return this};Drupal.behaviors.npFlaggingVote=function(context){$("form.flagging-ajax-form:not(.flagging-ajax-form-processed)",context).each(function(){var form=$(this);var random=Math.round(Math.random()*16777215);if(this.action.match(/\?/)){if(this.action.match("[?&]v=")){this.action=this.action.replace(/([\?&]v=)(?:[^&]*)(&|$)/,"$1"+random+"$2")}else{this.action+="&v="+Math.round(Math.random()*16777215)}}else{this.action+="?v="+Math.round(Math.random()*16777215)}var options={dataType:"json",success:function(data){form.removeClass("flagging-ajax-form-submitting").find("div.container-messages, div.messages").remove().end();if(data.errors){$(data.errors).hide().prependTo(form.find(":submit").removeAttr("disabled").end()).fadeIn("slow").click(function(){$(this).remove()}).each(function(){var target=this;window.setTimeout(function(){$(target).fadeOut()},5000)})}else{var newForm=$(data.response);form.replaceWith(newForm);newForm.prepend(data.statusMsgs).find("div.container-messages").hide().fadeIn("slow").click(function(){$(this).remove()}).each(function(){var target=this;window.setTimeout(function(){$(target).fadeOut()},5000)});Drupal.attachBehaviors(newForm)}},beforeSubmit:function(){form.find(":submit").attr("disabled","disabled").end().addClass("flagging-ajax-form-submitting")}};$(this).addClass("flagging-ajax-form-processed").find("input[name=ajax]").val(true).end().ajaxForm(options)})};Drupal.behaviors.npFlaggingComments=function(context){$("div#comments:not(.comments-processed)",context).addClass("comments-processed").each(function(){$(this).find("h2.has-tabs span.tab a[href*='comment_sort=']").each(function(){if(Drupal.settings&&Drupal.settings.nid){$(this).click(function(){var toReplace=$(this).parents("span.tab:first").addClass("active").siblings("span.tab").removeClass("active").parents("div#comments:first").find("div.nodelist-comments").children(":not(form):not(div.list-header)").remove().end().children("div.list-header").after('<img src="'+Drupal.settings.loading_signal+'" id="comment-loader" />');$.ajax({url:this.href.replace(/^[^\?]+(\?.*)$/,"/node/"+Drupal.settings.nid+"/comments$1"),dataType:"html",success:function(data){var content=$(data);if(content.find("div.nodelist-comments").size()){content=content.find("div.nodelist-comments").children(":not(form):not(div.list-header)")}toReplace.siblings("#comment-loader").replaceWith(content);Drupal.attachBehaviors(content)}});return false})}})});$("form.flagging-comment-form input.form-submit:not(.flagging-comment-form-submit-processed)",context).addClass("flagging-comment-form-submit-processed").hover(function(){if(this.title){$(this).parents("form:first").prepend($('<div class="flagging-comment-desc"></div>').text(this.title))}},function(){$(this).parents("form:first").children("div.flagging-comment-desc").remove()})};Drupal.behaviors.npFlaggingRecommend=function(context){var initHTMLBox=function(){$(this).find("textarea").show().parents("div.form-item:first").append($(this).find("textarea")).find(".htmlbox:first").remove();$(this).find("textarea").each(function(){$(this).htmlbox().button("bold").button("italic").separator("dots").button("hyperlink").separator("dots").button("ul").button("ol").separator("dots").button("html").init()}).end()};$("form#np-flagging-recommend.form-add-comment:not(.form-add-comment-processed)",context).addClass("form-add-comment-processed").find("a.show-comment").click(function(){$(this).parents("form:first").find("fieldset.collapsible").slideToggle("normal",function(){if($(this).is(":visible")){initHTMLBox.call(this)}});this.blur();return false}).end().find("fieldset.collapsible").filter(".collapsed").hide().end().filter(":not(.collapsed)").each(initHTMLBox).end().find('.wrapper-header span.header-button a[href$="#close"]').click(function(){$(this).parents("fieldset.collapsible").slideUp();this.blur();return false})};Drupal.behaviors.npFlaggingRecommendations=function(context){$("div#block-np_flagging-recommendations:not(.np_flagging-recommendations-processed)",context).addClass("np_flagging-recommendations-processed").each(function(){var block=this;$(this).find('a.more-link[href$="#show-more"]').toggle(function(){$(this).find("img.arrow-02-d6").addClass("arrow-02-u6").removeClass("arrow-02-d6").end().html($(this).html().replace(" more"," less"));$("ul.list-01-hidden",block).slideDown("normal")},function(){$(this).find("img.arrow-02-u6").addClass("arrow-02-d6").removeClass("arrow-02-u6").end().html($(this).html().replace(" less"," more"));$("ul.list-01-hidden",block).slideUp("normal")})})};