﻿var chrLft="{0} characters left.";var saveEdits="Save";function hltTxt(b,a){b.css("color","#f00");b.animate({color:"#999"},a)}$(function(){hltTxt($("#cmtQuesTitle"),3000);$("#QuesTitle").focus(function(){hltTxt($("#cmtQuesTitle"),900)});$("#QuesDetail").focus(function(){hltTxt($("#cmtQuesDetail"),900)});$("#QuesTitle").lc(100,chrLft);$("#frmMain .selCat").click(function(){var b="#"+this.name;var c=$(b+" :selected").text();$(b).nextAll().hide();var a=this.value;if(c.indexOf(">")>-1){$(b).after('<div class="loadingCat"></div>');$.get("/core/catlist?pid="+this.value,function(d){$(b).next("div").remove();$(b).next("select").html(d).show()})}$(b).parent().next(".errMsg").remove();$("#boxCatSelected span").html(c.replace(" >",""));$("#boxCatSelected").css({"line-height":"33px",visibility:"visible"});$("#CatId").attr("value",a)});if($("#QuesId").val()!="0"){$("label[for=Cat1]").hide();$("#boxCatSelected").css({"line-height":"33px",visibility:"visible"});$("#btnSubmit").val(saveEdits)}else{$("#Cat1").show()}$("#btnChange").click(function(){$("label[for=Cat1]").show();$("#Cat1").show();return false})});