function check(obj1,obj2,obj3,obj4,obj5,obj6)
{
var value1 =document.getElementById(obj1);
var value2 =parseInt(obj2);
var drpgrade=document.getElementById("grade");
var drpgrade1=document.getElementById("grade1");
if(parseInt(value1.value))
{
var mark_scored= 0,mark_total = 0,mobtained = 0;
var status='',absent='';
var limit= value1.id;
var ff=limit.substring(3,limit.length-1);
var limit1= parseInt(limit.substring(3))+( parseInt(obj5)-1);
var sum;
for(i=0;i<=(parseInt(obj5)-1);i++)
{
if (document.getElementById('Tit' + limit.substring(3,limit.length-1) + i ).value=="")
{
sum=parseInt(0);
}
else
{
sum=parseInt(document.getElementById('Tit' + limit.substring(3,limit.length-1) + i ).value);
}
mark_total=parseInt(mark_total) + sum;
}
document.getElementById('Tit' + limit.substring(3,limit.length-1) + parseInt(obj5)).value=mark_total;
document.getElementById('Tit' + limit.substring(3,limit.length-1)+ (parseInt(obj5)+1) ).value=mark_total/ parseInt(obj5);
for(i=0;i<drpgrade.options.length;i++)
{
var ss1= drpgrade.options[i].text;
var ss2= drpgrade.options[i].value ;
var ss3= drpgrade1.options[i].text;
var ss4= drpgrade1.options[i].value ;
var per=parseFloat(document.getElementById('Tit' + limit.substring(3,limit.length-1)+ (parseInt(obj5)+1) ).value)
if( per >= parseFloat(ss1) && per <=ss3)
{
document.getElementById('Tit' + limit.substring(3,limit.length-1)+ (parseInt(obj5)+2) ).value=ss2;
}
}
}
}
function Mark_Entry_Block_NonNumeric(obj,marklimit)
{
var content = document.getElementById(obj).value;
var con1 = document.getElementById(obj);
content='';
var limit =marklimit;
//var content1=content+ parseInt(String.fromCharCode(event.keyCode));
var content1=parseInt(String.fromCharCode(event.keyCode));
if(content=='')
{
if(parseInt(content1)<=limit)
{
document.getElementById(obj).value='';
return true;
}
else
return false;
}
else
{
if((event.keyCode>=48) && (event.keyCode<=54))
{
if(parseInt(content1)<=limit)
{
return true;
}
else
{
con1.value=parseInt(String.fromCharCode(event.keyCode));
return false;
}
}
else
{
return false;
}
}
}
function setID(obj)
{
var inID=document.getElementById(obj.id);
var sID=document.getElementById('TextBox1');
sID.value=inID.id;
}
function Generate(obj)
{
var btn = document.getElementById(obj.id);
btn.click();
}
function Add_Ne(obj,Eve)
{
var MyVar =parseInt(webcon);
if ($get(obj.id).value<= MyVar)
{
var btn = document.getElementById(Eve.id);
btn.click();
}
else
{
var popupp=$get('popup');
popupp.width='360px';
popupp.height='128px';
popupp.style.display="none";
var newImage = "url(../images/RMsgBar.jpg)";
popupp.style.backgroundImage=newImage;
Msg_Show_1Btn('stv06',obj.id,'Info','btnyes','btnno','btnok','lblmsg',MyVar);obj.value="";return false
}
}
function Msg_Show_1Btn(node,Target_ID,mode,btnyes,btnno,btnok,lblmsg,myvar)
{
var lbl = document.getElementById(lblmsg);
var btnshow = document.getElementById('modal');
var hide = parent.document.getElementById('txtfocus_ID');
//------- Getting Message from XML File ----------------
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
var gett=msg[0].firstChild.nodeValue;
var cntt=gett.replace('~Description~',myvar);
lbl.innerText = cntt;
//------------------------------------------------------
//-------- Handle Modal Popup Button Event ------------
hide.value = Target_ID;
btnshow.click();
//-----------------------------------------------------
//--- Process for Hide Button to Confirm or Info ------
var yes = document.getElementById(btnyes);
var no = document.getElementById(btnno);
var ok = document.getElementById(btnok);
yes.style.display="none";
no.style.display="none";
ok.style.display="";
ok.focus();
return false;
}
//Function For Grade Desc ------------------------------------->
//Begin-------------------------------------------------------->
function ch1(txt,ss)
{
var vv="Txt";
var idd=txt;
document.getElementById(ss).innerHTML="";
var ddlReport =document.getElementById(vv.concat(txt));
var table = document.createElement('table');
table.id="tit";
table.border=1;
table.borderWidth=1;
table.className ="report_titlebar";
table.setAttribute("className","report_titlebar")
table.align='center';
var newTR5 = document.createElement('tr');
var newTD5 = document.createElement('td');
var titl=document.getElementById(vv.concat(txt)).title
newTD5.appendChild(document.createTextNode(titl.toUpperCase()+": "+"GRADES AND DESCRIPTION"));
newTD5.background="../images/title_bg.jpg";
newTD5.color="#FFFFFF";
newTD5.fontsize="11px";
newTD5.fontweight="bold";
newTD5.colSpan='3';
newTD5.align='center';
newTD5.height='55px';
newTR5.appendChild(newTD5);
table.appendChild(newTR5);
for (i = 1; i < ddlReport.options.length; i++){
var radio = document.createElement('input');
radio.id =i;
radio.setAttribute("type", "radio");
radio.setAttribute("name", "radios");
radio.setAttribute("value", ddlReport.options[i].value);
var ss1= ddlReport.options[i].text;
var ss2= ddlReport.options[i].value ;
var newTR = document.createElement('tr');
var newTD = document.createElement('td');
var newTD1 = document.createElement('td');
var newTD2 = document.createElement('td');
if (idd.substring(0,1)=="0")
{radio.setAttribute("onclick", "window.opener.resultset("+i+",'"+ idd +"');self.close();"); }
else
{radio.setAttribute("onclick", "window.opener.resultset("+i+","+ idd +");self.close();"); }
newTD.appendChild (radio);
newTR.appendChild (newTD);
newTD1.appendChild (document.createTextNode(ss1));
newTR.appendChild (newTD1);
newTD2.appendChild (document.createTextNode(ss2));
newTR.appendChild (newTD2);
table.appendChild (newTR);
}
div = document.getElementById(ss);
div.title="GRADE DESCRIPTION"
div.align='center';
var newTR6 = document.createElement('tr');
var newTD6 = document.createElement('td');
var btn=document.createElement('input')
btn.setAttribute("type", "button");
btn.setAttribute("name", "btn");
btn.setAttribute("value", "Close");
btn.setAttribute("onclick","self.close();");
newTD6.appendChild (btn);
newTD6.align='center';
newTD6.colSpan='3';
newTR6.appendChild (newTD6);
table.appendChild (newTD6);
document.getElementById(ss).appendChild(table);
var left = (screen.width/2);
var top = (screen.height/2);
var content=document.getElementById(ss).innerHTML;
myWin=window.open('','myWin','toolbar=no,menubar=no,directories=yes,addressbar=no,location=no,scrollbars=yes,height=300px,width=700px,top=200,left=220,resizable=yes,status=no');
myWin.document.write(content);
myWin.document.title=titl.toUpperCase()+": "+"GRADES AND DESCRIPTION";
}
function resultset(obj,txt)
{
var vv="Txt";
var idd1=String(txt);
var ddlReport =document.getElementById(vv.concat(txt));
var t_id=parseFloat(txt)+ parseInt(1);
if (idd1.charAt(0)=="0")
{
ddlReport.selectedIndex=obj;
document.getElementById('Txt00'+t_id).value=document.getElementById(obj).value;
}
else
{
var t_id1=parseInt(txt)+1;
ddlReport.selectedIndex=obj;
document.getElementById('Txt0'+t_id1).value=document.getElementById(obj).value;
}
}
function togglediv(divid)
{
if(document.getElementById(divid).style.display == 'none'){
document.getElementById(divid).style.display = 'block';
}else{
document.getElementById(divid).style.display = 'none';
}
}
//End Grade Desc Function----------------------------------------------->
function fcs(txt)
{
var ddlReport =document.getElementById('txt'+txt);
var drp_Val = ddlReport.options[ddlReport.selectedIndex].value;
var t_id=parseInt(txt)+1;
if (drp_Val=='-')
{
document.getElementById('Txt0'+t_id).value='';
}
else
{
document.getElementById('Txt0'+t_id).value=drp_Val;
}
}
function fcs1(txt)
{
var ddlReport =document.getElementById('txt'+txt);
var idd=ddlReport.id;
var drp_Val = ddlReport.options[ddlReport.selectedIndex].value;
var t_id=parseFloat(txt)+ parseInt(1);
if (drp_Val=='-')
{
document.getElementById('Txt00'+t_id).value='';
}
else
{
document.getElementById('Txt00'+t_id).value=drp_Val;
}
}
// key press event on allowed alpha not allowed block numbers
function onKeyPressBlockNumbers(e)
{
var key = window.event ? e.keyCode : e.which;
var keychar = String.fromCharCode(key);
reg = /\d/;
return !reg.test(keychar);
}
function CheckMaxLength(obj,length)
{
var mxlength=length;
var temp = document.getElementById(obj).value;
if (temp.length<mxlength)
{
document.getElementById(obj).value='';
document.getElementById(obj).focus();
return false;
}
}
//for Sports and Events
function Clear_Zero_SeatSettingForm(obj)
{
var txtsportfine=document.getElementById(obj.id);
if(txtsportfine.value==0)
{
txtsportfine.value='';
}
}
// Allowed only numbers not allowed - and alpha
function extractNumber(obj, decimalPlaces, allowNegative)
{
var temp = obj.value;
// avoid changing things if already formatted correctly
var reg0Str = '[0-9]*';
if (decimalPlaces > 0) {
reg0Str += '\\.?[0-9]{0,' + decimalPlaces + '}';
} else if (decimalPlaces < 0) {
reg0Str += '\\.?[0-9]*';
}
reg0Str = allowNegative ? '^-?' + reg0Str : '^' + reg0Str;
reg0Str = reg0Str + '$';
var reg0 = new RegExp(reg0Str);
if (reg0.test(temp)) return true;
// first replace all non numbers
var reg1Str = '[^0-9' + (decimalPlaces != 0 ? '.' : '') + (allowNegative ? '-' : '') + ']';
var reg1 = new RegExp(reg1Str, 'g');
temp = temp.replace(reg1, '');
if (allowNegative) {
// replace extra negative
var hasNegative = temp.length > 0 && temp.charAt(0) == '-';
var reg2 = /-/g;
temp = temp.replace(reg2, '');
if (hasNegative) temp = '-' + temp;
}
if (decimalPlaces != 0) {
var reg3 = /\./g;
var reg3Array = reg3.exec(temp);
if (reg3Array != null) {
// keep only first occurrence of .
// and the number of places specified by decimalPlaces or the entire string if decimalPlaces < 0
var reg3Right = temp.substring(reg3Array.index + reg3Array[0].length);
reg3Right = reg3Right.replace(reg3, '');
reg3Right = decimalPlaces > 0 ? reg3Right.substring(0, decimalPlaces) : reg3Right;
temp = temp.substring(0,reg3Array.index) + '.' + reg3Right;
}
}
obj.value = temp;
}
function blockNonNumbers(obj, e, allowDecimal, allowNegative)
{
var key;
var isCtrl = false;
var keychar;
var reg;
if(window.event) {
key = e.keyCode;
isCtrl = window.event.ctrlKey
}
else if(e.which) {
key = e.which;
isCtrl = e.ctrlKey;
}
if (isNaN(key)) return true;
keychar = String.fromCharCode(key);
// check for backspace or delete, or if Ctrl was pressed
if (key == 8 || isCtrl)
{
return true;
}
reg = /\d/;
var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
return isFirstN || isFirstD || reg.test(keychar);
}
function BlockIntialZero(obj)
{
if (event.keyCode==48 ||event.keyCode==96)
{
if(!parseInt(document.getElementById(obj.id).value)>=1)
return false;
}
}
// Allowed Limited numbers
function limitlength(obj, length){
var maxlength=length
if (obj.value.length>maxlength)
obj.value=obj.value.substring(0, maxlength)
}
// display key code
function displayunicode(e){
var unicode=e.keyCode? e.keyCode : e.charCode
alert(unicode)
}
// Date Function in dd/mm/yyyy
function validateDate(fld) {
var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
var errorMessage = 'Please enter valid date as month, day, and four digit year.\nYou may use a slash, hyphen or period to separate the values.\nThe date must be a real date. 2-30-2000 would not be accepted.\nFormay mm/dd/yyyy.';
if ((fld.value.match(RegExPattern)) && (fld.value!='')) {
alert('Date is OK');
} else {
alert(errorMessage);
fld.focus();
}
}
// Date Function in mm/dd/yyyy
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
var i;
for (i = 0; i < s.length; i++){
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function stripCharsInBag(s, bag){
var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++){
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}
function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
if (i==2) {this[i] = 29}
}
return this
}
function isDate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strMonth=dtStr.substring(0,pos1)
var strDay=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
alert("The date format should be : mm/dd/yyyy")
return false
}
if (strMonth.length<1 || month<1 || month>12){
alert("Please enter a valid month")
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
alert("Please enter a valid day")
return false
}
if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
alert("Please enter a valid date")
return false
}
return true
}
function ValidateForm(){
var dt=document.frmSample.txtDate
if (isDate(dt.value)==false){
dt.focus()
return false
}
return true
}
function addrs(obj)
{
var txt = document.getElementById(obj.id).value.length;
if (event.keyCode >= 33 && event.keyCode <=40 || event.keyCode == 8 || event.keyCode == 46 )
{
return true;
}
else
{
if (event.keyCode==222 || txt > 99)
{
var val=document.getElementById(obj.id).value.search("'");
return false;
}
}
}
function isNumberKey(evt)
{
if(event.shiftKey) return false;
var charCode=(evt.which) ? evt.which: event.keyCode
if(charCode==16) return false;
if ((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 106)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14))
{
return false;
}
return true;
}
//Select all the rows in checkbox datagird
function selectAll(involker)
{
var inputElements = document.getElementsByTagName('input');
for (var i = 0 ; i < inputElements.length ; i++)
{
var myElement = inputElements[i];
if (myElement.type === "checkbox")
{
myElement.checked = involker.checked;
}
}
}
function time_compare()
{
document.getElementById('btntime_check').click();
}
function pers_change(txt)
{
document.getElementById(txt).value="";
}
function Focus()
{
var debit = document.getElementById('txtdebit').value;
var credit =document.getElementById('txtcredit').value;
if(event.keyCode==9)
{
if ((debit > 0) && (debit!= ''))
{
document.getElementById('txtcredit').value=0;
document.getElementById('btnadd1').click();
return true;
}
else
{
document.getElementById('txtdebit').value=0;
document.getElementById('txtcredit').focus();
return false;
}
}
}
function Focus1()
{
var debit = document.getElementById('txtdebitor').value;
var credit =document.getElementById('txtcreditor').value;
}
function Dot(obj)
{
if (event.keyCode==190 || event.keyCode==110)
{
var a = obj.value.indexOf('.')
if (a == -1)
return true;
else
return false;
}
}
function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
var net=document.getElementById('txtnet_amt');
}
//*******************************************************************************************
//Number To Words
//==================
// American Numbering System
var th = ['','thousand','million', 'billion','trillion'];
var dg = ['zero','one','two','three','four', 'five','six','seven','eight','nine'];
var tn = ['ten','eleven','twelve','thirteen', 'fourteen','fifteen','sixteen', 'seventeen','eighteen','nineteen'];
var tw = ['twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];
function toWords(s)
{
// s = document.getElementById(s).value; //Source Control
s = document.getElementById('txtnet_amt').value;
s = s.replace(/[\, ]/g,'');
if (s != String(parseFloat(s)))
return 'not a number';
var x = s.indexOf('.');
if (x == -1) x = s.length;
if (x > 15)
return 'too big';
var n = s.split('');
var str = '';
var sk = 0;
for (var i=0; i < x; i++)
{
if ((x-i)%3==2)
{
if (n[i] == '1')
{
str += tn[Number(n[i+1])] + ' ';
i++; sk=1;
}
else if (n[i]!=0)
{
str += tw[n[i]-2] + ' ';
sk=1;
}
}
else if (n[i]!=0)
{
str += dg[n[i]] +' ';
if ((x-i)%3==0)
str += 'hundred ';
sk=1;
}
if ((x-i)%3==1)
{
if (sk)
str += th[(x-i-1)/3] + ' ';
sk=0;
}
}
if (x != s.length)
{
var y = s.length;
str += 'point ';
for (var i=x+1; i<y; i++)
str += dg[n[i]] +' ';
}
document.getElementById('word_amt').value = str.replace(/\s+/g,' ') +' ' + 'rupees only'; //TargetControl
//return str.replace(/\s+/g,' ');
}
//*******************************************************************************************
//FUNCTION FOR PRINT THE CONTENT
function Printing(obj,head)
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=25";
div = document.getElementById('Div1');
if (div != null)
{
div.style.height = "auto";
}
var content_vlue = document.getElementById(obj).innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>'+ head + '</title>');
docprint.document.write('</head><body onLoad="self.print()"><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.document.close();
docprint.focus();
}
//=============================== COMMON JAVASCRIPT - START ============================
//----------------------- Block Greater and Lesser than symbol --------------------------
function Greater_Lesser_Block(obj)
{
if (event.keyCode==60 || event.keyCode==62)
{
var val_les=document.getElementById(obj.id).value.search("<");
var val_gre=document.getElementById(obj.id).value.search(">");
if (val_les == -1 || val_gre == -1)
return false;
else
return true;
}
}
//------------------------------- Mobile No. Start with 9 ------------------------------
function mobile(obj)
{
if (obj.value.length==0)
{
if (event.keyCode==57 || event.keyCode==105 || event.keyCode==9 || event.keyCode==48 || event.keyCode==56)
return true;
else
return false;
}
}
//----------------------- GridView Checkbox Individal Check Calculation ---------------
function GV_Check_in(chk_head,chk,txt)
{
if(document.getElementById(chk.id).checked==true)
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='#993333';
chkBox.parentNode.parentNode.style.fontWeight='bold';
}
else
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='black';
chkBox.parentNode.parentNode.style.fontWeight='normal';
}
var chkBox=document.getElementById(chk_head).form.elements;
var state=document.getElementById(chk_head).checked;
var len=0;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox")
len=len+1;
len=len-1;
if (len==parseInt(document.getElementById(txt).value))
{
if(state==false)
document.getElementById(chk_head).checked=true;
}
else if (len!=parseInt(document.getElementById(txt).value))
{
if(state==true)
document.getElementById(chk_head).checked=false;
}
}
//------------------------- GridView Checkbox Check All Calculation --------------------
function GV_Check_All(chkAll,txt)
{
var chkBox=chkAll.form.elements;
var state=chkAll.checked;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
{
if (chkBox[i].checked!=chkAll.checked)
if(state==true)
{
chkBox[i].checked=true;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
//chkBox[i].parentNode.parentNode.style.color='#993333';
chkBox[i].parentNode.parentNode.style.fontWeight='bold';
}
else
{ chkBox[i].checked=false;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
//chkBox[i].parentNode.parentNode.style.color='black';
chkBox[i].parentNode.parentNode.style.fontWeight='normal';
}
}
}
//------------------------- GridView Checkbox Check All Calculation --------------------
function GV_Check_All_New(chkAll,txt)
{
var chkBox=chkAll.form.elements;
var state=chkAll.checked;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
{
if (chkBox[i].checked!=chkAll.checked && chkBox[i].disabled!=true)
if(state==true)
{
chkBox[i].checked=true;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
//chkBox[i].parentNode.parentNode.style.color='#993333';
chkBox[i].parentNode.parentNode.style.fontWeight='bold';
}
else
{ chkBox[i].checked=false;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
//chkBox[i].parentNode.parentNode.style.color='black';
chkBox[i].parentNode.parentNode.style.fontWeight='normal';
}
}
}
//----------------------- Date Validation without Academic Year Checking ---------------------
function Valid_Date_Not_Academic(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy <= 0 && dat.value != ''){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
}
function Valid_Date_Not_Academic_Rpt(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var lbl_focus = document.getElementById('lbl_FocusId');
lbl_focus.value = txtdate.id;
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy <= 0 && dat.value != ''){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
}
// ----------------- Mutually Exclusive Radiobutton selection in Gridview ----------------
function uncheckOthers_radio(id)
{
var radio=document.getElementById(id.id);
// radio.parentNode.parentNode.style.color='#993333';
radio.parentNode.parentNode.style.fontWeight='bold';
var elm = document.getElementsByTagName('input');
for(var i = 0; i < elm.length; i++)
{
if(elm.item(i).id.substring(id.id.lastIndexOf('_')) == id.id.substring(id.id.lastIndexOf('_')))
{
if( elm.item(i)!=id)
{
elm.item(i).checked = false;
// elm.item(i).parentNode.parentNode.style.color='black';
elm.item(i).parentNode.parentNode.style.fontWeight='normal';
}
}
}
}
// ----------------- Mutually Exclusive Checkbox selection in Gridview -------------------
function uncheckothers_check(id)
{
var checkbox=document.getElementById(id.id);
//checkbox.parentNode.parentNode.style.color='#993333';
checkbox.parentNode.parentNode.style.fontWeight='bold';
var elm = document.getElementsByTagName('input');
for(var i = 0; i < elm.length; i++)
{
if(elm.item(i).id.substring(id.id.lastIndexOf('_')) == id.id.substring(id.id.lastIndexOf('_')))
{
if( elm.item(i).type == "checkbox" && elm.item(i)!=id)
elm.item(i).checked = false;
//elm.item(i).parentNode.parentNode.style.color='black';
elm.item(i).parentNode.parentNode.style.fontWeight='normal';
}
}
}
// ----------------- Mutually Exclusive Radiobutton selection in Gridview used in code behind----------------
function uncheckOthers_radio_new(id)
{
var radio=document.getElementById(id);
// radio.parentNode.parentNode.style.color='#993333';
radio.parentNode.parentNode.style.fontWeight='bold';
var elm = document.getElementsByTagName('input');
for(var i = 0; i < elm.length; i++)
{
if(elm.item(i).id.substring(id.id.lastIndexOf('_')) == id.id.substring(id.id.lastIndexOf('_')))
{
if( elm.item(i)!=id)
{
elm.item(i).checked = false;
// elm.item(i).parentNode.parentNode.style.color='black';
elm.item(i).parentNode.parentNode.style.fontWeight='normal';
}
}
}
}
// ------------------------- Allow only one hyphen in the Field ------------------------
function phoneval(obj)
{
if (event.keyCode==189)
{
var val=document.getElementById(obj.id).value.search("-");
if (val == -1)
return true;
else
return false;
}
}
// -------------------------- Except ' its allow all the character -----------------------
function speci(obj)
{
var txt = document.getElementById(obj.id).value.length;
if (event.keyCode >= 33 && event.keyCode <=40 || event.keyCode == 8 || event.keyCode == 46 )
{
return true;
}
else
{
if (event.keyCode==222 || txt > 99)
{
var val=document.getElementById(obj.id).value.search("'");
if (val == -1)
return false;
else
return true;
}
}
}
function tab_focus(obj)
{
document.getElementById(obj).focus();
document.getElementById('btn_hid').click();
}
//================================ COMMON JAVASCRIPT - END =============================
//================================== HR - JAVASCRIPT - START ===========================
// ------------- Upload value is posted into hide textbox (Interview Call)--------------
function Fire_upload_button(obj)
{
document.getElementById('txt_hide').value = obj.value;
}
//================================== HR - JAVASCRIPT - END ==============================
//============================== ADMISSION - JAVASCRIPT - START ===========================
//----------------------------- Section Transfer Row Hide --------------------------------
function section_transfer_visible()
{
document.getElementById('tr_grid').style.display="none";
document.getElementById('tr_txt_select').style.display="none";
document.getElementById('tr_trans_button').style.display="none";
}
//----------------------- Mark Total calculation (Application Form)-----------------------
function Mark_total(obj_name)
{
if (parseFloat(obj_name.value) > 100.00)
{
obj_name.value='';
}
var value = document.getElementById('TabContainer_App_TabPanel_Education_txt_no_sub').value;
var total=0;
for(i=1; i<=value; i++)
{
var mark=parseFloat(document.getElementById('TabContainer_App_TabPanel_Education_txt_mark' + i).value);
if (mark >= 0 && mark != NaN)
{
total=parseFloat(total) + parseFloat(mark);
}
}
total=CurrencyFormatted(parseFloat(total)/value);
document.getElementById('TabContainer_App_TabPanel_Education_txt_total_per').value=parseFloat(total);
}
//---------------------------------Student Date of birth (Application Form) -----------------
function date_drop(tab,condi,destination_obj)
{
if (tab=="1")
{
document.getElementById('TabContainer_App_TabPanel_Personal_Txt_Age').value="";
var obj_name="TabContainer_App_TabPanel_Personal_" + destination_obj;
}
else
var obj_name="TabContainer_App_TabPanel_Parents_" + destination_obj;
if (condi=="Year")
document.getElementById(obj_name).value=condi;
else
document.getElementById(obj_name).value=condi;
}
//----------------- Language-1 and language-2 are same or different (Application Form)-------------
function same_language(obj)
{
if (document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_1').value==document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_2').value)
{
if (obj=="1")
{
document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_1').value="--Select--";
Msg_Show('App09','TabContainer_App_TabPanel_Personal_Drp_Lag_1','Info','btnyes','btnno','btnok','lblmsg')
}
else
{
document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_2').value="--Select--";
Msg_Show('App09','TabContainer_App_TabPanel_Personal_Drp_Lag_2','Info','btnyes','btnno','btnok','lblmsg')
}
}
}
//----------------- After File UPload - focus goes to Next Button (Application Form) --------------
function upload_focus()
{
document.getElementById('TabContainer_App_TabPanel_Personal_Btn_Personal').focus();
}
//------------------ Print option for Admission Selection -----------------------------------
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=250,top=0,width=700,height=500,toolbar=0,scrollbars=0,status=1');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
//============================== ADMISSION - JAVASCRIPT - END ===========================
//================================= TIME TABLE - Javascript - Start ====================
//--------------------------------- Time Master - Focus --------------------------------
function time_focus(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var time=document.getElementById(target +'txt_Time');
time.focus();
//document.getElementById('txt_time').focus();
}
//--------------------------------- Subject Master Text clear----------------------------
function txt_clear()
{
if (document.getElementById('drp_Theory').value == 'Language' && document.getElementById('txt_Subcode').value != '')
{
document.getElementById('drp_Pos').value = 'NA';
document.getElementById('drp_Pos').style.visibility='hidden';
}
document.getElementById('drp_Theory').value = '--Select--';
document.getElementById('txt_Subcode').value='';
}
//---------------------- Subject Master - subject code generation------------------------
function Fire_Button()
{
document.getElementById('btn_Hide').click();
}
//-------------------------- Button Hide - Before print --------------------------------
function begin_Print()
{
document.getElementById('btn_export').style.visibility='hidden';
document.getElementById('btn_print').style.visibility='hidden';
}
//-----------------------------Button show - after print---------------------------------
function after_Print()
{
document.getElementById('btn_export').style.visibility='visible';
document.getElementById('btn_print').style.visibility='visible';
window.event.returnValue=0;
}
//-------------------------- Button Hide - Before print For Time Table Report--------------------------------
function begin_Print_TIME_TBL()
{
document.getElementById('btn_export').style.visibility='hidden';
document.getElementById('btn_print').style.visibility='hidden';
document.getElementById('btnMail').style.visibility='hidden';
document.getElementById('btnCancel').style.visibility='hidden';
}
//-----------------------------Button show - after print For Time Table Report---------------------------------
function after_Print_TIME_TBL()
{
document.getElementById('btn_export').style.visibility='visible';
document.getElementById('btn_print').style.visibility='visible';
document.getElementById('btnMail').style.visibility='visible';
document.getElementById('btnCancel').style.visibility='visible';
window.event.returnValue=0;
}
//-------------------------- Time Table Modify Staturday Selection ---------------------
function Modify_From_Drop()
{
if (document.getElementById('drp_from_day').value=='Saturday')
{
document.getElementById('drp_to_day').value="Saturday";
document.getElementById('drp_to_day').disabled=true;
}
else
{
document.getElementById('drp_to_day').value="--Select--";
document.getElementById('drp_to_day').disabled=false;
}
}
function Modify_To_Drop()
{
if (document.getElementById('drp_from_day').value != 'Saturday' && document.getElementById('drp_to_day').value == 'Saturday')
document.getElementById('drp_to_day').value="--Select--";
}
//================================= TIME TABLE - Javascript - End ======================
//=====================================================================================
//FUNCTION FOR CHECKING ALL IN CHECK BOX LIST
function cblAll(obj1,obj2)
{
var chklist = document.getElementById(obj1).getElementsByTagName("input");
var chk = document.getElementById(obj2).getElementsByTagName("input");
for ( i=0; i < chk.length; i++ )
{
if (chklist[0].checked == true)
{
chk[i].checked = true;
}
else
{
chk[i].checked = false;
}
}
}
//=====================================================================================
//UNCHECK 'all'CHECKBOX
function unchk(obj1,obj2)
{ var count = 0;
var chklist = document.getElementById(obj1).getElementsByTagName("input");
var chk = document.getElementById(obj2).getElementsByTagName("input");
for ( i=0; i < chk.length; i++ )
{
count += 1;
if ( chk[i].checked == false )
{
count -= 1;
chklist[0].checked = false;
}
}
if ( count == chk.length)
{
chklist[0].checked = true;
}
}
//======================================================================================
function foc(obj)
{
document.getElementById(obj.id).style.width="250px";
}
function out(obj)
{
document.getElementById(obj.id).style.width="170px";
}
if (typeof window.event != 'undefined')
document.onkeydown = function()
{
var test_var=event.srcElement.tagName.toUpperCase();
if (test_var != 'INPUT' && test_var != 'TEXTAREA')
return (event.keyCode != 8);
}
else
document.onkeypress = function(e)
{
var test_var=e.target.nodeName.toUpperCase();
if (test_var != 'INPUT' && test_var != 'TEXTAREA')
return (e.keyCode != 8);
}
//-------------------- Financial Reports Switch Over Views --------------------------------------
function switchViews(obj,row)
{
var div = document.getElementById(obj);
var img = document.getElementById('img' + obj);
if (div.style.display=="none")
{
div.style.display = "inline";
if (row=='alt')
{
img.src="../images/expand_button_white_alt_down.jpg";// mce_src="../images/expand_button_white_alt_down.jpg";
}
else
{
img.src="../images/Expand_Button_white_Down.jpg";// mce_src="../images/Expand_Button_white_Down.jpg";
}
img.alt = "Close";
}
else
{
div.style.display = "none";
if (row=='alt')
{
img.src="../images/Expand_button_white_alt.jpg";// mce_src="../images/Expand_button_white_alt.jpg";
}
else
{
img.src="../images/Expand_button_white.jpg";// mce_src="../images/Expand_button_white.jpg";
}
img.alt = "Expand";
}
}
//--------------------------------------------------------------------------------------------------------
function mod_click(obj)
{
document.getElementById(obj).click();
}
// This For Reception Contact Numbers From Sathish
function IsNumber(obj)
{
var key=event.keyCode;
if((key>=48 && key<=57)||(key==45))
{
if (key==45)
{
var chk=document.getElementById(obj).value.indexOf('-');
if (chk!=-1)
return false;
}
return true;
}
else
{
return false;
}
}
// This is EMail Validation
function validate_email(field)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{ return false;}
else {return true;}
}
}
function validate_form(email)
{
if (validate_email(email)==false)
{
document.getElementById(email.id).focus();
return false;
}
}
// Email Validation End
function GridVisibility()
{
var gd=document.getElementById('GridView1');
if(gd!= null)
gd.style.visibility="hidden";
}
function Time(st,drp)//transport pickup time,drop time checking
{
var t1 = document.getElementById(st);
var t2 = document.getElementById(drp);
if(t1 != null && t2!= null)
{
if (mil(t1.value)>mil(t2.value))
{
//alert('Invalid Time');
t2.value="";
t2.focus();
}
}
}
function mil(str)
{
var t = str.split(':')
var hh = parseInt(t[0],10);
var mm = parseInt(t[1],10)
hh += (str.toLowerCase().indexOf('pm')!=-1)?12:0;
var d = new Date(2007,0,1,hh,mm,00);
return d.getTime();
}
//From Suresh.C
function Time_Diff(st,drp,lblinvalid)
{
var t1 = document.getElementById(st);
var t2 = document.getElementById(drp);
var lbl=document.getElementById(lblinvalid);
lbl.style.display='none';
// ||(t1.value=='12:00 AM')
if((t1.value==t2.value) || (t2.value=='12:00 AM'))
{
t2.value='';
t2.focus();
lbl.style.display='';
}
else if (mil(t1.value)>mil(t2.value))
{
t2.focus();
t2.value='';
lbl.style.display='';
}
else
{
lbl.style.display='none';
}
}
function mil(str)
{
var t = str.split(':')
var hh = parseInt(t[0],10);
var mm = parseInt(t[1],10)
hh += (str.toLowerCase().indexOf('pm')!=-1)?12:0;
var d = new Date(2007,0,1,hh,mm,00);
return d.getTime();
}
function Greater_Lesser_Block(obj)
{
if (event.keyCode==60 || event.keyCode==62)
{
var val_les=document.getElementById(obj.id).value.search("<");
var val_gre=document.getElementById(obj.id).value.search(">");
if (val_les == -1 || val_gre == -1)
return false;
else
return true;
}
}
function NonzeroInSportsReturn(txtfine)
{
if (event.keyCode==48 ||event.keyCode==96)
return false;
else
return true;
}
function SportsReturnItemCheck(obj)
{
var lblItemdisplay=document.getElementById('lblQuantityItem')
lblItemdisplay.style.display='none';
if(parseInt($get(obj.id).value) > parseInt($get('Txthide').value))
{
$get(obj.id).value='';
lblItemdisplay.style.display='';
}
else
{
lblItemdisplay.style.display='none';
}
}
function advancemodule2(obj)
{
var txtsportfine=document.getElementById(obj.id);
if(txtsportfine.value==0)
{
txtsportfine.value="";
}
}
//*********************** Academic School Information JavaScript Started Here ***************************
//Adding Academic Year by Selected Date
//Don't Alter anythings in this scripts
//it may affect the whole Software
function onKeyPressEventAddyear(obj1,obj2)
{
var dt2;
var dt1= document.getElementById(obj1).value;
if (dt1=='')
{ document.getElementById(obj2).value=""; }
else
{ dt2=dt1.split('/');
document.getElementById(obj2).value=(dt2[0])+"/"+dt2[1]+"/" +(parseInt(dt2[2])+1);
}
}
//***************************** Academic School Information JavaScript Ended *****************************
//****************** ACCOUNT PAGES JAVASCRIPT ********************
//----------------------- Checking Numeric Values ----------------------------
function numeric(obj)
{
//Key Codes
// >=48,>=96 - Numbers
// <=58,<=105 - Numbers
// 46 - Delete
// 8 - Backspace
// 9 - Tab
// 36 - Home
// 37 - Left Arrow
// 39 - Right Arrow
//190,46 - .
var key=event.keyCode;
var txt = document.getElementById(obj.id)
//if (txt.value.length==0 && (event.keyCode==48 ||event.keyCode==96)){return false;}
if ((key >= 48) && (key <=58) || (key>=96) && (key<=105) || (key == 46) || (key == 8) || (key == 9) || (key == 36) || (key == 37) || (key == 39))
{
var arr = txt.value.split(".")
if (arr.length > 1)
{
if (arr[1].length > 1)
{
if((key >= 48) && (key <=58) || (key>=96) && (key<=105))//? return false : return true;
{
return false;
}
else
{
return true;
}
}
else
{
return true;
}
}
else
{
return true;
}
}
else
{
if((key == 190) || (key == 110))
{
return Dot(obj);
}
else
{
return false;
}
}
}
//Function for Account opening Entry to Enter Credit or Debit
function OpenCR_DR(obj,Deb,Cre)
{
var DR = document.getElementById(Deb);
var CR = document.getElementById(Cre);
var txt = document.getElementById(obj.id);
var hide = document.getElementById('txtmsg');
// if (DR.value == 0 || CR.value == 0){Msg_Show('Acc32',CR.id,'Info','btnyes','btnno','btnok','lblmsg')}
if (DR.value != "" && CR.value != "")
{
//----- ID for Clear Values --------
if(txt.id==DR.id)
{
Msg_Show('Acc13',CR.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = CR.id;
}
else
{
Msg_Show('Acc14',DR.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = DR.id;
}
}
}
//------------- Display Unit for Selected Items ----------------
function DRP_Item_Unit()
{
var drp = document.getElementById('rptItems_ctl00_drpitem');
var txt = document.getElementById('rptItems_ctl00_txtunit');
var txtrate=document.getElementById('rptItems_ctl00_txtrate');
if (drp.options[drp.selectedIndex].text != '--Select--')
{
var Unit = drp.value.split('$');
txt.value = Unit[1];
txtrate.value=Unit[2];
}
else
{
txt.value = "";
txtrate.value="";
}
}
//--------------------------------------------------------------
//------------- Calculating Amount In Account Item List ------------------
function AmtCalculate()
{
var Qty = document.getElementById('rptItems_ctl00_txtqty');
var Rate = document.getElementById('rptItems_ctl00_txtrate');
var Amt = document.getElementById('rptItems_ctl00_txtamt');
if (Qty.value >= 0 && Qty.value != "" && Rate.value >= 0 && Rate.value != "")
{
Amt.value = CurrencyFormatted(parseFloat(Qty.value) * parseFloat(Rate.value))
}
else
{
Amt.value = "";
}
}
//---For Transport Module--
function TransCalAmt(km,pkm,tctrl)//transport Calculate Amount based on Kilometer
{
var t1 = document.getElementById(km);
var t2 = document.getElementById(pkm);
var t3 = document.getElementById(tctrl);
if (t1.value >= 0 && t1.value != "" && t2.value >= 0 && t2.value != "")
{
t3.value = CurrencyFormatted(parseFloat(t1.value) * parseFloat(t2.value))
}
else
{
t3.value = "";
}
}
//------------- Convert String Amt Format ---------------
//function Amt_Float(Amt)
//{
// if (parseFloat(Amt.value) > 0)
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value = CurrencyFormatted(Amt_txt.value);
// }
// else
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value ='';
// Amt_txt.focus();
// }
//}
var currentObjectName='';
function Amt_Float(object)
{
if (currentObjectName!='' && currentObjectName!= object.name) return;
currentObjectName=object.name;
if (object.value == "" || parseFloat(object.value)==0)
{
//alert(lc_name + " input field cannot be blank!")
object.value = ""
object.focus();
return false;
}
else if (parseFloat(object.value) > 0)
{
var Amt_txt = document.getElementById(object.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else
{
object.value = ""
object.focus();
return false;
}
currentObjectName='';
return true;
}
//-------------------------------------------------------
//------------- Convert String Amt Format For Fine---------------
var currentObjectName='';
function Amt_Float_Fine(object)
{
if (currentObjectName!='' && currentObjectName!= object.name) return;
currentObjectName=object.name;
if (object.value == "")
{
//alert(lc_name + " input field cannot be blank!")
object.value = ""
object.focus();
return false;
}
else if (parseFloat(object.value) > 0 || parseFloat(object.value)==0)
{
var Amt_txt = document.getElementById(object.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else
{
object.value = ""
object.focus();
return false;
}
currentObjectName='';
return true;
}
//function Amt_Float_Fine(Amt)
//{
// if (parseFloat(Amt.value) > 0 || parseFloat(Amt.value)==0)
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value = CurrencyFormatted(Amt_txt.value);
// }
// else
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value ='';
// Amt_txt.focus();
// }
//}
//-------------------------------------------------------
//------------- Convert String Amt Format ---------------
function Amt_Float_Trans(Amt)
{
if (parseFloat(Amt.value) > 0)
{
var Amt_txt = document.getElementById(Amt.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else if (parseFloat(Amt.value) < 0)
{
var Amt_txt = document.getElementById(Amt.id);
Amt_txt.value ='';
Amt_txt.focus();
}
}
//-------------------------------------------------------
function calc_net(Ctrl,Choice)
{
//Declaration
//---------------------------Gross Amount-----------------------------
var tot_amt = document.getElementById('txttotal_amt');
//--------------------------------------------------------------------
//------------------------Discount---------------------------------
var pers_disc = document.getElementById('txtpers_discount');
var amt_disc = document.getElementById('txtamt_discount');
var tot_disc = document.getElementById('txttotal_discount');
//-----------------------------------------------------------------
//------------------------Tax---------------------------------------
var pers_tax = document.getElementById('txtpers_tax');
var amt_tax = document.getElementById('txtamt_tax');
//------------------------------------------------------------------
//-------------------------Net----------------------------
var net_amt = document.getElementById('txtnet_amt');
//-------------------------------------------------------
if (tot_amt.value != "")
{
switch(Choice)
{
case 'Disc':
{
//----------------------- Discount Calculation Part -------------------------------------------------------
if (pers_disc.value != "" && Ctrl == 'pers' && parseFloat(pers_disc.value) < 100)
{
amt_disc.value = CurrencyFormatted(parseFloat(pers_disc.value) * parseFloat(tot_amt.value)/100);
tot_disc.value = CurrencyFormatted(parseFloat(tot_amt.value) - parseFloat(amt_disc.value));
}
else if (amt_disc.value != "" && Ctrl == 'amt' && parseFloat(amt_disc.value) < parseFloat(tot_amt.value))
{
pers_disc.value = CurrencyFormatted(parseFloat(amt_disc.value) * 100 / parseFloat(tot_amt.value));
tot_disc.value = CurrencyFormatted(parseFloat(tot_amt.value) - parseFloat(amt_disc.value));
}
else if (amt_disc.value == "" || pers_disc.value == "")
{
pers_disc.value = "";
amt_disc.value = "";
tot_disc.value = tot_amt.value;
}
if (pers_disc.value >= 100 || parseFloat(amt_disc.value) >= parseFloat(tot_amt.value))
{
pers_disc.value = "";
amt_disc.value = "";
tot_disc.value = tot_amt.value;
Msg_Show('Acc29',amt_disc.id,'Info','btnyes','btnno','btnok','lblmsg')
}
//------------------------ Tax Calculation part -----------------------------------------------------------
if (pers_tax.value != "" && Ctrl == 'pers' && parseFloat(pers_tax.value) < 100)
{
amt_tax.value = CurrencyFormatted(parseFloat(pers_tax.value) * parseFloat(tot_disc.value)/100);
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value != "" && Ctrl == 'amt' && parseFloat(amt_tax.value) < parseFloat(tot_disc.value))
{
pers_tax.value = CurrencyFormatted(parseFloat(amt_tax.value) * 100 / parseFloat(tot_disc.value));
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value == "" || pers_tax.value == "" || parseFloat(pers_tax.value) >= 100 || parseFloat(amt_tax.value) >= parseFloat(tot_disc.value))
{
pers_tax.value = "";
amt_tax.value = "";
net_amt.value = tot_disc.value;
}
//---------------------------------------------------------------------------------------------------------
}
break;
case 'Tax':
{
//------------------------ Tax Calculation part -----------------------------------------------------------
if (pers_tax.value != "" && Ctrl == 'pers' && parseFloat(pers_tax.value) < 100)
{
amt_tax.value = CurrencyFormatted(parseFloat(pers_tax.value) * parseFloat(tot_disc.value)/100);
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value != "" && Ctrl == 'amt' && parseFloat(amt_tax.value) < parseFloat(tot_disc.value))
{
pers_tax.value = CurrencyFormatted(parseFloat(amt_tax.value) * 100 / parseFloat(tot_disc.value));
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value == "" || pers_tax.value == "" )
{
pers_tax.value = "";
amt_tax.value = "";
net_amt.value = tot_disc.value;
}
if (parseFloat(pers_tax.value) >= 100 || parseFloat(amt_tax.value) >= parseFloat(tot_disc.value))
{
pers_tax.value = "";
amt_tax.value = "";
net_amt.value = tot_disc.value;
Msg_Show('Acc30',amt_tax.id,'Info','btnyes','btnno','btnok','lblmsg')
}
//---------------------------------------------------------------------------------------------------------
}
break;
}
}
}
function zero(obj)
{
var txt = document.getElementById(obj.id);
if (parseInt(txt.value) == 0){txt.value="";Msg_Show('Acc32',txt.id,'Info','btnyes','btnno','btnok','lblmsg')}
}
function Popup_Event(obj)
{
document.getElementById('btnPopup_Acc').click();
document.getElementById('txtmsg').value=obj;
return false;
}
//--------------- Disable Controls Depends on User Entry -----------------------
function Journal_Sub_Disable()
{
var Main_Debit = document.getElementById('rptJournal_ctl00_txtMain_Debit');
var Main_Credit = document.getElementById('rptJournal_ctl00_txtMain_Credit');
var Sub_Debit = document.getElementById('rptJournal_ctl00_txtDebit');
var Sub_Credit = document.getElementById('rptJournal_ctl00_txtCredit');
if (Main_Debit.value != ""){Sub_Credit.disabled=false;}else{Sub_Credit.disabled=true;}
if (Main_Credit.value != ""){Sub_Debit.disabled=false;}else{Sub_Debit.disabled=true;}
}
function first_not_zero(obj)
{
var txt = document.getElementById(obj.id);
if ((event.keyCode==48 ||event.keyCode==96) && txt.value.length==0)
return false;
else
return true;
}
function Url_Acct(Rpt_Entry_No,Header)
{
var New=window.open('../frm_Printing/PrintInven.aspx?Entry_No=' + Rpt_Entry_No + '&Header=' + Header +'','','titlebar=yes,fullscreen=no,scrollbars=yes','popup');
if (window.focus)
{
New.focus();
alert('Printed');
return false;
}
}
//==================================================================================================
//-------------------------- Date Validation for Accounts Modal Popup ------------------------------
//==================================================================================================
//---- Changing date Format Depends on User's Requirement ----
function date_focus(obj,option)
{
var txt = document.getElementById(obj.id);
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (option == 'focus')
{
if (dt_format.value=='MM/dd/yyyy')
{
if (txt.value == "MM/dd/yyyy"){txt.value="";}
//txt.focus();
}
else if (dt_format.value=='dd/MM/yyyy')
{
if (txt.value == "dd/MM/yyyy"){txt.value="";}
}
}
else
{
if (dt_format.value=='MM/dd/yyyy')
{
if (txt.value == ""){txt.value="MM/dd/yyyy";}
}
else if (dt_format.value=='dd/MM/yyyy')
{
if (txt.value == ""){txt.value="dd/MM/yyyy";}
}
}
}
//---------------------- Validating the date ---------------------------
function Valid_Date(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
}
//--------------------------Function to Allow Pre, Current Date and Block Future Date
function Valid_Pre_Date(txtdate,btnyes,btnno,btnok,lblmsg)
{
debugger;
var right_now=new Date();
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.value=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
// dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
else
{
if (getdate(dat.value) > right_now){Msg_Show('Cmn16',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
//-------- Changing Date Format -------------
function getdate(dat)
{
var datsplt = dat.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
dtobj = new Date(yy,mm,dd);
return dtobj;
}
//Function for Processing Modal Popup
function Msg_Show(node,Target_ID,mode,btnyes,btnno,btnok,lblmsg)
{
var lbl = document.getElementById(lblmsg);
var btnshow = document.getElementById('modal');
var hide = parent.document.getElementById('txtfocus_ID');
//------- Getting Message from XML File ----------------
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
lbl.innerText = msg[0].firstChild.nodeValue;
//------------------------------------------------------
//-------- Handle Modal Popup Button Event ------------
hide.value = Target_ID;
btnshow.click();
//-----------------------------------------------------
//--- Process for Hide Button to Confirm or Info -------
var yes = document.getElementById(btnyes);
var no = document.getElementById(btnno);
var ok = document.getElementById(btnok);
if(mode == 'Confirm')
{
yes.style.display="";
no.style.display="";
ok.style.display="none";
yes.focus();
}
else
{
yes.style.display="none";
no.style.display="none";
ok.style.display="";
ok.focus();
}
//------------------------------------------------------
}
function Print_From_To()
{
var from = document.getElementById('txtfrom');
var to = document.getElementById('txtto');
var lbl = document.getElementById('lblpages');
if (from !=null && to != null)
{
if (parseInt(from.value) > parseInt(to.value) && from.value != "" && to.value != "")
{
lbl.style.display='';
to.focus();
return false;
}
else
{
lbl.style.display='none';
return true;
}
}
}
//---------- Date comparision for checking greater or less ------------
function date_compare(from,to)
{
var from_date = document.getElementById(from);
var to_date = document.getElementById(to);
if (Date.parse(Date_Format_Change_Fun(from_date.value,from_date))> Date.parse(Date_Format_Change_Fun(to_date.value,to_date)))
{
Msg_Show('Cmn14',to_date.id,'Info','btnyes','btnno','btnok','lblmsg')
return false;
}
}
//---------------------------------------------------------------------
//------------------- Function for showing Add New Popup ------------------
function Add_New_Acc(obj,Eve)
{
var drp = document.getElementById(obj.id);
var btn = document.getElementById(Eve);
if (drp.options[drp.selectedIndex].text == '[Add New]')
{
btn.click();
}
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//************************************ PAYROLL JAVASCRIPT ****************************************
//PAYROLL CALCULATIONS
//=================================================================================================
function amt_pers(E,bas,per,amount)
{
var basic = document.getElementById(bas);
var pers = document.getElementById(per);
var amt = document.getElementById(amount);
if (basic.value > 0 && basic.value != "")
{
if (E =='pers' && pers.value > 0 && pers.value != "" && pers.value < 100)
{
amt.value = parseFloat(pers.value)*parseFloat(basic.value)/100;
amt.value = CurrencyFormatted(amt.value);
}
else if (E == 'amt' && amt.value > 0 && amt.value != "" && parseFloat(amt.value) < parseFloat(basic.value))
{
pers.value = parseFloat(amt.value)*100/parseFloat(basic.value);
pers.value = CurrencyFormatted(pers.value);
}
else
{
if(E == 'pers' && pers.value != "" && pers.value != 0 && pers.value !='.')
{
Msg_Show('Prl10',pers.id,'Info','btnyes','btnno','btnok','lblmsg')
}
else if(E == 'amt' && amt.value != "" && amt.value != 0 && amt.value !='.')
{
Msg_Show('Prl11',amt.id,'Info','btnyes','btnno','btnok','lblmsg')
}
else if (E == 'pers' && (pers.value == "" || pers.value == 0 || pers.value == '.'))
{
amt.value="";
}
}
}
else{Msg_Show('Prl12',basic.id,'Info','btnyes','btnno','btnok','lblmsg')}
}
function allow(obj1,obj2,obj3,obj4)
{
var bas = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
var grs = document.getElementById('RptAllowance_ctl01_txtGross');
var net = document.getElementById('RptDeduction_ctl01_txtNet');
if ( bas.value > 0 && bas.value != NaN )
{
if ( obj4 == 'basic')
{
amt.value = "";
grs.value = CurrencyFormatted(bas.value);
net.value = CurrencyFormatted(bas.value);
}
}
else
{
grs.value ="";
net.value ="";
amt.value ="";
bas.value ="";
if ( pers.value > 0 && pers.value != NaN )
{
Msg_Show('Prl12',bas.id,'Info','btnyes','btnno','btnok','lblmsg')
pers.value = "";
}
}
if ( bas.value > 0 && bas.value != NaN && pers.value > 0 && amt.value != NaN )
{
if ( pers.value < 100 )
{
amt.value = CurrencyFormatted((parseFloat(pers.value)/100)*parseFloat(bas.value));
}
else
{
pers.value = "";
amt.value = "";
}
}
}
function dir_allow(obj1,obj2,obj3)
{
var bas = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
if ( bas.value > 0 && bas.value != NaN )
{
pers.value = "";
if ( amt.value <= 0 )
{
amt.value ="";
}
}
else
{
amt.value = "";
Msg_Show('Prl12',bas.id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
function deduct(obj1,obj2,obj3)
{
var grs = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
var drop = document.getElementById('drpdeduct');
var esi = document.getElementById('txtmax_esi');
var pf = document.getElementById('txtmax_pf');
var basic = document.getElementById('txtbasic');
var max="";
if ( grs.value > 0 && grs.value != NaN )
{
amt.value = "";
}
else
{
grs.value ="";
amt.value ="";
if ( pers.value > 0 && pers.value != NaN )
{
Msg_Show('Prl12',basic.id,'Info','btnyes','btnno','btnok','lblmsg')
pers.value = "";
}
}
if ( grs.value > 0 && grs.value != NaN && pers.value > 0 && amt.value != NaN )
{
if ( pers.value < 100 )
{
amt.value = CurrencyFormatted((parseFloat(pers.value)/100)*parseFloat(grs.value));
}
else
{
pers.value = "";
amt.value = "";
}
}
}
function dir_deduct(obj1,obj2,obj3)
{
var grs = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
var drop = document.getElementById('drpdeduct');
var esi = document.getElementById('txtmax_esi');
var pf = document.getElementById('txtmax_pf');
var lblmax = document.getElementById('lblmax');
var bas = document.getElementById('txtbasic');
var max="";
if ( grs.value > 0 && grs.value != NaN )
{
if ( amt.value <= 0 )
{
amt.value = "";
}
pers.value = "";
}
else
{
amt.value = "";
Msg_Show('Prl12',bas.id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
function PRL_event(obj)
{
document.getElementById(obj).click();
}
//---------------- Limitation Entry In Textbox --------------
function max_val(obj,max)
{
var txt = document.getElementById(obj.id);
if (parseInt(txt.value) > max )
{
Msg_Show('Prl07',txt.id,'Info','btnyes','btnno','btnok','lblmsg');
}
}
//------------- Block the Future Date ---------------
function cur_date(obj)
{
var txt = document.getElementById(obj.id);
var cur = new Date();
var mm = cur.getMonth() + 1;
var dd = cur.getDate();
var yy = cur.getFullYear();
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var cur = mm + "/" + dd + "/" + yy;
}
else if(dt_format.value=='dd/MM/yyyy')
{
var cur = dd + "/" + mm + "/" + yy;
}
if(getdate(txt.value) > getdate(cur))
{
txt.value='';
Msg_Show('Cmn16',txt.id,'Info','btnyes','btnno','btnok','lblmsg');
}
}
//---------------------------------------------------
function btn_hide()
{
document.getElementById('btnno').style.display="none";
document.getElementById('btnyes').style.display="none";
var btn = document.getElementById('btnok');
btn.style.display="";
return btn;
}
//---------------------- PAYROLL SALARY GRID CALCULATION --------------------------
function salary_calc(obj,ctrl)
{
// var target = document.getElementById(obj);
// target = target.id.replace(ctrl,"").replace(/gvsalary_calc_ctl/,"");
// var net = document.getElementById('gvsalary_calc_ctl'+ target + '_lblnet');
// var allowance = document.getElementById('gvsalary_calc_ctl'+ target + '_txtallowance');
// var advance = document.getElementById('gvsalary_calc_ctl'+ target + '_txtadvance');
// var EMI = document.getElementById('gvsalary_calc_ctl'+ target + '_txtloan_EMI');
// var deduct = document.getElementById('gvsalary_calc_ctl'+ target + '_txtdeduction');
// var home = document.getElementById('gvsalary_calc_ctl'+ target + '_txttake_home');
// var Leave = document.getElementById('gvsalary_calc_ctl'+ target + '_txt_Leave');
//
// home.value = parseFloat(net.innerText)
// if (allowance.value != "")
// {
// home.value = parseFloat(net.innerText) + parseFloat(allowance.value);
// }
// if (advance.value != "")
// {
// home.value = parseFloat(home.value) - parseFloat(advance.value);
// }
// if (EMI.innerText!= "")
// {
// home.value = parseFloat(home.value) - parseFloat(EMI.innerText);
// }
// if (deduct.value != "")
// {
// home.value = parseFloat(home.value) - parseFloat(deduct.value);
// }
// if (Leave.innerText != "")
// {
// home.value = parseFloat(home.value) - parseFloat(Leave.innerText);
// }
//
// home.value = CurrencyFormatted(home.value)
// var key=event.keyCode;
// var chk;
// var target = document.getElementById(obj);
// target.focus();
//// target = target.id.replace(ctrl,"").replace(/gvsalary_calc_ctl/,"");
//// var grd = document.getElementById('gvsalary_calc').rows.length;
//// if (key == 38 && parseInt(target)>=3)
//// {
//// chk = parseFloat(target) - 1;
//// chk = parseInt(chk)>9?chk:'0'+chk;
//// document.getElementById('gvsalary_calc_ctl'+ chk + ctrl).focus();
//// }
//// else if (key == 40 && parseInt(target)< parseInt(grd))
//// {
//// chk = (parseFloat(target) + 1);
//// chk = parseInt(chk)>9?chk:'0'+chk;
//// var ID=document.getElementById('gvsalary_calc_ctl'+ chk + ctrl);
//// if (ID != null)
//// {
//// ID.focus();
//// }
//// }
}
function Extractpers(obj)
{
var key=event.keyCode;
var txt = document.getElementById(obj.id)
if ((parseFloat(txt.value) >= 100) && (parseFloat(txt.value)!= NaN))
{
txt.value = txt.value.substring(0,(txt.value.length-1))
if ((key >= 48) && (key <=58) || (key>=96) && (key<=105))
{
return false;
}
else
{
return true;
}
}
else
{
return true;
}
}
function advance()
{
var txtamt = document.getElementById('txtAmount');
var txtmonth = document.getElementById('txtMonth');
var txtcalc = document.getElementById('txtAmt_Month');
if ( txtamt.value > 0 && txtamt.value != NaN && txtmonth.value > 0 && txtmonth.value != NaN )
{
txtcalc.value = CurrencyFormatted(parseFloat(txtamt.value)/parseInt(txtmonth.value));
}
else{txtcalc.value="";}
}
//------------- Row Highlighting in gridview ----------
//Global Declaration
var Previous=0;
function hightlight_row(index,Grid_ID)
{
var Grid = document.getElementById(Grid_ID)
Grid.rows(Previous + 1).style.backgroundColor=XML_msg('Clr07');
Grid.rows(index + 1).style.backgroundColor=XML_msg('Clr08');
Previous = index;
}
//------- Getting Message from XML File ----------------
function XML_msg(node)
{
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
return msg[0].firstChild.nodeValue;
//------------------------------------------------------
}
//------------------------ Adding New Allowance or Deduction in Salary Master ----------------
function Add_New_Allow_Deduct(Obj)
{
var DRP = document.getElementById(Obj.id);
if (DRP.value == '[Add New]')
{
var lbl = document.getElementById('lblHead');
if (DRP.id == 'RptAllowance_ctl00_drpAllowance')
{
lbl.innerText = 'ALLOWANCE CREATION';
}
else
{
lbl.innerText = 'DEDUCTION CREATION';
}
document.getElementById('txtmsg').value = DRP.id;
document.getElementById('BtnAdd_Hide').click();
document.getElementById('txtAdd_New').focus();
}
}
//-------------------- Adding New Account in Payroll ------------------------------------
function Add_New_Acc_Pay(Obj)
{
var DRP = document.getElementById(Obj.id);
if (DRP.value == '[Add New]')
{
document.getElementById('txtmsg').value = DRP.id;
document.getElementById('BtnAdd_Hide').click();
}
}
//-------------------- Adding New & Focus to popup control ------------------------------------
function Add_New_Acc_Pay_New(Obj,focus_id)
{
var DRP = document.getElementById(Obj.id);
if (DRP.value == '[Add New]')
{
document.getElementById('txtmsg').value = DRP.id;
document.getElementById('BtnAdd_Hide').click();
document.getElementById(focus_id).focus();
}
}
//============================== PAYROLL SCRIPT FINISHED ==============================
// ================================= FEES MODULE - JAVASCRIPT - START =======================
//------------------------------FEES SETTING - MODALPOPUP FIRE ------------------------
function Msg_Show_2Btn(node,Target_ID,mode,btnyes,btnno,btnok,lblmsg)
{
var lbl = document.getElementById(lblmsg);
var btnshow = document.getElementById('modal');
var hide = parent.document.getElementById('txtfocus_ID');
//------- Getting Message from XML File ----------------
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
lbl.innerText = msg[0].firstChild.nodeValue;
//------------------------------------------------------
//-------- Handle Modal Popup Button Event ------------
hide.value = Target_ID;
btnshow.click();
//-----------------------------------------------------
//--- Process for Hide Button to Confirm or Info ------
var yes = document.getElementById(btnyes);
var no = document.getElementById(btnno);
if(mode == 'Confirm' && btnok=='')
{
yes.value='Yes';
yes.style.display="";
no.style.display="";
yes.focus();
}
else if (mode == 'Confirm' && btnok!='')
{
var ok = document.getElementById(btnok);
yes.style.display="";
no.style.display="";
ok.style.display="none";
ok.focus();
}
else if (mode == 'Info' && btnok!='')
{
var ok = document.getElementById(btnok);
yes.style.display="none";
no.style.display="none";
ok.style.display="";
ok.focus();
}
else
{
yes.value='OK';
yes.style.display="";
no.style.display="none";
yes.focus();
}
}
//---------------------FEES SETTING - TERM DATE CHECKING -----------------------
function Fee_setting_Date(obj,ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Install_No;
Install_No=document.getElementById('drp_Install').value;
//-------------------------------------------
//For Sankara Matriculation School
//Install_No=3;
//-------------------------------------------
var Previous_date;
var Next_date;
var Msg_check_pre=0;
var Msg_check_next=0;
var temp=parseInt(obj.id.replace(target,"").substring(8));
if (obj.id != target+'Txt_Last1')
{
temp=parseInt(temp)-1;
Previous_date=document.getElementById(target+'Txt_Last'+ temp);
}
if (obj.id!='Txt_Last'+Install_No)
{
temp=parseInt(temp)+1;
Next_date=document.getElementById(target+'Txt_Last'+ temp);
}
if (Previous_date!=null)
if (Date.parse(Date_Format_Change_Fun(Previous_date.value,Previous_date)) > Date.parse(Date_Format_Change_Fun(obj.value,obj)))
{
obj.value='';
Msg_check_pre=parseInt(temp)-1;
}
if (Next_date!=null)
if (Date.parse(Date_Format_Change_Fun(obj.value,obj)) > Date.parse(Date_Format_Change_Fun(Next_date.value,Next_date)))
{
obj.value='';
Msg_check_next=parseInt(temp)+1;
}
switch(Msg_check_pre)
{
case 1:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 2:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
if ((Msg_check_pre==0) && (Msg_check_next!=0))
{
switch(Msg_check_next)
{
case 2:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 12:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
}
}
//----------------------- FEES SETTING - FINE SETTING -----------------------------
function Fine_Setting_Row_visble()
{
if(document.getElementById('Radio_per_day').checked==true)
{
document.getElementById('Tr_Per_day').style.visibility='visible';
document.getElementById('Tr_Period').style.visibility='hidden';
}
else
{
document.getElementById('Tr_Per_day').style.visibility='hidden';
document.getElementById('Tr_Period').style.visibility='visible';
}
}
//------------------------------ FEES SETTING - TO DAY ON CHANGE ------------------
function Fine_To_Day(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var To_day=document.getElementById(target +'Txt_From_Day');
var Error = document.getElementById(target +'Lb_Fine_Error');
if (parseInt(obj.value)==0 || parseInt(obj.value)>365 || parseInt(obj.value)<=parseInt(To_day.value))
{
obj.value='';
Error.style.display='';
obj.focus();
}
else
{
Error.style.display='none';
obj.focus();
}
}
//------------------------ FEES PAY AND UPDATION - OTHER FEES -----------------------------
function Other_Fees_Amt_Validation(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Basic=document.getElementById(target +'Lbl_Other_Amt');
var err_msg = document.getElementById('Rep_Other_ctl00_Lbl_Other_Error');
if (parseFloat(obj.value)>parseFloat(Basic.innerText))
{
err_msg.innerText='Error!! Greater than Fee Amount';
err_msg.style.visibility='visible';
obj.value='';
obj.focus();
}
else
{
err_msg.style.visibility='hidden';
}
}
function Other_Fees_Amt_Update_Validation(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Basic=document.getElementById(target +'Lbl_Other_Amt');
var Temp_Basic=Basic.innerText;
var Temp_obj=obj.value=='' ? 0 : obj.value;
var Hidden=document.getElementById(target +'Lbl_Hidden_Tot_Amt');
Temp_Basic= (parseInt(Hidden.innerText)-parseInt(Temp_obj))
var err_msg = document.getElementById('Rep_Other_ctl00_Lbl_Other_Error');
if (parseFloat(Temp_obj)>parseFloat(Hidden.innerText))
{
Basic.innerText=CurrencyFormatted(Hidden.innerText);
err_msg.innerText='Error!! Greater than Fee Amount';
err_msg.style.visibility='visible';
obj.value='';
obj.focus();
}
else
{
Basic.innerText=CurrencyFormatted(Temp_Basic);
err_msg.style.visibility='hidden';
}
}
//------------------------ FEES PAY AND UPDATEION - CONCESSION CALCULATION ----------------
function scholar(obj, ctrl)
{
var E=obj.id.substring(obj.id.length-3);
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var basic=document.getElementById(target +'Lbl_Concess_Tot_Amt');
var pers = document.getElementById(target + 'Txt_Concess_Per');
var amt = document.getElementById(target + 'Txt_Concess_Amt');
var err_msg = document.getElementById('Rep_Concess_ctl00_Lbl_Concess_Error');
if (E =='Per' && pers.value > 0 && pers.value != "" )
{
if (pers.value <= 100)
{
amt.value = parseFloat(pers.value)*parseFloat(basic.innerText)/100;
amt.value = CurrencyFormatted(amt.value);
err_msg.style.visibility='hidden';
}
else
{
err_msg.innerText='Error!! Invalid Percentage';
err_msg.style.visibility='visible';
pers.value='';
amt.value='';
pers.focus();
}
}
else if (E == 'Amt' && amt.value > 0 && amt.value != "")
{
if(parseFloat(amt.value) <= parseFloat(basic.innerText))
{
pers.value = parseFloat(amt.value)*100/parseFloat(basic.innerText);
pers.value = CurrencyFormatted(pers.value);
err_msg.style.visibility='hidden';
}
else
{
err_msg.innerText='Amount is greater than Fee Amount';
err_msg.style.visibility='visible';
pers.value='';
amt.value='';
amt.focus();
}
}
else if (E =='Per' && ( pers.value == 0 || pers.value == "" ))
amt.value = '';
else if (E =='Amt' && ( amt.value == 0 || amt.value == "" ))
pers.value='';
}
//----------------------- FEES PAY AND UPDATION - DROPDOWNLIST SHOW ------------------------
function onCalendarShown(sender,args)
{
document.getElementById("Drp_mode").style.visibility='hidden';
}
//----------------------- FEES PAY AND UPDATION - DROPDOWNLIST HIDING ----------------------
function onCalendarHidden(sender,args)
{
document.getElementById("Drp_mode").style.visibility='visible';
}
//----------------------- FEES STRCTURE - PRINT OPTION --------------------------------------
function Clickheretoprint(obj)
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=no,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
var content_vlue = document.getElementById(obj).innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>Fee Receipt</title>');
docprint.document.write('</head><body onLoad="self.print()"><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.document.close();
docprint.focus();
}
//------------------------------ Fee Pay and Update Preview Total Calculation --------------
function Receipt_Tot()
{
var Name = document.getElementById('Tr_Receipt_SName');
var Roll = document.getElementById('Tr_Receipt_Roll');
var Std = document.getElementById('Tr_Receipt_Std');
var Section = document.getElementById('Tr_Receipt_Sec');
var radio = document.getElementsByName('Radio_Option');
var term = document.getElementById('Drp_Term');
if (term==null)
term='--Select--';
var values;
for (var i=0; i<radio.length; i++)
{
if (radio[i].checked==true)
values=radio[i].parentElement.innerText;
}
var Concess = document.getElementById('Tr_Receipt_Concess');
var Concess_Tot = document.getElementById('Tr_Receipt_Tot_Concess');
var Scholar = document.getElementById('Tr_Receipt_Scholar');
var Net_Tot = document.getElementById('Tr_Receipt_Net_Tot');
var Gross = document.getElementById('Tr_Receipt_Gross_Tot');
var Fine = document.getElementById('Tr_Receipt_Fine');
var Tot_Fine = document.getElementById('Tr_Receipt_Tot_Fine');
var Tot_Scholar = document.getElementById('Tr_Receipt_Tot_Scholar');
var Excess_Shortage = document.getElementById('Tr_Excess_Shortage');
if(Roll.value=='' ||
(term.value=='--Select--' && values!='Other Fees') ||
(document.getElementById('Tot_Total').value==0 && values=='Other Fees'))
{
Name.cells[1].innerText='';
Name.cells[2].innerText='';
Name.cells[3].innerText='';
Roll.cells[1].innerText='';
Std.cells[1].innerText = '';
Section.cells[1].innerText = '';
Gross.cells[2].innerText = CurrencyFormatted(0);
Fine.cells[2].innerText = CurrencyFormatted(0);
Tot_Fine.cells[2].innerText = CurrencyFormatted(0);
Concess.cells[2].innerText = CurrencyFormatted(0);
Concess_Tot.cells[2].innerText= CurrencyFormatted(0);
Scholar.cells[2].innerText = CurrencyFormatted(0);
Net_Tot.cells[2].innerText= CurrencyFormatted(0);
Excess_Shortage.cells[1].innerText = ' Excess Or Shortage : '
Excess_Shortage.cells[2].innerText = CurrencyFormatted(0);
Tot_Scholar.cells[2].innerText = CurrencyFormatted(0);
var fee;
for(i=1;i<=20;i++)
{
fee=document.getElementById('fee'+i);
fee.style.display="none";
}
}
else
{
Name.cells[1].innerText=document.getElementById('Txt_Name').value;
Roll.cells[1].innerText=document.getElementById('Txt_Roll').value;
var Concess_Amt = document.getElementById('Txt_Concession_Amt');
if (Concess_Amt != null)
Concess.cells[2].innerText = Concess_Amt.value == '' ? CurrencyFormatted(0) : CurrencyFormatted(Concess_Amt.value);
else
Concess.cells[2].innerText = CurrencyFormatted(0);
Concess_Tot.cells[2].innerText= CurrencyFormatted(parseFloat(document.getElementById('Tr_Receipt_Tot_Fine').cells[2].innerText) - parseFloat(Concess.cells[2].innerText));
var Scholar_Amt = document.getElementById('Txt_Scholar_Amount');
if (Scholar_Amt != null)
Scholar.cells[2].innerText = Scholar_Amt.value == '' ? CurrencyFormatted(0) : CurrencyFormatted(Scholar_Amt.value);
else
Scholar.cells[2].innerText = CurrencyFormatted(0);
Net_Tot.cells[2].innerText= CurrencyFormatted(parseFloat(Concess_Tot.cells[2].innerText) - parseFloat(Scholar.cells[2].innerText));
}
if (values=='Other Fees')
{
document.getElementById('Tr_Receipt_Gross_Tot').style.display="none";
document.getElementById('Tr_Receipt_Fine').style.display="none";
document.getElementById('Tr_Receipt_Fine_Line').style.display="none";
document.getElementById('Tr_Receipt_Tot_Fine').style.display="none";
document.getElementById('Tr_Receipt_Concess').style.display="none";
document.getElementById('Tr_Receipt_Concess_Line').style.display="none";
document.getElementById('Tr_Receipt_Tot_Concess').style.display="none";
document.getElementById('Tr_Receipt_Scholar').style.display="none";
document.getElementById('Tr_Receipt_Scholar_Line').style.display="none";
}
else
{
document.getElementById('Tr_Receipt_Gross_Tot').style.display="";
document.getElementById('Tr_Receipt_Fine').style.display="";
document.getElementById('Tr_Receipt_Fine_Line').style.display="";
document.getElementById('Tr_Receipt_Tot_Fine').style.display="";
document.getElementById('Tr_Receipt_Concess').style.display="";
document.getElementById('Tr_Receipt_Concess_Line').style.display="";
document.getElementById('Tr_Receipt_Tot_Concess').style.display="";
document.getElementById('Tr_Receipt_Scholar').style.display="";
document.getElementById('Tr_Receipt_Scholar_Line').style.display="";
}
}
//---------------------------------- FEES PAY AND UPDATE -----------------------------------
function Receipt_Popup(obj, title)
{
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
title=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin();" onafterprint="Fee_Receipt_Print_End();"><div align="center">';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</div></body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
}
//---------------------- FEES PAY AND UPDATE (PRINT,CLOSE) Button hide ----------------------
function Fee_Receipt_Print_Begin()
{
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
}
//---------------------- FEES PAY AND UPDATE (PRINT,CLOSE) Button visible -------------------
function Fee_Receipt_Print_End()
{
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
}
//----------------------- FEES STUCTURE - MORE DETAILS BUTTON VISIBLE HIDDEN -------------
function Fee_Structure_Print_Begin()
{
document.getElementById('A_Print_Stru').style.visibility='hidden';
}
//----------------------- FEES STRUCTURE - MORE DETAILS BUTTON VISIBLE SHOW --------------
function Fee_Structure_Print_End()
{
document.getElementById('A_Print_Stru').style.visibility='visible';
}
// ================================= FEES MODULE - JAVASCRIPT - END =======================
// Interview Call
//Gridview Header Checkbox Checked (Check All) Operation
function HeaderClick(objHeader,objCount)
{
var State=objHeader.checked;
var header=objHeader.form.elements;
var parentGrid=document.getElementById('grid_candidate');
var Count=0;
if (parentGrid.rows.length > 0)
{
for(i=1;i<parentGrid.rows.length;i++)
{
var gridCell = parentGrid.rows[i].cells[0];
for (j=0;j<gridCell.childNodes.length;j++)
{
if(gridCell.childNodes[j].type=="checkbox" && header[i]!=objHeader.id)
{
if (State==true)
{
gridCell.childNodes[j].checked = objHeader.checked;
gridCell.childNodes[j].parentNode.parentNode.style.fontWeight='bold';
Count= parseInt(Count) + 1;
}
else
{
gridCell.childNodes[j].checked = objHeader.checked;
gridCell.childNodes[j].parentNode.parentNode.style.fontWeight='normal';
}
}
}
}
document.getElementById(objCount).value = Count;
}
}
//Gridview Datarow Checkbox Checked (Individual Check Box) Operation
function childChkSelected(objHeadName,objChildName,chkCount,grid2)
{
if(document.getElementById(objChildName.id).checked==true)
{
document.getElementById(chkCount).value=parseInt(document.getElementById(chkCount).value) + 1;
objChildName.parentNode.parentNode.style.fontWeight='bold';
}
else
{
document.getElementById(chkCount).value=parseInt(document.getElementById(chkCount).value) - 1;
objChildName.parentNode.parentNode.style.fontWeight='normal';
}
var chkBox=document.getElementById(objChildName.id);
var chkBox=document.getElementById(objHeadName).form.elements;
var state=document.getElementById(objHeadName).checked;
var pCount=0;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=='checkbox' && chkBox[i].id!=objHeadName && chkBox[i].id.startsWith(grid2)==false)
pCount= pCount + 1;
//pCount=pCount-1;
if(pCount==parseInt(document.getElementById(chkCount).value))
{
if(state==false)
document.getElementById(objHeadName).checked=true;
}
else if (pCount!=parseInt(document.getElementById(chkCount).value))
{
if(state==true)
document.getElementById(objHeadName).checked=false;
}
document.getElementById(chkCount).value;
}
//For Reloading the Javascript Function for Data once again
function ReLoadEmp()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(childChkSelected);
}
//------------------After File Upload - Focus Goes to Save Button (Employee Details)
function Fileupload_focus()
{
document.getElementById('btnSave').focus();
}
//Retirement Date Calculation
function Retirement()
{
var iddd=document.getElementById('txtDateofBirth').value;
var DateSplit=iddd.split('/');
var AddYear=(parseInt(DateSplit[2])+parseInt(58));
$get('txtRetirementdate').value=DateSplit[0]+'/'+DateSplit[1]+'/'+AddYear;
}
// ================================= SMS MODULE - JAVASCRIPT - START =======================
function Char_Sms_Count(header,message)
{
var From = document.getElementById(header).value;
var From_len = From !='' ? From.length : 0;
var Msg = document.getElementById(message).value;
var len = Msg !='' ? Msg.length : 0;
len=parseInt(From_len) + parseInt(len);
document.getElementById('Txt_Char_Len').innerText=parseInt(len);
//alert(len);
if (parseInt(len)>160)
{
if(Msg.length>940)
{
document.getElementById(message).value=Msg.substring(0,940);
document.getElementById('Txt_Char_Len').innerText=940+From.length;
document.getElementById('Txt_Sms_Count').innerText=6;
}
else
{
document.getElementById('Txt_Sms_Count').innerText=parseInt(parseInt(len)/160)+1;
}
}
else if (parseInt(len)>0)
{
document.getElementById('Txt_Sms_Count').innerText='1';
}
else
{
document.getElementById('Txt_Sms_Count').innerText='0';
}
}
function SMS_CheckMaxLength(obj,length)
{
var mxlength=length;
var temp = document.getElementById(obj).value;
if (temp.length>=mxlength)
{
if(event.keyCode == 8)
{
document.getElementById(obj).value=temp.substring(0,940);
document.getElementById(obj).focus();
return true;
}
else
{
document.getElementById(obj).focus();
return false;
}
}
}
function Valid_Time(obj)
{
txt = document.getElementById(obj.id);
var Str = txt.value.split(':');
Str[1] = Str[1].replace(' AM','').replace(' PM','');
if(parseInt(Str[0])>12 || parseInt(Str[1])>59)
{
Msg_Show('Cmn19',txt.id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
// ================================= SMS MODULE - JAVASCRIPT - END =======================
function maximize()
{
window.moveTo(0,0)
window.resizeTo(screen.availWidth, screen.availHeight)
}
function date_compare_Excursion(from,to)
{
var F = document.getElementById(from).value;
var E = document.getElementById(to).value;
if (Date.parse(Date_Format_Change_Fun(F,document.getElementById(from))) > Date.parse(Date_Format_Change_Fun(E,document.getElementById(to))))
{
document.getElementById(to).value="";
document.getElementById('btncheck').click();
}
}
//===================
function isNumberKeyWithDot(txt_id)
{
if(event.shiftKey) return false;
var charCode=(event.which) ? event.which: event.keyCode
if ((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 105)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14) && charCode != 190 && charCode !=110)
{
return false;
}
else
{
var txt = document.getElementById(txt_id.id).value;
if(txt.length==0)
{
if(event.keyCode==48 || event.keyCode==96 || event.keyCode==45 || event.keyCode==110 || event.keyCode==190)
return false;
}
return true;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
function FirstDigitNonZero(txt_id)
{
if(event.shiftKey) return false;
var charCode=(event.which) ? event.which: event.keyCode
if(charCode==16) return false;
if ((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 105)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14))
{
return false;
}
else
{
var txt = document.getElementById(txt_id.id).value;
if(txt.length==0)
{
if(event.keyCode==48 || event.keyCode==96)
return false;
}
return true;
}
}
//Hostel Module Scripts
function Time_Diff_Hostel(st,drp)
{
var t1 = document.getElementById(st);
var t2 = document.getElementById(drp);
if((t1.value==t2.value) || (t2.value=='12:00 AM')|| (mil(t1.value)>mil(t2.value)))
{
t2.value='';
t2.focus();
$get('btnScript').click();
}
}
function testWithCustomdate(txt_Date)
{
var dat_Fetch = document.getElementById(txt_Date).value;
if(dat_Fetch !='')
{
var date_Validate = Date_Validate(dat_Fetch);
if(date_Validate == false)
{
document.getElementById(txt_Date).value='';
document.getElementById(txt_Date).focus();
document.getElementById('Btnhide').click();
}
else
{
var dt1=new Date(document.getElementById('Txthide').value);
var dt2=new Date(dat_Fetch);
if(dt2>dt1)
{
document.getElementById(txt_Date).value='';
document.getElementById(txt_Date).focus();
document.getElementById('Btnhide').click();
}
else
{
document.getElementById('BtnFocus').click();
}
}
}
}
function ToDate_Validate(txt_Date)
{
var dat_Fetch = document.getElementById(txt_Date).value;
if(dat_Fetch != "")
{
var date_Validate = Date_Validate(dat_Fetch);
if (date_Validate == false)
{
document.getElementById(txt_Date).value='';
document.getElementById(txt_Date).focus();
document.getElementById('Btnhide').click();
}
else
{
document.getElementById('BtnFocus').click();
}
}
}
function Date_Validate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var strMonth=dtStr.substring(0,pos1)
var strDay=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
}
else if(dt_format.value=='dd/MM/yyyy')
{
var strDay=dtStr.substring(0,pos1)
var strMonth=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
}
strYr=strYear
if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
//alert("The date format should be : mm/dd/yyyy")
return false
}
if (strMonth.length<1 || month<1 || month>12){
//alert("Please enter a valid month")
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
//alert("Please enter a valid day")
return false
}
if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
//alert("Please enter a valid date")
return false
}
return true
}
function HoInOut_Valid_Time(obj)
{
txt = document.getElementById(obj.id);
var Str = txt.value.split(":");
Str[1] = Str[1].replace(" AM","").replace(" PM","");
if(parseInt(Str[0])>12 || parseInt(Str[1])>59)
{
$get('hdenCheck').value='0';
$get('btncheck').click();
}
}
// ************************** Hostel Module ***********************************************
//Hoste Master
function FirstDigitNonZero(txt_id)
{
if(event.shiftKey)
return false;
var charCode=(event.which) ? event.which: event.keyCode
if(charCode==16) return false;
if((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 105)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14))
{
return false;
}
else
{
var txt = document.getElementById(txt_id.id).value;
if(txt.length==0)
{
if(event.keyCode==48 || event.keyCode==96)
return false;
}
return true;
}
}
function DiscountAmt(objDiscount,objTotAmt,objPreBalance)
{
var Discount=$get(objDiscount.id).value;
var Amt=$get(objTotAmt).value;
var PreBalance=$get(objPreBalance).value;
var TotalAmount= $get('txtTotalAmount');
var AmtPaid=$get('txtAmtPaid');
var Balance=$get('txtCurrentBalance');
if (Discount>0 && Discount!=NaN)
{
TotalAmount.value=parseFloat(Amt)+parseFloat(PreBalance)-parseFloat(Discount);
if (isNaN(parseFloat(TotalAmount.value)))
{
TotalAmount.value=''
}
}
else
{
TotalAmount.value=Amt;
}
if(AmtPaid.value>0 && AmtPaid.value!=NaN )
{
Balance.value=parseFloat(TotalAmount.value)-parseFloat(AmtPaid.value);
}
}
function AmountPaid(objAmtPaid,objTotAmt,objBalance)
{
var AmtPaid=$get(objAmtPaid.id).value;
var TotAmt=$get(objTotAmt).value;
var Balance=$get(objBalance);
if (AmtPaid>0 && AmtPaid!=NaN)
{
Balance.value=parseFloat(TotAmt)-parseFloat(AmtPaid);
}
else
{
Balance.value=TotAmt;
}
if (isNaN(Balance.value))
{
Balance.value='0.00';
}
}
function Calculate()
{
var messbill = parseFloat(document.getElementById('txtMessBill').value);
var launbill = parseFloat(document.getElementById('txtLanudryBill').value);
var roombill = parseFloat(document.getElementById('txtRoomBill').value);
var others = parseFloat(document.getElementById('txtOthersBill').value);
var TotalAmt = document.getElementById('txtAmount');
TotalAmt.value=0;
if (messbill > 0 && messbill != NaN)
TotalAmt.value=CurrencyFormatted(messbill);
if (launbill > 0 && launbill != NaN)
TotalAmt.value = CurrencyFormatted(parseFloat(TotalAmt.value) + launbill);
if (roombill > 0 && roombill != NaN)
TotalAmt.value = CurrencyFormatted(parseFloat(TotalAmt.value) + roombill);
if(others > 0 && others != NaN)
TotalAmt.value = CurrencyFormatted(parseFloat(TotalAmt.value) + others);
}
// ------------------------ STUDENT INFORMATION UPLOAD ----------------------------
function sheet_change()
{
if (document.getElementById('Tab_Gv_Info') != null)
document.getElementById('Tab_Gv_Info').style.visibility='hidden';
}
// Single Add New Information
function Add_New_process(obj,pop_id)
{
if(obj.value=='[Add New]' && obj.value!=null)
{
document.getElementById('lbl_alert').style.display="none";
document.getElementById(pop_id).click();
}
}
// Multiple Add New Information
function Add_New_Process_Multi(obj,pop_id,ident_value)
{
if (obj.value=='[Add New]' && obj.value!= null)
{
document.getElementById('lbl_alert').style.display="none";
document.getElementById('Txt_hidden').value=ident_value;
document.getElementById('Td_Add_New_Title').innerText="";
document.getElementById('Td_Add_New_Title').innerText = 'Enter ' + ident_value ;
document.getElementById(pop_id).click();
document.getElementById('Txt_Add_New').focus();
}
}
//--------------------------Function to Allow Pre, Current Date and Block Future Date
function c(txtdate,btnyes,btnno,btnok,lblmsg)
{
var right_now=new Date();
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.value=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
else
{
if (getdate(dat.value) > right_now){Msg_Show('Cmn16',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
//---------------------------- For Offline Exam Schedule -------------------------
function Valid_Off_Exam_Date(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.value=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if(mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if(yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
else
{
document.getElementById('txt_Time_From_'+ current_datecontrol).value='';
document.getElementById('txt_Time_To_'+ current_datecontrol).value='';
document.getElementById('txt_Duration_'+ current_datecontrol).value='';
var count_check=0;
total_no_of_controls=intLoopCountAdd;
for(i=intLoopCount;i<total_no_of_controls;i++)
{
if((current_datecontrol != i) && (document.getElementById('txt_Date_' + i).value != '') && (document.getElementById('txt_Date_' + current_datecontrol).value == document.getElementById('txt_Date_' + i).value))
{
count_check+=1;
}
}
if(count_check>=2)
{
document.getElementById('txt_Date_' + current_datecontrol).value='';
Msg_Show('Ofe26','txt_Date_' + current_datecontrol,'Info','ibtnadd','ibtncancel','ibtnadd_alone','lblmsg');
}
else
{
var txt_date = document.getElementById('txt_Date_' + current_datecontrol).value;
if(txt_date!='')
{
var Todaydate = new Date(document.getElementById('txt_Today_Date').value);
var date_to_check = new Date(txt_date)
if(date_to_check<Todaydate)
{
document.getElementById('txt_Date_' + current_datecontrol).value='';
Msg_Show('Ofe28','txt_Date_' + current_datecontrol,'Info','ibtnadd','ibtncancel','ibtnadd_alone','lblmsg');
}
else
{
document.getElementById('txt_Date_' + current_datecontrol).focus();
}
}
}
}
}
//----------------------- Date Validation without Academic Year Checking ---------------------
function Valid_Date_Not_Academic_New(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var txt = document.getElementById('txt_hidden');
var datsplt = dat.value.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10)
{
txt.value='Cmn13';
Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false
}
if(mm > 12 || (mm <= 0 && dat.value != '')){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy <= 0 && dat.value != ''){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){txt.value='Cmn15';Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){txt.value='Cmn15';Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
}
/////////////Class Id Generation.///////////////////
function GV_Check_All_classID(chkAll,txt)
{
var chkBox=chkAll.form.elements;
var state=chkAll.checked;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
{
if (chkBox[i].checked!=chkAll.checked)
if(state==true)
{
chkBox[i].checked=true;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
//chkBox[i].parentNode.parentNode.style.color='#993333';
chkBox[i].parentNode.parentNode.style.fontWeight='bold';
var name=chkBox[i].id.substring(0,chkBox[i].id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=false
}
else
{ chkBox[i].checked=false;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
//chkBox[i].parentNode.parentNode.style.color='black';
chkBox[i].parentNode.parentNode.style.fontWeight='normal';
var name=chkBox[i].id.substring(0,chkBox[i].id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=true
}
}
}
function GV_Check_in_classID(chk_head,chk,txt)
{
if(document.getElementById(chk.id).checked==true)
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='#993333';
chkBox.parentNode.parentNode.style.fontWeight='bold';
var name=chk.id.substring(0,chk.id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=false
}
else
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='black';
chkBox.parentNode.parentNode.style.fontWeight='normal';
var name=chk.id.substring(0,chk.id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=true
}
var chkBox=document.getElementById(chk_head).form.elements;
var state=document.getElementById(chk_head).checked;
var len=0;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox")
len=len+1;
len=len-1;
if(len==parseInt(document.getElementById(txt).value))
{
if(state==false)
document.getElementById(chk_head).checked=true;
}
else if (len!=parseInt(document.getElementById(txt).value))
{
if(state==true)
document.getElementById(chk_head).checked=false;
}
}
function gvCheckall(chkAll,chkChild)
{
//var chkBox=chkAll.form.elements;
var pos = 0;
var chk_id=chkAll.id;
var split_val=chk_id.split("_");
var dg_Name=split_val[0];
var Data_Grid=document.getElementById('gvacc');
var RW_cnt=Data_Grid.rows.length;
var state=chkAll.checked;
var len=0;
for(i=1;i<RW_cnt;i++)//chkBox.length
{
// if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
// {
// if (chkBox[i].checked!=chkAll.checked)
if (i<9)
{
pos='0' + (i+1);
}
else
{
pos = i+1;
}
var Child_id =document.getElementById(Data_Grid.id +'_ctl'+ pos + '_' + chkChild);
//if (chkAll.checked)
if(state==true)
{
Child_id.checked=true;
//chkAll.parentNode.parentNode.style.fontWeight='bold';
len=len+1;
}
else
{
Child_id.checked=false;
//chkAll.parentNode.parentNode.style.fontWeight='normal';
}
// }
}
document.getElementById('txt_select').value=len;
}
/////////////////////
function gvCheckIN(chk_head,chk,txt)
{
var txt_val=document.getElementById(txt);
var tttt=document.getElementById(txt).value;
if(document.getElementById(chk.id).checked==true)
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='#993333';
//chkBox.parentNode.parentNode.style.fontWeight='bold';
}
else
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='black';
//chkBox.parentNode.parentNode.style.fontWeight='normal';
}
//var chkBox=document.getElementById(chk_head).form.elements;
var Data_Grid=document.getElementById('gvacc');
var RW_cnt=Data_Grid.rows.length;
var split_Val=chk.id.split("_");
var childChk=split_Val[2];
var state=document.getElementById(chk_head).checked;
var len=0;
for(i=1;i<RW_cnt;i++)
{
if (i<9)
{
pos='0' + (i+1);
}
else
{
pos = i+1;
}
var Child_id =document.getElementById('gvacc_ctl'+ pos + '_' + childChk);
var Child_State=Child_id.checked;
if(Child_State==true)
{
len=len+1;
}
else
{
if(i!=1)
{
len=len-1;
}
}
}
if (len==(RW_cnt-1))
{
if(state==false)
document.getElementById(chk_head).checked=true;
}
else if (len!=(RW_cnt-1))
{
if(state==true)
document.getElementById(chk_head).checked=false;
}
document.getElementById(txt).value=len;
}
///////////////Changing Date Formate to MM/dd/yyyy
function Date_Format_Change_Fun(Date_Value,txtdate)
{
var datsplt ;
var dt_format=parent.document.getElementById('lbl_Date_Format');
var date_return="";
datsplt = Date_Value.split('/');
if (datsplt[0].length != 2 || datsplt[1].length !=2 || datsplt[2].length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info','btnyes','btnno','','lblmsg');txtdate.value="";return false}
if((dt_format.innerText=='dd/MM/yyyy') && (dt_format.innerText!='MM/dd/yyyy'))
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
date_return =datsplt[1] +'/'+datsplt[0]+'/'+datsplt[2]
}
else
{
date_return=Date_Value;
}
return date_return;
}
function cheque_Dt(txtdate)
{
var dat = document.getElementById(txtdate.id);
var chk_dat = document.getElementById('Txt_Ch_Date');
if (chk_dat != null)
{
chk_dat.value=dat.value;
dat.focus();
}
}
function Fine_Settin_Date_Compare(grace_Date)
{
var target = document.getElementById(grace_Date.id);
target = target.id.replace(grace_Date,"").substring(0,15)
var Last_Date =document.getElementById(target+"txt_Date")
if (Date.parse(Date_Format_Change_Fun(Last_Date.value,Last_Date))> Date.parse(Date_Format_Change_Fun(grace_Date.value,grace_Date)))
{
Msg_Show_2Btn('Cmn14',grace_Date.id,'Info','btnyes','btnno','','lblmsg');
grace_Date.value="";
return false;
}
}
function Sibling_Txt_Change()
{
var var_check= document.getElementById('invalid');
var_check.value="add_new"
//__doPostBack(strid,'OnClick');
// return true;
}
function Amt_Float_Journal(object)
{
if (parseFloat(object.value) > 0)
{
var Amt_txt = document.getElementById(object.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else
{
document.getElementById(object.id).value="";
}
}
function check_Dob(obj,btnyes,btnno,btnok,lblmsg)
{
var Dob =document.getElementById(obj);
var x= new Date;
if (Date.parse(Date_Format_Change_Fun(Dob.value,Dob.id)) > Date.parse(x))
{
Msg_Show_2Btn('Hwk06',Dob.id,'Info',btnyes,btnno,btnok,lblmsg);
Dob.value="";
}
}
function Receipt_Popup_New(obj, title)
{
if(document.getElementById('Div_Print_Ctrl1') != null)
document.getElementById('Div_Print_Ctrl1').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
title=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin_New();" onafterprint="Fee_Receipt_Print_End_New();"><div align="center">';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</div></body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
if(document.getElementById('Div_Print_Ctrl1') != null)
document.getElementById('Div_Print_Ctrl1').style.visibility='hidden';
}
function Fee_Receipt_Print_Begin_New()
{
document.getElementById('Div_Print_Ctrl1').style.visibility='hidden';
}
//---------------------- FEES PAY AND UPDATE (PRINT,CLOSE) Button visible -------------------
function Fee_Receipt_Print_End_New()
{
document.getElementById('Div_Print_Ctrl1').style.visibility='visible';
}
function Get_courier_Type(obj)
{
var txt = document.getElementById(obj.id);
var txt_hide = document.getElementById('txt_hidden');
txt_hide.value ='';
return true;
}
function Open_Exs_strg(obj,Excess,Shortage)
{
var Exs = document.getElementById(Excess);
var srtg = document.getElementById(Shortage);
var txt = document.getElementById(obj.id);
var hide = document.getElementById('txtmsg');
if (Exs.value != "" && srtg.value != "")
{
//----- ID for Clear Values --------
if(txt.id==Exs.id)
{
Msg_Show('ES002',srtg.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = srtg.id;
}
else
{
Msg_Show('ES003',Exs.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = Exs.id;
}
}
}
function Tab_Func()
{
if(event.keyCode==9 || event.keyCode==16)
{
return true;
}
else
{
return false;
}
}
function Fee_setting_Date1(obj,ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Install_No;
Install_No=document.getElementById('drp_Install').value;
//-------------------------------------------
//For Sankara Matriculation School
//Install_No=3;
//-------------------------------------------
var Previous_date;
var Next_date;
var Msg_check_pre=0;
var Msg_check_next=0;
var temp=parseInt(obj.id.replace(target,"").substring(18));
if (obj.id != target+'TXT_FIRST_REMINDER1')
{
temp=parseInt(temp)-1;
Previous_date=document.getElementById(target+'TXT_FIRST_REMINDER'+ temp);
}
if (obj.id!='TXT_FIRST_REMINDER'+Install_No)
{
temp=parseInt(temp)+1;
Next_date=document.getElementById(target+'TXT_FIRST_REMINDER'+ temp);
}
if (Previous_date!=null)
if (Date.parse(Date_Format_Change_Fun(Previous_date.value,Previous_date)) > Date.parse(Date_Format_Change_Fun(obj.value,obj)))
{
Msg_check_pre=parseInt(temp)-1;
}
if (Next_date!=null)
if (Date.parse(Date_Format_Change_Fun(obj.value,obj)) > Date.parse(Date_Format_Change_Fun(Next_date.value,Next_date)))
{
Msg_check_next=parseInt(temp)+1;
}
switch(Msg_check_pre)
{
case 1:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 2:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
if ((Msg_check_pre==0) && (Msg_check_next!=0))
{
switch(Msg_check_next)
{
case 2:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 12:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
}
}
function Fee_setting_Date2(obj,ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Install_No;
Install_No=document.getElementById('drp_Install').value;
//-------------------------------------------
//For Sankara Matriculation School
//Install_No=3;
//-------------------------------------------
var Previous_date;
var Next_date;
var Msg_check_pre=0;
var Msg_check_next=0;
var temp=parseInt(obj.id.replace(target,"").substring(16));
if (obj.id != target+'TXT_2ND_REMINDER1')
{
temp=parseInt(temp)-1;
Previous_date=document.getElementById(target+'TXT_2ND_REMINDER'+ temp);
}
if (obj.id!='TXT_2ND_REMINDER'+Install_No)
{
temp=parseInt(temp)+1;
Next_date=document.getElementById(target+'TXT_2ND_REMINDER'+ temp);
}
if (Previous_date!=null)
if (Date.parse(Date_Format_Change_Fun(Previous_date.value,Previous_date)) > Date.parse(Date_Format_Change_Fun(obj.value,obj)))
{
Msg_check_pre=parseInt(temp)-1;
}
if (Next_date!=null)
if (Date.parse(Date_Format_Change_Fun(obj.value,obj)) > Date.parse(Date_Format_Change_Fun(Next_date.value,Next_date)))
{
Msg_check_next=parseInt(temp)+1;
}
switch(Msg_check_pre)
{
case 1:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 2:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
if ((Msg_check_pre==0) && (Msg_check_next!=0))
{
switch(Msg_check_next)
{
case 2:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 12:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
}
}
function date_compare_Fees_Sms(Last,First_Reminder,obj)
{
var target = document.getElementById(obj.id);
target = target.id.replace(First_Reminder,"")
var Last_date = document.getElementById(target+Last);
var First_Reminder_date = document.getElementById(target+First_Reminder);
if (Date.parse(Date_Format_Change_Fun(Last_date.value,Last_date))< Date.parse(Date_Format_Change_Fun(First_Reminder_date.value,First_Reminder_date)))
{
Msg_Show_2Btn('Cmn14',obj.id,'Info','btnyes','btnno','','lblmsg');
return false;
}
}
function date_compare_Fees_Sms1(Last,First_Reminder,Second_Reminder,obj)
{
var target = document.getElementById(obj.id);
target = target.id.replace(Second_Reminder,"")
var Last_date = document.getElementById(target+Last);
var First_Reminder_date = document.getElementById(target+First_Reminder);
var Second_Reminder_date =document.getElementById(target+Second_Reminder);
if (Date.parse(Date_Format_Change_Fun(First_Reminder_date.value,First_Reminder_date))> Date.parse(Date_Format_Change_Fun(Second_Reminder_date.value,Second_Reminder_date)))
{
Msg_Show_2Btn('Cmn14',obj.id,'Info','btnyes','btnno','','lblmsg');
return false;
}
if (Date.parse(Date_Format_Change_Fun(Second_Reminder_date.value,Second_Reminder_date))> Date.parse(Date_Format_Change_Fun(Last_date.value,Last_date)))
{
Msg_Show_2Btn('Cmn14',obj.id,'Info','btnyes','btnno','','lblmsg');
return false;
}
}
function Receipt_Popup_test(obj, title,txt,focus_id)
{
var txt_hidden_Val=document.getElementById(txt);
txt_hidden_Val.value='S';
if (txt_hidden_Val.value=='S')
{
cmpny_Info_Display();
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=no,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//var title_dynamic=document.getElementById(title).innerText
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
//title=document.getElementById('td_Page_Heading').innerText+" Report"
// title=document.getElementById('td_Page_Heading').innerText+" Report"
//title=document.getElementById('lblRptTitle').innerText
//title_dynamic=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin();" onafterprint="Fee_Receipt_Print_End();">';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
cmpny_Info_Dsply_none();
}
else
{
Msg_Show('Rp01',focus_id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
function cmpny_Info_Display()
{
document.getElementById('tr_CompanyName').style.display="inline";
document.getElementById('tr_CompanyAddress').style.display="inline";
}
function cmpny_Info_Dsply_none()
{
document.getElementById('tr_CompanyName').style.display="none";
document.getElementById('tr_CompanyAddress').style.display="none";
}
function Receipt_Popup_WithSchool(obj, title,Heading)
{
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
title=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin();" onafterprint="Fee_Receipt_Print_End();"><div align="center">';
concat_vlue=concat_vlue+'<table>';
concat_vlue=concat_vlue+document.getElementById(Heading).innerHTML;
concat_vlue=concat_vlue+'</table>';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</div></body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
}
function SelectAll(id,txt,grid)
{
var grid = document.getElementById(grid);
var cell;
if (grid.rows.length > 0)
{
for (i=1; i<grid.rows.length; i++)
{
cell = grid.rows[i].cells[0];
for (j=0; j<cell.childNodes.length; j++)
{
if (cell.childNodes[j].type =="checkbox")
{
cell.childNodes[j].checked = id.checked;
}
}
}
}
}
{
var value1 =document.getElementById(obj1);
var value2 =parseInt(obj2);
var drpgrade=document.getElementById("grade");
var drpgrade1=document.getElementById("grade1");
if(parseInt(value1.value))
{
var mark_scored= 0,mark_total = 0,mobtained = 0;
var status='',absent='';
var limit= value1.id;
var ff=limit.substring(3,limit.length-1);
var limit1= parseInt(limit.substring(3))+( parseInt(obj5)-1);
var sum;
for(i=0;i<=(parseInt(obj5)-1);i++)
{
if (document.getElementById('Tit' + limit.substring(3,limit.length-1) + i ).value=="")
{
sum=parseInt(0);
}
else
{
sum=parseInt(document.getElementById('Tit' + limit.substring(3,limit.length-1) + i ).value);
}
mark_total=parseInt(mark_total) + sum;
}
document.getElementById('Tit' + limit.substring(3,limit.length-1) + parseInt(obj5)).value=mark_total;
document.getElementById('Tit' + limit.substring(3,limit.length-1)+ (parseInt(obj5)+1) ).value=mark_total/ parseInt(obj5);
for(i=0;i<drpgrade.options.length;i++)
{
var ss1= drpgrade.options[i].text;
var ss2= drpgrade.options[i].value ;
var ss3= drpgrade1.options[i].text;
var ss4= drpgrade1.options[i].value ;
var per=parseFloat(document.getElementById('Tit' + limit.substring(3,limit.length-1)+ (parseInt(obj5)+1) ).value)
if( per >= parseFloat(ss1) && per <=ss3)
{
document.getElementById('Tit' + limit.substring(3,limit.length-1)+ (parseInt(obj5)+2) ).value=ss2;
}
}
}
}
function Mark_Entry_Block_NonNumeric(obj,marklimit)
{
var content = document.getElementById(obj).value;
var con1 = document.getElementById(obj);
content='';
var limit =marklimit;
//var content1=content+ parseInt(String.fromCharCode(event.keyCode));
var content1=parseInt(String.fromCharCode(event.keyCode));
if(content=='')
{
if(parseInt(content1)<=limit)
{
document.getElementById(obj).value='';
return true;
}
else
return false;
}
else
{
if((event.keyCode>=48) && (event.keyCode<=54))
{
if(parseInt(content1)<=limit)
{
return true;
}
else
{
con1.value=parseInt(String.fromCharCode(event.keyCode));
return false;
}
}
else
{
return false;
}
}
}
function setID(obj)
{
var inID=document.getElementById(obj.id);
var sID=document.getElementById('TextBox1');
sID.value=inID.id;
}
function Generate(obj)
{
var btn = document.getElementById(obj.id);
btn.click();
}
function Add_Ne(obj,Eve)
{
var MyVar =parseInt(webcon);
if ($get(obj.id).value<= MyVar)
{
var btn = document.getElementById(Eve.id);
btn.click();
}
else
{
var popupp=$get('popup');
popupp.width='360px';
popupp.height='128px';
popupp.style.display="none";
var newImage = "url(../images/RMsgBar.jpg)";
popupp.style.backgroundImage=newImage;
Msg_Show_1Btn('stv06',obj.id,'Info','btnyes','btnno','btnok','lblmsg',MyVar);obj.value="";return false
}
}
function Msg_Show_1Btn(node,Target_ID,mode,btnyes,btnno,btnok,lblmsg,myvar)
{
var lbl = document.getElementById(lblmsg);
var btnshow = document.getElementById('modal');
var hide = parent.document.getElementById('txtfocus_ID');
//------- Getting Message from XML File ----------------
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
var gett=msg[0].firstChild.nodeValue;
var cntt=gett.replace('~Description~',myvar);
lbl.innerText = cntt;
//------------------------------------------------------
//-------- Handle Modal Popup Button Event ------------
hide.value = Target_ID;
btnshow.click();
//-----------------------------------------------------
//--- Process for Hide Button to Confirm or Info ------
var yes = document.getElementById(btnyes);
var no = document.getElementById(btnno);
var ok = document.getElementById(btnok);
yes.style.display="none";
no.style.display="none";
ok.style.display="";
ok.focus();
return false;
}
//Function For Grade Desc ------------------------------------->
//Begin-------------------------------------------------------->
function ch1(txt,ss)
{
var vv="Txt";
var idd=txt;
document.getElementById(ss).innerHTML="";
var ddlReport =document.getElementById(vv.concat(txt));
var table = document.createElement('table');
table.id="tit";
table.border=1;
table.borderWidth=1;
table.className ="report_titlebar";
table.setAttribute("className","report_titlebar")
table.align='center';
var newTR5 = document.createElement('tr');
var newTD5 = document.createElement('td');
var titl=document.getElementById(vv.concat(txt)).title
newTD5.appendChild(document.createTextNode(titl.toUpperCase()+": "+"GRADES AND DESCRIPTION"));
newTD5.background="../images/title_bg.jpg";
newTD5.color="#FFFFFF";
newTD5.fontsize="11px";
newTD5.fontweight="bold";
newTD5.colSpan='3';
newTD5.align='center';
newTD5.height='55px';
newTR5.appendChild(newTD5);
table.appendChild(newTR5);
for (i = 1; i < ddlReport.options.length; i++){
var radio = document.createElement('input');
radio.id =i;
radio.setAttribute("type", "radio");
radio.setAttribute("name", "radios");
radio.setAttribute("value", ddlReport.options[i].value);
var ss1= ddlReport.options[i].text;
var ss2= ddlReport.options[i].value ;
var newTR = document.createElement('tr');
var newTD = document.createElement('td');
var newTD1 = document.createElement('td');
var newTD2 = document.createElement('td');
if (idd.substring(0,1)=="0")
{radio.setAttribute("onclick", "window.opener.resultset("+i+",'"+ idd +"');self.close();"); }
else
{radio.setAttribute("onclick", "window.opener.resultset("+i+","+ idd +");self.close();"); }
newTD.appendChild (radio);
newTR.appendChild (newTD);
newTD1.appendChild (document.createTextNode(ss1));
newTR.appendChild (newTD1);
newTD2.appendChild (document.createTextNode(ss2));
newTR.appendChild (newTD2);
table.appendChild (newTR);
}
div = document.getElementById(ss);
div.title="GRADE DESCRIPTION"
div.align='center';
var newTR6 = document.createElement('tr');
var newTD6 = document.createElement('td');
var btn=document.createElement('input')
btn.setAttribute("type", "button");
btn.setAttribute("name", "btn");
btn.setAttribute("value", "Close");
btn.setAttribute("onclick","self.close();");
newTD6.appendChild (btn);
newTD6.align='center';
newTD6.colSpan='3';
newTR6.appendChild (newTD6);
table.appendChild (newTD6);
document.getElementById(ss).appendChild(table);
var left = (screen.width/2);
var top = (screen.height/2);
var content=document.getElementById(ss).innerHTML;
myWin=window.open('','myWin','toolbar=no,menubar=no,directories=yes,addressbar=no,location=no,scrollbars=yes,height=300px,width=700px,top=200,left=220,resizable=yes,status=no');
myWin.document.write(content);
myWin.document.title=titl.toUpperCase()+": "+"GRADES AND DESCRIPTION";
}
function resultset(obj,txt)
{
var vv="Txt";
var idd1=String(txt);
var ddlReport =document.getElementById(vv.concat(txt));
var t_id=parseFloat(txt)+ parseInt(1);
if (idd1.charAt(0)=="0")
{
ddlReport.selectedIndex=obj;
document.getElementById('Txt00'+t_id).value=document.getElementById(obj).value;
}
else
{
var t_id1=parseInt(txt)+1;
ddlReport.selectedIndex=obj;
document.getElementById('Txt0'+t_id1).value=document.getElementById(obj).value;
}
}
function togglediv(divid)
{
if(document.getElementById(divid).style.display == 'none'){
document.getElementById(divid).style.display = 'block';
}else{
document.getElementById(divid).style.display = 'none';
}
}
//End Grade Desc Function----------------------------------------------->
function fcs(txt)
{
var ddlReport =document.getElementById('txt'+txt);
var drp_Val = ddlReport.options[ddlReport.selectedIndex].value;
var t_id=parseInt(txt)+1;
if (drp_Val=='-')
{
document.getElementById('Txt0'+t_id).value='';
}
else
{
document.getElementById('Txt0'+t_id).value=drp_Val;
}
}
function fcs1(txt)
{
var ddlReport =document.getElementById('txt'+txt);
var idd=ddlReport.id;
var drp_Val = ddlReport.options[ddlReport.selectedIndex].value;
var t_id=parseFloat(txt)+ parseInt(1);
if (drp_Val=='-')
{
document.getElementById('Txt00'+t_id).value='';
}
else
{
document.getElementById('Txt00'+t_id).value=drp_Val;
}
}
// key press event on allowed alpha not allowed block numbers
function onKeyPressBlockNumbers(e)
{
var key = window.event ? e.keyCode : e.which;
var keychar = String.fromCharCode(key);
reg = /\d/;
return !reg.test(keychar);
}
function CheckMaxLength(obj,length)
{
var mxlength=length;
var temp = document.getElementById(obj).value;
if (temp.length<mxlength)
{
document.getElementById(obj).value='';
document.getElementById(obj).focus();
return false;
}
}
//for Sports and Events
function Clear_Zero_SeatSettingForm(obj)
{
var txtsportfine=document.getElementById(obj.id);
if(txtsportfine.value==0)
{
txtsportfine.value='';
}
}
// Allowed only numbers not allowed - and alpha
function extractNumber(obj, decimalPlaces, allowNegative)
{
var temp = obj.value;
// avoid changing things if already formatted correctly
var reg0Str = '[0-9]*';
if (decimalPlaces > 0) {
reg0Str += '\\.?[0-9]{0,' + decimalPlaces + '}';
} else if (decimalPlaces < 0) {
reg0Str += '\\.?[0-9]*';
}
reg0Str = allowNegative ? '^-?' + reg0Str : '^' + reg0Str;
reg0Str = reg0Str + '$';
var reg0 = new RegExp(reg0Str);
if (reg0.test(temp)) return true;
// first replace all non numbers
var reg1Str = '[^0-9' + (decimalPlaces != 0 ? '.' : '') + (allowNegative ? '-' : '') + ']';
var reg1 = new RegExp(reg1Str, 'g');
temp = temp.replace(reg1, '');
if (allowNegative) {
// replace extra negative
var hasNegative = temp.length > 0 && temp.charAt(0) == '-';
var reg2 = /-/g;
temp = temp.replace(reg2, '');
if (hasNegative) temp = '-' + temp;
}
if (decimalPlaces != 0) {
var reg3 = /\./g;
var reg3Array = reg3.exec(temp);
if (reg3Array != null) {
// keep only first occurrence of .
// and the number of places specified by decimalPlaces or the entire string if decimalPlaces < 0
var reg3Right = temp.substring(reg3Array.index + reg3Array[0].length);
reg3Right = reg3Right.replace(reg3, '');
reg3Right = decimalPlaces > 0 ? reg3Right.substring(0, decimalPlaces) : reg3Right;
temp = temp.substring(0,reg3Array.index) + '.' + reg3Right;
}
}
obj.value = temp;
}
function blockNonNumbers(obj, e, allowDecimal, allowNegative)
{
var key;
var isCtrl = false;
var keychar;
var reg;
if(window.event) {
key = e.keyCode;
isCtrl = window.event.ctrlKey
}
else if(e.which) {
key = e.which;
isCtrl = e.ctrlKey;
}
if (isNaN(key)) return true;
keychar = String.fromCharCode(key);
// check for backspace or delete, or if Ctrl was pressed
if (key == 8 || isCtrl)
{
return true;
}
reg = /\d/;
var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
return isFirstN || isFirstD || reg.test(keychar);
}
function BlockIntialZero(obj)
{
if (event.keyCode==48 ||event.keyCode==96)
{
if(!parseInt(document.getElementById(obj.id).value)>=1)
return false;
}
}
// Allowed Limited numbers
function limitlength(obj, length){
var maxlength=length
if (obj.value.length>maxlength)
obj.value=obj.value.substring(0, maxlength)
}
// display key code
function displayunicode(e){
var unicode=e.keyCode? e.keyCode : e.charCode
alert(unicode)
}
// Date Function in dd/mm/yyyy
function validateDate(fld) {
var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
var errorMessage = 'Please enter valid date as month, day, and four digit year.\nYou may use a slash, hyphen or period to separate the values.\nThe date must be a real date. 2-30-2000 would not be accepted.\nFormay mm/dd/yyyy.';
if ((fld.value.match(RegExPattern)) && (fld.value!='')) {
alert('Date is OK');
} else {
alert(errorMessage);
fld.focus();
}
}
// Date Function in mm/dd/yyyy
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
var i;
for (i = 0; i < s.length; i++){
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function stripCharsInBag(s, bag){
var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++){
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}
function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
if (i==2) {this[i] = 29}
}
return this
}
function isDate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strMonth=dtStr.substring(0,pos1)
var strDay=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
alert("The date format should be : mm/dd/yyyy")
return false
}
if (strMonth.length<1 || month<1 || month>12){
alert("Please enter a valid month")
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
alert("Please enter a valid day")
return false
}
if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
alert("Please enter a valid date")
return false
}
return true
}
function ValidateForm(){
var dt=document.frmSample.txtDate
if (isDate(dt.value)==false){
dt.focus()
return false
}
return true
}
function addrs(obj)
{
var txt = document.getElementById(obj.id).value.length;
if (event.keyCode >= 33 && event.keyCode <=40 || event.keyCode == 8 || event.keyCode == 46 )
{
return true;
}
else
{
if (event.keyCode==222 || txt > 99)
{
var val=document.getElementById(obj.id).value.search("'");
return false;
}
}
}
function isNumberKey(evt)
{
if(event.shiftKey) return false;
var charCode=(evt.which) ? evt.which: event.keyCode
if(charCode==16) return false;
if ((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 106)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14))
{
return false;
}
return true;
}
//Select all the rows in checkbox datagird
function selectAll(involker)
{
var inputElements = document.getElementsByTagName('input');
for (var i = 0 ; i < inputElements.length ; i++)
{
var myElement = inputElements[i];
if (myElement.type === "checkbox")
{
myElement.checked = involker.checked;
}
}
}
function time_compare()
{
document.getElementById('btntime_check').click();
}
function pers_change(txt)
{
document.getElementById(txt).value="";
}
function Focus()
{
var debit = document.getElementById('txtdebit').value;
var credit =document.getElementById('txtcredit').value;
if(event.keyCode==9)
{
if ((debit > 0) && (debit!= ''))
{
document.getElementById('txtcredit').value=0;
document.getElementById('btnadd1').click();
return true;
}
else
{
document.getElementById('txtdebit').value=0;
document.getElementById('txtcredit').focus();
return false;
}
}
}
function Focus1()
{
var debit = document.getElementById('txtdebitor').value;
var credit =document.getElementById('txtcreditor').value;
}
function Dot(obj)
{
if (event.keyCode==190 || event.keyCode==110)
{
var a = obj.value.indexOf('.')
if (a == -1)
return true;
else
return false;
}
}
function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
var net=document.getElementById('txtnet_amt');
}
//*******************************************************************************************
//Number To Words
//==================
// American Numbering System
var th = ['','thousand','million', 'billion','trillion'];
var dg = ['zero','one','two','three','four', 'five','six','seven','eight','nine'];
var tn = ['ten','eleven','twelve','thirteen', 'fourteen','fifteen','sixteen', 'seventeen','eighteen','nineteen'];
var tw = ['twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];
function toWords(s)
{
// s = document.getElementById(s).value; //Source Control
s = document.getElementById('txtnet_amt').value;
s = s.replace(/[\, ]/g,'');
if (s != String(parseFloat(s)))
return 'not a number';
var x = s.indexOf('.');
if (x == -1) x = s.length;
if (x > 15)
return 'too big';
var n = s.split('');
var str = '';
var sk = 0;
for (var i=0; i < x; i++)
{
if ((x-i)%3==2)
{
if (n[i] == '1')
{
str += tn[Number(n[i+1])] + ' ';
i++; sk=1;
}
else if (n[i]!=0)
{
str += tw[n[i]-2] + ' ';
sk=1;
}
}
else if (n[i]!=0)
{
str += dg[n[i]] +' ';
if ((x-i)%3==0)
str += 'hundred ';
sk=1;
}
if ((x-i)%3==1)
{
if (sk)
str += th[(x-i-1)/3] + ' ';
sk=0;
}
}
if (x != s.length)
{
var y = s.length;
str += 'point ';
for (var i=x+1; i<y; i++)
str += dg[n[i]] +' ';
}
document.getElementById('word_amt').value = str.replace(/\s+/g,' ') +' ' + 'rupees only'; //TargetControl
//return str.replace(/\s+/g,' ');
}
//*******************************************************************************************
//FUNCTION FOR PRINT THE CONTENT
function Printing(obj,head)
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=25";
div = document.getElementById('Div1');
if (div != null)
{
div.style.height = "auto";
}
var content_vlue = document.getElementById(obj).innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>'+ head + '</title>');
docprint.document.write('</head><body onLoad="self.print()"><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.document.close();
docprint.focus();
}
//=============================== COMMON JAVASCRIPT - START ============================
//----------------------- Block Greater and Lesser than symbol --------------------------
function Greater_Lesser_Block(obj)
{
if (event.keyCode==60 || event.keyCode==62)
{
var val_les=document.getElementById(obj.id).value.search("<");
var val_gre=document.getElementById(obj.id).value.search(">");
if (val_les == -1 || val_gre == -1)
return false;
else
return true;
}
}
//------------------------------- Mobile No. Start with 9 ------------------------------
function mobile(obj)
{
if (obj.value.length==0)
{
if (event.keyCode==57 || event.keyCode==105 || event.keyCode==9 || event.keyCode==48 || event.keyCode==56)
return true;
else
return false;
}
}
//----------------------- GridView Checkbox Individal Check Calculation ---------------
function GV_Check_in(chk_head,chk,txt)
{
if(document.getElementById(chk.id).checked==true)
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='#993333';
chkBox.parentNode.parentNode.style.fontWeight='bold';
}
else
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='black';
chkBox.parentNode.parentNode.style.fontWeight='normal';
}
var chkBox=document.getElementById(chk_head).form.elements;
var state=document.getElementById(chk_head).checked;
var len=0;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox")
len=len+1;
len=len-1;
if (len==parseInt(document.getElementById(txt).value))
{
if(state==false)
document.getElementById(chk_head).checked=true;
}
else if (len!=parseInt(document.getElementById(txt).value))
{
if(state==true)
document.getElementById(chk_head).checked=false;
}
}
//------------------------- GridView Checkbox Check All Calculation --------------------
function GV_Check_All(chkAll,txt)
{
var chkBox=chkAll.form.elements;
var state=chkAll.checked;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
{
if (chkBox[i].checked!=chkAll.checked)
if(state==true)
{
chkBox[i].checked=true;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
//chkBox[i].parentNode.parentNode.style.color='#993333';
chkBox[i].parentNode.parentNode.style.fontWeight='bold';
}
else
{ chkBox[i].checked=false;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
//chkBox[i].parentNode.parentNode.style.color='black';
chkBox[i].parentNode.parentNode.style.fontWeight='normal';
}
}
}
//------------------------- GridView Checkbox Check All Calculation --------------------
function GV_Check_All_New(chkAll,txt)
{
var chkBox=chkAll.form.elements;
var state=chkAll.checked;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
{
if (chkBox[i].checked!=chkAll.checked && chkBox[i].disabled!=true)
if(state==true)
{
chkBox[i].checked=true;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
//chkBox[i].parentNode.parentNode.style.color='#993333';
chkBox[i].parentNode.parentNode.style.fontWeight='bold';
}
else
{ chkBox[i].checked=false;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
//chkBox[i].parentNode.parentNode.style.color='black';
chkBox[i].parentNode.parentNode.style.fontWeight='normal';
}
}
}
//----------------------- Date Validation without Academic Year Checking ---------------------
function Valid_Date_Not_Academic(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy <= 0 && dat.value != ''){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
}
function Valid_Date_Not_Academic_Rpt(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var lbl_focus = document.getElementById('lbl_FocusId');
lbl_focus.value = txtdate.id;
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy <= 0 && dat.value != ''){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
}
// ----------------- Mutually Exclusive Radiobutton selection in Gridview ----------------
function uncheckOthers_radio(id)
{
var radio=document.getElementById(id.id);
// radio.parentNode.parentNode.style.color='#993333';
radio.parentNode.parentNode.style.fontWeight='bold';
var elm = document.getElementsByTagName('input');
for(var i = 0; i < elm.length; i++)
{
if(elm.item(i).id.substring(id.id.lastIndexOf('_')) == id.id.substring(id.id.lastIndexOf('_')))
{
if( elm.item(i)!=id)
{
elm.item(i).checked = false;
// elm.item(i).parentNode.parentNode.style.color='black';
elm.item(i).parentNode.parentNode.style.fontWeight='normal';
}
}
}
}
// ----------------- Mutually Exclusive Checkbox selection in Gridview -------------------
function uncheckothers_check(id)
{
var checkbox=document.getElementById(id.id);
//checkbox.parentNode.parentNode.style.color='#993333';
checkbox.parentNode.parentNode.style.fontWeight='bold';
var elm = document.getElementsByTagName('input');
for(var i = 0; i < elm.length; i++)
{
if(elm.item(i).id.substring(id.id.lastIndexOf('_')) == id.id.substring(id.id.lastIndexOf('_')))
{
if( elm.item(i).type == "checkbox" && elm.item(i)!=id)
elm.item(i).checked = false;
//elm.item(i).parentNode.parentNode.style.color='black';
elm.item(i).parentNode.parentNode.style.fontWeight='normal';
}
}
}
// ----------------- Mutually Exclusive Radiobutton selection in Gridview used in code behind----------------
function uncheckOthers_radio_new(id)
{
var radio=document.getElementById(id);
// radio.parentNode.parentNode.style.color='#993333';
radio.parentNode.parentNode.style.fontWeight='bold';
var elm = document.getElementsByTagName('input');
for(var i = 0; i < elm.length; i++)
{
if(elm.item(i).id.substring(id.id.lastIndexOf('_')) == id.id.substring(id.id.lastIndexOf('_')))
{
if( elm.item(i)!=id)
{
elm.item(i).checked = false;
// elm.item(i).parentNode.parentNode.style.color='black';
elm.item(i).parentNode.parentNode.style.fontWeight='normal';
}
}
}
}
// ------------------------- Allow only one hyphen in the Field ------------------------
function phoneval(obj)
{
if (event.keyCode==189)
{
var val=document.getElementById(obj.id).value.search("-");
if (val == -1)
return true;
else
return false;
}
}
// -------------------------- Except ' its allow all the character -----------------------
function speci(obj)
{
var txt = document.getElementById(obj.id).value.length;
if (event.keyCode >= 33 && event.keyCode <=40 || event.keyCode == 8 || event.keyCode == 46 )
{
return true;
}
else
{
if (event.keyCode==222 || txt > 99)
{
var val=document.getElementById(obj.id).value.search("'");
if (val == -1)
return false;
else
return true;
}
}
}
function tab_focus(obj)
{
document.getElementById(obj).focus();
document.getElementById('btn_hid').click();
}
//================================ COMMON JAVASCRIPT - END =============================
//================================== HR - JAVASCRIPT - START ===========================
// ------------- Upload value is posted into hide textbox (Interview Call)--------------
function Fire_upload_button(obj)
{
document.getElementById('txt_hide').value = obj.value;
}
//================================== HR - JAVASCRIPT - END ==============================
//============================== ADMISSION - JAVASCRIPT - START ===========================
//----------------------------- Section Transfer Row Hide --------------------------------
function section_transfer_visible()
{
document.getElementById('tr_grid').style.display="none";
document.getElementById('tr_txt_select').style.display="none";
document.getElementById('tr_trans_button').style.display="none";
}
//----------------------- Mark Total calculation (Application Form)-----------------------
function Mark_total(obj_name)
{
if (parseFloat(obj_name.value) > 100.00)
{
obj_name.value='';
}
var value = document.getElementById('TabContainer_App_TabPanel_Education_txt_no_sub').value;
var total=0;
for(i=1; i<=value; i++)
{
var mark=parseFloat(document.getElementById('TabContainer_App_TabPanel_Education_txt_mark' + i).value);
if (mark >= 0 && mark != NaN)
{
total=parseFloat(total) + parseFloat(mark);
}
}
total=CurrencyFormatted(parseFloat(total)/value);
document.getElementById('TabContainer_App_TabPanel_Education_txt_total_per').value=parseFloat(total);
}
//---------------------------------Student Date of birth (Application Form) -----------------
function date_drop(tab,condi,destination_obj)
{
if (tab=="1")
{
document.getElementById('TabContainer_App_TabPanel_Personal_Txt_Age').value="";
var obj_name="TabContainer_App_TabPanel_Personal_" + destination_obj;
}
else
var obj_name="TabContainer_App_TabPanel_Parents_" + destination_obj;
if (condi=="Year")
document.getElementById(obj_name).value=condi;
else
document.getElementById(obj_name).value=condi;
}
//----------------- Language-1 and language-2 are same or different (Application Form)-------------
function same_language(obj)
{
if (document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_1').value==document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_2').value)
{
if (obj=="1")
{
document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_1').value="--Select--";
Msg_Show('App09','TabContainer_App_TabPanel_Personal_Drp_Lag_1','Info','btnyes','btnno','btnok','lblmsg')
}
else
{
document.getElementById('TabContainer_App_TabPanel_Personal_Drp_Lag_2').value="--Select--";
Msg_Show('App09','TabContainer_App_TabPanel_Personal_Drp_Lag_2','Info','btnyes','btnno','btnok','lblmsg')
}
}
}
//----------------- After File UPload - focus goes to Next Button (Application Form) --------------
function upload_focus()
{
document.getElementById('TabContainer_App_TabPanel_Personal_Btn_Personal').focus();
}
//------------------ Print option for Admission Selection -----------------------------------
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=250,top=0,width=700,height=500,toolbar=0,scrollbars=0,status=1');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
//============================== ADMISSION - JAVASCRIPT - END ===========================
//================================= TIME TABLE - Javascript - Start ====================
//--------------------------------- Time Master - Focus --------------------------------
function time_focus(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var time=document.getElementById(target +'txt_Time');
time.focus();
//document.getElementById('txt_time').focus();
}
//--------------------------------- Subject Master Text clear----------------------------
function txt_clear()
{
if (document.getElementById('drp_Theory').value == 'Language' && document.getElementById('txt_Subcode').value != '')
{
document.getElementById('drp_Pos').value = 'NA';
document.getElementById('drp_Pos').style.visibility='hidden';
}
document.getElementById('drp_Theory').value = '--Select--';
document.getElementById('txt_Subcode').value='';
}
//---------------------- Subject Master - subject code generation------------------------
function Fire_Button()
{
document.getElementById('btn_Hide').click();
}
//-------------------------- Button Hide - Before print --------------------------------
function begin_Print()
{
document.getElementById('btn_export').style.visibility='hidden';
document.getElementById('btn_print').style.visibility='hidden';
}
//-----------------------------Button show - after print---------------------------------
function after_Print()
{
document.getElementById('btn_export').style.visibility='visible';
document.getElementById('btn_print').style.visibility='visible';
window.event.returnValue=0;
}
//-------------------------- Button Hide - Before print For Time Table Report--------------------------------
function begin_Print_TIME_TBL()
{
document.getElementById('btn_export').style.visibility='hidden';
document.getElementById('btn_print').style.visibility='hidden';
document.getElementById('btnMail').style.visibility='hidden';
document.getElementById('btnCancel').style.visibility='hidden';
}
//-----------------------------Button show - after print For Time Table Report---------------------------------
function after_Print_TIME_TBL()
{
document.getElementById('btn_export').style.visibility='visible';
document.getElementById('btn_print').style.visibility='visible';
document.getElementById('btnMail').style.visibility='visible';
document.getElementById('btnCancel').style.visibility='visible';
window.event.returnValue=0;
}
//-------------------------- Time Table Modify Staturday Selection ---------------------
function Modify_From_Drop()
{
if (document.getElementById('drp_from_day').value=='Saturday')
{
document.getElementById('drp_to_day').value="Saturday";
document.getElementById('drp_to_day').disabled=true;
}
else
{
document.getElementById('drp_to_day').value="--Select--";
document.getElementById('drp_to_day').disabled=false;
}
}
function Modify_To_Drop()
{
if (document.getElementById('drp_from_day').value != 'Saturday' && document.getElementById('drp_to_day').value == 'Saturday')
document.getElementById('drp_to_day').value="--Select--";
}
//================================= TIME TABLE - Javascript - End ======================
//=====================================================================================
//FUNCTION FOR CHECKING ALL IN CHECK BOX LIST
function cblAll(obj1,obj2)
{
var chklist = document.getElementById(obj1).getElementsByTagName("input");
var chk = document.getElementById(obj2).getElementsByTagName("input");
for ( i=0; i < chk.length; i++ )
{
if (chklist[0].checked == true)
{
chk[i].checked = true;
}
else
{
chk[i].checked = false;
}
}
}
//=====================================================================================
//UNCHECK 'all'CHECKBOX
function unchk(obj1,obj2)
{ var count = 0;
var chklist = document.getElementById(obj1).getElementsByTagName("input");
var chk = document.getElementById(obj2).getElementsByTagName("input");
for ( i=0; i < chk.length; i++ )
{
count += 1;
if ( chk[i].checked == false )
{
count -= 1;
chklist[0].checked = false;
}
}
if ( count == chk.length)
{
chklist[0].checked = true;
}
}
//======================================================================================
function foc(obj)
{
document.getElementById(obj.id).style.width="250px";
}
function out(obj)
{
document.getElementById(obj.id).style.width="170px";
}
if (typeof window.event != 'undefined')
document.onkeydown = function()
{
var test_var=event.srcElement.tagName.toUpperCase();
if (test_var != 'INPUT' && test_var != 'TEXTAREA')
return (event.keyCode != 8);
}
else
document.onkeypress = function(e)
{
var test_var=e.target.nodeName.toUpperCase();
if (test_var != 'INPUT' && test_var != 'TEXTAREA')
return (e.keyCode != 8);
}
//-------------------- Financial Reports Switch Over Views --------------------------------------
function switchViews(obj,row)
{
var div = document.getElementById(obj);
var img = document.getElementById('img' + obj);
if (div.style.display=="none")
{
div.style.display = "inline";
if (row=='alt')
{
img.src="../images/expand_button_white_alt_down.jpg";// mce_src="../images/expand_button_white_alt_down.jpg";
}
else
{
img.src="../images/Expand_Button_white_Down.jpg";// mce_src="../images/Expand_Button_white_Down.jpg";
}
img.alt = "Close";
}
else
{
div.style.display = "none";
if (row=='alt')
{
img.src="../images/Expand_button_white_alt.jpg";// mce_src="../images/Expand_button_white_alt.jpg";
}
else
{
img.src="../images/Expand_button_white.jpg";// mce_src="../images/Expand_button_white.jpg";
}
img.alt = "Expand";
}
}
//--------------------------------------------------------------------------------------------------------
function mod_click(obj)
{
document.getElementById(obj).click();
}
// This For Reception Contact Numbers From Sathish
function IsNumber(obj)
{
var key=event.keyCode;
if((key>=48 && key<=57)||(key==45))
{
if (key==45)
{
var chk=document.getElementById(obj).value.indexOf('-');
if (chk!=-1)
return false;
}
return true;
}
else
{
return false;
}
}
// This is EMail Validation
function validate_email(field)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{ return false;}
else {return true;}
}
}
function validate_form(email)
{
if (validate_email(email)==false)
{
document.getElementById(email.id).focus();
return false;
}
}
// Email Validation End
function GridVisibility()
{
var gd=document.getElementById('GridView1');
if(gd!= null)
gd.style.visibility="hidden";
}
function Time(st,drp)//transport pickup time,drop time checking
{
var t1 = document.getElementById(st);
var t2 = document.getElementById(drp);
if(t1 != null && t2!= null)
{
if (mil(t1.value)>mil(t2.value))
{
//alert('Invalid Time');
t2.value="";
t2.focus();
}
}
}
function mil(str)
{
var t = str.split(':')
var hh = parseInt(t[0],10);
var mm = parseInt(t[1],10)
hh += (str.toLowerCase().indexOf('pm')!=-1)?12:0;
var d = new Date(2007,0,1,hh,mm,00);
return d.getTime();
}
//From Suresh.C
function Time_Diff(st,drp,lblinvalid)
{
var t1 = document.getElementById(st);
var t2 = document.getElementById(drp);
var lbl=document.getElementById(lblinvalid);
lbl.style.display='none';
// ||(t1.value=='12:00 AM')
if((t1.value==t2.value) || (t2.value=='12:00 AM'))
{
t2.value='';
t2.focus();
lbl.style.display='';
}
else if (mil(t1.value)>mil(t2.value))
{
t2.focus();
t2.value='';
lbl.style.display='';
}
else
{
lbl.style.display='none';
}
}
function mil(str)
{
var t = str.split(':')
var hh = parseInt(t[0],10);
var mm = parseInt(t[1],10)
hh += (str.toLowerCase().indexOf('pm')!=-1)?12:0;
var d = new Date(2007,0,1,hh,mm,00);
return d.getTime();
}
function Greater_Lesser_Block(obj)
{
if (event.keyCode==60 || event.keyCode==62)
{
var val_les=document.getElementById(obj.id).value.search("<");
var val_gre=document.getElementById(obj.id).value.search(">");
if (val_les == -1 || val_gre == -1)
return false;
else
return true;
}
}
function NonzeroInSportsReturn(txtfine)
{
if (event.keyCode==48 ||event.keyCode==96)
return false;
else
return true;
}
function SportsReturnItemCheck(obj)
{
var lblItemdisplay=document.getElementById('lblQuantityItem')
lblItemdisplay.style.display='none';
if(parseInt($get(obj.id).value) > parseInt($get('Txthide').value))
{
$get(obj.id).value='';
lblItemdisplay.style.display='';
}
else
{
lblItemdisplay.style.display='none';
}
}
function advancemodule2(obj)
{
var txtsportfine=document.getElementById(obj.id);
if(txtsportfine.value==0)
{
txtsportfine.value="";
}
}
//*********************** Academic School Information JavaScript Started Here ***************************
//Adding Academic Year by Selected Date
//Don't Alter anythings in this scripts
//it may affect the whole Software
function onKeyPressEventAddyear(obj1,obj2)
{
var dt2;
var dt1= document.getElementById(obj1).value;
if (dt1=='')
{ document.getElementById(obj2).value=""; }
else
{ dt2=dt1.split('/');
document.getElementById(obj2).value=(dt2[0])+"/"+dt2[1]+"/" +(parseInt(dt2[2])+1);
}
}
//***************************** Academic School Information JavaScript Ended *****************************
//****************** ACCOUNT PAGES JAVASCRIPT ********************
//----------------------- Checking Numeric Values ----------------------------
function numeric(obj)
{
//Key Codes
// >=48,>=96 - Numbers
// <=58,<=105 - Numbers
// 46 - Delete
// 8 - Backspace
// 9 - Tab
// 36 - Home
// 37 - Left Arrow
// 39 - Right Arrow
//190,46 - .
var key=event.keyCode;
var txt = document.getElementById(obj.id)
//if (txt.value.length==0 && (event.keyCode==48 ||event.keyCode==96)){return false;}
if ((key >= 48) && (key <=58) || (key>=96) && (key<=105) || (key == 46) || (key == 8) || (key == 9) || (key == 36) || (key == 37) || (key == 39))
{
var arr = txt.value.split(".")
if (arr.length > 1)
{
if (arr[1].length > 1)
{
if((key >= 48) && (key <=58) || (key>=96) && (key<=105))//? return false : return true;
{
return false;
}
else
{
return true;
}
}
else
{
return true;
}
}
else
{
return true;
}
}
else
{
if((key == 190) || (key == 110))
{
return Dot(obj);
}
else
{
return false;
}
}
}
//Function for Account opening Entry to Enter Credit or Debit
function OpenCR_DR(obj,Deb,Cre)
{
var DR = document.getElementById(Deb);
var CR = document.getElementById(Cre);
var txt = document.getElementById(obj.id);
var hide = document.getElementById('txtmsg');
// if (DR.value == 0 || CR.value == 0){Msg_Show('Acc32',CR.id,'Info','btnyes','btnno','btnok','lblmsg')}
if (DR.value != "" && CR.value != "")
{
//----- ID for Clear Values --------
if(txt.id==DR.id)
{
Msg_Show('Acc13',CR.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = CR.id;
}
else
{
Msg_Show('Acc14',DR.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = DR.id;
}
}
}
//------------- Display Unit for Selected Items ----------------
function DRP_Item_Unit()
{
var drp = document.getElementById('rptItems_ctl00_drpitem');
var txt = document.getElementById('rptItems_ctl00_txtunit');
var txtrate=document.getElementById('rptItems_ctl00_txtrate');
if (drp.options[drp.selectedIndex].text != '--Select--')
{
var Unit = drp.value.split('$');
txt.value = Unit[1];
txtrate.value=Unit[2];
}
else
{
txt.value = "";
txtrate.value="";
}
}
//--------------------------------------------------------------
//------------- Calculating Amount In Account Item List ------------------
function AmtCalculate()
{
var Qty = document.getElementById('rptItems_ctl00_txtqty');
var Rate = document.getElementById('rptItems_ctl00_txtrate');
var Amt = document.getElementById('rptItems_ctl00_txtamt');
if (Qty.value >= 0 && Qty.value != "" && Rate.value >= 0 && Rate.value != "")
{
Amt.value = CurrencyFormatted(parseFloat(Qty.value) * parseFloat(Rate.value))
}
else
{
Amt.value = "";
}
}
//---For Transport Module--
function TransCalAmt(km,pkm,tctrl)//transport Calculate Amount based on Kilometer
{
var t1 = document.getElementById(km);
var t2 = document.getElementById(pkm);
var t3 = document.getElementById(tctrl);
if (t1.value >= 0 && t1.value != "" && t2.value >= 0 && t2.value != "")
{
t3.value = CurrencyFormatted(parseFloat(t1.value) * parseFloat(t2.value))
}
else
{
t3.value = "";
}
}
//------------- Convert String Amt Format ---------------
//function Amt_Float(Amt)
//{
// if (parseFloat(Amt.value) > 0)
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value = CurrencyFormatted(Amt_txt.value);
// }
// else
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value ='';
// Amt_txt.focus();
// }
//}
var currentObjectName='';
function Amt_Float(object)
{
if (currentObjectName!='' && currentObjectName!= object.name) return;
currentObjectName=object.name;
if (object.value == "" || parseFloat(object.value)==0)
{
//alert(lc_name + " input field cannot be blank!")
object.value = ""
object.focus();
return false;
}
else if (parseFloat(object.value) > 0)
{
var Amt_txt = document.getElementById(object.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else
{
object.value = ""
object.focus();
return false;
}
currentObjectName='';
return true;
}
//-------------------------------------------------------
//------------- Convert String Amt Format For Fine---------------
var currentObjectName='';
function Amt_Float_Fine(object)
{
if (currentObjectName!='' && currentObjectName!= object.name) return;
currentObjectName=object.name;
if (object.value == "")
{
//alert(lc_name + " input field cannot be blank!")
object.value = ""
object.focus();
return false;
}
else if (parseFloat(object.value) > 0 || parseFloat(object.value)==0)
{
var Amt_txt = document.getElementById(object.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else
{
object.value = ""
object.focus();
return false;
}
currentObjectName='';
return true;
}
//function Amt_Float_Fine(Amt)
//{
// if (parseFloat(Amt.value) > 0 || parseFloat(Amt.value)==0)
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value = CurrencyFormatted(Amt_txt.value);
// }
// else
// {
// var Amt_txt = document.getElementById(Amt.id);
// Amt_txt.value ='';
// Amt_txt.focus();
// }
//}
//-------------------------------------------------------
//------------- Convert String Amt Format ---------------
function Amt_Float_Trans(Amt)
{
if (parseFloat(Amt.value) > 0)
{
var Amt_txt = document.getElementById(Amt.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else if (parseFloat(Amt.value) < 0)
{
var Amt_txt = document.getElementById(Amt.id);
Amt_txt.value ='';
Amt_txt.focus();
}
}
//-------------------------------------------------------
function calc_net(Ctrl,Choice)
{
//Declaration
//---------------------------Gross Amount-----------------------------
var tot_amt = document.getElementById('txttotal_amt');
//--------------------------------------------------------------------
//------------------------Discount---------------------------------
var pers_disc = document.getElementById('txtpers_discount');
var amt_disc = document.getElementById('txtamt_discount');
var tot_disc = document.getElementById('txttotal_discount');
//-----------------------------------------------------------------
//------------------------Tax---------------------------------------
var pers_tax = document.getElementById('txtpers_tax');
var amt_tax = document.getElementById('txtamt_tax');
//------------------------------------------------------------------
//-------------------------Net----------------------------
var net_amt = document.getElementById('txtnet_amt');
//-------------------------------------------------------
if (tot_amt.value != "")
{
switch(Choice)
{
case 'Disc':
{
//----------------------- Discount Calculation Part -------------------------------------------------------
if (pers_disc.value != "" && Ctrl == 'pers' && parseFloat(pers_disc.value) < 100)
{
amt_disc.value = CurrencyFormatted(parseFloat(pers_disc.value) * parseFloat(tot_amt.value)/100);
tot_disc.value = CurrencyFormatted(parseFloat(tot_amt.value) - parseFloat(amt_disc.value));
}
else if (amt_disc.value != "" && Ctrl == 'amt' && parseFloat(amt_disc.value) < parseFloat(tot_amt.value))
{
pers_disc.value = CurrencyFormatted(parseFloat(amt_disc.value) * 100 / parseFloat(tot_amt.value));
tot_disc.value = CurrencyFormatted(parseFloat(tot_amt.value) - parseFloat(amt_disc.value));
}
else if (amt_disc.value == "" || pers_disc.value == "")
{
pers_disc.value = "";
amt_disc.value = "";
tot_disc.value = tot_amt.value;
}
if (pers_disc.value >= 100 || parseFloat(amt_disc.value) >= parseFloat(tot_amt.value))
{
pers_disc.value = "";
amt_disc.value = "";
tot_disc.value = tot_amt.value;
Msg_Show('Acc29',amt_disc.id,'Info','btnyes','btnno','btnok','lblmsg')
}
//------------------------ Tax Calculation part -----------------------------------------------------------
if (pers_tax.value != "" && Ctrl == 'pers' && parseFloat(pers_tax.value) < 100)
{
amt_tax.value = CurrencyFormatted(parseFloat(pers_tax.value) * parseFloat(tot_disc.value)/100);
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value != "" && Ctrl == 'amt' && parseFloat(amt_tax.value) < parseFloat(tot_disc.value))
{
pers_tax.value = CurrencyFormatted(parseFloat(amt_tax.value) * 100 / parseFloat(tot_disc.value));
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value == "" || pers_tax.value == "" || parseFloat(pers_tax.value) >= 100 || parseFloat(amt_tax.value) >= parseFloat(tot_disc.value))
{
pers_tax.value = "";
amt_tax.value = "";
net_amt.value = tot_disc.value;
}
//---------------------------------------------------------------------------------------------------------
}
break;
case 'Tax':
{
//------------------------ Tax Calculation part -----------------------------------------------------------
if (pers_tax.value != "" && Ctrl == 'pers' && parseFloat(pers_tax.value) < 100)
{
amt_tax.value = CurrencyFormatted(parseFloat(pers_tax.value) * parseFloat(tot_disc.value)/100);
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value != "" && Ctrl == 'amt' && parseFloat(amt_tax.value) < parseFloat(tot_disc.value))
{
pers_tax.value = CurrencyFormatted(parseFloat(amt_tax.value) * 100 / parseFloat(tot_disc.value));
net_amt.value = CurrencyFormatted(parseFloat(tot_disc.value) + parseFloat(amt_tax.value));
}
else if (amt_tax.value == "" || pers_tax.value == "" )
{
pers_tax.value = "";
amt_tax.value = "";
net_amt.value = tot_disc.value;
}
if (parseFloat(pers_tax.value) >= 100 || parseFloat(amt_tax.value) >= parseFloat(tot_disc.value))
{
pers_tax.value = "";
amt_tax.value = "";
net_amt.value = tot_disc.value;
Msg_Show('Acc30',amt_tax.id,'Info','btnyes','btnno','btnok','lblmsg')
}
//---------------------------------------------------------------------------------------------------------
}
break;
}
}
}
function zero(obj)
{
var txt = document.getElementById(obj.id);
if (parseInt(txt.value) == 0){txt.value="";Msg_Show('Acc32',txt.id,'Info','btnyes','btnno','btnok','lblmsg')}
}
function Popup_Event(obj)
{
document.getElementById('btnPopup_Acc').click();
document.getElementById('txtmsg').value=obj;
return false;
}
//--------------- Disable Controls Depends on User Entry -----------------------
function Journal_Sub_Disable()
{
var Main_Debit = document.getElementById('rptJournal_ctl00_txtMain_Debit');
var Main_Credit = document.getElementById('rptJournal_ctl00_txtMain_Credit');
var Sub_Debit = document.getElementById('rptJournal_ctl00_txtDebit');
var Sub_Credit = document.getElementById('rptJournal_ctl00_txtCredit');
if (Main_Debit.value != ""){Sub_Credit.disabled=false;}else{Sub_Credit.disabled=true;}
if (Main_Credit.value != ""){Sub_Debit.disabled=false;}else{Sub_Debit.disabled=true;}
}
function first_not_zero(obj)
{
var txt = document.getElementById(obj.id);
if ((event.keyCode==48 ||event.keyCode==96) && txt.value.length==0)
return false;
else
return true;
}
function Url_Acct(Rpt_Entry_No,Header)
{
var New=window.open('../frm_Printing/PrintInven.aspx?Entry_No=' + Rpt_Entry_No + '&Header=' + Header +'','','titlebar=yes,fullscreen=no,scrollbars=yes','popup');
if (window.focus)
{
New.focus();
alert('Printed');
return false;
}
}
//==================================================================================================
//-------------------------- Date Validation for Accounts Modal Popup ------------------------------
//==================================================================================================
//---- Changing date Format Depends on User's Requirement ----
function date_focus(obj,option)
{
var txt = document.getElementById(obj.id);
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (option == 'focus')
{
if (dt_format.value=='MM/dd/yyyy')
{
if (txt.value == "MM/dd/yyyy"){txt.value="";}
//txt.focus();
}
else if (dt_format.value=='dd/MM/yyyy')
{
if (txt.value == "dd/MM/yyyy"){txt.value="";}
}
}
else
{
if (dt_format.value=='MM/dd/yyyy')
{
if (txt.value == ""){txt.value="MM/dd/yyyy";}
}
else if (dt_format.value=='dd/MM/yyyy')
{
if (txt.value == ""){txt.value="dd/MM/yyyy";}
}
}
}
//---------------------- Validating the date ---------------------------
function Valid_Date(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
}
//--------------------------Function to Allow Pre, Current Date and Block Future Date
function Valid_Pre_Date(txtdate,btnyes,btnno,btnok,lblmsg)
{
debugger;
var right_now=new Date();
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.value=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
// dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
else
{
if (getdate(dat.value) > right_now){Msg_Show('Cmn16',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
//-------- Changing Date Format -------------
function getdate(dat)
{
var datsplt = dat.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
dtobj = new Date(yy,mm,dd);
return dtobj;
}
//Function for Processing Modal Popup
function Msg_Show(node,Target_ID,mode,btnyes,btnno,btnok,lblmsg)
{
var lbl = document.getElementById(lblmsg);
var btnshow = document.getElementById('modal');
var hide = parent.document.getElementById('txtfocus_ID');
//------- Getting Message from XML File ----------------
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
lbl.innerText = msg[0].firstChild.nodeValue;
//------------------------------------------------------
//-------- Handle Modal Popup Button Event ------------
hide.value = Target_ID;
btnshow.click();
//-----------------------------------------------------
//--- Process for Hide Button to Confirm or Info -------
var yes = document.getElementById(btnyes);
var no = document.getElementById(btnno);
var ok = document.getElementById(btnok);
if(mode == 'Confirm')
{
yes.style.display="";
no.style.display="";
ok.style.display="none";
yes.focus();
}
else
{
yes.style.display="none";
no.style.display="none";
ok.style.display="";
ok.focus();
}
//------------------------------------------------------
}
function Print_From_To()
{
var from = document.getElementById('txtfrom');
var to = document.getElementById('txtto');
var lbl = document.getElementById('lblpages');
if (from !=null && to != null)
{
if (parseInt(from.value) > parseInt(to.value) && from.value != "" && to.value != "")
{
lbl.style.display='';
to.focus();
return false;
}
else
{
lbl.style.display='none';
return true;
}
}
}
//---------- Date comparision for checking greater or less ------------
function date_compare(from,to)
{
var from_date = document.getElementById(from);
var to_date = document.getElementById(to);
if (Date.parse(Date_Format_Change_Fun(from_date.value,from_date))> Date.parse(Date_Format_Change_Fun(to_date.value,to_date)))
{
Msg_Show('Cmn14',to_date.id,'Info','btnyes','btnno','btnok','lblmsg')
return false;
}
}
//---------------------------------------------------------------------
//------------------- Function for showing Add New Popup ------------------
function Add_New_Acc(obj,Eve)
{
var drp = document.getElementById(obj.id);
var btn = document.getElementById(Eve);
if (drp.options[drp.selectedIndex].text == '[Add New]')
{
btn.click();
}
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//************************************ PAYROLL JAVASCRIPT ****************************************
//PAYROLL CALCULATIONS
//=================================================================================================
function amt_pers(E,bas,per,amount)
{
var basic = document.getElementById(bas);
var pers = document.getElementById(per);
var amt = document.getElementById(amount);
if (basic.value > 0 && basic.value != "")
{
if (E =='pers' && pers.value > 0 && pers.value != "" && pers.value < 100)
{
amt.value = parseFloat(pers.value)*parseFloat(basic.value)/100;
amt.value = CurrencyFormatted(amt.value);
}
else if (E == 'amt' && amt.value > 0 && amt.value != "" && parseFloat(amt.value) < parseFloat(basic.value))
{
pers.value = parseFloat(amt.value)*100/parseFloat(basic.value);
pers.value = CurrencyFormatted(pers.value);
}
else
{
if(E == 'pers' && pers.value != "" && pers.value != 0 && pers.value !='.')
{
Msg_Show('Prl10',pers.id,'Info','btnyes','btnno','btnok','lblmsg')
}
else if(E == 'amt' && amt.value != "" && amt.value != 0 && amt.value !='.')
{
Msg_Show('Prl11',amt.id,'Info','btnyes','btnno','btnok','lblmsg')
}
else if (E == 'pers' && (pers.value == "" || pers.value == 0 || pers.value == '.'))
{
amt.value="";
}
}
}
else{Msg_Show('Prl12',basic.id,'Info','btnyes','btnno','btnok','lblmsg')}
}
function allow(obj1,obj2,obj3,obj4)
{
var bas = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
var grs = document.getElementById('RptAllowance_ctl01_txtGross');
var net = document.getElementById('RptDeduction_ctl01_txtNet');
if ( bas.value > 0 && bas.value != NaN )
{
if ( obj4 == 'basic')
{
amt.value = "";
grs.value = CurrencyFormatted(bas.value);
net.value = CurrencyFormatted(bas.value);
}
}
else
{
grs.value ="";
net.value ="";
amt.value ="";
bas.value ="";
if ( pers.value > 0 && pers.value != NaN )
{
Msg_Show('Prl12',bas.id,'Info','btnyes','btnno','btnok','lblmsg')
pers.value = "";
}
}
if ( bas.value > 0 && bas.value != NaN && pers.value > 0 && amt.value != NaN )
{
if ( pers.value < 100 )
{
amt.value = CurrencyFormatted((parseFloat(pers.value)/100)*parseFloat(bas.value));
}
else
{
pers.value = "";
amt.value = "";
}
}
}
function dir_allow(obj1,obj2,obj3)
{
var bas = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
if ( bas.value > 0 && bas.value != NaN )
{
pers.value = "";
if ( amt.value <= 0 )
{
amt.value ="";
}
}
else
{
amt.value = "";
Msg_Show('Prl12',bas.id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
function deduct(obj1,obj2,obj3)
{
var grs = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
var drop = document.getElementById('drpdeduct');
var esi = document.getElementById('txtmax_esi');
var pf = document.getElementById('txtmax_pf');
var basic = document.getElementById('txtbasic');
var max="";
if ( grs.value > 0 && grs.value != NaN )
{
amt.value = "";
}
else
{
grs.value ="";
amt.value ="";
if ( pers.value > 0 && pers.value != NaN )
{
Msg_Show('Prl12',basic.id,'Info','btnyes','btnno','btnok','lblmsg')
pers.value = "";
}
}
if ( grs.value > 0 && grs.value != NaN && pers.value > 0 && amt.value != NaN )
{
if ( pers.value < 100 )
{
amt.value = CurrencyFormatted((parseFloat(pers.value)/100)*parseFloat(grs.value));
}
else
{
pers.value = "";
amt.value = "";
}
}
}
function dir_deduct(obj1,obj2,obj3)
{
var grs = document.getElementById(obj1);
var pers = document.getElementById(obj2);
var amt = document.getElementById(obj3);
var drop = document.getElementById('drpdeduct');
var esi = document.getElementById('txtmax_esi');
var pf = document.getElementById('txtmax_pf');
var lblmax = document.getElementById('lblmax');
var bas = document.getElementById('txtbasic');
var max="";
if ( grs.value > 0 && grs.value != NaN )
{
if ( amt.value <= 0 )
{
amt.value = "";
}
pers.value = "";
}
else
{
amt.value = "";
Msg_Show('Prl12',bas.id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
function PRL_event(obj)
{
document.getElementById(obj).click();
}
//---------------- Limitation Entry In Textbox --------------
function max_val(obj,max)
{
var txt = document.getElementById(obj.id);
if (parseInt(txt.value) > max )
{
Msg_Show('Prl07',txt.id,'Info','btnyes','btnno','btnok','lblmsg');
}
}
//------------- Block the Future Date ---------------
function cur_date(obj)
{
var txt = document.getElementById(obj.id);
var cur = new Date();
var mm = cur.getMonth() + 1;
var dd = cur.getDate();
var yy = cur.getFullYear();
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var cur = mm + "/" + dd + "/" + yy;
}
else if(dt_format.value=='dd/MM/yyyy')
{
var cur = dd + "/" + mm + "/" + yy;
}
if(getdate(txt.value) > getdate(cur))
{
txt.value='';
Msg_Show('Cmn16',txt.id,'Info','btnyes','btnno','btnok','lblmsg');
}
}
//---------------------------------------------------
function btn_hide()
{
document.getElementById('btnno').style.display="none";
document.getElementById('btnyes').style.display="none";
var btn = document.getElementById('btnok');
btn.style.display="";
return btn;
}
//---------------------- PAYROLL SALARY GRID CALCULATION --------------------------
function salary_calc(obj,ctrl)
{
// var target = document.getElementById(obj);
// target = target.id.replace(ctrl,"").replace(/gvsalary_calc_ctl/,"");
// var net = document.getElementById('gvsalary_calc_ctl'+ target + '_lblnet');
// var allowance = document.getElementById('gvsalary_calc_ctl'+ target + '_txtallowance');
// var advance = document.getElementById('gvsalary_calc_ctl'+ target + '_txtadvance');
// var EMI = document.getElementById('gvsalary_calc_ctl'+ target + '_txtloan_EMI');
// var deduct = document.getElementById('gvsalary_calc_ctl'+ target + '_txtdeduction');
// var home = document.getElementById('gvsalary_calc_ctl'+ target + '_txttake_home');
// var Leave = document.getElementById('gvsalary_calc_ctl'+ target + '_txt_Leave');
//
// home.value = parseFloat(net.innerText)
// if (allowance.value != "")
// {
// home.value = parseFloat(net.innerText) + parseFloat(allowance.value);
// }
// if (advance.value != "")
// {
// home.value = parseFloat(home.value) - parseFloat(advance.value);
// }
// if (EMI.innerText!= "")
// {
// home.value = parseFloat(home.value) - parseFloat(EMI.innerText);
// }
// if (deduct.value != "")
// {
// home.value = parseFloat(home.value) - parseFloat(deduct.value);
// }
// if (Leave.innerText != "")
// {
// home.value = parseFloat(home.value) - parseFloat(Leave.innerText);
// }
//
// home.value = CurrencyFormatted(home.value)
// var key=event.keyCode;
// var chk;
// var target = document.getElementById(obj);
// target.focus();
//// target = target.id.replace(ctrl,"").replace(/gvsalary_calc_ctl/,"");
//// var grd = document.getElementById('gvsalary_calc').rows.length;
//// if (key == 38 && parseInt(target)>=3)
//// {
//// chk = parseFloat(target) - 1;
//// chk = parseInt(chk)>9?chk:'0'+chk;
//// document.getElementById('gvsalary_calc_ctl'+ chk + ctrl).focus();
//// }
//// else if (key == 40 && parseInt(target)< parseInt(grd))
//// {
//// chk = (parseFloat(target) + 1);
//// chk = parseInt(chk)>9?chk:'0'+chk;
//// var ID=document.getElementById('gvsalary_calc_ctl'+ chk + ctrl);
//// if (ID != null)
//// {
//// ID.focus();
//// }
//// }
}
function Extractpers(obj)
{
var key=event.keyCode;
var txt = document.getElementById(obj.id)
if ((parseFloat(txt.value) >= 100) && (parseFloat(txt.value)!= NaN))
{
txt.value = txt.value.substring(0,(txt.value.length-1))
if ((key >= 48) && (key <=58) || (key>=96) && (key<=105))
{
return false;
}
else
{
return true;
}
}
else
{
return true;
}
}
function advance()
{
var txtamt = document.getElementById('txtAmount');
var txtmonth = document.getElementById('txtMonth');
var txtcalc = document.getElementById('txtAmt_Month');
if ( txtamt.value > 0 && txtamt.value != NaN && txtmonth.value > 0 && txtmonth.value != NaN )
{
txtcalc.value = CurrencyFormatted(parseFloat(txtamt.value)/parseInt(txtmonth.value));
}
else{txtcalc.value="";}
}
//------------- Row Highlighting in gridview ----------
//Global Declaration
var Previous=0;
function hightlight_row(index,Grid_ID)
{
var Grid = document.getElementById(Grid_ID)
Grid.rows(Previous + 1).style.backgroundColor=XML_msg('Clr07');
Grid.rows(index + 1).style.backgroundColor=XML_msg('Clr08');
Previous = index;
}
//------- Getting Message from XML File ----------------
function XML_msg(node)
{
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
return msg[0].firstChild.nodeValue;
//------------------------------------------------------
}
//------------------------ Adding New Allowance or Deduction in Salary Master ----------------
function Add_New_Allow_Deduct(Obj)
{
var DRP = document.getElementById(Obj.id);
if (DRP.value == '[Add New]')
{
var lbl = document.getElementById('lblHead');
if (DRP.id == 'RptAllowance_ctl00_drpAllowance')
{
lbl.innerText = 'ALLOWANCE CREATION';
}
else
{
lbl.innerText = 'DEDUCTION CREATION';
}
document.getElementById('txtmsg').value = DRP.id;
document.getElementById('BtnAdd_Hide').click();
document.getElementById('txtAdd_New').focus();
}
}
//-------------------- Adding New Account in Payroll ------------------------------------
function Add_New_Acc_Pay(Obj)
{
var DRP = document.getElementById(Obj.id);
if (DRP.value == '[Add New]')
{
document.getElementById('txtmsg').value = DRP.id;
document.getElementById('BtnAdd_Hide').click();
}
}
//-------------------- Adding New & Focus to popup control ------------------------------------
function Add_New_Acc_Pay_New(Obj,focus_id)
{
var DRP = document.getElementById(Obj.id);
if (DRP.value == '[Add New]')
{
document.getElementById('txtmsg').value = DRP.id;
document.getElementById('BtnAdd_Hide').click();
document.getElementById(focus_id).focus();
}
}
//============================== PAYROLL SCRIPT FINISHED ==============================
// ================================= FEES MODULE - JAVASCRIPT - START =======================
//------------------------------FEES SETTING - MODALPOPUP FIRE ------------------------
function Msg_Show_2Btn(node,Target_ID,mode,btnyes,btnno,btnok,lblmsg)
{
var lbl = document.getElementById(lblmsg);
var btnshow = document.getElementById('modal');
var hide = parent.document.getElementById('txtfocus_ID');
//------- Getting Message from XML File ----------------
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0");
oXML.async = false;
oXML.load("../XML FILES/msg.xml");
var msg = oXML.getElementsByTagName(node);
lbl.innerText = msg[0].firstChild.nodeValue;
//------------------------------------------------------
//-------- Handle Modal Popup Button Event ------------
hide.value = Target_ID;
btnshow.click();
//-----------------------------------------------------
//--- Process for Hide Button to Confirm or Info ------
var yes = document.getElementById(btnyes);
var no = document.getElementById(btnno);
if(mode == 'Confirm' && btnok=='')
{
yes.value='Yes';
yes.style.display="";
no.style.display="";
yes.focus();
}
else if (mode == 'Confirm' && btnok!='')
{
var ok = document.getElementById(btnok);
yes.style.display="";
no.style.display="";
ok.style.display="none";
ok.focus();
}
else if (mode == 'Info' && btnok!='')
{
var ok = document.getElementById(btnok);
yes.style.display="none";
no.style.display="none";
ok.style.display="";
ok.focus();
}
else
{
yes.value='OK';
yes.style.display="";
no.style.display="none";
yes.focus();
}
}
//---------------------FEES SETTING - TERM DATE CHECKING -----------------------
function Fee_setting_Date(obj,ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Install_No;
Install_No=document.getElementById('drp_Install').value;
//-------------------------------------------
//For Sankara Matriculation School
//Install_No=3;
//-------------------------------------------
var Previous_date;
var Next_date;
var Msg_check_pre=0;
var Msg_check_next=0;
var temp=parseInt(obj.id.replace(target,"").substring(8));
if (obj.id != target+'Txt_Last1')
{
temp=parseInt(temp)-1;
Previous_date=document.getElementById(target+'Txt_Last'+ temp);
}
if (obj.id!='Txt_Last'+Install_No)
{
temp=parseInt(temp)+1;
Next_date=document.getElementById(target+'Txt_Last'+ temp);
}
if (Previous_date!=null)
if (Date.parse(Date_Format_Change_Fun(Previous_date.value,Previous_date)) > Date.parse(Date_Format_Change_Fun(obj.value,obj)))
{
obj.value='';
Msg_check_pre=parseInt(temp)-1;
}
if (Next_date!=null)
if (Date.parse(Date_Format_Change_Fun(obj.value,obj)) > Date.parse(Date_Format_Change_Fun(Next_date.value,Next_date)))
{
obj.value='';
Msg_check_next=parseInt(temp)+1;
}
switch(Msg_check_pre)
{
case 1:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 2:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
if ((Msg_check_pre==0) && (Msg_check_next!=0))
{
switch(Msg_check_next)
{
case 2:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 12:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
}
}
//----------------------- FEES SETTING - FINE SETTING -----------------------------
function Fine_Setting_Row_visble()
{
if(document.getElementById('Radio_per_day').checked==true)
{
document.getElementById('Tr_Per_day').style.visibility='visible';
document.getElementById('Tr_Period').style.visibility='hidden';
}
else
{
document.getElementById('Tr_Per_day').style.visibility='hidden';
document.getElementById('Tr_Period').style.visibility='visible';
}
}
//------------------------------ FEES SETTING - TO DAY ON CHANGE ------------------
function Fine_To_Day(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var To_day=document.getElementById(target +'Txt_From_Day');
var Error = document.getElementById(target +'Lb_Fine_Error');
if (parseInt(obj.value)==0 || parseInt(obj.value)>365 || parseInt(obj.value)<=parseInt(To_day.value))
{
obj.value='';
Error.style.display='';
obj.focus();
}
else
{
Error.style.display='none';
obj.focus();
}
}
//------------------------ FEES PAY AND UPDATION - OTHER FEES -----------------------------
function Other_Fees_Amt_Validation(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Basic=document.getElementById(target +'Lbl_Other_Amt');
var err_msg = document.getElementById('Rep_Other_ctl00_Lbl_Other_Error');
if (parseFloat(obj.value)>parseFloat(Basic.innerText))
{
err_msg.innerText='Error!! Greater than Fee Amount';
err_msg.style.visibility='visible';
obj.value='';
obj.focus();
}
else
{
err_msg.style.visibility='hidden';
}
}
function Other_Fees_Amt_Update_Validation(obj, ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Basic=document.getElementById(target +'Lbl_Other_Amt');
var Temp_Basic=Basic.innerText;
var Temp_obj=obj.value=='' ? 0 : obj.value;
var Hidden=document.getElementById(target +'Lbl_Hidden_Tot_Amt');
Temp_Basic= (parseInt(Hidden.innerText)-parseInt(Temp_obj))
var err_msg = document.getElementById('Rep_Other_ctl00_Lbl_Other_Error');
if (parseFloat(Temp_obj)>parseFloat(Hidden.innerText))
{
Basic.innerText=CurrencyFormatted(Hidden.innerText);
err_msg.innerText='Error!! Greater than Fee Amount';
err_msg.style.visibility='visible';
obj.value='';
obj.focus();
}
else
{
Basic.innerText=CurrencyFormatted(Temp_Basic);
err_msg.style.visibility='hidden';
}
}
//------------------------ FEES PAY AND UPDATEION - CONCESSION CALCULATION ----------------
function scholar(obj, ctrl)
{
var E=obj.id.substring(obj.id.length-3);
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var basic=document.getElementById(target +'Lbl_Concess_Tot_Amt');
var pers = document.getElementById(target + 'Txt_Concess_Per');
var amt = document.getElementById(target + 'Txt_Concess_Amt');
var err_msg = document.getElementById('Rep_Concess_ctl00_Lbl_Concess_Error');
if (E =='Per' && pers.value > 0 && pers.value != "" )
{
if (pers.value <= 100)
{
amt.value = parseFloat(pers.value)*parseFloat(basic.innerText)/100;
amt.value = CurrencyFormatted(amt.value);
err_msg.style.visibility='hidden';
}
else
{
err_msg.innerText='Error!! Invalid Percentage';
err_msg.style.visibility='visible';
pers.value='';
amt.value='';
pers.focus();
}
}
else if (E == 'Amt' && amt.value > 0 && amt.value != "")
{
if(parseFloat(amt.value) <= parseFloat(basic.innerText))
{
pers.value = parseFloat(amt.value)*100/parseFloat(basic.innerText);
pers.value = CurrencyFormatted(pers.value);
err_msg.style.visibility='hidden';
}
else
{
err_msg.innerText='Amount is greater than Fee Amount';
err_msg.style.visibility='visible';
pers.value='';
amt.value='';
amt.focus();
}
}
else if (E =='Per' && ( pers.value == 0 || pers.value == "" ))
amt.value = '';
else if (E =='Amt' && ( amt.value == 0 || amt.value == "" ))
pers.value='';
}
//----------------------- FEES PAY AND UPDATION - DROPDOWNLIST SHOW ------------------------
function onCalendarShown(sender,args)
{
document.getElementById("Drp_mode").style.visibility='hidden';
}
//----------------------- FEES PAY AND UPDATION - DROPDOWNLIST HIDING ----------------------
function onCalendarHidden(sender,args)
{
document.getElementById("Drp_mode").style.visibility='visible';
}
//----------------------- FEES STRCTURE - PRINT OPTION --------------------------------------
function Clickheretoprint(obj)
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=no,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
var content_vlue = document.getElementById(obj).innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>Fee Receipt</title>');
docprint.document.write('</head><body onLoad="self.print()"><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.document.close();
docprint.focus();
}
//------------------------------ Fee Pay and Update Preview Total Calculation --------------
function Receipt_Tot()
{
var Name = document.getElementById('Tr_Receipt_SName');
var Roll = document.getElementById('Tr_Receipt_Roll');
var Std = document.getElementById('Tr_Receipt_Std');
var Section = document.getElementById('Tr_Receipt_Sec');
var radio = document.getElementsByName('Radio_Option');
var term = document.getElementById('Drp_Term');
if (term==null)
term='--Select--';
var values;
for (var i=0; i<radio.length; i++)
{
if (radio[i].checked==true)
values=radio[i].parentElement.innerText;
}
var Concess = document.getElementById('Tr_Receipt_Concess');
var Concess_Tot = document.getElementById('Tr_Receipt_Tot_Concess');
var Scholar = document.getElementById('Tr_Receipt_Scholar');
var Net_Tot = document.getElementById('Tr_Receipt_Net_Tot');
var Gross = document.getElementById('Tr_Receipt_Gross_Tot');
var Fine = document.getElementById('Tr_Receipt_Fine');
var Tot_Fine = document.getElementById('Tr_Receipt_Tot_Fine');
var Tot_Scholar = document.getElementById('Tr_Receipt_Tot_Scholar');
var Excess_Shortage = document.getElementById('Tr_Excess_Shortage');
if(Roll.value=='' ||
(term.value=='--Select--' && values!='Other Fees') ||
(document.getElementById('Tot_Total').value==0 && values=='Other Fees'))
{
Name.cells[1].innerText='';
Name.cells[2].innerText='';
Name.cells[3].innerText='';
Roll.cells[1].innerText='';
Std.cells[1].innerText = '';
Section.cells[1].innerText = '';
Gross.cells[2].innerText = CurrencyFormatted(0);
Fine.cells[2].innerText = CurrencyFormatted(0);
Tot_Fine.cells[2].innerText = CurrencyFormatted(0);
Concess.cells[2].innerText = CurrencyFormatted(0);
Concess_Tot.cells[2].innerText= CurrencyFormatted(0);
Scholar.cells[2].innerText = CurrencyFormatted(0);
Net_Tot.cells[2].innerText= CurrencyFormatted(0);
Excess_Shortage.cells[1].innerText = ' Excess Or Shortage : '
Excess_Shortage.cells[2].innerText = CurrencyFormatted(0);
Tot_Scholar.cells[2].innerText = CurrencyFormatted(0);
var fee;
for(i=1;i<=20;i++)
{
fee=document.getElementById('fee'+i);
fee.style.display="none";
}
}
else
{
Name.cells[1].innerText=document.getElementById('Txt_Name').value;
Roll.cells[1].innerText=document.getElementById('Txt_Roll').value;
var Concess_Amt = document.getElementById('Txt_Concession_Amt');
if (Concess_Amt != null)
Concess.cells[2].innerText = Concess_Amt.value == '' ? CurrencyFormatted(0) : CurrencyFormatted(Concess_Amt.value);
else
Concess.cells[2].innerText = CurrencyFormatted(0);
Concess_Tot.cells[2].innerText= CurrencyFormatted(parseFloat(document.getElementById('Tr_Receipt_Tot_Fine').cells[2].innerText) - parseFloat(Concess.cells[2].innerText));
var Scholar_Amt = document.getElementById('Txt_Scholar_Amount');
if (Scholar_Amt != null)
Scholar.cells[2].innerText = Scholar_Amt.value == '' ? CurrencyFormatted(0) : CurrencyFormatted(Scholar_Amt.value);
else
Scholar.cells[2].innerText = CurrencyFormatted(0);
Net_Tot.cells[2].innerText= CurrencyFormatted(parseFloat(Concess_Tot.cells[2].innerText) - parseFloat(Scholar.cells[2].innerText));
}
if (values=='Other Fees')
{
document.getElementById('Tr_Receipt_Gross_Tot').style.display="none";
document.getElementById('Tr_Receipt_Fine').style.display="none";
document.getElementById('Tr_Receipt_Fine_Line').style.display="none";
document.getElementById('Tr_Receipt_Tot_Fine').style.display="none";
document.getElementById('Tr_Receipt_Concess').style.display="none";
document.getElementById('Tr_Receipt_Concess_Line').style.display="none";
document.getElementById('Tr_Receipt_Tot_Concess').style.display="none";
document.getElementById('Tr_Receipt_Scholar').style.display="none";
document.getElementById('Tr_Receipt_Scholar_Line').style.display="none";
}
else
{
document.getElementById('Tr_Receipt_Gross_Tot').style.display="";
document.getElementById('Tr_Receipt_Fine').style.display="";
document.getElementById('Tr_Receipt_Fine_Line').style.display="";
document.getElementById('Tr_Receipt_Tot_Fine').style.display="";
document.getElementById('Tr_Receipt_Concess').style.display="";
document.getElementById('Tr_Receipt_Concess_Line').style.display="";
document.getElementById('Tr_Receipt_Tot_Concess').style.display="";
document.getElementById('Tr_Receipt_Scholar').style.display="";
document.getElementById('Tr_Receipt_Scholar_Line').style.display="";
}
}
//---------------------------------- FEES PAY AND UPDATE -----------------------------------
function Receipt_Popup(obj, title)
{
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
title=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin();" onafterprint="Fee_Receipt_Print_End();"><div align="center">';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</div></body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
}
//---------------------- FEES PAY AND UPDATE (PRINT,CLOSE) Button hide ----------------------
function Fee_Receipt_Print_Begin()
{
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
}
//---------------------- FEES PAY AND UPDATE (PRINT,CLOSE) Button visible -------------------
function Fee_Receipt_Print_End()
{
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
}
//----------------------- FEES STUCTURE - MORE DETAILS BUTTON VISIBLE HIDDEN -------------
function Fee_Structure_Print_Begin()
{
document.getElementById('A_Print_Stru').style.visibility='hidden';
}
//----------------------- FEES STRUCTURE - MORE DETAILS BUTTON VISIBLE SHOW --------------
function Fee_Structure_Print_End()
{
document.getElementById('A_Print_Stru').style.visibility='visible';
}
// ================================= FEES MODULE - JAVASCRIPT - END =======================
// Interview Call
//Gridview Header Checkbox Checked (Check All) Operation
function HeaderClick(objHeader,objCount)
{
var State=objHeader.checked;
var header=objHeader.form.elements;
var parentGrid=document.getElementById('grid_candidate');
var Count=0;
if (parentGrid.rows.length > 0)
{
for(i=1;i<parentGrid.rows.length;i++)
{
var gridCell = parentGrid.rows[i].cells[0];
for (j=0;j<gridCell.childNodes.length;j++)
{
if(gridCell.childNodes[j].type=="checkbox" && header[i]!=objHeader.id)
{
if (State==true)
{
gridCell.childNodes[j].checked = objHeader.checked;
gridCell.childNodes[j].parentNode.parentNode.style.fontWeight='bold';
Count= parseInt(Count) + 1;
}
else
{
gridCell.childNodes[j].checked = objHeader.checked;
gridCell.childNodes[j].parentNode.parentNode.style.fontWeight='normal';
}
}
}
}
document.getElementById(objCount).value = Count;
}
}
//Gridview Datarow Checkbox Checked (Individual Check Box) Operation
function childChkSelected(objHeadName,objChildName,chkCount,grid2)
{
if(document.getElementById(objChildName.id).checked==true)
{
document.getElementById(chkCount).value=parseInt(document.getElementById(chkCount).value) + 1;
objChildName.parentNode.parentNode.style.fontWeight='bold';
}
else
{
document.getElementById(chkCount).value=parseInt(document.getElementById(chkCount).value) - 1;
objChildName.parentNode.parentNode.style.fontWeight='normal';
}
var chkBox=document.getElementById(objChildName.id);
var chkBox=document.getElementById(objHeadName).form.elements;
var state=document.getElementById(objHeadName).checked;
var pCount=0;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=='checkbox' && chkBox[i].id!=objHeadName && chkBox[i].id.startsWith(grid2)==false)
pCount= pCount + 1;
//pCount=pCount-1;
if(pCount==parseInt(document.getElementById(chkCount).value))
{
if(state==false)
document.getElementById(objHeadName).checked=true;
}
else if (pCount!=parseInt(document.getElementById(chkCount).value))
{
if(state==true)
document.getElementById(objHeadName).checked=false;
}
document.getElementById(chkCount).value;
}
//For Reloading the Javascript Function for Data once again
function ReLoadEmp()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(childChkSelected);
}
//------------------After File Upload - Focus Goes to Save Button (Employee Details)
function Fileupload_focus()
{
document.getElementById('btnSave').focus();
}
//Retirement Date Calculation
function Retirement()
{
var iddd=document.getElementById('txtDateofBirth').value;
var DateSplit=iddd.split('/');
var AddYear=(parseInt(DateSplit[2])+parseInt(58));
$get('txtRetirementdate').value=DateSplit[0]+'/'+DateSplit[1]+'/'+AddYear;
}
// ================================= SMS MODULE - JAVASCRIPT - START =======================
function Char_Sms_Count(header,message)
{
var From = document.getElementById(header).value;
var From_len = From !='' ? From.length : 0;
var Msg = document.getElementById(message).value;
var len = Msg !='' ? Msg.length : 0;
len=parseInt(From_len) + parseInt(len);
document.getElementById('Txt_Char_Len').innerText=parseInt(len);
//alert(len);
if (parseInt(len)>160)
{
if(Msg.length>940)
{
document.getElementById(message).value=Msg.substring(0,940);
document.getElementById('Txt_Char_Len').innerText=940+From.length;
document.getElementById('Txt_Sms_Count').innerText=6;
}
else
{
document.getElementById('Txt_Sms_Count').innerText=parseInt(parseInt(len)/160)+1;
}
}
else if (parseInt(len)>0)
{
document.getElementById('Txt_Sms_Count').innerText='1';
}
else
{
document.getElementById('Txt_Sms_Count').innerText='0';
}
}
function SMS_CheckMaxLength(obj,length)
{
var mxlength=length;
var temp = document.getElementById(obj).value;
if (temp.length>=mxlength)
{
if(event.keyCode == 8)
{
document.getElementById(obj).value=temp.substring(0,940);
document.getElementById(obj).focus();
return true;
}
else
{
document.getElementById(obj).focus();
return false;
}
}
}
function Valid_Time(obj)
{
txt = document.getElementById(obj.id);
var Str = txt.value.split(':');
Str[1] = Str[1].replace(' AM','').replace(' PM','');
if(parseInt(Str[0])>12 || parseInt(Str[1])>59)
{
Msg_Show('Cmn19',txt.id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
// ================================= SMS MODULE - JAVASCRIPT - END =======================
function maximize()
{
window.moveTo(0,0)
window.resizeTo(screen.availWidth, screen.availHeight)
}
function date_compare_Excursion(from,to)
{
var F = document.getElementById(from).value;
var E = document.getElementById(to).value;
if (Date.parse(Date_Format_Change_Fun(F,document.getElementById(from))) > Date.parse(Date_Format_Change_Fun(E,document.getElementById(to))))
{
document.getElementById(to).value="";
document.getElementById('btncheck').click();
}
}
//===================
function isNumberKeyWithDot(txt_id)
{
if(event.shiftKey) return false;
var charCode=(event.which) ? event.which: event.keyCode
if ((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 105)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14) && charCode != 190 && charCode !=110)
{
return false;
}
else
{
var txt = document.getElementById(txt_id.id).value;
if(txt.length==0)
{
if(event.keyCode==48 || event.keyCode==96 || event.keyCode==45 || event.keyCode==110 || event.keyCode==190)
return false;
}
return true;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
function FirstDigitNonZero(txt_id)
{
if(event.shiftKey) return false;
var charCode=(event.which) ? event.which: event.keyCode
if(charCode==16) return false;
if ((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 105)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14))
{
return false;
}
else
{
var txt = document.getElementById(txt_id.id).value;
if(txt.length==0)
{
if(event.keyCode==48 || event.keyCode==96)
return false;
}
return true;
}
}
//Hostel Module Scripts
function Time_Diff_Hostel(st,drp)
{
var t1 = document.getElementById(st);
var t2 = document.getElementById(drp);
if((t1.value==t2.value) || (t2.value=='12:00 AM')|| (mil(t1.value)>mil(t2.value)))
{
t2.value='';
t2.focus();
$get('btnScript').click();
}
}
function testWithCustomdate(txt_Date)
{
var dat_Fetch = document.getElementById(txt_Date).value;
if(dat_Fetch !='')
{
var date_Validate = Date_Validate(dat_Fetch);
if(date_Validate == false)
{
document.getElementById(txt_Date).value='';
document.getElementById(txt_Date).focus();
document.getElementById('Btnhide').click();
}
else
{
var dt1=new Date(document.getElementById('Txthide').value);
var dt2=new Date(dat_Fetch);
if(dt2>dt1)
{
document.getElementById(txt_Date).value='';
document.getElementById(txt_Date).focus();
document.getElementById('Btnhide').click();
}
else
{
document.getElementById('BtnFocus').click();
}
}
}
}
function ToDate_Validate(txt_Date)
{
var dat_Fetch = document.getElementById(txt_Date).value;
if(dat_Fetch != "")
{
var date_Validate = Date_Validate(dat_Fetch);
if (date_Validate == false)
{
document.getElementById(txt_Date).value='';
document.getElementById(txt_Date).focus();
document.getElementById('Btnhide').click();
}
else
{
document.getElementById('BtnFocus').click();
}
}
}
function Date_Validate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var strMonth=dtStr.substring(0,pos1)
var strDay=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
}
else if(dt_format.value=='dd/MM/yyyy')
{
var strDay=dtStr.substring(0,pos1)
var strMonth=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
}
strYr=strYear
if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
//alert("The date format should be : mm/dd/yyyy")
return false
}
if (strMonth.length<1 || month<1 || month>12){
//alert("Please enter a valid month")
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
//alert("Please enter a valid day")
return false
}
if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
//alert("Please enter a valid date")
return false
}
return true
}
function HoInOut_Valid_Time(obj)
{
txt = document.getElementById(obj.id);
var Str = txt.value.split(":");
Str[1] = Str[1].replace(" AM","").replace(" PM","");
if(parseInt(Str[0])>12 || parseInt(Str[1])>59)
{
$get('hdenCheck').value='0';
$get('btncheck').click();
}
}
// ************************** Hostel Module ***********************************************
//Hoste Master
function FirstDigitNonZero(txt_id)
{
if(event.shiftKey)
return false;
var charCode=(event.which) ? event.which: event.keyCode
if(charCode==16) return false;
if((charCode < 45 || charCode > 57) && (charCode < 36 || charCode > 40)&&(charCode < 95 || charCode > 105)&&(charCode<7 || charCode>9) &&(charCode<13 || charCode>14))
{
return false;
}
else
{
var txt = document.getElementById(txt_id.id).value;
if(txt.length==0)
{
if(event.keyCode==48 || event.keyCode==96)
return false;
}
return true;
}
}
function DiscountAmt(objDiscount,objTotAmt,objPreBalance)
{
var Discount=$get(objDiscount.id).value;
var Amt=$get(objTotAmt).value;
var PreBalance=$get(objPreBalance).value;
var TotalAmount= $get('txtTotalAmount');
var AmtPaid=$get('txtAmtPaid');
var Balance=$get('txtCurrentBalance');
if (Discount>0 && Discount!=NaN)
{
TotalAmount.value=parseFloat(Amt)+parseFloat(PreBalance)-parseFloat(Discount);
if (isNaN(parseFloat(TotalAmount.value)))
{
TotalAmount.value=''
}
}
else
{
TotalAmount.value=Amt;
}
if(AmtPaid.value>0 && AmtPaid.value!=NaN )
{
Balance.value=parseFloat(TotalAmount.value)-parseFloat(AmtPaid.value);
}
}
function AmountPaid(objAmtPaid,objTotAmt,objBalance)
{
var AmtPaid=$get(objAmtPaid.id).value;
var TotAmt=$get(objTotAmt).value;
var Balance=$get(objBalance);
if (AmtPaid>0 && AmtPaid!=NaN)
{
Balance.value=parseFloat(TotAmt)-parseFloat(AmtPaid);
}
else
{
Balance.value=TotAmt;
}
if (isNaN(Balance.value))
{
Balance.value='0.00';
}
}
function Calculate()
{
var messbill = parseFloat(document.getElementById('txtMessBill').value);
var launbill = parseFloat(document.getElementById('txtLanudryBill').value);
var roombill = parseFloat(document.getElementById('txtRoomBill').value);
var others = parseFloat(document.getElementById('txtOthersBill').value);
var TotalAmt = document.getElementById('txtAmount');
TotalAmt.value=0;
if (messbill > 0 && messbill != NaN)
TotalAmt.value=CurrencyFormatted(messbill);
if (launbill > 0 && launbill != NaN)
TotalAmt.value = CurrencyFormatted(parseFloat(TotalAmt.value) + launbill);
if (roombill > 0 && roombill != NaN)
TotalAmt.value = CurrencyFormatted(parseFloat(TotalAmt.value) + roombill);
if(others > 0 && others != NaN)
TotalAmt.value = CurrencyFormatted(parseFloat(TotalAmt.value) + others);
}
// ------------------------ STUDENT INFORMATION UPLOAD ----------------------------
function sheet_change()
{
if (document.getElementById('Tab_Gv_Info') != null)
document.getElementById('Tab_Gv_Info').style.visibility='hidden';
}
// Single Add New Information
function Add_New_process(obj,pop_id)
{
if(obj.value=='[Add New]' && obj.value!=null)
{
document.getElementById('lbl_alert').style.display="none";
document.getElementById(pop_id).click();
}
}
// Multiple Add New Information
function Add_New_Process_Multi(obj,pop_id,ident_value)
{
if (obj.value=='[Add New]' && obj.value!= null)
{
document.getElementById('lbl_alert').style.display="none";
document.getElementById('Txt_hidden').value=ident_value;
document.getElementById('Td_Add_New_Title').innerText="";
document.getElementById('Td_Add_New_Title').innerText = 'Enter ' + ident_value ;
document.getElementById(pop_id).click();
document.getElementById('Txt_Add_New').focus();
}
}
//--------------------------Function to Allow Pre, Current Date and Block Future Date
function c(txtdate,btnyes,btnno,btnok,lblmsg)
{
var right_now=new Date();
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.value=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
else
{
if (getdate(dat.value) > right_now){Msg_Show('Cmn16',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
//---------------------------- For Offline Exam Schedule -------------------------
function Valid_Off_Exam_Date(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var start = parent.document.getElementById('lblfrom_date').innerText;
var end = parent.document.getElementById('lblto_date').innerText;
var datsplt = dat.value.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.value=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.value=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
//dat.value = mm + '/' + dd + '/' + yy;
}
if( dat.value !='' && dat.value.length != 10){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if(mm > 12 || (mm <= 0 && dat.value != '')){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if(yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){Msg_Show('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){Msg_Show('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
if (getdate(dat.value) < getdate(start) || getdate(dat.value) > getdate(end))
{
Msg_Show('Cmn14',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;
}
else
{
document.getElementById('txt_Time_From_'+ current_datecontrol).value='';
document.getElementById('txt_Time_To_'+ current_datecontrol).value='';
document.getElementById('txt_Duration_'+ current_datecontrol).value='';
var count_check=0;
total_no_of_controls=intLoopCountAdd;
for(i=intLoopCount;i<total_no_of_controls;i++)
{
if((current_datecontrol != i) && (document.getElementById('txt_Date_' + i).value != '') && (document.getElementById('txt_Date_' + current_datecontrol).value == document.getElementById('txt_Date_' + i).value))
{
count_check+=1;
}
}
if(count_check>=2)
{
document.getElementById('txt_Date_' + current_datecontrol).value='';
Msg_Show('Ofe26','txt_Date_' + current_datecontrol,'Info','ibtnadd','ibtncancel','ibtnadd_alone','lblmsg');
}
else
{
var txt_date = document.getElementById('txt_Date_' + current_datecontrol).value;
if(txt_date!='')
{
var Todaydate = new Date(document.getElementById('txt_Today_Date').value);
var date_to_check = new Date(txt_date)
if(date_to_check<Todaydate)
{
document.getElementById('txt_Date_' + current_datecontrol).value='';
Msg_Show('Ofe28','txt_Date_' + current_datecontrol,'Info','ibtnadd','ibtncancel','ibtnadd_alone','lblmsg');
}
else
{
document.getElementById('txt_Date_' + current_datecontrol).focus();
}
}
}
}
}
//----------------------- Date Validation without Academic Year Checking ---------------------
function Valid_Date_Not_Academic_New(txtdate,btnyes,btnno,btnok,lblmsg)
{
var dat = document.getElementById(txtdate.id);
var txt = document.getElementById('txt_hidden');
var datsplt = dat.value.split('/');
// var mm = datsplt[0];
// var dd = datsplt[1];
// var yy = datsplt[2];
var dt_format=parent.document.getElementById('lbl_Date_Format');
if (dt_format.innerText=='MM/dd/yyyy')
{
var mm = datsplt[0];
var dd = datsplt[1];
var yy = datsplt[2];
}
else if(dt_format.innerText=='dd/MM/yyyy')
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
}
if ( mm != '' && dd != '' && yy != '' && mm != null && dd != null && yy != null)
{
mm = mm.length < 2 ? '0' + mm : mm;
dd = dd.length < 2 ? '0' + dd : dd;
if (mm.length != 2 || dd.length !=2 || yy.length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
//dat.value = mm + '/' + dd + '/' + yy;
}
if ( dat.value !='' && dat.value.length != 10)
{
txt.value='Cmn13';
Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false
}
if(mm > 12 || (mm <= 0 && dat.value != '')){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy <= 0 && dat.value != ''){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false}
if (yy % 4 == 0)
{
if (mm == 2)
{
if (dd > 29){txt.value='Cmn15';Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
not_leap();
}
}
else
{
not_leap();
}
function not_leap()
{
if (mm == 2)
{
if (dd > 28 || dd == 0){txt.value='Cmn15';Msg_Show_2Btn('Cmn15',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
{
if (dd > 30 || dd == 0){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
else
{
if (dd > 31 || dd == 0){txt.value='Cmn13';Msg_Show_2Btn('Cmn13',txtdate.id,'Info',btnyes,btnno,btnok,lblmsg);dat.value="";return false;}
}
}
}
/////////////Class Id Generation.///////////////////
function GV_Check_All_classID(chkAll,txt)
{
var chkBox=chkAll.form.elements;
var state=chkAll.checked;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
{
if (chkBox[i].checked!=chkAll.checked)
if(state==true)
{
chkBox[i].checked=true;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
//chkBox[i].parentNode.parentNode.style.color='#993333';
chkBox[i].parentNode.parentNode.style.fontWeight='bold';
var name=chkBox[i].id.substring(0,chkBox[i].id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=false
}
else
{ chkBox[i].checked=false;
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
//chkBox[i].parentNode.parentNode.style.color='black';
chkBox[i].parentNode.parentNode.style.fontWeight='normal';
var name=chkBox[i].id.substring(0,chkBox[i].id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=true
}
}
}
function GV_Check_in_classID(chk_head,chk,txt)
{
if(document.getElementById(chk.id).checked==true)
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='#993333';
chkBox.parentNode.parentNode.style.fontWeight='bold';
var name=chk.id.substring(0,chk.id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=false
}
else
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='black';
chkBox.parentNode.parentNode.style.fontWeight='normal';
var name=chk.id.substring(0,chk.id.length-14)
var txtbx=document.getElementById(name+"_txtClass_Id")
txtbx.disabled=true
}
var chkBox=document.getElementById(chk_head).form.elements;
var state=document.getElementById(chk_head).checked;
var len=0;
for(i=0;i<chkBox.length;i++)
if(chkBox[i].type=="checkbox")
len=len+1;
len=len-1;
if(len==parseInt(document.getElementById(txt).value))
{
if(state==false)
document.getElementById(chk_head).checked=true;
}
else if (len!=parseInt(document.getElementById(txt).value))
{
if(state==true)
document.getElementById(chk_head).checked=false;
}
}
function gvCheckall(chkAll,chkChild)
{
//var chkBox=chkAll.form.elements;
var pos = 0;
var chk_id=chkAll.id;
var split_val=chk_id.split("_");
var dg_Name=split_val[0];
var Data_Grid=document.getElementById('gvacc');
var RW_cnt=Data_Grid.rows.length;
var state=chkAll.checked;
var len=0;
for(i=1;i<RW_cnt;i++)//chkBox.length
{
// if(chkBox[i].type=="checkbox" && chkBox[i].id!=chkAll.id)
// {
// if (chkBox[i].checked!=chkAll.checked)
if (i<9)
{
pos='0' + (i+1);
}
else
{
pos = i+1;
}
var Child_id =document.getElementById(Data_Grid.id +'_ctl'+ pos + '_' + chkChild);
//if (chkAll.checked)
if(state==true)
{
Child_id.checked=true;
//chkAll.parentNode.parentNode.style.fontWeight='bold';
len=len+1;
}
else
{
Child_id.checked=false;
//chkAll.parentNode.parentNode.style.fontWeight='normal';
}
// }
}
document.getElementById('txt_select').value=len;
}
/////////////////////
function gvCheckIN(chk_head,chk,txt)
{
var txt_val=document.getElementById(txt);
var tttt=document.getElementById(txt).value;
if(document.getElementById(chk.id).checked==true)
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) + 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='#993333';
//chkBox.parentNode.parentNode.style.fontWeight='bold';
}
else
{
document.getElementById(txt).value=parseInt(document.getElementById(txt).value) - 1;
var chkBox=document.getElementById(chk.id);
//chkBox.parentNode.parentNode.style.color='black';
//chkBox.parentNode.parentNode.style.fontWeight='normal';
}
//var chkBox=document.getElementById(chk_head).form.elements;
var Data_Grid=document.getElementById('gvacc');
var RW_cnt=Data_Grid.rows.length;
var split_Val=chk.id.split("_");
var childChk=split_Val[2];
var state=document.getElementById(chk_head).checked;
var len=0;
for(i=1;i<RW_cnt;i++)
{
if (i<9)
{
pos='0' + (i+1);
}
else
{
pos = i+1;
}
var Child_id =document.getElementById('gvacc_ctl'+ pos + '_' + childChk);
var Child_State=Child_id.checked;
if(Child_State==true)
{
len=len+1;
}
else
{
if(i!=1)
{
len=len-1;
}
}
}
if (len==(RW_cnt-1))
{
if(state==false)
document.getElementById(chk_head).checked=true;
}
else if (len!=(RW_cnt-1))
{
if(state==true)
document.getElementById(chk_head).checked=false;
}
document.getElementById(txt).value=len;
}
///////////////Changing Date Formate to MM/dd/yyyy
function Date_Format_Change_Fun(Date_Value,txtdate)
{
var datsplt ;
var dt_format=parent.document.getElementById('lbl_Date_Format');
var date_return="";
datsplt = Date_Value.split('/');
if (datsplt[0].length != 2 || datsplt[1].length !=2 || datsplt[2].length !=4)
{Msg_Show_2Btn('Cmn23',txtdate.id,'Info','btnyes','btnno','','lblmsg');txtdate.value="";return false}
if((dt_format.innerText=='dd/MM/yyyy') && (dt_format.innerText!='MM/dd/yyyy'))
{
var mm = datsplt[1];
var dd = datsplt[0];
var yy = datsplt[2];
date_return =datsplt[1] +'/'+datsplt[0]+'/'+datsplt[2]
}
else
{
date_return=Date_Value;
}
return date_return;
}
function cheque_Dt(txtdate)
{
var dat = document.getElementById(txtdate.id);
var chk_dat = document.getElementById('Txt_Ch_Date');
if (chk_dat != null)
{
chk_dat.value=dat.value;
dat.focus();
}
}
function Fine_Settin_Date_Compare(grace_Date)
{
var target = document.getElementById(grace_Date.id);
target = target.id.replace(grace_Date,"").substring(0,15)
var Last_Date =document.getElementById(target+"txt_Date")
if (Date.parse(Date_Format_Change_Fun(Last_Date.value,Last_Date))> Date.parse(Date_Format_Change_Fun(grace_Date.value,grace_Date)))
{
Msg_Show_2Btn('Cmn14',grace_Date.id,'Info','btnyes','btnno','','lblmsg');
grace_Date.value="";
return false;
}
}
function Sibling_Txt_Change()
{
var var_check= document.getElementById('invalid');
var_check.value="add_new"
//__doPostBack(strid,'OnClick');
// return true;
}
function Amt_Float_Journal(object)
{
if (parseFloat(object.value) > 0)
{
var Amt_txt = document.getElementById(object.id);
Amt_txt.value = CurrencyFormatted(Amt_txt.value);
}
else
{
document.getElementById(object.id).value="";
}
}
function check_Dob(obj,btnyes,btnno,btnok,lblmsg)
{
var Dob =document.getElementById(obj);
var x= new Date;
if (Date.parse(Date_Format_Change_Fun(Dob.value,Dob.id)) > Date.parse(x))
{
Msg_Show_2Btn('Hwk06',Dob.id,'Info',btnyes,btnno,btnok,lblmsg);
Dob.value="";
}
}
function Receipt_Popup_New(obj, title)
{
if(document.getElementById('Div_Print_Ctrl1') != null)
document.getElementById('Div_Print_Ctrl1').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
title=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin_New();" onafterprint="Fee_Receipt_Print_End_New();"><div align="center">';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</div></body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
if(document.getElementById('Div_Print_Ctrl1') != null)
document.getElementById('Div_Print_Ctrl1').style.visibility='hidden';
}
function Fee_Receipt_Print_Begin_New()
{
document.getElementById('Div_Print_Ctrl1').style.visibility='hidden';
}
//---------------------- FEES PAY AND UPDATE (PRINT,CLOSE) Button visible -------------------
function Fee_Receipt_Print_End_New()
{
document.getElementById('Div_Print_Ctrl1').style.visibility='visible';
}
function Get_courier_Type(obj)
{
var txt = document.getElementById(obj.id);
var txt_hide = document.getElementById('txt_hidden');
txt_hide.value ='';
return true;
}
function Open_Exs_strg(obj,Excess,Shortage)
{
var Exs = document.getElementById(Excess);
var srtg = document.getElementById(Shortage);
var txt = document.getElementById(obj.id);
var hide = document.getElementById('txtmsg');
if (Exs.value != "" && srtg.value != "")
{
//----- ID for Clear Values --------
if(txt.id==Exs.id)
{
Msg_Show('ES002',srtg.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = srtg.id;
}
else
{
Msg_Show('ES003',Exs.id,'Confirm','btnyes','btnno','btnok','lblmsg')
hide.value = Exs.id;
}
}
}
function Tab_Func()
{
if(event.keyCode==9 || event.keyCode==16)
{
return true;
}
else
{
return false;
}
}
function Fee_setting_Date1(obj,ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Install_No;
Install_No=document.getElementById('drp_Install').value;
//-------------------------------------------
//For Sankara Matriculation School
//Install_No=3;
//-------------------------------------------
var Previous_date;
var Next_date;
var Msg_check_pre=0;
var Msg_check_next=0;
var temp=parseInt(obj.id.replace(target,"").substring(18));
if (obj.id != target+'TXT_FIRST_REMINDER1')
{
temp=parseInt(temp)-1;
Previous_date=document.getElementById(target+'TXT_FIRST_REMINDER'+ temp);
}
if (obj.id!='TXT_FIRST_REMINDER'+Install_No)
{
temp=parseInt(temp)+1;
Next_date=document.getElementById(target+'TXT_FIRST_REMINDER'+ temp);
}
if (Previous_date!=null)
if (Date.parse(Date_Format_Change_Fun(Previous_date.value,Previous_date)) > Date.parse(Date_Format_Change_Fun(obj.value,obj)))
{
Msg_check_pre=parseInt(temp)-1;
}
if (Next_date!=null)
if (Date.parse(Date_Format_Change_Fun(obj.value,obj)) > Date.parse(Date_Format_Change_Fun(Next_date.value,Next_date)))
{
Msg_check_next=parseInt(temp)+1;
}
switch(Msg_check_pre)
{
case 1:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 2:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
if ((Msg_check_pre==0) && (Msg_check_next!=0))
{
switch(Msg_check_next)
{
case 2:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 12:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
}
}
function Fee_setting_Date2(obj,ctrl)
{
var target = document.getElementById(obj.id);
target = target.id.replace(ctrl,"")
var Install_No;
Install_No=document.getElementById('drp_Install').value;
//-------------------------------------------
//For Sankara Matriculation School
//Install_No=3;
//-------------------------------------------
var Previous_date;
var Next_date;
var Msg_check_pre=0;
var Msg_check_next=0;
var temp=parseInt(obj.id.replace(target,"").substring(16));
if (obj.id != target+'TXT_2ND_REMINDER1')
{
temp=parseInt(temp)-1;
Previous_date=document.getElementById(target+'TXT_2ND_REMINDER'+ temp);
}
if (obj.id!='TXT_2ND_REMINDER'+Install_No)
{
temp=parseInt(temp)+1;
Next_date=document.getElementById(target+'TXT_2ND_REMINDER'+ temp);
}
if (Previous_date!=null)
if (Date.parse(Date_Format_Change_Fun(Previous_date.value,Previous_date)) > Date.parse(Date_Format_Change_Fun(obj.value,obj)))
{
Msg_check_pre=parseInt(temp)-1;
}
if (Next_date!=null)
if (Date.parse(Date_Format_Change_Fun(obj.value,obj)) > Date.parse(Date_Format_Change_Fun(Next_date.value,Next_date)))
{
Msg_check_next=parseInt(temp)+1;
}
switch(Msg_check_pre)
{
case 1:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 2:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
if ((Msg_check_pre==0) && (Msg_check_next!=0))
{
switch(Msg_check_next)
{
case 2:
Msg_Show_2Btn('Fes06',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 3:
Msg_Show_2Btn('Fes07',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 4:
Msg_Show_2Btn('Fes08',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 5:
Msg_Show_2Btn('Fes09',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 6:
Msg_Show_2Btn('Fes10',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 7:
Msg_Show_2Btn('Fes11',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 8:
Msg_Show_2Btn('Fes12',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 9:
Msg_Show_2Btn('Fes13',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 10:
Msg_Show_2Btn('Fes14',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 11:
Msg_Show_2Btn('Fes15',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
case 12:
Msg_Show_2Btn('Fes16',obj.id,'Info','btnyes','btnno','','lblmsg');
break;
}
}
}
function date_compare_Fees_Sms(Last,First_Reminder,obj)
{
var target = document.getElementById(obj.id);
target = target.id.replace(First_Reminder,"")
var Last_date = document.getElementById(target+Last);
var First_Reminder_date = document.getElementById(target+First_Reminder);
if (Date.parse(Date_Format_Change_Fun(Last_date.value,Last_date))< Date.parse(Date_Format_Change_Fun(First_Reminder_date.value,First_Reminder_date)))
{
Msg_Show_2Btn('Cmn14',obj.id,'Info','btnyes','btnno','','lblmsg');
return false;
}
}
function date_compare_Fees_Sms1(Last,First_Reminder,Second_Reminder,obj)
{
var target = document.getElementById(obj.id);
target = target.id.replace(Second_Reminder,"")
var Last_date = document.getElementById(target+Last);
var First_Reminder_date = document.getElementById(target+First_Reminder);
var Second_Reminder_date =document.getElementById(target+Second_Reminder);
if (Date.parse(Date_Format_Change_Fun(First_Reminder_date.value,First_Reminder_date))> Date.parse(Date_Format_Change_Fun(Second_Reminder_date.value,Second_Reminder_date)))
{
Msg_Show_2Btn('Cmn14',obj.id,'Info','btnyes','btnno','','lblmsg');
return false;
}
if (Date.parse(Date_Format_Change_Fun(Second_Reminder_date.value,Second_Reminder_date))> Date.parse(Date_Format_Change_Fun(Last_date.value,Last_date)))
{
Msg_Show_2Btn('Cmn14',obj.id,'Info','btnyes','btnno','','lblmsg');
return false;
}
}
function Receipt_Popup_test(obj, title,txt,focus_id)
{
var txt_hidden_Val=document.getElementById(txt);
txt_hidden_Val.value='S';
if (txt_hidden_Val.value=='S')
{
cmpny_Info_Display();
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=no,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//var title_dynamic=document.getElementById(title).innerText
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
//title=document.getElementById('td_Page_Heading').innerText+" Report"
// title=document.getElementById('td_Page_Heading').innerText+" Report"
//title=document.getElementById('lblRptTitle').innerText
//title_dynamic=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin();" onafterprint="Fee_Receipt_Print_End();">';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
cmpny_Info_Dsply_none();
}
else
{
Msg_Show('Rp01',focus_id,'Info','btnyes','btnno','btnok','lblmsg')
}
}
function cmpny_Info_Display()
{
document.getElementById('tr_CompanyName').style.display="inline";
document.getElementById('tr_CompanyAddress').style.display="inline";
}
function cmpny_Info_Dsply_none()
{
document.getElementById('tr_CompanyName').style.display="none";
document.getElementById('tr_CompanyAddress').style.display="none";
}
function Receipt_Popup_WithSchool(obj, title,Heading)
{
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='visible';
var disp_setting="toolbar=no,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=850, height=650, left=100, top=50";
//Altered by Sathish for General Report (heading Purpose only)
if (title =='')
{
title=document.getElementById('lblRptTitle').innerText
}
//Ended
var concat_vlue='<html><head><title>'+ title +'</title>';
concat_vlue=concat_vlue+'<script type="text/javascript" src="../Javascript/Validation.js" language="javascript"></script></head>';
concat_vlue=concat_vlue+'<body onbeforeprint="Fee_Receipt_Print_Begin();" onafterprint="Fee_Receipt_Print_End();"><div align="center">';
concat_vlue=concat_vlue+'<table>';
concat_vlue=concat_vlue+document.getElementById(Heading).innerHTML;
concat_vlue=concat_vlue+'</table>';
concat_vlue=concat_vlue+document.getElementById(obj).innerHTML;
concat_vlue=concat_vlue+'</div></body></html>';
var docprint=window.open("","Print",disp_setting);
docprint.document.open();
docprint.document.write(concat_vlue);
docprint.document.close();
docprint.focus();
if(document.getElementById('Div_Print_Ctrl') != null)
document.getElementById('Div_Print_Ctrl').style.visibility='hidden';
}
function SelectAll(id,txt,grid)
{
var grid = document.getElementById(grid);
var cell;
if (grid.rows.length > 0)
{
for (i=1; i<grid.rows.length; i++)
{
cell = grid.rows[i].cells[0];
for (j=0; j<cell.childNodes.length; j++)
{
if (cell.childNodes[j].type =="checkbox")
{
cell.childNodes[j].checked = id.checked;
}
}
}
}
}
No comments :
Post a Comment