$(document).ready(function(){$("code").each(function(){eval($(this).html())})});var prevGridRowClass;function changeCssOnMouseover(A,B){prevGridRowClass=document.getElementById(A).className;document.getElementById(A).className=B}function changeCssOnMouseout(A,B){document.getElementById(A).className=B}function validateFormOnSubmit(F){var B="TR_"+F;var A=document.getElementById(B);var D=A.getElementsByTagName("INPUT");errorTextToDisplay="";for(var C=0;C<D.length;C++){if(D[C].getAttribute("error_text")!=null){curVal=document.getElementById(D[C].name).value;columnId=D[C].name;errorText=D[C].getAttribute("error_text");if(errorText==""||errorText==null){errorTextArray="";errorText=""}else{myRegArray=errorText.split("~");errorTextArray=myRegArray[0].split("#");errorText=myRegArray[1].split("#")}for(myRegCount=0;myRegCount<errorTextArray.length;myRegCount++){if("isEmpty"==errorTextArray[myRegCount]){message=isBlank(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isBlank"==errorTextArray[myRegCount]){message=isBlank(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isCharacter"==errorTextArray[myRegCount]){message=isCharacter(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("ischeckboxConfirm"==errorTextArray[myRegCount]){message=ischeckboxConfirm(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isSpecialCharacter"==errorTextArray[myRegCount]){message=isSpecialCharacter(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isFirstCharBlank"==errorTextArray[myRegCount]){message=isFirstCharBlank(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isNumeric"==errorTextArray[myRegCount]){message=isNumeric(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isEmail"==errorTextArray[myRegCount]){message=isEmail(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isDecimal"==errorTextArray[myRegCount]){message=isDecimal(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isDate"==errorTextArray[myRegCount]){message=isDate(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("isPhonrNumber"==errorTextArray[myRegCount]){message=isPhonrNumber(columnId,errorText[myRegCount]);if(message!=""){errorTextToDisplay+=errorText[myRegCount]+"\n"}}if("FirstChar"==errorTextArray[myRegCount]){var E=curVal.charAt(0);if(E==" "){errorTextToDisplay+=errorText[myRegCount]+"\n"}}}}}if(errorTextToDisplay!=""){alert(errorTextToDisplay);return false}return true}function validateFormOnChange(C,A){errorTextToDisplay="";if(A==""||A==null){errorTextArray="";A=""}else{myRegArray=A.split("~");errorTextArray=myRegArray[0].split("#");A=myRegArray[1].split("#")}curVal=document.getElementById(C).value;for(myRegCount=0;myRegCount<errorTextArray.length;myRegCount++){if("isEmpty"==errorTextArray[myRegCount]){message=isBlank(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isBlank"==errorTextArray[myRegCount]){message=isBlank(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isCharacter"==errorTextArray[myRegCount]){message=isCharacter(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("ischeckboxConfirm"==errorTextArray[myRegCount]){message=ischeckboxConfirm(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isSpecialCharacter"==errorTextArray[myRegCount]){message=isSpecialCharacter(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isFirstCharBlank"==errorTextArray[myRegCount]){message=isFirstCharBlank(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isNumeric"==errorTextArray[myRegCount]){message=isNumeric(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isEmail"==errorTextArray[myRegCount]){message=isEmail(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isDecimal"==errorTextArray[myRegCount]){message=isDecimal(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isDate"==errorTextArray[myRegCount]){message=isDate(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("isPhonrNumber"==errorTextArray[myRegCount]){message=isPhonrNumber(C,A[myRegCount]);if(message!=""){errorTextToDisplay+=A[myRegCount]+"\n"}}if("FirstChar"==errorTextArray[myRegCount]){var B=curVal.charAt(0);if(B==" "){errorTextToDisplay+=A[myRegCount]+"\n"}}}if(errorTextToDisplay!=""){alert(errorTextToDisplay);return false}return true}function download(J,L,D,C,K,G,E,F,I,H,A,B){document.getElementById("downloadType").value=J;$.post(HOST_ROOT_PATH_VAR+"code/Plugin/GirdList/gridAjax.php",{"downloadType":J,"id":D,"query":C,"formName":L,"queryLimit":K,"paginationQuery":G,"paginationType":E,"isMultiLevelGridAllowed":F,"multiLevelGridUrl":I,"sortByColumnNameGridList":H,"sortOrderGridList":A},getAjaxData,"json")}function getAjaxData(B,A){if(B.success==1){document.getElementById("downloadGridHtml").value=B.gridHtml;document.getElementById(B.formName).submit();document.getElementById("downloadType").value=""}}function getGridDataByAjax(B,A){if(B.success==1){document.getElementById("div"+B.gridName+B.gridId).innerHTML=B.gridHtml;document.getElementById("pagination"+B.gridName+B.gridId).innerHTML=B.paginationHtml}}function gridListActionPlugin(actionMode,actionParameterHFID,rowId,gridName,formName,gridId,gridQuery,queryLimit,paginationQuery,paginationType,isMultiLevelGridAllowed,multiLevelGridUrl,sortByColumnNameGridList,sortOrderGridList,gridManualHeader){$("#gridManualHeader").attr("gridManualHeader",gridManualHeader);var answer=true;if(actionMode=="A"){}if(actionMode=="U"){answer=validateFormOnSubmit(rowId);var modifyColumnArray=document.getElementsByName("columnNameid[]");var gridListModifyParameterArray=new Array(10);var gridListModifyString="";for(var countArray=0;countArray<modifyColumnArray.length;countArray++){gridListModifyParameterArray[countArray]=new Array(2);gridListModifyParameterArray[countArray][0]=modifyColumnArray[countArray].value;gridListModifyParameterArray[countArray][1]=document.getElementById(gridName+"Modify"+modifyColumnArray[countArray].value+rowId).value;gridListModifyString+="~!@#"+gridListModifyParameterArray[countArray][0]+"~!@#"+gridListModifyParameterArray[countArray][1]}}var gridListActionParameterArray=new Array(10);var columnNameArray=document.getElementById(actionParameterHFID).value;var columnName=columnNameArray.split(",");for(var count=0;count<columnName.length;count++){gridListActionParameterArray[count]=new Array(2);gridListActionParameterArray[count][0]=columnName[count];gridListActionParameterArray[count][1]=document.getElementById(gridName+columnName[count]+"Row"+rowId).value}var paginationCurrentPage="";var linksPageSet="";var linksToDisplayPagination="";var recordsPerPage="";if(document.getElementById("paginationCurrentPage"+gridId)){paginationCurrentPage=document.getElementById("paginationCurrentPage"+gridId).value}if(document.getElementById("linksPageSet"+gridId)){linksPageSet=document.getElementById("linksPageSet"+gridId).value}if(document.getElementById("linksToDisplayPagination"+gridId)){linksToDisplayPagination=document.getElementById("linksToDisplayPagination"+gridId).value}if(document.getElementById("recordsPerPage"+gridId)){recordsPerPage=document.getElementById("recordsPerPage"+gridId).value}if(answer){eval(gridName+"Action(actionMode, gridListActionParameterArray,gridListModifyString);");$.post(HOST_ROOT_PATH_VAR+"code/Plugin/GirdList/gridAjax.php",{"id":gridId,"query":gridQuery,"formName":formName,"queryLimit":queryLimit,"paginationQuery":paginationQuery,"paginationType":paginationType,"isMultiLevelGridAllowed":isMultiLevelGridAllowed,"multiLevelGridUrl":multiLevelGridUrl,"sortByColumnNameGridList":sortByColumnNameGridList,"sortOrderGridList":sortOrderGridList,"paginationCurrentPage":paginationCurrentPage,"linksPageSet":linksPageSet,"linksToDisplayPagination":linksToDisplayPagination,"recordsPerPage":recordsPerPage,"gridManualHeader":gridManualHeader},getGridDataByAjax,"json")}}function sortByColumn(columnName,formName){document.getElementById("sortByColumnNameGridList").value=columnName;if(formName=="displayLiveChallengeForm"){document.getElementById(formName).action=HOST_ROOT_PATH_VAR+"live-think-tank/#"+columnName}eval("document.getElementById('"+formName+"').submit();")}function switchMenu(A,B){if((document.getElementById(A).src)==HOST_ROOT_PATH_VAR+"images/plus_img.gif"){document.getElementById(A).src=HOST_ROOT_PATH_VAR+"images/minus_img.gif";document.getElementById(B).style.display="block"}else{document.getElementById(A).src=HOST_ROOT_PATH_VAR+"images/plus_img.gif";document.getElementById(B).style.display="none"}}
