function _doPost(sElementId,sValue,sSortAction,sFormId,sFormAction,bMustSelect,sConfirm){if(bMustSelect==true&&_getFirstCheckedRow()==""){alert("Please select item for execute!");return void(0)}if(sConfirm!=null){if(confirm(sConfirm)==false){return void(0)}}if(sElementId!=null||sValue!=null)$("#"+sElementId).val(sValue);if(sSortAction!=null)$("#"+sSortAction).val(1);if(sFormId==null)sFormId="frmSearch";if(sFormAction!=null)$("#"+sFormId).attr('action',sFormAction);$("#"+sFormId).submit();return true}function _doRedirect(sUrl){if(_getFirstCheckedRow()==false){alert("Please select one item!");return void(0)}else{document.location.href=sUrl;return true}}function _goRedirect(sUrl){document.location.href=sUrl;return true}function _getSingleCheckedRow(sCheckBoxName){if(sCheckBoxName==null)sCheckBoxName='uIdRow';var sReturnValue=false;var aValue=new Array("");var nCounter=0;$("input[name='"+sCheckBoxName+"[]']:checked").each(function(){aValue[nCounter]=$(this).val();nCounter++});if(nCounter==1){sReturnValue=aValue[0]}else{sReturnValue=false}return sReturnValue}function _getCheckedRowValue(sCheckBoxName,sValue,sElIdForReturn){if(!sCheckBoxName)sCheckBoxName='uIdRow';var nCounter=0;var nIndex=0;var sReturnValue=false;$("input[name='"+sCheckBoxName+"[]']").each(function(){if($(this).val()==sValue){nIndex=nCounter;sReturnValue=$("#"+sElIdForReturn+nIndex).val()}nCounter++});return sReturnValue}function _getFirstCheckedRow(){var aValue=new Array("");var nCounter=0;$("input[name='uIdRow[]']:checked").each(function(){aValue[nCounter]=$(this).val();nCounter++});return aValue[0]}function _getLastCheckedRow(sCheckBoxName){var aValue2=new Array("");var nCounter2=0;$("input[name='"+sCheckBoxName+"[]']:checked").each(function(){aValue2[nCounter2]=$(this).val();nCounter2++});return aValue2[nCounter2]}function _setAllChecked(sParam,sCheckBoxName){if(!sCheckBoxName)sCheckBoxName='uIdRow';if(sParam.checked==true)$("input[name='"+sCheckBoxName+"[]']").attr('checked',true);else $("input[name='"+sCheckBoxName+"[]']").attr('checked',false)}function _setAllUnchecked(sCheckBoxName){if(!sCheckBoxName)sCheckBoxName='uIdRow';$("input[name='"+sCheckBoxName+"[]']").attr('checked',false)}function Confirm(url,name,message){var messages="Are You Sure Want to Delete";if(message!=null)messages=message;var where_to=confirm(messages+" "+name+"?");if(where_to==true){window.location=url}}function ConfirmEdit(url,name){window.location=url}function setShowHideObject(objShow,objHide,aObjEmpty){if(objShow!='')$('#'+objShow).attr('class','obj_display');if(objHide!='')$('#'+objHide).attr('class','obj_hidden');if(aObjEmpty!=''){strtemp=aObjEmpty.substring(1,aObjEmpty.length-1);aTemp=strtemp.split(',');ncount=aTemp.length;var obj='';var n=0;for(n;n<ncount;n++){obj=aTemp[n];$('#'+obj).val('')}}}function check_file(file,suffixadd){str=$(file).val().toUpperCase();suffix=".JPG";suffix2=".JPEG";suffix3=".SWF";var sErr='';if(!(str.indexOf(suffix,str.length-suffix.length)!==-1||str.indexOf(suffix2,str.length-suffix2.length)!==-1||str.indexOf(suffix3,str.length-suffix3.length)!==-1)){sErr='Format File tidak diberbolehkan,\nUpload hanya format JPG :foto.jpg, foto.jpeg';if(suffixadd=='swf')sErr=sErr+', file.swf';$(file).val('')}if(sErr!='')alert(sErr)}
