
/* AnswersQuestion.js */
;var activeQuestionAnswerForm=0;var savingQuestion=false;var savingAnswer=false;var imageUploadContainerWasVisible=false;var imageUploadedContainerWasVisible=false;var checkEmail=false;var sendEmail=true;function submitQuestion(){var h=$j("#question").text();var g=false;var p=false;var j=USER_ID;if(j==0){if(typeof loginWhileAnsweringEpisodeQuiz!="undefined"){loginWhileAnsweringEpisodeQuiz="false"}showLoginPopup()}else{if(checkEmail&&$j("#question-emailMe").attr("checked")){FB.Connect.showPermissionDialog("email",function(r){if(r){sendEmail=true}else{$j("#question-emailMe").attr("checked","")}});checkEmail=false}else{if(!savingQuestion){savingQuestion=true;$j("#counter-button-container img").css("cursor","default");h=$j.trim(h);var o=h;if(BrowserDetect.browser=="Explorer"){var q=new RegExp(String.fromCharCode(13)+String.fromCharCode(10),"gi");o=o.replace(q,"<br>")}o=stripHTML(o);o=get_ents(o);o=$j.trim(o);var a=false;if(h.length>QUESTION_SIZE_DB){savingQuestion=false;$j("#counter-button-container img").css("cursor","pointer");if(document.getElementById("unableToSubmit")){$j.facebox(document.getElementById("unableToSubmit").innerHTML);$j("#facebox .body").css({width:"335px"});$j("#facebox .footer").css({width:"335px"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}return false}if(o.length==0){if(containsImgTag(h)){p=true}}var i=isEmpty(o);if((o.length>QUESTION_MAX_CHARACTER_COUNTER)||((o.length==0)&&!p)||(i&&!p)){if(o.length==0||i){var e=$j("#questionCounter");var l=$j("#questionCharactersText");var m=$j("#errorProfanityDescription");e.html("");l.html("Please submit a question");l.css({color:"#f00"});m.html("&nbsp;");m.css({display:"none"})}$j("#counter-button-container img").css("cursor","pointer");savingQuestion=false;return false}else{$j.blockUI({css:{border:"none",padding:"15px",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px",opacity:0.5,color:"#fff"}});var c="/answers/mathhelpquestion";var k=$j("#categoryLevel2Id").val();var n="";if(sendEmail){n=$j("#question-emailMe").attr("checked")?"on":""}else{$j("#question-emailMe").attr("checked","")}var d=0;if(typeof current_epId=="undefined"){d=EPISODE_ID}else{d=current_epId}var b=a?"true":"false";$j("#auxDiv").html(h);$j("#auxDiv img").each(function(){var r=file_name_only(new String($j(this).attr("src")));if($j(this).attr("longdesc")!=""){$j(this).attr("src",$j(this).attr("longdesc"))}});h=$j("#auxDiv").html();$j("#auxDiv").html("");h=htmlNumbers(h);var f={question:h,userId:j,categoryLevel2Id:k,episodeId:d,emailMe:n,topicUrl:ONLY_TOPIC_URI,topicId:TOPIC_ID,isThereAFile:b};goAjax(c,f,afterSubmitQuestion);return false}}}}}function afterSubmitQuestion(e){var g=e;var f=g.search(/div/i);var a=null;if(f==-1){if(e!="imageError"){var d=$j("#errorProfanityDescription");d.html(e);$j("#errorProfanityDescription").show();var c=($j("#fileToUploadQuestion").val()=="")?false:true;if(!c){removeFile("Question")}}}else{a=$j(e).find("#question_id");var b=$j("#question").text();cleanQuestionForm();$j("#question-list").prepend(e);$j("#question-list #question-container-"+a.val()+" .question span a img").each(function(){$j(this).attr("onerror","loadAgainImage($j(this))")});$j("#question").text("");$j("#question").attr("value","");if(BrowserDetect.browser=="Firefox"){$j("#question_rte").contents().find("body").html('<br _moz_dirty=""/>')}else{$j("#question_rte").contents().find("body").html("")}}$j("#counter-button-container img").css("cursor","pointer");savingQuestion=false;$j.unblockUI({onUnblock:function(){if(e=="imageError"){if(document.getElementById("uploadFileError")){$j.facebox(document.getElementById("uploadFileError").innerHTML);$j("#facebox .body").css({width:"335px"});$j("#facebox .footer").css({width:"335px"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}}else{if(f==1){var h=$j(e).find(".question_image img");var i=file_name_only(new String(h.attr("src")));a=a.val();if(i=="ajax-loader.gif"){window.setTimeout(function(){requestQuestionAnswerImageSource(a,"question")},15000)}}}}})}function requestQuestionAnswerImageSource(d,b){var a="/answers/getquestionanswerimage";var c={questionAnswerId:d,type:b};goAjax(a,c,function(e){afterRequestQuestionAnswerImageSource(e,d,b)})}function afterRequestQuestionAnswerImageSource(data,questionAnswerId,type){var response=eval("("+data+")");if(response.error=="false"){if(type=="question"){var questionAnswerContainer="#question-container-";var questionAnswerImage=".question_image";var questionAnswerImageWidth="330px"}else{var questionAnswerContainer="#answer-container-";var questionAnswerImage=".answer_image";var questionAnswerImageWidth="370px"}var img=$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage+" img");$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage+" img").fadeOut(function(){img.attr("src",response.imageSrc);$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage+" img").load(function(){$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage).css({"margin-left":"0px"});$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage).css({width:questionAnswerImageWidth});var imageWidth=response.imageWidth+"px";img.css({width:imageWidth});$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage+" img").fadeIn();var targetLink=$j(questionAnswerContainer+questionAnswerId+" "+questionAnswerImage+" a");targetLink.attr("href",response.imageSrc);targetLink.attr("target","_blank")})})}else{window.setTimeout(function(){requestQuestionAnswerImageSource(questionAnswerId,type)},15000)}}function loadQuestions(c){var a="/answers/mathhelpquestions";var b={episodeId:c};goAjax(a,b,afterLoadQuestions)}function afterLoadQuestions(a){$j("#question-list").html(a)}function showAnswers(a){var c=$j("#answer-list-"+a);var b=c.children().children().children(".answer-container");if((b.length>0)||($j("#answer-form-container-"+a).children().length>0)){$j("#answer-list-"+a).toggle()}}function showAnswerForm(a){var c=USER_ID;if(c==0){showLoginPopup()}else{var e=$j("#answer-form-container-"+a).html();e='<div style = "margin-top: 10px; float: left; width: 100%;"><div style = "float: left; width: 100%; padding-bottom: 5px;" id = "answer-label-container" name = "answer-label-container"><label id = "yourAnswer-label">Your Answer:</label><span>(</span><span id="answerCounter">'+ANSWER_MAX_CHARACTER_COUNTER+'</span><span id="answerCharactersText"> characters</span><span>)</span><span id="errorProfanityAnswer"></span></div><textarea id="answer" name="answer" class="jqrte_popup" rows="5" cols="5" maxlength = "'+ANSWER_MAX_CHARACTER_COUNTER+'"></textarea>'+$j("#answerContentEditor_rte").html()+'</div><div style = "margin-top: 5px; float: left; width: 100%;"><label id = "source-label">Source:</label><input id = "answer-source" name = "answer-source" type = "text" maxlength = "2000"></input></div><div style = "padding-top: 5px; padding-bottom: 8px; float: left; width: 100%; clear: both;">';e+='<div style = "float: right; display: inline; width: 120px;"><img id = "answer-question-img" name = "answer-question-img" onclick = "javascript:submitAnswer('+a+');" src = "/images/mathhelp/submitAnswerButton.png"></img></div>';e+='<div style = "float: left; width: 250px;"><input type="checkbox" id="emailMe" name="emailMe" '+(showUpEmail?"checked":"")+'><label class = "emailMe-label" for="emailMe">Email me when other answers come in</label></div>';e+="</div>";e+='<input type = "hidden" id = "answerFormQuestionId" name = "answerFormQuestionId" value = "'+a+'" >';$j("#answerFormRTE .jqrte_rte_div").html("");$j("#answer-form-container-"+activeQuestionAnswerForm).html("");var d=$j("#answer-list-"+activeQuestionAnswerForm);var b=d.children().children().children(".answer-container");if(!(b.length>0)){$j("#answer-list-"+activeQuestionAnswerForm).hide()}$j("#answer-form-container-"+a).html(e);$j("#question-container-"+activeQuestionAnswerForm+" #answer-question").fadeIn();activeQuestionAnswerForm=a;$j("#answer-list-"+a).show();addAfterFileUploadEvent("Answer");if(BrowserDetect.browser=="Firefox"){$j("#answer_rte").load(function(){$j("#answer_rte").jqrte_setIcon();$j("#answer_rte").jqrte_setContent();$j("#answer_rte").jqrte();try{setEventHandlerAnswerW3C()}catch(f){}})}else{$j("#answer_rte").ready(function(){$j("#answer_rte").jqrte_setIcon();$j("#answer_rte").jqrte_setContent();$j("#answer_rte").jqrte();try{if(BrowserDetect.browser=="Explorer"){document.getElementById("answer_rte").contentWindow.document.onclick=function(g){if(document.getElementById("answer_rte").contentWindow.document.body!=null){setEventHandlerAnswerIE()}};document.getElementById("answer_rte").contentWindow.document.oncontextmenu=function(g){if(document.getElementById("answer_rte").contentWindow.document.body!=null){setEventHandlerAnswerIE()}}}else{setEventHandlerAnswerW3C()}}catch(f){}})}$j("#question-container-"+activeQuestionAnswerForm+" #answer-question").fadeOut()}}function submitAnswer(b){var o=$j("#answer").text();var h=false;var n=false;var j=USER_ID;if(j==0){showLoginPopup()}else{if(checkEmail&&$j("#emailMe").attr("checked")){FB.Connect.showPermissionDialog("email",function(q){if(q){sendEmail=true}else{$j("#emailMe").attr("checked","")}});checkEmail=false}else{if(!savingAnswer){savingAnswer=true;$j(".answer-form-container #answer-question-img").css("cursor","default");o=$j.trim(o);var i=o;if(BrowserDetect.browser=="Explorer"){var p=new RegExp(String.fromCharCode(13)+String.fromCharCode(10),"gi");i=i.replace(p,"<br>")}i=stripHTML(i);i=get_ents(i);i=$j.trim(i);var a=false;if(o.length>ANSWER_SIZE_DB){savingAnswer=false;$j(".answer-form-container #answer-question-img").css("cursor","pointer");if(document.getElementById("unableToSubmit")){$j.facebox(document.getElementById("unableToSubmit").innerHTML);$j("#facebox .body").css({width:"335px"});$j("#facebox .footer").css({width:"335px"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}return false}if(i.length==0){if(containsImgTag(o)){n=true}}var g=isEmpty(i);if((i.length>ANSWER_MAX_CHARACTER_COUNTER)||((i.length==0)&&!n)||(g&&!n)){if(i.length==0||g){var e=$j("#answerCounter");var k=$j("#answerCharactersText");e.html("");k.html("Please submit an answer");k.css({color:"#f00"})}$j(".answer-form-container #answer-question-img").css("cursor","pointer");savingAnswer=false;return false}else{$j.blockUI({css:{border:"none",padding:"15px",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px",opacity:0.5,color:"#fff"}});var d="/answers/mathhelpanswer";var m=$j("#answer-source").val();var l="";if(sendEmail){l=$j("#emailMe").attr("checked")?"on":""}else{$j("#emailMe").attr("checked","")}var c=a?"true":"false";$j("#auxDiv").html(o);$j("#auxDiv img").each(function(){var q=file_name_only(new String($j(this).attr("src")));if($j(this).attr("longdesc")!=""){$j(this).attr("src",$j(this).attr("longdesc"))}});o=$j("#auxDiv").html();$j("#auxDiv").html("");o=htmlNumbers(o);var f={answer:o,userId:j,questionId:b,source:m,emailMe:l,isThereAFile:c};goAjax(d,f,function(q){afterSubmitAnswer(q,b)});return false}}}}}function afterSubmitAnswer(e,a){var g=e;var f=g.search(/div/i);var d=null;if(f==-1){if(e!="imageError"){var c=$j("#errorProfanityAnswer");c.html(e);$j("#errorProfanityAnswer").show();var b=($j("#fileToUploadAnswer").val()=="")?false:true;if(!b){removeFile("Answer")}}}else{cleanAnswerForm();d=$j(e).find("#answer_id");$j("#answer-list-"+a).children().children().prepend(e);$j("#answer-container-"+d.val()+" .answer span img").each(function(){$j(this).attr("onerror","loadAgainImage($j(this))")});$j("#answer").text("");$j("#answer").attr("value","");if(BrowserDetect.browser=="Firefox"){$j("#answer_rte").contents().find("body").html('<br _moz_dirty=""/>')}else{$j("#answer_rte").contents().find("body").html("")}if((typeof(bunchballHandler)!="undefined")&&(bunchballHandler!=null)){bunchballHandler.showNotifications()}}$j(".answer-form-container #answer-question-img").css("cursor","pointer");savingAnswer=false;$j.unblockUI({onUnblock:function(){if(e=="imageError"){if(document.getElementById("uploadFileError")){$j.facebox(document.getElementById("uploadFileError").innerHTML);$j("#facebox .body").css({width:"335px"});$j("#facebox .footer").css({width:"335px"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}}else{if(f==1){var h=$j(e).find(".answer_image img");var i=file_name_only(new String(h.attr("src")));d=d.val();if(i=="ajax-loader.gif"){window.setTimeout(function(){requestQuestionAnswerImageSource(d,"answer")},15000)}}}}})}function cleanQuestionForm(){var b=$j("#questionCounter");var a=$j("#questionCharactersText");var c=$j("#errorProfanityDescription");b.css({color:"#666"});a.css({color:"#666"});var d=$j("#question").attr("maxlength");b.html(d);a.html("&nbsp;characters");c.html("&nbsp;");c.css({display:"none"});$j("#question").attr("value","");$j("#question-emailMe").attr("checked",true);removeFile("Question")}function cleanAnswerForm(){var b=$j("#answerCounter");var a=$j("#answerCharactersText");var c=$j("errorProfanityAnswer");b.css({color:"#666"});a.css({color:"#666"});var d=$j(".answer-form-container #answer").attr("maxlength");b.html(d);a.html("&nbsp;characters");c.html("&nbsp;");c.css({display:"none"});$j(".answer-form-container #answer").attr("value","");$j("#answer-source").val("");$j(".answer-form-container #emailMe").attr("checked",true);removeFile("Answer")}function enablingQuestions(a){USER_ID=a;removeFile("Question");$j("#emailMe-container").fadeIn();enableRteAfterLogin("question",QUESTION_MAX_CHARACTER_COUNTER,true,true);$j("#question-label-container").append('<span id="errorProfanityDescription"></span>');specialcharacter()}$j(document).ready(function(){addAfterFileUploadEvent("Question");$j("#question-list .question_image img").each(function(){var b=$j(this);var c=file_name_only(new String(b.attr("src")))});if(USER_ID==0){$j("#question_rte").jqrte_setIconNotLoggedIn()}else{$j("#question_rte").jqrte_setIcon();$j("#question_rte").jqrte_setContent();$j("#question_rte").jqrte();try{if(BrowserDetect.browser!="Explorer"){setEventHandlerQuestionW3C()}else{document.getElementById("question_rte").contentWindow.document.onclick=function(b){if(document.getElementById("question_rte").contentWindow.document.body!=null){setEventHandlerQuestionIE()}};document.getElementById("question_rte").contentWindow.document.oncontextmenu=function(b){if(document.getElementById("question_rte").contentWindow.document.body!=null){setEventHandlerQuestionIE()}}}}catch(a){}}if(USER_ID==0){$j(".jqrte_menu_div .jqrte_menu td").click(function(){showLoginPopup()})}});function addAfterFileUploadEvent(b){var a=document.getElementById("fileToUpload"+b);if(a!=null){a.onchange=a.onmouseout=function(){if(this.value!=""){$j("#image-upload-container"+b).hide();$j("#filename"+b).text("Uploaded!");$j("#removeFileLink"+b).show();$j("#image-uploaded-container"+b).show();if(b=="Question"){checkTextAreaLen(document.getElementById("question"))}else{if(b=="Answer"){checkTextAreaLen(document.getElementById("answer"))}}}else{$j("#filename").text("")}}}}function removeFile(a){$j("#fileToUpload"+a).remove();$j("#fileToUploadContainer"+a).append('<input id = "fileToUpload'+a+'" name = "fileToUpload'+a+'" style = "right: 125px;" type="file" class="file" />');addAfterFileUploadEvent(a);$j("#filename"+a).text("");$j("#removeFileLink"+a).hide();$j("#image-uploaded-container"+a).hide();$j("#image-upload-container"+a).show()}function ajaxFileUpload(){$j.ajaxFileUpload({url:"/image/uploadimageinsession",secureuri:false,fileElementId:"fileToUpload",dataType:"json",success:function(b,a){if(typeof(b.error)!="undefined"){if(b.error!=""){alert(b.error)}else{alert(b.msg)}}},error:function(b,a,c){alert(c)}});return false}function submitRichText(){var a=$j("#content").attr("value");alert(a);$j("#output").html(a)}function resetUploadImageInputTypeFile(){$j("#uploadimage_div_pc #uploadimage_div #uploadimage_error").html("");var a=$j("#uploadimage_div_pc #uploadimage_div #uploadimage_fileToUpload").parent();$j("#uploadimage_div_pc #uploadimage_div #uploadimage_fileToUpload").remove();a.append('<input type="file" name="fileToUpload" id="uploadimage_fileToUpload"/>')}function loadQuestionTab(){if(loadQuestionsFlag==1){$j("#questions_content").html($j("#load_questions_msg").html());loadQuestionsFlag=0;var c="/math-help/getquestiontab";var d=window.current_epId;var b=window.TOPIC_ID;var a=$j("#subjectName").val();var e={currentEpId:d,subTopicId:b,subjectName:a};goAjax(c,e,afterLoadQuestionTab)}}function afterLoadQuestionTab(a){$j("#questions_content").html(a);if(USER_ID!=0){addAfterFileUploadEvent("Question");$j("#question-list .question_image img").each(function(){var b=$j(this);var c=file_name_only(new String(b.attr("src")))});setTimeout("finishPostLoadQuestionTab();",500)}else{$j("#question_rte").jqrte_setIconNotLoggedIn();$j(".jqrte_menu_div .jqrte_menu td").click(function(){showLoginPopup()})}}function finishPostLoadQuestionTab(){$j("#question_rte").jqrte_setIcon();$j("#question_rte").jqrte_setContent();$j("#question_rte").jqrte();specialcharacter();$j(".jqrte_menu td").mouseover(function(){$j(this).toggleClass("jqrte_active")});$j(".jqrte_menu td").mouseout(function(){$j(this).toggleClass("jqrte_active")});$j("#color_picker").ready(function(){try{$j("#color_picker").jqcp()}catch(a){}});$j("#color_value").ready(function(){try{$j("#color_value").jqcp_setObject()}catch(a){}})};
/* AnswersQuestionReport.js */
;function reportAbuse(c,b){var a=USER_ID;if(a==0){showLoginPopup()}else{jQuery.facebox('<DIV id="report-abuse-container" style="color:black;"><div class = "title">Report</div><div class = "report-body"><p>You are about to report a violation of our Terms of Use. <span style = "font-weight: bold;">All reports are strictly confidential.</span></p><p>We will NOT remove posts just because you disagree with the statement being made.</p><div id="report-abuse-error" name = "report-abuse-error" class="clear-both error-container" style="display: none;"><span>{MSG}</span></div><div class = "formRow"><label>Reason:<br/>(required)</label><select id="reason" name="reason" class=""><option value="0">Choose One</option><option value="SPAM_OR_ADVERTISEMENT">Spam or Advertisement</option><option value="ATTACKS_OR_OFFENDS">Attacks or Offends</option></select></div><div class = "formRow" style = "height: 70px;"><label>Additional Comments:<br/>(required)</label><textarea maxlength="256" rows="3" name="additional-comments" id="additional-comments"></textarea></div></div><div class = "report-abuse-footer"><button type = "button" onclick = "javascript:submitReportAbuse();">Submit</button><button type = "button" onclick = "javascript:closeReportAbuse();">Cancel</button></div></DIV><DIV class="clear-both"></DIV>');$j("#facebox .body").css({width:"470px"});$j("#facebox .body").css({padding:"0px"});$j("#facebox .footer").hide();$j("#facebox #report-abuse-error").hide();$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2});currentQuestionAnswerId=c;reportAbuseType=b}}function closeReportAbuse(){jQuery(document).trigger("close.facebox")}function submitReportAbuse(){var b=validateReporAbuseForm();if(b){var a="/answers/ajax/ajax-action/submit-report-abuse";var e=$j("#facebox #reason").val();var d=$j("#facebox #additional-comments").val();var c={questionAnswerId:currentQuestionAnswerId,reason:e,additionalComments:d,userId:USER_ID,type:reportAbuseType};goAjax(a,c,afterSubmitReportAbuse);jQuery.facebox.loading();$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}}function afterSubmitReportAbuse(jsonedResponse){var response=eval("("+jsonedResponse+")");var responseShowed=document.getElementById("success-template").innerHTML;responseShowed=responseShowed.replace(/{STATUS-MSG}/g,"Thanks. Your report has been submitted.");jQuery.facebox(responseShowed);$j("#facebox .body").css({padding:"10px",width:"370px"});$j("#facebox .footer").css({"float":"none",width:"auto"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}function validateReporAbuseForm(){var a=true;var b=$j("#reason");var e=$j("#facebox #reason").val();var c=new Array();if(e=="0"){c[c.length]="Please select a reason"}var d=$j("#facebox #additional-comments").val();if(d==""){c[c.length]="The additional comments is required"}if(c.length>0){a=false;goError(c)}return a}function goError(b){var a="";for(i=0;i<b.length;i++){a=a+"<span>"+b[i]+"</span>"}$j("#facebox #report-abuse-error").html(a);$j("#facebox #report-abuse-error").fadeIn();window.setTimeout("$j('#facebox #report-abuse-error').fadeOut();",3000)};
/* VideoPlayerHandler.js */
;var bcExp;var modVP;var modExp;var modCon;var excludePlayerInit="";function onTemplateLoaded(a){if(excludePlayerInit!=a){bcExp=brightcove.getExperience(a);modVP=bcExp.getModule(APIModules.VIDEO_PLAYER);modExp=bcExp.getModule(APIModules.EXPERIENCE);modCon=bcExp.getModule(APIModules.CONTENT);modExp.addEventListener("templateReady",onTemplateReady);if(a=="myExperience"){addingEvents(modVP)}}}function onTemplateReady(a){modExp.removeEventListener("templateReady",onTemplateReady);if(modVP){modVP.setRenditionSelectionCallback(selectRendition)}}function addingEvents(a){a.addEventListener(BCVideoEvent.VIDEO_START,onVideoStart);a.addEventListener(BCVideoEvent.VIDEO_COMPLETE,onVideoComplete);if(typeof window.playPlaylist=="function"){a.addEventListener(BCVideoEvent.VIDEO_COMPLETE,playPlaylist)}if(typeof window.onVideoProgress=="function"){a.addEventListener(BCVideoEvent.VIDEO_PROGRESS,onVideoProgress)}if(typeof window.onPlayerLoaded=="function"){onPlayerLoaded()}}function onVideoStart(){var c=modVP.getCurrentVideo();if(typeof c!="undefined"){var d=c.id;var b=$j("#userId").val();var a="/download/trackprogressvideo";if(typeof d!="undefined"&&typeof b!="undefined"&&b!=0){if(modVP.getVideoDuration()!=60000){$j(document).ready(function(){$j.post(a,{video_id:d,user_id:b,status:"start"},function(e){if(e=="IN-PROGRESS"){$j("#video_image_"+d).attr("src","/images/ap/icons/checkbox_inprogress.png");$j("#div-"+d).removeClass("tryMe");$j("#div-"+d).removeClass("notStarted");$j("#div-"+d).addClass("inProgress")}else{if(e=="FINISHED"){$j("#video_image_"+d).attr("src","/images/ap/icons/checkbox_checked.png");$j("#div-"+d).removeClass("tryMe");$j("#div-"+d).removeClass("notStarted");$j("#div-"+d).removeClass("inProgress");$j("#div-"+d).addClass("finished")}else{$j("#video_image_"+d).attr("src","")}}})})}}if(typeof onVideoBegin=="function"){onVideoBegin()}}}function onVideoComplete(){var c=modVP.getCurrentVideo();var d=c.id;var b=$j("#userId").val();var a="/download/trackprogressvideo";if(typeof d!="undefined"&&typeof b!="undefined"&&b!=0){if(modVP.getVideoDuration()>5){$j(document).ready(function(){$j.post(a,{video_id:d,user_id:b,status:"finish"},function(e){if(e=="IN-PROGRESS"){$j("#video_image_"+d).attr("src","/images/ap/icons/checkbox_inprogress.png");$j("#div-"+d).removeClass("notStarted");$j("#div-"+d).addClass("inProgress")}else{if(e=="FINISHED"){$j("#video_image_"+d).attr("src","/images/ap/icons/checkbox_checked.png");$j("#div-"+d).removeClass("notStarted");$j("#div-"+d).removeClass("inProgress");$j("#div-"+d).addClass("finished")}else{$j("#video_image_"+d).attr("src","")}}bunchballHandler.showNotifications();if(typeof window.onVideoCompleteShowEpisodeQuizTab=="function"){onVideoCompleteShowEpisodeQuizTab()}})})}}}function loadVideo(a){if(typeof(modCon)!="undefined"&&typeof(modVP)!="undefined"){modCon.getVideo(a);modVP.loadVideo(a)}else{setTimeout("loadVideo('"+a+"');",200)}}function getCurrentVideoTime(){return modVP.getVideoPosition()}function setCurrentVideoTime(a){modVP.seek(a-2)}function stopVideo(){if(modVP){modVP.stop()}}function playVideo(){if(modVP){modVP.play()}}function resumeVideo(){if(modVP){modVP.pause(false)}}function pauseVideo(){if(modVP){modVP.pause(true)}}function setEnabledVideo(a){if(modVP){modVP.setEnabled(a)}}var FRAME_HEIGHT_TOLERANCE=1.2;var ENCODING_RATE_TOLERANCE=0.7;var ENCODING_MAX_RATE=1300000;function selectRendition(a){var g=a.renditions.slice();var e;var c;var b;var f=a.detectedBandwidth;var j=a.screenHeight;if(f>-1&&g.length>1){g=sortRenditions(g);c=g[1];if(!isNaN(c.encodingRate)&&c.encodingRate<=f*1000*ENCODING_RATE_TOLERANCE&&c.frameHeight<=j*FRAME_HEIGHT_TOLERANCE&&!isNaN(g[0].encodingRate)&&g[0].encodingRate<ENCODING_MAX_RATE){b=c}else{b=a.currentRendition}}else{b=a.currentRendition}var h=-1;for(var d=0;d<a.renditions.length;d++){if(b==a.renditions[d]){h=d;break}}return h}function sortRenditions(d){d.sort(sortByEncoding);var a={};for(var b=0;b<d.length;b++){if(a[d[b].encodingRate]==null){a[d[b].encodingRate]=[]}a[d[b].encodingRate].push(d[b])}var c=[];for(var b in a){a[b].sort(sortByFrameHeight);c=c.concat(a[b])}return c}function sortByEncoding(e,d){var c=e.encodingRate;var f=d.encodingRate;return((c<f)?1:((c>f)?-1:0))}function sortByFrameHeight(e,d){var c=e.frameHeight;var f=d.frameHeight;return((c<f)?1:((c>f)?-1:0))}function describeRendition(a){var b=("size: "+a.size);b+=("\nframeWidth: "+a.frameWidth);b+=("\nframeHeight: "+a.frameHeight);b+=("\nencodingRate: "+a.encodingRate);alert(b)};
/* MathHelpHandler.js */
;jQuery(document).ready(function(){mathHelpInit()});function mathHelpInit(){for(var c in episodes){var b="";if(episodes[c]["data-type"]=="IMG"){b='<div class=""> <img src="'+episodes[c]["img-url"]+'"/> </div>'}else{b='<div class="tooltipTopic"> '+episodes[c]["text"]+"</div>"}setTooltip(c,b)}showMathHelpTab(ACTIVE_TAB);jQuery("#log_reg_font2").addClass("episode_view_style2");jQuery("#log_reg_font3").addClass("episode_view_style");jQuery("#log_reg_font4").addClass("episode_view_style2");jQuery("#math_help_content_id").fadeIn(400,function(){if(jQuery(".math_help_description_text").height()>0){jQuery("#math_help_content_id").removeClass("align_breadcrumb")}jQuery("#math_help_content_id").removeClass("display_none")});var d=document.getElementById("episodeOrder").value;jQuery("#mycarousel").jcarousel({vertical:true,scroll:1,start:(d<=2)?1:d,initCallback:mycarousel_initCallback});var a=new Array("one","two","three","four","five");for(var c in a){$j("#rate-container #"+a[c]).bind("mouseover",addStar);$j("#rate-container #"+a[c]).bind("mouseout",removeStar);$j("#rate-container #"+a[c]).bind("click",{vote:parseInt(c)+1,uri:TOPIC_URI},rate)}}function onPlayerLoaded(){var a=$j("#userId").val();if(a==0){}}function resumePlayer(){resumeVideo();setEnabledVideo(true)}function pausePlayer(){pauseVideo();setEnabledVideo(false)}function testPlaylist(){continuosPlay=true;alert("Test Playlist - continuosPlay: "+(continuosPlay))}function playPlaylist1(){var a=$j("#userId").val();if(typeof playlist!="undefined"&&continuosPlay==true&&(playlist_index+1)<playlist_max_index){playlist_index=playlist_index+1;if(typeof playlist[playlist_index]!="undefined"){loadVideo(playlist[playlist_index]);if(modVP){modVP.play()}setBrowserTitle(playlist[playlist_index])}}}function playPlaylist(){var a=$j("#userId").val();if(typeof playlist!="undefined"&&continuosPlay==true&&(playlist_index+1)<playlist_max_index){playlist_index=playlist_index+1;if(typeof playlist[playlist_index]!="undefined"){playVideo(playlist[playlist_index]["partner_video_id"],playlist[playlist_index]["episode_id"],playlist[playlist_index]["name"],playlist[playlist_index]["askForTranscript"]);if(playlist_index>=playlist_max_visible){nextEpisodeCarouselFn()}}}}function selectEpisode(b,c){var a="ep-"+c;var d="ep-"+current_epId;if(document.getElementById(d)){$j("#"+d).removeClass("episode-playing");$j("#"+d).addClass("episode")}$j("#"+a).removeClass("episode");$j("#"+a).addClass("episode-playing");current_epId=c;current_videoId=b}function disablePlaylist(){continuosPlay=false}function playVideo(c,e,b,a){if(c!=null){loadVideo(c);selectEpisode(c,e);setBrowserTitle(b);loadConceptProblem(e);var d=$j("#episode-description-title-"+e).val();loadQuestions(e);if(a==1){$j("#transcript_content").html("");$j("#transcriptTab").fadeIn("slow",function(){showMathHelpTab(TRANSCRIPT_TAB);showMathHelpTab(TRANSCRIPT_TAB);loadTranscriptTab(TRANS_TYPE,e)})}else{showMathHelpTab(ANSWER_CHECKER_TAB);$j("#transcriptTab").hide();$j("#transcript_content").html("")}if(typeof(update_more_info)=="function"){update_more_info(e)}trackAction()}}function setBrowserTitle(b){var a=document.getElementById("usePersonalizedTitle");if(a!=null&&a.value==0){document.title=$j("#topicName").val()+" - "+b+" - "+$j("#subjectName").val()+" - Brightstorm"}$j("#currentLinkLabel").html(b)}function showHideInfo(){var a=$j("#moreInfo").html();if(a=="(more info)"){$j("#moreInfo").html("(less info)");$j("#collapseDescription").show()}else{$j("#moreInfo").html("(more info)");$j("#collapseDescription").hide()}}function loadConceptProblem(a){var b="/math-help/ajax/ajax-action/get-problem-concept";var c={episodeId:a};goAjax(b,c,afterLoadConceptProblem)}function afterLoadConceptProblem(jsonedResponse){var response=eval("("+jsonedResponse+")");var title=response.title;var text=response.text;var img_name=response.img_name;var description=response.description;var keywords=response.keywords;var img_src=IMAGE_SERVER_URL+img_name;if(typeof title=="undefined"){$j("#title").html("");$j("#title").hide()}else{$j("#title").html(title);$j("#title").show()}if(typeof img_name!="undefined"&&(img_name!="")){$j("#episode_text").hide();$j("#episode_image").attr("src",img_src);$j("#episode_image").show()}else{if(typeof text!="undefined"){$j("#episode_image").hide();$j("#episode_text").html(text);$j("#episode_text").show()}else{$j("#episode_image").hide();$j("#episode_text").hide()}}if(typeof description=="undefined"){$j("#description").html("")}else{$j("#description").html(description)}if(typeof keywords=="undefined"){$j("#keywords").html("")}else{$j("#keywords").html("Tags: "+keywords)}}function setTooltip(b,a){$j("#ep-"+b).tooltip({delay:0,showURL:false,opacity:1,fade:250,bodyHandler:function(){clearTooltip();return a}})}function mycarousel_initCallback(a){nextEpisodeCarouselFn=function(){a.next()}}function showMathHelpTab(a){showTab(a,MATH_EPISODE_TAB_ID);ACTIVE_TAB=a;if(ACTIVE_TAB==ANSWER_CHECKER_TAB){$j("#"+TAB_PREFIX+MATH_EPISODE_TAB_ID+ACTIVE_TAB).attr("class","answer selected2")}if(typeof closeRTEPopups=="function"){closeRTEPopups()}trackAction()}function rate(a){if(typeof a.data.vote!="undefined"){$j("#rate-big-container").fadeOut("slow",function(){$j("#rate-msg-container").fadeIn()});goAjax("/math-help/ajax/ajax-action/rate",a.data,afterRate)}}function afterRate(a){}function removeStar(){$j("#rate-container").attr("class","")}function addStar(a){if(typeof a.target.id!="undefined"){$j("#rate-container").attr("class",a.target.id)}}function refreshMathway(a){$j("#mathway_content").html(a)}function loginCallback(){goAjax("/math-help/refresh-mathway/calledFrom/math","",refreshMathway);if(!showUpEmail){$j("input[name=emailMe-container]").attr("checked",false);$j("#emailMe-container").css({display:"none"})}if(typeof updatePasteHandler=="function"){updatePasteHandler()}}function clearTooltip(){try{$j("#tooltip").attr("className","")}catch(a){}}function trackAction(a){var b=$j("#currentLinkLabel").text();b=trim(b);b=b.replace(" ","-");var c="concept";switch(ACTIVE_TAB){case QUESTIONS_TAB:c="questions";break;case ANSWER_CHECKER_TAB:c="answer-checker";break;default:break}gaTrackingMathHelp(ONLY_TOPIC_URI,b,c,a)}var loadTranscriptFlag=1;function loadTranscriptTab(d,a){$j("#transcript_content").html($j("#load_questions_msg").html());loadTranscriptFlag=0;var b="/math-help/gettranscripttab";var c={transType:d,episodeId:a};goAjax(b,c,afterLoadTranscriptTab)}function afterLoadTranscriptTab(a){$j("#transcript_content").html(a)};
/* VideoPlayerLoginHandler.js */
;function trackStartVideo(){var c=0;if(typeof current_videoId=="undefined"){c=currentId}else{c=current_videoId}var b=$j("#userId").val();var a="/download/trackprogressvideo";$j.post(a,{video_id:c,user_id:b,status:"start"},function(d){if(d=="IN-PROGRESS"){$j("#video_image_"+c).attr("src","/images/ap/icons/checkbox_inprogress.png")}else{if(d=="FINISHED"){$j("#video_image_"+c).attr("src","/images/ap/icons/checkbox_checked.png")}else{$j("#video_image_"+c).attr("src","")}}})}function onVideoProgress(b){var a=$j("#userId").val();if(b.position>PREVIEW_TIME&&a==0){if(modVP){modVP.pause(true)}if(typeof loginWhileAnsweringEpisodeQuiz!="undefined"){loginWhileAnsweringEpisodeQuiz="false"}showLoginPopup();allowLogin=true;allowRegister=true}};
/* jquery.dump.js */
;(function(c){c.fn.dump=function(){return c.dump(this)};c.dump=function(f){var e=function(l,m){if(!m){m=0}var k="",j="";for(i=0;i<m;i++){j+="\t"}t=g(l);switch(t){case"string":return'"'+l+'"';break;case"number":return l.toString();break;case"boolean":return l?"true":"false";case"date":return"Date: "+l.toLocaleString();case"array":k+="Array ( \n";c.each(l,function(o,n){k+=j+"\t"+o+" => "+e(n,m+1)+"\n"});k+=j+")";break;case"object":k+="Object { \n";c.each(l,function(o,n){k+=j+"\t"+o+": "+e(n,m+1)+"\n"});k+=j+"}";break;case"jquery":k+="jQuery Object { \n";c.each(l,function(o,n){k+=j+"\t"+o+" = "+e(n,m+1)+"\n"});k+=j+"}";break;case"regexp":return"RegExp: "+l.toString();case"error":return l.toString();case"document":case"domelement":k+="DOMElement [ \n"+j+"\tnodeName: "+l.nodeName+"\n"+j+"\tnodeValue: "+l.nodeValue+"\n"+j+"\tinnerHTML: [ \n";c.each(l.childNodes,function(o,n){if(o<1){var p=0}if(g(n)=="string"){if(n.textContent.match(/[^\s]/)){k+=j+"\t\t"+(o-(p||0))+" = String: "+a(n.textContent)+"\n"}else{p--}}else{k+=j+"\t\t"+(o-(p||0))+" = "+e(n,m+2)+"\n"}});k+=j+"\t]\n"+j+"]";break;case"function":var h=l.toString().match(/^(.*)\(([^\)]*)\)/im);h[1]=a(h[1].replace(new RegExp("[\\s]+","g")," "));h[2]=a(h[2].replace(new RegExp("[\\s]+","g")," "));return h[1]+"("+h[2]+")";case"window":default:k+="N/A: "+t;break}return k};var g=function(j){var h=typeof(j);if(h!="object"){return h}switch(j){case null:return"null";case window:return"window";case document:return"document";case window.event:return"event";default:break}if(j.jquery){return"jquery"}switch(j.constructor){case Array:return"array";case Boolean:return"boolean";case Date:return"date";case Object:return"object";case RegExp:return"regexp";case ReferenceError:case Error:return"error";case null:default:break}switch(j.nodeType){case 1:return"domelement";case 3:return"string";case null:default:break}return"Unknown"};return e(f)};function a(e){return d(b(e))}function d(e){return e.replace(new RegExp("^[\\s]+","g"),"")}function b(e){return e.replace(new RegExp("[\\s]+$","g"),"")}})(jQuery);
/* jquery.dimensions.js */
;(function(d){var a=d.fn.height,c=d.fn.width;d.fn.extend({height:function(){if(this[0]==window){return self.innerHeight||d.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}if(this[0]==document){return Math.max(document.body.scrollHeight,document.body.offsetHeight)}return a.apply(this,arguments)},width:function(){if(this[0]==window){return self.innerWidth||d.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}if(this[0]==document){return Math.max(document.body.scrollWidth,document.body.offsetWidth)}return c.apply(this,arguments)},innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight-b(this,"borderTopWidth")-b(this,"borderBottomWidth"):this.height()+b(this,"paddingTop")+b(this,"paddingBottom")},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth-b(this,"borderLeftWidth")-b(this,"borderRightWidth"):this.width()+b(this,"paddingLeft")+b(this,"paddingRight")},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight:this.height()+b(this,"borderTopWidth")+b(this,"borderBottomWidth")+b(this,"paddingTop")+b(this,"paddingBottom")},outerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth:this.width()+b(this,"borderLeftWidth")+b(this,"borderRightWidth")+b(this,"paddingLeft")+b(this,"paddingRight")},scrollLeft:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(f,d(window).scrollTop())}else{this.scrollLeft=f}})}if(this[0]==window||this[0]==document){return self.pageXOffset||d.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this[0].scrollLeft},scrollTop:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(d(window).scrollLeft(),f)}else{this.scrollTop=f}})}if(this[0]==window||this[0]==document){return self.pageYOffset||d.boxModel&&document.documentElement.scrollTop||document.body.scrollTop}return this[0].scrollTop},position:function(o,j){var g=this[0],m=g.parentNode,i=g.offsetParent,o=d.extend({margin:false,border:false,padding:false,scroll:false},o||{}),l=g.offsetLeft,k=g.offsetTop,h=g.scrollLeft,n=g.scrollTop;if(d.browser.mozilla||d.browser.msie){l+=b(g,"borderLeftWidth");k+=b(g,"borderTopWidth")}if(d.browser.mozilla){do{if(d.browser.mozilla&&m!=g&&d.css(m,"overflow")!="visible"){l+=b(m,"borderLeftWidth");k+=b(m,"borderTopWidth")}if(m==i){break}}while((m=m.parentNode)&&(m.tagName.toLowerCase()!="body"||m.tagName.toLowerCase()!="html"))}var f=e(g,o,l,k,h,n);if(j){d.extend(j,f);return this}else{return f}},offset:function(g,l){var k=0,j=0,t=0,o=0,u=this[0],i=this[0],h,f,s=d.css(u,"position"),r=d.browser.mozilla,m=d.browser.msie,w=d.browser.safari,q=d.browser.opera,n=false,p=false,g=d.extend({margin:true,border:false,padding:false,scroll:true,lite:false},g||{});if(g.lite){return this.offsetLite(g,l)}if(u.tagName.toLowerCase()=="body"){k=u.offsetLeft;j=u.offsetTop;if(r){k+=b(u,"marginLeft")+(b(u,"borderLeftWidth")*2);j+=b(u,"marginTop")+(b(u,"borderTopWidth")*2)}else{if(q){k+=b(u,"marginLeft");j+=b(u,"marginTop")}else{if(m&&jQuery.boxModel){k+=b(u,"borderLeftWidth");j+=b(u,"borderTopWidth")}}}}else{do{f=d.css(i,"position");k+=i.offsetLeft;j+=i.offsetTop;if(r||m){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth");if(r&&f=="absolute"){n=true}if(m&&f=="relative"){p=true}}h=i.offsetParent;if(g.scroll||r){do{if(g.scroll){t+=i.scrollLeft;o+=i.scrollTop}if(r&&i!=u&&d.css(i,"overflow")!="visible"){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth")}i=i.parentNode}while(i!=h)}i=h;if(i.tagName.toLowerCase()=="body"||i.tagName.toLowerCase()=="html"){if((w||(m&&d.boxModel))&&s!="absolute"&&s!="fixed"){k+=b(i,"marginLeft");j+=b(i,"marginTop")}if((r&&!n&&s!="fixed")||(m&&s=="static"&&!p)){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth")}break}}while(i)}var v=e(u,g,k,j,t,o);if(l){d.extend(l,v);return this}else{return v}},offsetLite:function(n,i){var k=0,j=0,g=0,m=0,l=this[0],h,n=d.extend({margin:true,border:false,padding:false,scroll:true},n||{});do{k+=l.offsetLeft;j+=l.offsetTop;h=l.offsetParent;if(n.scroll){do{g+=l.scrollLeft;m+=l.scrollTop;l=l.parentNode}while(l!=h)}l=h}while(l&&l.tagName.toLowerCase()!="body"&&l.tagName.toLowerCase()!="html");var f=e(this[0],n,k,j,g,m);if(i){d.extend(i,f);return this}else{return f}}});var b=function(f,g){return parseInt(d.css(f.jquery?f[0]:f,g))||0};var e=function(j,i,g,k,f,h){if(!i.margin){g-=b(j,"marginLeft");k-=b(j,"marginTop")}if(i.border&&(d.browser.safari||d.browser.opera)){g+=b(j,"borderLeftWidth");k+=b(j,"borderTopWidth")}else{if(!i.border&&!(d.browser.safari||d.browser.opera)){g-=b(j,"borderLeftWidth");k-=b(j,"borderTopWidth")}}if(i.padding){g+=b(j,"paddingLeft");k+=b(j,"paddingTop")}if(i.scroll){f-=j.scrollLeft;h-=j.scrollTop}return i.scroll?{top:k-h,left:g-f,scrollTop:h,scrollLeft:f}:{top:k,left:g}}})(jQuery);
/* jquery.tooltip.js */
;(function(e){var b={},k,m,o,j=e.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),a=false;e.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){e.tooltip.blocked=!e.tooltip.blocked}};e.fn.extend({tooltip:function(p){p=e.extend({},e.tooltip.defaults,p);h(p);return this.each(function(){e.data(this,"tooltip",p);this.tOpacity=b.parent.css("opacity");this.tooltipText=this.title;e(this).removeAttr("title");this.alt=""}).mouseover(l).mouseout(f).click(f)},fixPNG:j?function(){return this.each(function(){var p=e(this).css("backgroundImage");if(p.match(/^url\(["']?(.*\.png)["']?\)$/i)){p=RegExp.$1;e(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+p+"')"}).each(function(){var q=e(this).css("position");if(q!="absolute"&&q!="relative"){e(this).css("position","relative")}})}})}:function(){return this},unfixPNG:j?function(){return this.each(function(){e(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){e(this)[e(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function h(p){if(b.parent){return}b.parent=e('<div id="'+p.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if(e.fn.bgiframe){b.parent.bgiframe()}b.title=e("h3",b.parent);b.body=e("div.body",b.parent);b.url=e("div.url",b.parent)}function c(p){return e.data(p,"tooltip")}function g(p){if(c(this).delay){o=setTimeout(n,c(this).delay)}else{n()}a=!!c(this).track;e(document.body).bind("mousemove",d);d(p)}function l(){if(e.tooltip.blocked||this==k||(!this.tooltipText&&!c(this).bodyHandler)){return}k=this;m=this.tooltipText;if(c(this).bodyHandler){b.title.hide();var s=c(this).bodyHandler.call(this);if(s.nodeType||s.jquery){b.body.empty().append(s)}else{b.body.html(s)}b.body.show()}else{if(c(this).showBody){var r=m.split(c(this).showBody);b.title.html(r.shift()).show();b.body.empty();for(var q=0,p;(p=r[q]);q++){if(q>0){b.body.append("<br/>")}b.body.append(p)}b.body.hideWhenEmpty()}else{b.title.html(m).show();b.body.hide()}}if(c(this).showURL&&e(this).url()){b.url.html(e(this).url().replace("http://","")).show()}else{b.url.hide()}b.parent.addClass(c(this).extraClass);if(c(this).fixPNG){b.parent.fixPNG()}g.apply(this,arguments)}function n(){o=null;if((!j||!e.fn.bgiframe)&&c(k).fade){if(b.parent.is(":animated")){b.parent.stop().show().fadeTo(c(k).fade,k.tOpacity)}else{b.parent.is(":visible")?b.parent.fadeTo(c(k).fade,k.tOpacity):b.parent.fadeIn(c(k).fade)}}else{b.parent.show()}d()}function d(s){if(e.tooltip.blocked){return}if(s&&s.target.tagName=="OPTION"){return}if(!a&&b.parent.is(":visible")){e(document.body).unbind("mousemove",d)}if(k==null){e(document.body).unbind("mousemove",d);return}b.parent.removeClass("viewport-right").removeClass("viewport-bottom");var u=b.parent[0].offsetLeft;var t=b.parent[0].offsetTop;if(s){t=s.pageY+c(k).top;u="auto";var q=e(window).width()-s.pageX+c(k).left;b.parent.css({left:u,right:q,top:t})}var p=i(),r=b.parent[0];if(p.x+p.cx<r.offsetLeft+r.offsetWidth){u-=r.offsetWidth+20+c(k).left;b.parent.css({left:u+"px"}).addClass("viewport-right")}if(p.y+p.cy<r.offsetTop+r.offsetHeight){t-=r.offsetHeight+20+c(k).top;b.parent.css({top:t+"px"}).addClass("viewport-bottom")}}function i(){return{x:e(window).scrollLeft(),y:e(window).scrollTop(),cx:e(window).width(),cy:e(window).height()}}function f(r){if(e.tooltip.blocked){return}if(o){clearTimeout(o)}k=null;var q=c(this);function p(){b.parent.removeClass(q.extraClass).hide().css("opacity","")}if((!j||!e.fn.bgiframe)&&q.fade){if(b.parent.is(":animated")){b.parent.stop().fadeTo(q.fade,0,p)}else{b.parent.stop().fadeOut(q.fade,p)}}else{p()}if(c(this).fixPNG){b.parent.unfixPNG()}}})(jQuery);
/* TabHandler.js */
;var currentTabIds=new Array();var TAB_PREFIX="tab_";var CONTENT_PREFIX="tab_content_";var selectedTabGroupId=0;function showTab(d,a){var b=document.getElementById(TAB_PREFIX+a+d);var g=document.getElementById(CONTENT_PREFIX+a+d);selectedTabGroupId=a;if(typeof(g)!="undefined"&&typeof(b)!="undefined"){if(typeof(currentTabIds[a])=="undefined"){currentTabIds[a]=0}var i=a+currentTabIds[a];var h=document.getElementById(TAB_PREFIX+i);var j=document.getElementById(CONTENT_PREFIX+i);if(typeof(h)!="undefined"&&typeof(j)!="undefined"){if(h!=null){var c=TAB_PREFIX+a+"0"}if(h.id==c){h.className="answer unselected"}else{h.className="cpq unselected"}if(j!=null){j.className="unselected"}}if(b!=null){var c=TAB_PREFIX+a+"0"}if(h.id==c){b.className="answer selected2"}else{b.className="cpq selected"}if(g!=null){g.className="selected"}var f=navigator.appName;if(f=="Microsoft Internet Explorer"){try{b.focus()}catch(e){}}currentTabIds[a]=d}}function initTabs(a,b){currentTabIds[b]=a}function getCurrentTab(a){return currentTabIds[a]};
/* ajaxfileupload.js */
;jQuery.extend({createUploadIframe:function(d,b){var a="jUploadFrame"+d;if(window.ActiveXObject){var c=document.createElement('<iframe id="'+a+'" name="'+a+'" />');if(typeof b=="boolean"){c.src="javascript:false"}else{if(typeof b=="string"){c.src=b}}}else{var c=document.createElement("iframe");c.id=a;c.name=a}c.style.position="absolute";c.style.top="-1000px";c.style.left="-1000px";document.body.appendChild(c);return c},createUploadForm:function(g,b){var e="jUploadForm"+g;var a="jUploadFile"+g;var d=$j('<form  action="" method="POST" name="'+e+'" id="'+e+'" enctype="multipart/form-data"></form>');var c=$j("#"+b);var f=$j(c).clone();$j(c).attr("id",a);$j(c).before(f);$j(c).appendTo(d);$j(d).css("position","absolute");$j(d).css("top","-1200px");$j(d).css("left","-1200px");$j(d).appendTo("body");return d},ajaxFileUpload:function(k){k=jQuery.extend({},jQuery.ajaxSettings,k);var a=new Date().getTime();var b=jQuery.createUploadForm(a,k.fileElementId);var i=jQuery.createUploadIframe(a,k.secureuri);var h="jUploadFrame"+a;var j="jUploadForm"+a;if(k.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var c=false;var f={};if(k.global){jQuery.event.trigger("ajaxSend",[f,k])}var d=function(l){var p=document.getElementById(h);try{if(p.contentWindow){f.responseText=p.contentWindow.document.body?p.contentWindow.document.body.innerHTML:null;f.responseXML=p.contentWindow.document.XMLDocument?p.contentWindow.document.XMLDocument:p.contentWindow.document}else{if(p.contentDocument){f.responseText=p.contentDocument.document.body?p.contentDocument.document.body.innerHTML:null;f.responseXML=p.contentDocument.document.XMLDocument?p.contentDocument.document.XMLDocument:p.contentDocument.document}}}catch(o){jQuery.handleError(k,f,null,o)}if(f||l=="timeout"){c=true;var m;try{m=l!="timeout"?"success":"error";if(m!="error"){var n=jQuery.uploadHttpData(f,k.dataType);if(k.success){k.success(n,m)}if(k.global){jQuery.event.trigger("ajaxSuccess",[f,k])}}else{jQuery.handleError(k,f,m)}}catch(o){m="error";jQuery.handleError(k,f,m,o)}if(k.global){jQuery.event.trigger("ajaxComplete",[f,k])}if(k.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}if(k.complete){k.complete(f,m)}jQuery(p).unbind();setTimeout(function(){try{$j(p).remove();$j(b).remove()}catch(q){jQuery.handleError(k,f,null,q)}},100);f=null}};if(k.timeout>0){setTimeout(function(){if(!c){d("timeout")}},k.timeout)}try{var b=$j("#"+j);$j(b).attr("action",k.url);$j(b).attr("method","POST");$j(b).attr("target",h);if(b.encoding){b.encoding="multipart/form-data"}else{b.enctype="multipart/form-data"}$j(b).submit()}catch(g){jQuery.handleError(k,f,null,g)}if(window.attachEvent){document.getElementById(h).attachEvent("onload",d)}else{document.getElementById(h).addEventListener("load",d,false)}return{abort:function(){}}},uploadHttpData:function(r,type){var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script"){jQuery.globalEval(data)}if(type=="json"){eval("data = "+data)}if(type=="html"){data=data}return data}});
/* gaTrackingTabs.js */
;var URL_ANSWER_TRACK="/answers/area/<TABNAME>";var ANSWER_CHECKER_ACTION="/action/answer-checker-button";var URL_MATHHELP_TOPIC_TRACK="<TOPIC>/episode/<EPISODENAME>/area/<AREANAME>";var URL_PROFILE_CANCEL_TRACK="/profile/cancel-subscription-popup";var CANCEL_SUBSCRIPTION_ACTION="/action/cancel-subscription-button";var currentTrackURL="";function gaTrackingAnswers(c,a){var b=URL_ANSWER_TRACK;var d="forum";switch(c){case"0":d="forum";break;case"1":d="review";break;case"2":d="browse";break;case"3":d="answer-checker";break;default:break}b=b.replace("<TABNAME>",d);if(typeof a!="undefined"&&a==true){b+=ANSWER_CHECKER_ACTION}if(b!=currentTrackURL){currentTrackURL=b}else{return}if((typeof(_gaq)!="undefined")&&(_gaq!=null)){_gaq.push(["_trackPageview",b])}}function gaTrackingMathHelp(d,b,e,a){var c=URL_MATHHELP_TOPIC_TRACK;c=c.replace("<TOPIC>",d);c=c.replace("<EPISODENAME>",b);c=c.replace("<AREANAME>",e);if(typeof a!="undefined"&&a==true){c+=ANSWER_CHECKER_ACTION}if(c!=currentTrackURL){currentTrackURL=c}else{return}if((typeof(_gaq)!="undefined")&&(_gaq!=null)){_gaq.push(["_trackPageview",c])}}function answerCheckerButtonAction(a){trackAction(true);window.location=a}function gaTrackingProfileCancel(a){var b=URL_PROFILE_CANCEL_TRACK;if(typeof a!="undefined"&&a==true){b+=CANCEL_SUBSCRIPTION_ACTION}if((typeof(_gaq)!="undefined")&&(_gaq!=null)){_gaq.push(["_trackPageview",b])}};
/* jquery.jcarousel.pack.js */
;eval(function(h,b,i,d,g,f){g=function(a){return(a<b?"":g(parseInt(a/b)))+((a=a%b)>35?String.fromCharCode(a+29):a.toString(36))};if(!"".replace(/^/,String)){while(i--){f[g(i)]=d[i]||g(i)}d=[function(a){return f[a]}];g=function(){return"\\w+"};i=1}while(i--){if(d[i]){h=h.replace(new RegExp("\\b"+g(i)+"\\b","g"),d[i])}}return h}("(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:'2X',2c:'2Q',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:'<P></P>',1Q:'<P></P>',2m:'2l',2k:'2l',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?'1H':'26';4.E=!4.5.Z?'24':'23';8 a='',1e=e.K.1e(' ');1r(8 i=0;i<1e.I;i++){6(1e[i].2y('C-2w')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t=='3o'||e.2t=='3n'){4.t=$(e);4.D=4.t.19();6(4.D.1o('C-H')){6(!4.D.19().1o('C-D'))4.D=4.D.B('<P></P>');4.D=4.D.19()}10 6(!4.D.1o('C-D'))4.D=4.t.B('<P></P>').19()}10{4.D=$(e);4.t=$(e).3h('>2o,>2n,P>2o,P>2n')}6(a!=''&&4.D.19()[0].K.2y('C-2w')==-1)4.D.B('<P 3g=\" '+a+'\"></P>');4.H=4.t.19();6(!4.H.I||!4.H.1o('C-H'))4.H=4.t.B('<P></P>').19();4.R=$('.C-11',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K('C-11'));4.U=$('.C-17',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K('C-17'));4.H.V(4.K('C-H'));4.t.V(4.K('C-t'));4.D.V(4.K('C-D'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32('1F');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+'T');6(!o||o.u===J)4.5.u=c.u()}4.D.y('1y','1A');4.U.y('1y','1A');4.R.y('1y','1A');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,'2a');6($.2A.28){4.1f(F,F);$(27).1u('2I',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:'0.2.3'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+'T');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22('2E',4.1U).1u('2E',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,'3u');4.t.y(4.N,'3t');6(4.5.1j!=7)4.5.1j(4,'2D');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$('1F',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+'T');4.t.y(4.E,-E+'T')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o('C-1a-1D'))z F}z 1h},L:9(i){z $('.C-1a-'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K('C-1a-1D'));1R s=='3l'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+'T');4.t.y(4.N,r.M(4.t.y(4.N))+b+'T');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+'T');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+'T')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B=='1Z'||4.5.B=='G')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B=='1Z'||4.5.B=='A')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!='18')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!='18'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K('C-1a-1D'));c[a?'1z':'1X'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B=='18'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K('C-1a-1D'));c.I==0?4.t.2r(e):c[a?'1z':'1X'](e)}c=e;8 d=4.S(e);6(d==0){3f('3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...');z 0}6(4.5.B!='18'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+'T');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+'T')}}8 n=i+k-1;6(4.5.B!='18'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!='18'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!='18'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?'1l':'1N');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B=='1Z'||b.5.B=='G'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M('2i')};4.1M('31');6(!4.5.1K||a==F){4.t.y(4.E,p+'T');c()}10{8 o=!4.5.Z?{'24':p}:{'23':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!='A')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B=='A')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!='G')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B=='G')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?'1u':'22'](4.5.2m,4.2G)[n?'1E':'V'](4.K('C-17-1w')).1J('1w',n?F:1h);4.R[p?'1u':'22'](4.5.2k,4.2b)[p?'1E':'V'](4.K('C-11-1w')).1J('1w',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?'2a':(4.X<4.A?'17':'11');4.12('2F',a,b);6(4.X!==4.A){4.12('2B',a,b,4.A);4.12('2z',a,b,4.X)}6(4.13!==4.G){4.12('2x',a,b,4.G);4.12('2v',a,b,4.13)}4.12('2s',a,b,4.A,4.G,4.X,4.13);4.12('2p',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!='2h'&&b!='2i'))z;8 h=1R 4.5[a]=='2h'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I('<1F></1F>',i)},1I:9(e,i){8 a=$(e).V(4.K('C-1a')).V(4.K('C-1a-'+i));a.1J('2V',i);z a},K:9(c){z c+' '+c+(!4.5.Z?'-2U':'-Z')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,'2f')+r.Y(a,'1l'):a.2e+r.Y(a,'2d')+r.Y(a,'1N');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,'2f')-r.Y(a,'1l'):d-r.Y(a,'2d')-r.Y(a,'1N');$(a).y(4.N,w+'T');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y('2T'))-r.M(4.H.y('2S')):4.H[0].2e-r.M(4.H.y('2R'))-r.M(4.H.y('3i'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p=='1l'&&$.2A.28){8 b={'1y':'1A','2M':'2L','1H':'1q'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b['1l']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);",62,218,"||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery".split("|"),0,{}));
/* jQuery.jGlideMenu.067.min.js */
;jQuery.jGlideMenu={useDropShadow:new Boolean(),useDragDrop:new Boolean(),defaultScrollSpeed:new Number(0),defaultScrollBackSpeed:new Number(0),slideRight:new Boolean(),useSmoothScrolling:new Boolean(),easeFx:new String(""),closeLinkMarkUp:new String(""),menuShowFx:new String(""),menuHideFx:new String(""),tileWidth:new Number(0),tileInset:new Number(0),itemsToDisplay:new Number(8),useTileURL:new Boolean(),tileSource:new String(""),URLParams:new Object(),loadImage:new String(""),loadImageStyle:new Object(),initialTile:new String(""),alertOnError:new Boolean(),captureLinks:new Boolean(),imagePath:new String(),tileCount:new Number(0),animation:new Boolean(),helperImage:new Boolean(),currentElement:new Object(),currentElementID:new String(""),hasDragDropSupport:new Boolean(),hasShadowSupport:new Boolean(),displayToggle:new Boolean(),tileScrollPosition:new Array(),smoothScrollTimer:new Array(),mouseHover:new Boolean(),demoMode:new Boolean(),initialize:function(a){return this.each(function(){jQuery.jGlideMenu.animation=false;jQuery.jGlideMenu.helperImage=false;jQuery.jGlideMenu.hasDragDropSupport=false;jQuery.jGlideMenu.hasShadowSupport=false;jQuery.jGlideMenu.tileCount=0;jQuery.jGlideMenu.displayToggle=false;jQuery.jGlideMenu.mouseHover=false;jQuery.jGlideMenu.demoMode=false;jQuery.jGlideMenu.currentElement=jQuery(this);if(this.id){jQuery.jGlideMenu.currentElementID=this.id}var c={itemsToDisplay:11,tileInset:7,tileWidth:225,useDropShadow:false,slideRight:true,useDragDrop:true,useSmoothScrolling:true,useTileURL:false,defaultScrollSpeed:250,defaultScrollBackSpeed:250,tileSource:"myTiles",URLParams:{},closeLinkMarkUp:"Close",menuShowFx:"fadeIn",menuHideFx:"fadeOut",easeFx:"linear",loadImage:"/images/mathhelp/ajax.gif",initialTile:"tile_001",alertOnError:false,captureLinks:true,loadImageStyle:{position:"absolute",bottom:"10px",left:"10px","z-index":"999"},imagePath:"/images/mathhelp/",demoMode:false};if(a){jQuery.extend(c,a)}jQuery.jGlideMenu.checkFeatures();if(c.closeLinkMarkUp.length<1){c.closeLinkMarkUp="x Close"}if(parseInt(c.itemsToDisplay)<1){c.itemsToDisplay=1}if(c.initialTile.length<0){jQuery.jGlideMenu.errorTrap("Invalid Configuration")}for(i in c){jQuery.jGlideMenu[i]=c[i]}if(jQuery.jGlideMenu.useTileURL==false&&jQuery.jGlideMenu.tileSource.length>0){jQuery(jQuery.jGlideMenu.tileSource).css("display","none");jQuery(jQuery.jGlideMenu.currentElement).children().not(jQuery.jGlideMenu.tileSource).remove()}else{jQuery(jQuery.jGlideMenu.currentElement).html("")}jQuery(jQuery.jGlideMenu.currentElement).append('<div class="jGM_header"><a href="#">'+jQuery.jGlideMenu.closeLinkMarkUp+"</a></div>").append('<div class="jGM_wrapper" id="jGM_wrapper_'+this.id+'"></div>');var b=document.createElement("img");b.src=jQuery.jGlideMenu.loadImage;b.style.display="none";b.id="jGM_helper"+jQuery.jGlideMenu.currentElementID;jQuery(jQuery.jGlideMenu.currentElement).append(b);jQuery("img#"+b.id).css(jQuery.jGlideMenu.loadImageStyle);jQuery.jGlideMenu.helperImage=true;if(jQuery.jGlideMenu.hasDragDropSupport==true&&jQuery.jGlideMenu.useDragDrop==true){if(jQuery.isFunction(jQuery("body").Draggable)){jQuery(this).Draggable({handle:".jGM_header"})}else{jQuery(this).draggable({handle:".jGM_header"})}}if(jQuery.jGlideMenu.hasShadowSupport==true&&jQuery.jGlideMenu.useDropShadow==true){if(jQuery.isFunction(jQuery("body").dropShadow)){jQuery(this).dropShadow()}else{jQuery(this).shadow({color:"#cccccc"})}}jQuery(jQuery.jGlideMenu.currentElement).find("div.jGM_header a").bind("click",function(){if(jQuery.jGlideMenu.displayToggle==true){return false}jQuery.jGlideMenu.toggleDisplay(true);return false});jQuery(this).hover(function(){jQuery.jGlideMenu.mouseHover=true},function(){jQuery.jGlideMenu.mouseHover=false});jQuery(document).keydown(function(d){return true});jQuery.jGlideMenu.loadTile(jQuery.jGlideMenu.initialTile,jQuery.jGlideMenu.URLParams)})},toggleDisplay:function(a){jQuery.jGlideMenu.displayToggle=true;jQuery.jGlideMenu.mouseHover==false;if(jQuery(jQuery.jGlideMenu.currentElement).css("display")=="block"){var b=0}else{var b=1}jQuery(jQuery.jGlideMenu.currentElement).animate({opacity:b},"slow",function(){if(a==true){jQuery.jGlideMenu.scrollToTile(0,jQuery.jGlideMenu.defaultScrollBackSpeed);jQuery.jGlideMenu.tileScrollPosition[0]=0}if(b>0){jQuery(this).css("display","block")}else{jQuery(this).css("display","none")}jQuery.jGlideMenu.displayToggle=false})},checkFeatures:function(){jQuery.jGlideMenu.hasDragDropSupport=jQuery.isFunction(jQuery("body").Draggable);if(jQuery.jGlideMenu.hasDragDropSupport==false){jQuery.jGlideMenu.hasDragDropSupport=jQuery.isFunction(jQuery("body").draggable)}jQuery.jGlideMenu.hasShadowSupport=jQuery.isFunction(jQuery("body").dropShadow);if(jQuery.jGlideMenu.hasShadowSupport==false){jQuery.jGlideMenu.hasShadowSupport=jQuery.isFunction(jQuery("body").shadow)}return},parseURL:function(a){if(!$j.browser.msie){return a}if(a.indexOf("#tile_")<0){return a}var b=a.split("#");return"#"+b[(b.length-1)]},countTiles:function(){jQuery.jGlideMenu.tileCount=parseInt(jQuery("div.jGM_tile").size())},loadTile:function(m,c){var a=document.createElement("div");var e=jQuery.jGlideMenu.tileCount+1;a.id="jGM_tile_"+jQuery.jGlideMenu.currentElementID+"_"+e;if(jQuery.jGlideMenu.slideRight==true){var d=jQuery.jGlideMenu.tileWidth*jQuery.jGlideMenu.tileCount+jQuery.jGlideMenu.tileInset}else{var d=jQuery.jGlideMenu.tileWidth*jQuery.jGlideMenu.tileCount*-1+jQuery.jGlideMenu.tileInset}jQuery("#jGM_wrapper_"+jQuery.jGlideMenu.currentElementID).append(a);jQuery("#"+a.id).addClass("jGM_tile").css({top:0,left:d+"px",height:"800px",width:"210px",position:"absolute",overflow:"hidden",margin:0,padding:0,border:0,display:"block"});var k='<div style="height:100%;margin:0;border:0;width:100%;padding:0;text-align:center;"><h3>Missing Tile</h3><p>Unable to locate the requested Tile</p></div>';if(jQuery.jGlideMenu.useTileURL==false){if(jQuery("ul#"+m).size()<1){jQuery.jGlideMenu.errorTrap("Invalid Tile Request");return false}var j=jQuery("ul#"+m).attr("title");var g=jQuery("ul#"+m).attr("alt");var h=jQuery("ul#"+m+" li").size();var l=[];var b="";var n="";jQuery("ul#"+m+" li").each(function(){if(jQuery("a",this).size()>0){var p=jQuery("a",this).attr("class");p=(!p?"":p);b=jQuery("a",this).attr("id");b=(!b?"":"math_"+b);n=jQuery("a",this).attr("title");n=(!n?"":n);l[l.length]=[jQuery("a",this).attr("href"),jQuery("a",this).text(),1,p,b,n]}else{var o=jQuery(this).attr("style");o=(!o?"":o);b=jQuery(this).attr("id");b=(!b?"":"math_"+b);n=jQuery(this).attr("title");n=(!n?"":n);l[l.length]=[jQuery(this).attr("rel"),jQuery(this).text(),0,o,b,n]}});var k=jQuery.jGlideMenu.buildTile(j,g,l)}else{if(jQuery.jGlideMenu.tileSource.length<1){jQuery.jGlideMenu.errorTrap("Invalid AJAX Request");return false}var f="img#jGM_helper"+jQuery.jGlideMenu.currentElementID;jQuery(f).ajaxStart(function(){jQuery(this).animate({opacity:"show"},"fast")}).ajaxStop(function(){jQuery(this).animate({opacity:"hide"},"slow")});c.tile=m;jQuery.ajax({type:"POST",url:jQuery.jGlideMenu.tileSource,data:c,async:false,success:function(s){jQuery("body").append('<div id="jGM_temp_'+jQuery.jGlideMenu.currentElementID+c.tile+'" style="display:none;">'+s+"</div>");if(jQuery("#jGM_temp_"+jQuery.jGlideMenu.currentElementID+c.tile+" ul#"+m).size()<1){jQuery.jGlideMenu.errorTrap("AJAX: Invalid Tile Request");return false}var r=jQuery("#jGM_temp_"+jQuery.jGlideMenu.currentElementID+c.tile+" ul#"+m).attr("title");var q=jQuery("#jGM_temp_"+jQuery.jGlideMenu.currentElementID+c.tile+" ul#"+m).attr("alt");var p=jQuery("#jGM_temp_"+jQuery.jGlideMenu.currentElementID+c.tile+" ul#"+m+" li").size();var o=[];jQuery("#jGM_temp_"+jQuery.jGlideMenu.currentElementID+c.tile+" ul#"+m+" li").each(function(){if(jQuery("a",this).size()>0){var u=jQuery("a",this).attr("class");u=(!u?"":u);var w=jQuery("a",this).attr("id");w=(!w?"":"math_"+w);var v=jQuery("a",this).attr("title");v=(!v?"":v);o[o.length]=[jQuery("a",this).attr("href"),jQuery("a",this).text(),1,u,w,v]}else{var t=jQuery(this).attr("style");t=(!t?"":t);var w=jQuery(this).attr("id");w=(!w?"":"math_"+w);var v=jQuery(this).attr("title");v=(!v?"":v);o[o.length]=[jQuery(this).attr("rel"),jQuery(this).text(),0,t,w,v]}});jQuery("#jGM_temp_"+jQuery.jGlideMenu.currentElementID+c.tile).remove();k=jQuery.jGlideMenu.buildTile(r,q,o);jQuery(f).ajaxStart(function(){}).ajaxStop(function(){})},error:function(o){jQuery.jGlideMenu.errorTrap("Invalid AJAX Tile Request");jQuery(f).ajaxStart(function(){}).ajaxStop(function(){})}})}jQuery("#"+a.id).html(k);jQuery("#"+a.id+" div.jGM_content a").bind("click",function(){var p="";p=jQuery.jGlideMenu.parseURL(jQuery(this).attr("href"));if(p.length<1){return false}if(p.substr(0,1)=="#"){if(jQuery.jGlideMenu.animation==true){return false}var o=p.substr(1,p.length-1);jQuery.jGlideMenu.loadTile(o,jQuery.jGlideMenu.URLParams);return false}else{if(jQuery.jGlideMenu.demoMode){window.location.href=p}else{alert("Navigation Requestion: "+p)}if(jQuery.jGlideMenu.captureLinks==true){return false}}return true});jQuery.jGlideMenu.countTiles();if(jQuery.jGlideMenu.tileCount>1){jQuery("#"+a.id).append('<div class="jGM_back"><a href="#"><img src="/images/mathhelp/mathhelp_menu_back.png" border="0" /></a></div>');jQuery("#"+a.id+" div.jGM_back").bind("click",function(){if(jQuery.jGlideMenu.animation==true){return false}jQuery.jGlideMenu.scrollToTile((e-1),jQuery.jGlideMenu.defaultScrollBackSpeed);return false});if(jQuery.jGlideMenu.tileCount>2){jQuery("#"+a.id).append('<div class="jGM_reset"><a href="#"><img src="/images/mathhelp/mathhelp_menu_home.png" border="0" /></a></div>');jQuery("#"+a.id+" div.jGM_reset").bind("click",function(){if(jQuery.jGlideMenu.animation==true){return false}jQuery.jGlideMenu.scrollToTile(1,jQuery.jGlideMenu.defaultScrollBackSpeed);return false})}}jQuery.jGlideMenu.tileScrollPosition[e]=0;jQuery.jGlideMenu.drawPagers(a.id,jQuery("#"+a.id+" .jGM_content a").size());if(jQuery.jGlideMenu.useSmoothScrolling==false){jQuery("#"+a.id+" .jGM_pager a").click(function(){var o=1;if(jQuery(this).attr("rel")=="Up"){o=0}jQuery.jGlideMenu.scrollItems(o)})}else{jQuery("#"+a.id+" .jGM_pager a").hover(function(){var o=1;if(jQuery(this).attr("rel")=="Up"){o=0}jQuery.jGlideMenu.smoothScrollTimer[jQuery.jGlideMenu.tileCount]=window.setInterval("jQuery.jGlideMenu.scrollItems("+o+")",250)},function(){window.clearInterval(jQuery.jGlideMenu.smoothScrollTimer[jQuery.jGlideMenu.tileCount])})}jQuery.jGlideMenu.scrollToTile(e,jQuery.jGlideMenu.defaultScrollSpeed)},scrollItems:function(e){var a="#jGM_tile_"+jQuery.jGlideMenu.currentElementID+"_"+jQuery.jGlideMenu.tileCount;var b=jQuery(a+" .jGM_content a");var f=jQuery.jGlideMenu.tileScrollPosition[jQuery.jGlideMenu.tileCount];if(f<=0&&e==0){return}if(f+jQuery.jGlideMenu.itemsToDisplay>=jQuery(b).size()&&e==1){return}if(e==0){jQuery.jGlideMenu.tileScrollPosition[jQuery.jGlideMenu.tileCount]--}else{jQuery.jGlideMenu.tileScrollPosition[jQuery.jGlideMenu.tileCount]++}jQuery(b).show();jQuery(a+" .jGM_content").children("a:lt("+jQuery.jGlideMenu.tileScrollPosition[jQuery.jGlideMenu.tileCount]+")").hide();jQuery.jGlideMenu.drawPagers(a.substr(1,a.length),jQuery(b).size())},drawPagers:function(a,b){jQuery("#"+a+" .jGM_pager").find("a").each(function(){if(jQuery(this).attr("rel")=="Up"){if(jQuery.jGlideMenu.tileScrollPosition[jQuery.jGlideMenu.tileCount]>0){jQuery(this).css("display","block")}else{jQuery(this).css("display","none")}}else{if(jQuery.jGlideMenu.tileScrollPosition[jQuery.jGlideMenu.tileCount]+jQuery.jGlideMenu.itemsToDisplay<jQuery("#"+a+" .jGM_content a").size()){jQuery(this).css("display","block")}else{jQuery(this).css("display","none")}}})},cleanTiles:function(d){var c=d+1;var b=jQuery.jGlideMenu.tileCount;if(d>=b){return false}for(var a=c;a<=b;a++){jQuery("#jGM_tile_"+jQuery.jGlideMenu.currentElementID+"_"+a).remove();jQuery.jGlideMenu.tileScrollPosition[a]=0}jQuery.jGlideMenu.countTiles();return},scrollToTile:function(g,f){jQuery.jGlideMenu.countTiles();var e=jQuery.jGlideMenu.tileCount;if(g>e){g=e}if(g<1){g=1}if(!f){f=jQuery.jGlideMenu.defaultScrollSpeed}var c=(jQuery.jGlideMenu.tileWidth*g)-jQuery.jGlideMenu.tileWidth;var d=(jQuery.jGlideMenu.slideRight==true)?c*-1:c;jQuery.jGlideMenu.animation=true;jQuery("div#jGM_wrapper_"+jQuery.jGlideMenu.currentElementID).animate({left:d},f,jQuery.jGlideMenu.easeFx,function(){if(g<e){jQuery.jGlideMenu.cleanTiles(g)}if(d!=0){d+="px"}jQuery(this).css({left:d});jQuery.jGlideMenu.animation=false})},buildTile:function(k,g,c){if(jQuery.jGlideMenu.imagePath.length>1&&jQuery.jGlideMenu.imagePath.substr(-1,1)!="/"){jQuery.jGlideMenu.imagePath+="/"}var j=new String("");j='<div class="jGM_cats"><h1>'+k+'</h1><hr><p class="jGM_desc">'+g+"</p></div>";j+='<div class="jGM_pager"><a href="#" rel="Up" title="Scroll Up" style="display:none"><img src="'+jQuery.jGlideMenu.imagePath+'arrow_up.gif" alt="Scroll Up"/></a></div>';j+='<div class="jGM_content">';for(var f=0;f<c.length;f++){var e=(c[f][2]==1)?"":"#";var h=(c[f][2]==1)?(c[f][3]&&c[f][3]!=""?' class="'+c[f][3]+'"':""):' class="jGM_more"';var a=(c[f][2]==1?"":(c[f][3]&&c[f][3]!=""?' style="'+c[f][3]+'"':""));var b=(c[f][4]!=""?' id="'+c[f][4]+'"':"");var m=(c[f][5]!=""?' title="'+c[f][5]+'"':"");j+='<a href="'+e+c[f][0]+'"'+h+a+b+m+">"+c[f][1]+"</a>"}j+="</div>";j+='<div class="jGM_pager"><a href="#" rel="Down" title="Scroll Down" style="display:none"><img src="'+jQuery.jGlideMenu.imagePath+'arrow_dn.gif" alt="Scroll Up"/></a></div>';return j},errorTrap:function(a){if(jQuery.jGlideMenu.alertOnError==true){alert(a)}return}};jQuery.fn.jGlideMenu=jQuery.jGlideMenu.initialize;jQuery.fn.jGlideMenuToggle=jQuery.jGlideMenu.toggleDisplay;jQuery.fn.reverse=function(){return this.pushStack(this.get().reverse(),arguments)};jQuery.fn.setTile=jQuery.jGlideMenu.loadTile;
/* jquery.bgiframe.min.js */
;/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 2.1.2
 */
(function(a){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(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);

/* jqDnR.min.js */
;/*
 * jqDnR - Minimalistic Drag'n'Resize for jQuery.
 *
 * Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * $Version: 2007.08.19 +r2
 */
(function($){$.fn.jqDrag=function(h){return i(this,h,"d")
};
$.fn.jqResize=function(h){return i(this,h,"r")
};
$.jqDnR={dnr:{},e:0,drag:function(v){if(M.k=="d"){E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY})
}else{E.css({width:Math.max(v.pageX-M.pX+M.W,200),height:Math.max(v.pageY-M.pY+M.H,100)})
}return false
},stop:function(){$().unbind("mousemove",J.drag).unbind("mouseup",J.stop)
}};
var J=$.jqDnR,M=J.dnr,E=J.e,i=function(e,h,k){return e.each(function(){h=(h)?$(h,e):e;
h.bind("mousedown",{e:e,k:k},function(v){var d=v.data,p={};
E=d.e;
if(E.css("position")!="relative"){try{E.position(p)
}catch(e){}}M={X:p.left||f("left")||0,Y:p.top||f("top")||0,W:f("width")||E[0].scrollWidth||0,H:f("height")||E[0].scrollHeight||0,pX:v.pageX,pY:v.pageY,k:d.k,o:E.css("opacity")};
$().mousemove($.jqDnR.drag).mouseup($.jqDnR.stop).mousedown($.jqDnR.stop);
return false
})
})
},f=function(k){return parseInt(E.css(k))||false
}
})(jQuery);
/* jquery.jqpopup.min.js */
;/* jQpopup - jQuery Popup Box v0.2
 *  jQpopup is distributed under the terms of the MIT license
 *  For more information visit http://jqframework.com/jqpopup
 *  Copyright (C) 2009  jqframework.com
 * Do not remove this copyright message
 */
$j.jQpopup={minHeight:100,minWidth:200,imagePath:"images/",popupwrapper:null,box:function(object_id){var popupwrapper='<div id="'+object_id+'_p" class="jqpopup">';
popupwrapper+='<div class="jqpopup_header"><div id="'+object_id+'_ph"></div>';
popupwrapper+="<div>";
popupwrapper+='<div id="'+object_id+'_pl" class="jqpopup_center"></div>';
popupwrapper+='<div id="'+object_id+'_px" class="jqpopup_cross"></div>';
popupwrapper+="</div>";
popupwrapper+="</div>";
popupwrapper+='<div id="'+object_id+'_pm" class="jqpopup_message"></div>';
popupwrapper+='<div id="'+object_id+'_pc" class="jqpopup_content"></div>';
popupwrapper+='<div id="'+object_id+'_pf" class="jqpopup_footer"></div>';
popupwrapper+='<div id="'+object_id+'_ps" class="jqpopup_resize"></div>';
popupwrapper+="</div>";
return popupwrapper
},toTopEvent:function(e){var rid=(this.id).substr(0,this.id.length-1);
var zMax=0;
$j(".jqpopup").each(function(index){if($j(this).css("zIndex")>zMax){zMax=$j(this).css("zIndex")
}});
var val=parseInt(zMax)+1;
$j("#"+rid).css("zIndex",val)
},toTop:function(id){var str=id.substr(id.length-2);
var rid=id;
if(str!="_p"){rid+="_p"
}var zMax=0;
$j(".jqpopup").each(function(index){if($j(this).css("zIndex")>zMax){zMax=$j(this).css("zIndex")
}});
var val=parseInt(zMax)+1;
$j("#"+rid).css("zIndex",val)
},toCenter:function(id){var top=parseInt($j(window).scrollTop());
var left=parseInt($j(window).scrollLeft());
var rid=id+"_p";
var pos=$j("#"+rid).offset();
var box_x=parseInt($j("#"+rid).width());
var box_y=parseInt($j("#"+rid).height());
var center_x=parseInt($j(window).width())/2-box_x/2+left;
var center_y=parseInt($j(window).height())/2-box_y/2+top;
$j("#"+rid).css({left:center_x,top:center_y})
},open:function(button_id,object_id){if($j("#"+object_id).html()!=""){var content=$j.jQpopup.box(object_id);
$j("body").append(content);
$j("#"+object_id+"_p").bgiframe();
$j("#"+object_id+"_p").jqDrag(".jqpopup_header").jqResize(".jqpopup_resize");
$j("#"+object_id+"_px").bind("click",function(){$j("#"+object_id).jqpopup_close()
});
$j("#"+object_id+"_pl").bind("click",function(){$j("#"+object_id).jqpopup_toCenter(this.id)
});
var pos=$j("#"+button_id).offset();
var popup_x=parseInt(pos.left)+(parseInt($j("#"+button_id).width()/2));
var popup_y=parseInt(pos.top)+parseInt($j("#"+button_id).height());
$j("#"+object_id+"_p").css({left:popup_x,top:popup_y});
var popup_content=$j("#"+object_id).clone(true);
var title=$j("#"+object_id).attr("title");
$j("#"+object_id+"_ph").html(title);
$j("#"+object_id+"_pc").html(popup_content.show());
$j("#"+object_id+"_p").show();
$j("#"+object_id+"_ph").mousedown($j.jQpopup.toTopEvent);
$j("#"+object_id).empty();
if($j("#"+object_id+"_p").height()<$j.jQpopup.minHeight){$j("#"+object_id+"_p").css("height",$j.jQpopup.minHeight)
}if($j("#"+object_id+"_p").width()<$j.jQpopup.minWidth){$j("#"+object_id+"_p").css("width",$j.jQpopup.minWidth)
}$j("#"+object_id+"_p").jqpopup_toTop()
}},close:function(object_id){var content=$j("#"+object_id+"_pc").clone(true);
$j("#"+object_id).html(content.show());
$j("#"+object_id+"_pc").empty();
$j("#"+object_id+"_p").hide()
}};
$j.fn.extend({jqpopup_close:function(){return this.each(function(){$j.jQpopup.close(this.id)
})
},jqpopup_open:function(button_id){return this.each(function(){$j.jQpopup.open(button_id,this.id)
})
},jqpopup_toCenter:function(){return this.each(function(){$j.jQpopup.toCenter(this.id)
})
},jqpopup_toTop:function(){return this.each(function(){$j.jQpopup.toTop(this.id)
})
}});
/* jquery.jqcp.min.js */
;/* jQCP - $ Color Picker v 0.2
 *  jQCP is distributed under the terms of the MIT license
 *  For more information visit http://jqframework.com/jqcp
 *  Copyright (C) 2009  jqframework.com
 * Do not remove this copyright message
 */

$j.jQCP={imagePath:"images/c_tuner.png",prefix:"",colorObj:null,init:function(id){var prefix=$j.jQCP.prefix;
var str='<table class="jqcp_table"><tr>';
str+='<td><div id="'+prefix+'jqcp" class="jqcp"><div id="'+prefix+'marker" class="jqcpmarker"></div></div></td>';
str+='<td><div id="'+prefix+'jqbr" class="jqbr"></td>';
str+='<td><div id="'+prefix+'jqbrp" class="jqbrp"><div id="'+prefix+'c_point" class="jqbrpointer"></div></div></td>';
str+="</tr></table>";
$j("#"+id).html(str);
$j("#"+prefix+"jqcp").click(function(e){$j.jQCP.clickCp(e.pageX,e.pageY);
});
$j("#"+prefix+"jqbr").click(function(e){$j.jQCP.clickBp(e.pageX,e.pageY);
});
$j("#"+prefix+"jqcp_h").change(function(e){if($j.jQCP.validHSL($j("#"+prefix+"jqcp_h").val(),"jqcp_h")){$j.jQCP.setHsl();
}});
$j("#"+prefix+"jqcp_s").change(function(e){if($j.jQCP.validHSL($j("#"+prefix+"jqcp_s").val(),"jqcp_s")){$j.jQCP.setHsl();
}});
$j("#"+prefix+"jqcp_l").change(function(e){if($j.jQCP.validHSL($j("#"+prefix+"jqcp_l").val(),"jqcp_l")){$j.jQCP.setHsl();
}});
$j("#"+prefix+"jqcp_r").change(function(e){if($j.jQCP.validRGB($j("#"+prefix+"jqcp_r").val(),"jqcp_r")){$j.jQCP.setRGB();
}});
$j("#"+prefix+"jqcp_g").change(function(e){if($j.jQCP.validRGB($j("#"+prefix+"jqcp_g").val(),"jqcp_g")){$j.jQCP.setRGB();
}});
$j("#"+prefix+"jqcp_b").change(function(e){if($j.jQCP.validRGB($j("#"+prefix+"jqcp_b").val(),"jqcp_b")){$j.jQCP.setRGB();
}});
$j(".jqcp_value").click(function(e){$j.jQCP.colorObj=this.id;
$j.jQCP.HextoRGB();
});
$j.jQCP.setCpPos();
$j.jQCP.setBpPos();
},validHSL:function(value,obj){if(!isNaN(value)){if(value>240){$j("#"+$j.jQCP.prefix+obj).val(240);
}else{if(value<0){$j("#"+$j.jQCP.prefix+obj).val(0);
}}return true;
}return false;
},validRGB:function(value,obj){if(!isNaN(value)){if(value>255){$j("#"+$j.jQCP.prefix+obj).val(255);
}else{if(value<0){$j("#"+$j.jQCP.prefix+obj).val(0);
}}return true;
}return false;
},setCpPos:function(){var pos=$j("#"+$j.jQCP.prefix+"jqcp").offset();
var x=parseInt($j("#"+$j.jQCP.prefix+"jqcp_h").val())-4;
var y=240-parseInt($j("#"+$j.jQCP.prefix+"jqcp_s").val())-4;
$j("#"+$j.jQCP.prefix+"marker").css({position:"relative",zIndex:5000,left:x+"px",top:y+"px"});
},setBpPos:function(){var pos=$j("#"+$j.jQCP.prefix+"jqbrp").offset();
var y=240-parseInt($j("#"+$j.jQCP.prefix+"jqcp_l").val())-5;
$j("#"+$j.jQCP.prefix+"c_point").css({position:"relative",zIndex:5000,top:y+"px"});
},hsl2rgb:function(){var h=parseInt($j("#"+$j.jQCP.prefix+"jqcp_h").val())/240;
var s=parseInt($j("#"+$j.jQCP.prefix+"jqcp_s").val())/240;
var l=parseInt($j("#"+$j.jQCP.prefix+"jqcp_l").val())/240;
var r,g,b;
if(s==0){r=g=b=l;
}else{function hue2rgb(p,q,t){if(t<0){t+=1;
}if(t>1){t-=1;
}if(t<1/6){return p+(q-p)*6*t;
}if(t<1/2){return q;
}if(t<2/3){return p+(q-p)*(2/3-t)*6;
}return p;
}var q=l<0.5?l*(1+s):l+s-l*s;
var p=2*l-q;
r=hue2rgb(p,q,h+1/3);
g=hue2rgb(p,q,h);
b=hue2rgb(p,q,h-1/3);
}$j("#"+$j.jQCP.prefix+"jqcp_r").val(Math.round(r*255));
$j("#"+$j.jQCP.prefix+"jqcp_g").val(Math.round(g*255));
$j("#"+$j.jQCP.prefix+"jqcp_b").val(Math.round(b*255));
$j.jQCP.RGBtoHex();
},rgb2hsl:function(){var r=parseInt($j("#"+$j.jQCP.prefix+"jqcp_r").val())/255;
var g=parseInt($j("#"+$j.jQCP.prefix+"jqcp_g").val())/255;
var b=parseInt($j("#"+$j.jQCP.prefix+"jqcp_b").val())/255;
var max=Math.max(r,g,b),min=Math.min(r,g,b);
var h,s,l=(max+min)/2;
if(max==min){h=s=0;
}else{var d=max-min;
s=l>0.5?d/(2-max-min):d/(max+min);
switch(max){case r:h=(g-b)/d+(g<b?6:0);
break;
case g:h=(b-r)/d+2;
break;
case b:h=(r-g)/d+4;
break;
}h/=6;
}$j("#"+$j.jQCP.prefix+"jqcp_h").val(Math.round(h*240));
$j("#"+$j.jQCP.prefix+"jqcp_s").val(Math.round(s*240));
$j("#"+$j.jQCP.prefix+"jqcp_l").val(Math.round(l*240));
$j.jQCP.RGBtoHex();
},clickCp:function(x,y){var pos=$j("#"+$j.jQCP.prefix+"jqcp").offset();
$j("#"+$j.jQCP.prefix+"jqcp_h").val(Math.round(x-pos.left));
$j.jQCP.validHSL($j("#"+$j.jQCP.prefix+"jqcp_h").val(),"jqcp_h");
$j("#"+$j.jQCP.prefix+"jqcp_s").val(Math.round(240-y+pos.top));
$j.jQCP.validHSL($j("#"+$j.jQCP.prefix+"jqcp_s").val(),"jqcp_s");
$j.jQCP.hsl2rgb();
$j.jQCP.changeBpBg();
x=x-4-pos.left;
y=y-4-pos.top;
pos=$j("#"+$j.jQCP.prefix+"jqcp").offset();
$j("#"+$j.jQCP.prefix+"marker").css({position:"relative",zIndex:5000,left:x+"px",top:y+"px"});
},clickBp:function(x,y){var pos=$j("#"+$j.jQCP.prefix+"jqbr").offset();
$j("#"+$j.jQCP.prefix+"jqcp_l").val(Math.round(240-y+pos.top));
$j.jQCP.validHSL($j("#"+$j.jQCP.prefix+"jqcp_l").val(),"jqcp_l");
$j.jQCP.hsl2rgb();
y=y-3-pos.top;
pos=$j("#"+$j.jQCP.prefix+"jqbrp").offset();
$j("#"+$j.jQCP.prefix+"c_point").css({position:"relative",zIndex:5000,top:y+"px"});
},changeBpBg:function(){if(navigator.appVersion.indexOf("MSIE")!=-1){$j("#"+$j.jQCP.prefix+"jqbr").css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+$j.jQCP.imagePath+"')",backgroundColor:$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).val()});
}else{$j("#"+$j.jQCP.prefix+"jqbr").css({backgroundColor:$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).val()});
}},RGBtoHex:function(){$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).val("#"+$j.jQCP.toHex($j("#"+$j.jQCP.prefix+"jqcp_r").val())+$j.jQCP.toHex($j("#"+$j.jQCP.prefix+"jqcp_g").val())+$j.jQCP.toHex($j("#"+$j.jQCP.prefix+"jqcp_b").val()));
$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).css({backgroundColor:$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).val()});
},HextoRGB:function(){var value=$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).val();
$j("#"+$j.jQCP.prefix+"jqcp_r").val($j.jQCP.HexToR(value));
$j("#"+$j.jQCP.prefix+"jqcp_g").val($j.jQCP.HexToG(value));
$j("#"+$j.jQCP.prefix+"jqcp_b").val($j.jQCP.HexToB(value));
$j.jQCP.setRGB();
},setRGB:function(){$j.jQCP.rgb2hsl();
$j.jQCP.setCpPos();
$j.jQCP.setBpPos();
$j.jQCP.changeBpBg();
},setHsl:function(){$j.jQCP.hsl2rgb();
$j.jQCP.setCpPos();
$j.jQCP.setBpPos();
$j.jQCP.changeBpBg();
},toHex:function(N){if(N==null){return"00";
}N=parseInt(N);
if(N==0||isNaN(N)){return"00";
}N=Math.max(0,N);
N=Math.min(N,255);
N=Math.round(N);
return"0123456789ABCDEF".charAt((N-N%16)/16)+"0123456789ABCDEF".charAt(N%16);
},HexToR:function(h){return parseInt(($j.jQCP.cutHex(h)).substring(0,2),16);
},HexToG:function(h){return parseInt(($j.jQCP.cutHex(h)).substring(2,4),16);
},HexToB:function(h){return parseInt(($j.jQCP.cutHex(h)).substring(4,6),16);
},cutHex:function(h){return(h.charAt(0)=="#")?h.substring(1,7):h;
},setColorObj:function(colorObj){$j.jQCP.colorObj=colorObj;
$j("#"+$j.jQCP.prefix+colorObj).unbind("change");
$j("#"+$j.jQCP.prefix+colorObj).bind("change",function(e){$j.jQCP.HextoRGB();
});
$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).css({backgroundColor:$j("#"+$j.jQCP.prefix+$j.jQCP.colorObj).val()});
},setColor:function(colorObj,color){$j.jQCP.colorObj=colorObj;
$j("#"+$j.jQCP.prefix+colorObj).val(color);
$j.jQCP.HextoRGB();
}};
$j.fn.extend({jqcp:function(){return this.each(function(){$j.jQCP.init(this.id);
});
},jqcp_setObject:function(){return this.each(function(){$j.jQCP.setColorObj(this.id);
});
},jqcp_setColor:function(color){return this.each(function(){$j.jQCP.setColor(this.id,color);
});
}});

/* jquery.jqrte.min.js */
;$j.jQRTE = {
    iconList: ["popup_html", "popup_bgcolor", "popup_forecolor", "bold", "italic", "underline", "justifyleft", "justifycenter", "justifyright", "justifyfull", "insertHorizontalRule", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "popup_addlink", "unlink", "removeformat", "strikethrough", "superscript", "subscript", "popup_addtable", "popup_uploadfile", "popup_addimage", "popup_uploadimage", "popup_emotion", "popup_character", "popup_copyright"],
    rangeObj: null,
    element: null,
    selectionObj: null,
    boxy: {},
    backcolor: "#ffffff",
    forecolor: "#000000",
    backcolorList: {},
    forecolorList: {},
    init: function(element) {
        document.getElementById(element).contentWindow.document.designMode = "on";
        document.getElementById(element).contentWindow.document.contentEditable = true;
        $j(document.getElementById(element).contentWindow.document).keyup(function(e) {
            $j.jQRTE.saveRange(element);

            var box = element.split("_");
            var textid = "";
            for (var i = 0; i < box.length - 1; i++) {
                textid += "_" + box[i]
                }
            textid = textid.substr(1);
            checkTextAreaLen(document.getElementById(textid));
            });
        $j(document.getElementById(element).contentWindow.document).click(function(e) {
            $j.jQRTE.saveRange(element)
            });
        $j(document.getElementById(element).contentWindow.document).focus(function(e) {
            $j.jQRTE.saveRange(element)
            })
        },
    saveRange: function(element) {
        var iframe = document.getElementById(element);
        var doc = document.getElementById(element).contentDocument || document.getElementById(element).contentWindow.document;
        var selection = doc.selection || iframe.contentWindow.document.body;
        var range = selection.createRange ? selection.createRange() : selection.getRangeAt;
        var box = element.split("_");
        var textid = "";
        for (var i = 0; i < box.length - 1; i++) {
            textid += "_" + box[i]
            }
        textid = textid.substr(1);
        if (iframe.contentWindow.document.body != null)
           $j("#" + textid).text(document.getElementById(element).contentWindow.document.body.innerHTML);
        $j.jQRTE.rangeObj = range;
        $j.jQRTE.selectionObj = selection
    },
    restoreRange: function(element) {
        document.getElementById(element).contentWindow.focus();
        if (navigator.userAgent.indexOf("Firefox") != -1) {
            if ($j.jQRTE.rangeObj) {
                $j.jQRTE.selectionObj.removeAllRanges();
                $j.jQRTE.selectionObj.addRange($j.jQRTE.rangeObj)
            }
        } else {
            if ($j.jQRTE.rangeObj) {
                $j.jQRTE.rangeObj.select()
                document.getElementById(element).contentWindow.focus();
            }
        }
    },
    setIconNotLoggedIn: function(element) {
        for (var i = 0; i < $j.jQRTE.iconList.length; i++) {
            var checkpopup = ($j.jQRTE.iconList[i]).substr(0, 5);
            if (checkpopup == "popup") {
                var fn;
                var id = ($j.jQRTE.iconList[i]).substr(6);
                if (id == "bgcolor" || id == "forecolor") {
                    fn = "handle_color"
                } else {
                    fn = "handle_" + id
                }
                $j("#" + element + "_" + ($j.jQRTE.iconList[i]).substr(6)).html('<span id="' + element + "_" + $j.jQRTE.iconList[i].substr(6) + "_btn" + '" style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
            } else {
                $j("#" + element + "_" + $j.jQRTE.iconList[i]).html('<span id="' + element + "_" + $j.jQRTE.iconList[i] + '_btn" style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
            }
        }
    },
    setIcon: function(element) {
        for (var i = 0; i < $j.jQRTE.iconList.length; i++) {
            var checkpopup = ($j.jQRTE.iconList[i]).substr(0, 5);
            if (checkpopup == "popup") {
                var fn;
                var id = ($j.jQRTE.iconList[i]).substr(6);
                if (id == "bgcolor" || id == "forecolor") {
                    fn = "handle_color"
                } else {
                    fn = "handle_" + id
                }
                $j("#" + element + "_" + ($j.jQRTE.iconList[i]).substr(6)).html('<span id="' + element + "_" + $j.jQRTE.iconList[i].substr(6) + "_btn\" onclick='$j.jQRTE.jqp_c();$j.jQRTE." + fn + '("' + id + '","' + element + '");\' style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
                } else {
                $j("#" + element + "_" + $j.jQRTE.iconList[i]).html('<span id="' + element + "_" + $j.jQRTE.iconList[i] + '_btn" onclick=\'$j.jQRTE.setCommand("' + $j.jQRTE.iconList[i] + '",null,"' + element + '");\' style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
                }
        }
        $j("#" + element + "_fontsize").change(function() {
            $j.jQRTE.setCommand("fontsize", this.value, element);
            $j(this).val("")
            });
        $j("#" + element + "_fontname").change(function() {
            $j.jQRTE.setCommand("fontname", this.value, element);
            $j(this).val("")
            });
        $j("#" + element + "_formatblock").change(function() {
            $j.jQRTE.setCommand("formatblock", this.value, element);
            $j(this).val("")
            })
        },
    setContent: function(element) {
        var rid = element.split("_");
        var textid = "";
        for (var i = 0; i < rid.length - 1; i++) {
            textid += "_" + rid[i]
            }
        textid = textid.substr(1);
        var content = $j("#" + textid).text();
        if (content != "") {
            document.getElementById(element).contentWindow.document.open();
            document.getElementById(element).contentWindow.document.write(content);
            document.getElementById(element).contentWindow.document.close()
            }
    },
    setCommand: function(id, value, element) {
        $j.jQRTE.restoreRange(element);
        document.getElementById(element).contentWindow.document.execCommand(id, false, value);
        $j.jQRTE.restoreRange(element);
        var box = element.split("_");
        var textid = "";
        for (var i = 0; i < box.length - 1; i++) {
            textid += "_" + box[i]
            }
        textid = textid.substr(1);
        $j("#" + textid).text(document.getElementById(element).contentWindow.document.body.innerHTML)
        },
    jqp_o: function(id, element, btn_id) {
        $j.jQRTE.boxy[id] = id;
        $j("#" + id).jqpopup_open(element + "_" + btn_id + "_btn");
        $j.jQRTE.element = element
    },
    jqp_c: function() {
        $j.each($j.jQRTE.boxy, function() {
            $j("#" + this).jqpopup_close()
            });
        $j.jQRTE.boxy = {}
    },
    handle_color: function(id, element) {
        var rid = id;
        if (id == "bgcolor" && navigator.userAgent.indexOf("MSIE") != -1) {
            rid = "backColor"
        } else {
            if (id == "bgcolor") {
                rid = "hiliteColor"
            }
        }
        $j.jQRTE.jqp_o("color_div", element, id);
        if (id == "bgcolor") {
            if ($j.jQRTE.backcolorList[element] == null) {
                $j.jQRTE.backcolorList[element] = $j.jQRTE.backcolor
            }
            $j("#color_value").jqcp_setColor($j.jQRTE.backcolorList[element])
            } else {
            if (id == "forecolor") {
                if ($j.jQRTE.forecolorList[element] == null) {
                    $j.jQRTE.forecolorList[element] = $j.jQRTE.forecolor
                }
                $j("#color_value").jqcp_setColor($j.jQRTE.forecolorList[element])
                }
        }
        $j("#color_btn").unbind("click");
        $j("#color_btn").bind("click", function() {
            if (rid == "backColor" || rid == "hiliteColor") {
                $j.jQRTE.backcolorList[element] = $j("#color_value").val()
                } else {
                $j.jQRTE.forecolorList[element] = $j("#color_value").val()
                }
            $j.jQRTE.setCommand(rid, $j("#color_value").val(), element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_character: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j(".character").unbind("click");
        $j(".character").bind("click", function() {
            $j.jQRTE.htmlHandler(this.id.toString(), element);
            var box = element.split("_");
            var textid = "";
            for (var i = 0; i < box.length - 1; i++) {
                textid += "_" + box[i]
                }
            textid = textid.substr(1);
            checkTextAreaLen(document.getElementById(textid));
            $j.jQRTE.jqp_c()
            })
        },
    handle_emotion: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j(".emoticon").unbind("click");
        $j(".emoticon").bind("click", function() {
            var str = '<img src="' + this.src + '" title="' + this.title + '"/>';
            $j.jQRTE.htmlHandler(str, element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_html: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        if (navigator.userAgent.indexOf("MSIE") != -1) {
            $j("#html_content").text(document.getElementById(element).contentWindow.document.body.innerHTML)
            } else {
            $j("#html_content").val(document.getElementById(element).contentWindow.document.body.innerHTML)
            }
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            var rid = element.split("_");
            var textid = "";
            for (var i = 0; i < rid.length - 1; i++) {
                textid += "_" + rid[i]
                }
            textid = textid.substr(1);
            if (navigator.userAgent.indexOf("MSIE") != -1) {
                $j("#" + textid).text($j("#html_content").text())
                } else {
                $j("#" + textid).text($j("#html_content").val())
                }
            if (navigator.userAgent.indexOf("MSIE") != -1) {
                $j(document.getElementById(element).contentWindow.document.body).html($j("#html_content").text())
                } else {
                var content = $j("#html_content").val();
                $j(document.getElementById(element).contentWindow.document.body).html("<pre>" + content + "</pre>")
                }
            $j.jQRTE.jqp_c()
            })
        },
    handle_addimage: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            var str = " <img";
            str += ' src="' + $j("#addimage_url").val() + '"';
            str += ' title="' + $j("#addimage_desc").val() + '"';
            str += ' align="' + $j("#addimage_alignment").val() + '"';
            str += ' border="' + $j("#addimage_border").val() + '"';
            str += "/>";
            $j.jQRTE.htmlHandler(str, element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_addlink: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#addlink_url").val('');
        $j("#addlink_name").val('');

        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {

            if (isValidUrl( $j("#addlink_url").val())){
                var str = '<a href="' + $j("#addlink_url").val() + '"';
                str += ' target="' + $j("#addlink_target").val() + '"';
                str += ">";
                str += $j("#addlink_name").val();
                str += "</a>";
                $j.jQRTE.htmlHandler(str, element);
                var box = element.split("_");
                var textid = "";
                for (var i = 0; i < box.length - 1; i++) {
                    textid += "_" + box[i]
                    }
                textid = textid.substr(1);
                checkTextAreaLen(document.getElementById(textid));
                $j.jQRTE.jqp_c()
            }
            else{
                $j('#addlink_div_pc #addlink_div #addlink_error #errorMessage').html('Please enter a valid URL. ie http://www.example.com');
                $j('#addlink_div_pc #addlink_div #addlink_error').show();
                window.setTimeout( function(){ $j('#addlink_div_pc #addlink_div #addlink_error').fadeOut() }, 4000 );
                return false;
            }
        })
    },
    handle_copyright: function(id, element) {
        window.open("http://www.jqframework.com/", "_new")
        },
    handle_addtable: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            var str = "<table";
            str += ' cellpadding="' + $j("#addtable_cellpadding").val() + '"';
            str += ' cellspacing="' + $j("#addtable_cellspacing").val() + '"';
            str += ' width="' + $j("#addtable_width").val() + $j("#addtable_width_format").val() + '"';
            str += ' border="' + $j("#addtable_border").val() + '"';
            str += ' align="' + $j("#addtable_alignment").val() + '"';
            str += ">";
            for (var i = 0; i < $j("#addtable_row").val(); i++) {
                str += "<tr>";
                for (var j = 0; j < $j("#addtable_column").val(); j++) {
                    str += "<td>&nbsp;</td>"
                }
                str += "</tr>"
            }
            str += "</table>";
            $j.jQRTE.htmlHandler(str, element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_uploadimage: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        if (typeof resetUploadImageInputTypeFile == 'function')
            resetUploadImageInputTypeFile();
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            $j.jQRTE.uploads("image", element)
            })
        },
    handle_uploadimageReturn: function(element, uniqid, imageSrc ) {
        var str = " <img";
        str += ' src="' + $j("#uploadimage_url").val() + '"';
        str += ' id="' + uniqid + '"';
        str += ' longdesc="' + imageSrc + '"';
        str += ' title="' + $j("#uploadimage_desc").val() + '"';
        str += ' align="' + $j("#uploadimage_alignment").val() + '"';
        str += ' border="' + $j("#uploadimage_border").val() + '"';
        str += "/>";
        $j.jQRTE.htmlHandler(str, element);
        $j.jQRTE.jqp_c()
        },
    handle_uploadfile: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            $j.jQRTE.uploads("file", element)
            })
        },
    handle_uploadfileReturn: function(element) {
        var str = '<a href="' + $j("#uploadfile_url").val() + '"><img';
        str += ' src="images/attachment.gif"';
        str += ' title="' + $j("#uploadfile_name").val() + '"';
        str += ' border="0"/>';
        str += $j("#uploadfile_name").val();
        str += "</a>";
        $j.jQRTE.htmlHandler(str, element);
        $j.jQRTE.jqp_c()
        },
    htmlHandler: function(html_content, element) {
        $j.jQRTE.restoreRange(element);
        if (navigator.userAgent.indexOf("MSIE") != -1) {
            document.getElementById(element).contentWindow.document.selection.createRange().pasteHTML(html_content)
        }
        else {
            var success = false;
            try {
                document.getElementById(element).contentWindow.document.execCommand("insertHTML", false, html_content);
                success = true
            }
            catch(e) {}
            if (!success) {
                try {
                    document.getElementById(element).contentWindow.document.execCommand("insertText", false, html_content)
                }
                catch(e) {}
            }
        }
        $j.jQRTE.restoreRange(element);
        var box = element.split("_");
        var textid = "";
        for (var i = 0; i < box.length - 1; i++) {
            textid += "_" + box[i]
            }
        textid = textid.substr(1);
        $j("#" + textid).text(document.getElementById(element).contentWindow.document.body.innerHTML)
        },
    uploads: function(fname, element) {
        var uid = fname.toLowerCase();

        var url = "/image/uploadimage";

        if ( fname == "image"){
            var inputTypeFile = $j('#uploadimage_div_pc #uploadimage_div #uploadimage_fileToUpload');
            var isThereAFile = ( (typeof inputTypeFile.val() == "undefined") || (inputTypeFile.val() == '' )) ? 'false' : 'true';

            if (isThereAFile == 'false'){
                $j('#uploadimage_div_pc #uploadimage_div #uploadimage_error').html('Please select an image');
                $j('#uploadimage_div_pc #uploadimage_div #uploadimage_error').show();
                window.setTimeout( function(){ $j('#uploadimage_div_pc #uploadimage_div #uploadimage_error').fadeOut() }, 4000 );
                return false;
            }
            var categoryLevel2Id = $j('#categoryLevel2Id').val(); // for questions
            var questionId = $j('#question-list #answerFormQuestionId').val(); // for answers

            var box = element.split("_");
            var textid = "";
            for (var i = 0; i < box.length - 1; i++) {
                textid += "_" + box[i]
                }
            imageType = textid.substr(1);

            url = url + '?isThereAFile=' + isThereAFile + '&imageType=' + imageType + '&categoryLevel2Id=' + categoryLevel2Id + '&questionId=' + questionId;
        }

        $j.blockUI({ css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .5,
            color: '#fff'
        } });

        $j.jQRTE.ajaxFileUpload({
            url: url,
            secureuri: false,
            fileElementId: "upload" + uid + "_fileToUpload",
            dataType: "json",
            success: function(data, status) {
                $j.unblockUI({
                    onUnblock: function(){
                        if (typeof(data.error) != "undefined") {
                            if (data.error.value != "") {
                                if ( document.getElementById('uploadFileError') ){
                                    $j.facebox(document.getElementById('uploadFileError').innerHTML);
                                    $j('#facebox .body').css({'width':'335px' });
                                    $j('#facebox .footer').css({'width':'335px' });
                                    $j('#facebox').css({'left':($j(window).width() - $j('#facebox').width()) / 2})
                                }
                            } else {

                                var imageSrc = data.imagepath.value;
                                if (data.uploadingImage.value == "true"){
                                    imageSrc = "/images/ajax-loader.gif";
                                }

                                var uniqid = data.uniqid.value;

                                $j("#upload" + uid + "_url").val(imageSrc);
                                eval("$j.jQRTE.handle_upload" + fname + "Return('" + element + "', '" + uniqid + "','" + data.imagepath.value + "' );");

                                if (data.uploadingImage.value == "true"){
                                    window.setTimeout( function (){ requestQuestionAnswerImage( data.imagepath.value, imageType, uniqid);}, 15000);
                                }
                            }
                        }
                    }
                });
            },
            error: function(data, status, e) {
                $j.unblockUI({
                    onUnblock: function(){
                        if ( document.getElementById('uploadFileErrorPlugin') ){
                            $j.facebox(document.getElementById('uploadFileErrorPlugin').innerHTML);
                            $j('#facebox .body').css({'width':'335px' });
                            $j('#facebox .footer').css({'width':'335px' });
                            $j('#facebox').css({'left':($j(window).width() - $j('#facebox').width()) / 2})
                        }
                    }
                });
            }
        });
        return false
    },
    uploadIframe: function(id, uri) {
        var frameId = "jUploadFrame" + id;
        if (window.ActiveXObject) {
            var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
            if (typeof uri == "boolean") {
                io.src = "javascript:false"
            } else {
                if (typeof uri == "string") {
                    io.src = uri
                }
            }
        } else {
            var io = document.createElement("iframe");
            io.id = frameId;
            io.name = frameId
        }
        io.style.position = "absolute";
        io.style.top = "-1000px";
        io.style.left = "-1000px";
        document.body.appendChild(io);
        return io
    },
    uploadForm: function(id, fileElementId) {
        var formId = "jUploadForm" + id;
        var fileId = "jUploadFile" + id;
        var form = $j('<form  action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
        var oldElement = $j("#" + fileElementId);
        var newElement = $j(oldElement).clone();
        $j(oldElement).attr("id", fileId);
        $j(oldElement).before(newElement);
        $j(oldElement).appendTo(form);
        $j(form).css("position", "absolute");
        $j(form).css("top", "-1200px");
        $j(form).css("left", "-1200px");
        $j(form).appendTo("body");
        return form
    },
    ajaxFileUpload: function(s) {
        s = $j.extend({}, $j.ajaxSettings, s);
        var id = new Date().getTime();
        var form = $j.jQRTE.uploadForm(id, s.fileElementId);
        var io = $j.jQRTE.uploadIframe(id, s.secureuri);
        var frameId = "jUploadFrame" + id;
        var formId = "jUploadForm" + id;
        if (s.global && !$j.active++) {
            $j.event.trigger("ajaxStart")
            }
        var requestDone = false;
        var xml = {};
        if (s.global) {
            $j.event.trigger("ajaxSend", [xml, s])
            }
        var uploadCallback = function(isTimeout) {
            var io = document.getElementById(frameId);
            try {
                if (io.contentWindow) {
                    xml.responseText = io.contentWindow.document.body ? io.contentWindow.document.body.innerHTML: null;
                    xml.responseXML = io.contentWindow.document.XMLDocument ? io.contentWindow.document.XMLDocument: io.contentWindow.document
                } else {
                    if (io.contentDocument) {
                        xml.responseText = io.contentDocument.document.body ? io.contentDocument.document.body.innerHTML: null;
                        xml.responseXML = io.contentDocument.document.XMLDocument ? io.contentDocument.document.XMLDocument: io.contentDocument.document
                    }
                }
            } catch(e) {
                $j.handleError(s, xml, null, e)
                }
            if (xml || isTimeout == "timeout") {
                requestDone = true;
                var status;
                try {
                    status = isTimeout != "timeout" ? "success": "error";
                    if (status != "error") {
                        var data = $j.jQRTE.uploadHttpData(xml, s.dataType);
                        if (s.success) {
                            s.success(data, status)
                            }
                        if (s.global) {
                            $j.event.trigger("ajaxSuccess", [xml, s])
                            }
                    } else {
                        $j.handleError(s, xml, status)
                        }
                } catch(e) {
                    status = "error";
                    $j.handleError(s, xml, status, e)
                    }
                if (s.global) {
                    $j.event.trigger("ajaxComplete", [xml, s])
                    }
                if (s.global && !--$j.active) {
                    $j.event.trigger("ajaxStop")
                    }
                if (s.complete) {
                    s.complete(xml, status)
                    }
                $j(io).unbind();
                setTimeout(function() {
                    try {
                        $j(io).remove();
                        $j(form).remove()
                        } catch(e) {
                        $j.handleError(s, xml, null, e)
                        }
                }, 100);
                xml = null
            }
        };
        if (s.timeout > 0) {
            setTimeout(function() {
                if (!requestDone) {
                    uploadCallback("timeout")
                    }
            }, s.timeout)
            }
        try {
            var form = $j("#" + formId);
            $j(form).attr("action", s.url);
            $j(form).attr("method", "POST");
            $j(form).attr("target", frameId);
            if (form.encoding) {
                form.encoding = "multipart/form-data"
            } else {
                form.enctype = "multipart/form-data"
            }
            $j(form).submit()
            } catch(e) {
            $j.handleError(s, xml, null, e)
            }
        if (window.attachEvent) {
            document.getElementById(frameId).attachEvent("onload", uploadCallback)
            } else {
            document.getElementById(frameId).addEventListener("load", uploadCallback, false)
            }
        return {
            abort: function() {}
        }
    },
    uploadHttpData: function(r, type) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML: r.responseText;
        if (type == "script") {
            $j.globalEval(data)
            }
        if (type == "json") {
            eval("data = " + data)
            }
        if (type == "html") {
            $j("<div>").html(data).evalScripts()
            }
        return data
    }
};
$j.fn.extend({
    jqrte: function() {
        return this.each(function() {
            $j.jQRTE.init(this.id)
            })
        },
    jqrte_setIconNotLoggedIn: function() {
        return this.each(function() {
            $j.jQRTE.setIconNotLoggedIn(this.id)
            })
        },
    jqrte_setIcon: function() {
        return this.each(function() {
            $j.jQRTE.setIcon(this.id)
            })
        },
    jqrte_setContent: function() {
        return this.each(function() {
            $j.jQRTE.setContent(this.id)
            })
        },
    jqpopup_close: function() {
        return this.each(function() {
            try {
                $j.jQRTE.restoreRange($j.jQRTE.element)
                } catch(e) {}
            $j.jQpopup.close(this.id)
            })
        }
});
function specialcharacter() {
    var cols = 15;
    var j = 0;
    var tablebox = '<table cellpadding="1" cellspacing="1" border="1">';

    tablebox += "<tr>"
    tablebox += '<td class="character" id="&#177;">&#177;</td>';
    tablebox += '<td class="character" id="&#8734;">&#8734;</td>';
    tablebox += '<td class="character" id="&#8800;">&#8800;</td>';
    tablebox += '<td class="character" id="&#126;">&#126;</td>';
    tablebox += '<td class="character" id="&#215;">&#215;</td>';
    tablebox += '<td class="character" id="&#247;">&#247;</td>';
    tablebox += '<td class="character" id="&#8804;">&#8804;</td>';
    tablebox += '<td class="character" id="&#8805;">&#8805;</td>';
    tablebox += '<td class="character" id="&#8723;">&#8723;</td>';
    tablebox += '<td class="character" id="&#8773;">&#8773;</td>';
    tablebox += '<td class="character" id="&#8706;">&#8706;</td>';
    tablebox += '<td class="character" id="&#8730;">&#8730;</td>';
    tablebox += '<td class="character" id="&#8594;">&#8594;</td>';
    tablebox += "</tr>"
    tablebox += "<tr>"
    tablebox += '<td class="character" id="&#8596;">&#8596;</td>';
    tablebox += '<td class="character" id="&#945;">&#945;</td>';
    tablebox += '<td class="character" id="&#946;">&#946;</td>';
    tablebox += '<td class="character" id="&#947;">&#947;</td>';
    tablebox += '<td class="character" id="&#948;">&#948;</td>';
    tablebox += '<td class="character" id="&#949;">&#949;</td>';
    tablebox += '<td class="character" id="&#952;">&#952;</td>';
    tablebox += '<td class="character" id="&#977;">&#977;</td>';
    tablebox += '<td class="character" id="&#956;">&#956;</td>';
    tablebox += '<td class="character" id="&#960;">&#960;</td>';
    tablebox += '<td class="character" id="&#961;">&#961;</td>';
    tablebox += '<td class="character" id="&#963;">&#963;</td>';
    tablebox += '<td class="character" id="&#964;">&#964;</td>';
    tablebox += "</tr>"
    tablebox += "<tr>"
    tablebox += '<td class="character" id="&#966;">&#966;</td>';
    tablebox += '<td class="character" id="&#969;">&#969;</td>';
    tablebox += '<td colspan="11">&nbsp;</td>';
    tablebox += "</tr>";
    tablebox += "</table>";
    $j("#character_div").html(tablebox)
    }

$j(document).ready(function() {
//    $j("#color_picker").jqcp();
//    $j("#color_value").jqcp_setObject();
    specialcharacter();
    $j(".jqrte_menu td").mouseover(function() {
        $j(this).toggleClass("jqrte_active")
        });
    $j(".jqrte_menu td").mouseout(function() {
        $j(this).toggleClass("jqrte_active")
        })
    });

$j("#color_picker").ready(function() {
 try{
        $j("#color_picker").jqcp();
        }catch(err) {}
});

$j("#color_value").ready(function() {
 try{
    $j("#color_value").jqcp_setObject();
    }catch(err) {}
});


/* AnswersQuestionRTE.js */
;function file_name_only(b){var a="/";if(b.match(/\\/)){a="\\"}sURL=b.substring(b.lastIndexOf(a)+1);return sURL}function htmlNumbers(d){var c=d;var b=new Array({num:"&#177;",name:RegExp(String.fromCharCode(177),"gi")},{num:"&#8734;",name:RegExp(String.fromCharCode(8734),"gi")},{num:"&#8800;",name:RegExp(String.fromCharCode(8800),"gi")},{num:"&#126;",name:RegExp(String.fromCharCode(126),"gi")},{num:"&#215;",name:RegExp(String.fromCharCode(215),"gi")},{num:"&#247;",name:RegExp(String.fromCharCode(247),"gi")},{num:"&#8804;",name:RegExp(String.fromCharCode(8804),"gi")},{num:"&#8805;",name:RegExp(String.fromCharCode(8805),"gi")},{num:"&#8723;",name:RegExp(String.fromCharCode(8723),"gi")},{num:"&#8773;",name:RegExp(String.fromCharCode(8773),"gi")},{num:"&#8706;",name:RegExp(String.fromCharCode(8706),"gi")},{num:"&#8730;",name:RegExp(String.fromCharCode(8730),"gi")},{num:"&#8594;",name:RegExp(String.fromCharCode(8594),"gi")},{num:"&#8596;",name:RegExp(String.fromCharCode(8596),"gi")},{num:"&#945;",name:RegExp(String.fromCharCode(945),"gi")},{num:"&#946;",name:RegExp(String.fromCharCode(946),"gi")},{num:"&#947;",name:RegExp(String.fromCharCode(947),"gi")},{num:"&#948;",name:RegExp(String.fromCharCode(948),"gi")},{num:"&#949;",name:RegExp(String.fromCharCode(949),"gi")},{num:"&#952;",name:RegExp(String.fromCharCode(952),"gi")},{num:"&#977;",name:RegExp(String.fromCharCode(977),"gi")},{num:"&#956;",name:RegExp(String.fromCharCode(956),"gi")},{num:"&#960;",name:RegExp(String.fromCharCode(960),"gi")},{num:"&#961;",name:RegExp(String.fromCharCode(961),"gi")},{num:"&#963;",name:RegExp(String.fromCharCode(963),"gi")},{num:"&#964;",name:RegExp(String.fromCharCode(964),"gi")},{num:"&#966;",name:RegExp(String.fromCharCode(966),"gi")},{num:"&#969;",name:RegExp(String.fromCharCode(969),"gi")},{num:"&#191;",name:RegExp(String.fromCharCode(191),"gi")});for(var a=0;a<b.length;a++){if(b[a].name.test(c)){c=c.replace(b[a].name,b[a].num)}}return c}function get_ents(c){var a=document.createElement("pre");var b=c.replace(/\&nbsp\;/gi,"\u00a0");b=document.createTextNode(b);a.appendChild(b);if(a.firstChild==null){return""}else{return a.firstChild.nodeValue}}function checkTextAreaLen(e){var c=e.name;if(c=="question"){var f=$j("#questionCounter");var k=$j("#questionCharactersText");var l=$j("#errorProfanityDescription");l.css({display:"none"});var p=$j("#image-upload-containerQuestion");var j=$j("#image-uploaded-containerQuestion");var d=QUESTION_MAX_CHARACTER_COUNTER}else{if(c=="answer"){var f=$j("#answerCounter");var k=$j("#answerCharactersText");var l=$j("#errorProfanityAnswer");l.html("&nbsp;");l.css({display:"none"});var p=$j("#image-upload-containerAnswer");var j=$j("#image-uploaded-containerAnswer");var d=ANSWER_MAX_CHARACTER_COUNTER}else{if(c="questionDetails"){var f=$j("#questionDetailsCounter");var k=$j("#questionDetailsCharactersText");var l=$j("#errorProfanityDetails");l.css({display:"none"});var d=QUESTIONDETAIL_MAX_CHARACTER_COUNTER}}}var b=$j("#"+c).text();if(BrowserDetect.browser=="Explorer"){var q=new RegExp(String.fromCharCode(13)+String.fromCharCode(10),"gi");b=b.replace(q,"<br><br>");q=/^<p>\&nbsp\;<\/p><br\/?><br\/?><p>\&nbsp\;<\/p>$/i;if(q.test(b)){b="<br><br>"}else{q=/^(<p>\&nbsp\;<\/p><br\/?><br\/?>)+<p>\&nbsp\;<\/p>$/i;if(q.test(b)){b=b.replace(/<p>\&nbsp\;<\/p>$/i,"");b=b.replace(/<br\/?>/gi,"")}else{q=/<br\/?><br\/?><p>\&nbsp\;<\/p>$/i;if(q.test(b)){b=b.replace(q,"<p>&nbsp;</p>")}b=b.replace(/<br\/?><br\/?>/gi,"&nbsp;")}}}var n=b;var h=/^<br\/?><br\/?>$/i;if(h.test(n)){n=n.replace(/<br\/?><br\/?>/gi,"&nbsp;")}else{h=/<br\/?>$/i;if(h.test(n)){n=n.replace(h,"")}h=/<br\/?>/gi;if(h.test(n)){n=n.replace(h,"&nbsp;")}}var g=stripHTML(n);var o=get_ents(g);if(BrowserDetect.browser=="Explorer"){h=/^<p>\&nbsp\;<\/p>$/i;if(h.test(b)){o="";if(c=="question"){$j("#question_rte").contents().find("body").html("")}else{if(c=="answer"){$j("#answer_rte").contents().find("body").html("")}}}}var m=d-o.length;var a=m;if(m<0){f.css({color:"f00"});k.css({color:"#f00"})}else{f.css({color:"#666"});k.css({color:"#666"})}if(a>=0){f.html(a);k.html("&nbsp;characters");if((typeof imageUploadContainerWasVisible!="undefined")&&imageUploadContainerWasVisible){imageUploadContainerWasVisible=false;p.show()}if((typeof imageUploadedContainerWasVisible!="undefined")&&imageUploadedContainerWasVisible){imageUploadedContainerWasVisible=false;j.show()}}else{f.html("");if((typeof p!="undefined")&&p.is(":visible")){imageUploadContainerWasVisible=true;p.hide()}if((typeof j!="undefined")&&j.is(":visible")){imageUploadedContainerWasVisible=true;j.hide()}k.html("You exceeded the limit of characters by "+Math.abs(a))}}function containsImgTag(c){var d=/<\S[^><]*>/g;var b=c.match(d);if(b!=null){for(i=0;i<b.length;i++){var a=b[i];a=a.toLowerCase();if(a.indexOf("<img")>=0){return true}}}return false}function closeRTEPopups(){$j.jQRTE.jqp_c()}function validateRTEContent(f,b,g,j){var e=$j("#"+f).text();e=$j.trim(e);var l=e;if(BrowserDetect.browser=="Explorer"){var m=new RegExp(String.fromCharCode(13)+String.fromCharCode(10),"gi");l=l.replace(m,"<br>")}l=stripHTML(l);l=get_ents(l);l=$j.trim(l);var a=false;if(e.length>b){$j("#counter-button-container img").css("cursor","pointer");if(document.getElementById("unableToSubmit")){$j.facebox(document.getElementById("unableToSubmit").innerHTML);$j("#facebox .body").css({width:"335px"});$j("#facebox .footer").css({width:"335px"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}return false}containsImgTagB=false;if(l.length==0){if(containsImgTag(e)){containsImgTagB=true}}var d=isEmpty(l);if((l.length>g)||((l.length==0)&&!containsImgTagB&&!j)||(d&&!containsImgTagB&&!j)){if(l.length==0||d){var c=$j("#"+f+"Counter");var h=$j("#"+f+"CharactersText");var k=$j("#errorProfanityDescription");c.html("");h.html($j("#"+f+"EmptyMessage").text());h.css({color:"#f00"});k.css({display:"none"})}$j("#counter-button-container img").css("cursor","pointer");return false}return true}function setSrcImageValue(b){var a=$j("#"+b).text();a=$j.trim(a);$j("#auxDiv").html(a);$j("#auxDiv img").each(function(){var c=file_name_only(new String($j(this).attr("src")));if($j(this).attr("longdesc")!=""){$j(this).attr("src",$j(this).attr("longdesc"))}});a=$j("#auxDiv").html();$j("#auxDiv").html("");return a}function loadAgainImage(a){a.attr("src","/images/ajax-loader.gif");window.setTimeout(function(){a.attr("src",a.attr("longdesc"))},15000)}function requestQuestionAnswerImage(f,b,d){var a="/image/imageIsReady";var c=file_name_only(new String(f));var e={imageSrc:f,imageSrcFilename:c,type:b};goAjax(a,e,function(g){afterRequestQuestionAnswerImage(g,f,b,d)})}function afterRequestQuestionAnswerImage(data,imageSrc,type,uniqid){var response=eval("("+data+")");if(response.imageReady=="true"){$j("#"+type+"_rte").contents().find("body #"+uniqid).attr("src",imageSrc);$j("#"+type+"_rte").contents().trigger("keyup")}else{window.setTimeout(function(){requestQuestionAnswerImage(imageSrc,type)},15000)}}function enableRteAfterLogin(a,d,c,b){$j("#"+a+"-label-container #"+a+"-label").fadeOut("slow",function(){var e="";if(c){if(b){e="Question? "}e+="Write it here: ("}e+='<span id="'+a+'Counter">'+d+'</span><span id="'+a+'CharactersText"> characters</span>';if(c){e+=")"}$j("#"+a+"-label-container #"+a+"-label").html(e);$j("#"+a+"-label-container #"+a+"-label").fadeIn()});$j("#"+a+"_jqrte_body .jqrte_rte_div textarea").fadeOut("slow",function(){$j("#"+a+"_jqrte_body .jqrte_rte_div textarea").hide();$j("#"+a+"_rte").show();$j("#"+a+"_rte").jqrte_setIcon();$j("#"+a+"_rte").jqrte_setContent();$j("#"+a+"_rte").jqrte();$j("#"+a+"_rte").contents().trigger("keyup");$j("#"+a+"_jqrte_body .jqrte_menu_div table td").css({cursor:"pointer"})});$j("#"+a+"_jqrte_body .jqrte_menu_div .jqrte_menu td").unbind()}function setEventHandlerQuestionW3C(){$j(document.getElementById("question_rte").contentWindow.document).bind("cut click",function(a){setTimeout("updateTextArea('question')",100)});$j(document.getElementById("question_rte").contentWindow.document).bind("paste",function(a){setTimeout("updateTextAreaAfterPaste('question')",100)})}function setEventHandlerQuestionDetailsW3C(){$j(document.getElementById("questionDetails_rte").contentWindow.document).bind("cut click",function(a){setTimeout("updateTextArea('questionDetails')",100)});$j(document.getElementById("questionDetails_rte").contentWindow.document).bind("paste",function(a){setTimeout("updateTextAreaAfterPaste('questionDetails')",100)})}function setEventHandlerAnswerW3C(){$j(document.getElementById("answer_rte").contentWindow.document).bind("cut click",function(a){setTimeout("updateTextArea('answer')",100)});$j(document.getElementById("answer_rte").contentWindow.document).bind("paste",function(a){setTimeout("updateTextAreaAfterPaste('answer')",100)})}function setEventHandlerQuestionIE(){if(document.getElementById("question_rte").contentWindow.document.body.onpaste==null){document.getElementById("question_rte").contentWindow.document.body.onpaste=function(a){setTimeout("updateTextAreaAfterPaste('question')",100)}}if(document.getElementById("question_rte").contentWindow.document.body.oncut==null){document.getElementById("question_rte").contentWindow.document.body.oncut=function(a){setTimeout("updateTextArea('question')",100)}}}function setEventHandlerQuestionDetailsIE(){if(document.getElementById("questionDetails_rte").contentWindow.document.body.onpaste==null){document.getElementById("questionDetails_rte").contentWindow.document.body.onpaste=function(a){setTimeout("updateTextAreaAfterPaste('questionDetails')",100)}}if(document.getElementById("questionDetails_rte").contentWindow.document.body.oncut==null){document.getElementById("questionDetails_rte").contentWindow.document.body.oncut=function(a){setTimeout("updateTextArea('questionDetails')",100)}}}function setEventHandlerAnswerIE(){if(document.getElementById("answer_rte").contentWindow.document.body.onpaste==null){document.getElementById("answer_rte").contentWindow.document.body.onpaste=function(a){setTimeout("updateTextAreaAfterPaste('answer')",100)}}if(document.getElementById("answer_rte").contentWindow.document.body.oncut==null){document.getElementById("answer_rte").contentWindow.document.body.oncut=function(a){setTimeout("updateTextArea('answer')",100)}}}function updateTextArea(a){$j("#"+a+"_rte").contents().trigger("keyup")}function updateTextAreaAfterPaste(g){var c=$j("#"+g).text();$j("#"+g+"_rte").contents().trigger("keyup");var k=$j("#"+g).text();var f=/^<br\/?>$/i;if(!f.test(c)){f=/<br\/?>$/i;if(f.test(c)){c=c.replace(f,"")}}var d=k;var j=k.indexOf(c);if(j!=-1){d=k.substring(j+c.length)}var b=stripHTML(d);b=b.replace(/\&nbsp\;/gi," ");b=trim(b);var a="";if(j!=-1){a=c+b}else{a=b}try{document.getElementById(g+"_rte").contentWindow.document.body.innerHTML=a}catch(h){}$j("#"+g+"_rte").contents().trigger("keyup")};
