 function doAdminSubmit(frmName,hdnValue){
	if ((hdnValue != 'Add') && (hdnValue!='Show') && (hdnValue!='')){
		if (validateForm(frmName)){
			var intX=0;	
			if (hdnValue=='Delete')
				if(!confirm("Do you really want to Delete?"))
					intX=intX+1;
					//return false;
			if ((hdnValue=='Modify')||(hdnValue=='Update'))
				if(!confirm("Do you want to Save the Changes?"))
					intX=intX+1;
					//return false;
			if (hdnValue=='Save')
				if(!confirm("Do you want to Save ?"))
					intX=intX+1;
					//return false;
			if(intX==0){
				document.forms[frmName].HdnOAction.value=hdnValue;
				document.forms[frmName].submit();
				}
		}
	}
	else{
	document.forms[frmName].HdnOAction.value=hdnValue;
	document.forms[frmName].submit();
	}
}

function validateForm(frmName){

	var n;
	var ctlName;
	var ctlType;
	var ctlReq;
	var ctlValue;
	var ctlErrName;	
	var ctlObj;

	var errInt;
	var errFlt;
	var errTxt;
	var errDat;
	var  booSpace;
	var tempChr;
	var tempCtlValue;
	var tempDatFormat;

	tempDatFormat="mm/dd/yyyy";
	
	booSpace=false;

	errInt="Only Numbers are allowed in - ";
	errFlt="Only Numbers are allowed in - ";
	errTxt="Invalid Characters in - ";
	errDat="Date is not valid in - ";
	errNum="Not a Valid Number - ";	
	errEml	= "The e-mail address you typed was incomplete. Type your complete e-mail address, including the '@' symbol and the domain name. (i.e., email@domain.com) in - ";
	errCur	= "Invalid Amount in - ";


	n=document.forms[frmName].elements.length ;

	for(var i=0;i<document.forms[frmName].elements.length;i++){
		ctlName=document.forms[frmName].elements[i].name;		
		ctlObj=document.forms[frmName].elements[i].type;	
		document.forms[frmName].elements[i].value=replaceApos(document.forms[frmName].elements[i].value);
		//alert("controlname : "+ctlName);
		if (ctlName.indexOf(":")>=0){
		
			//alert(ctlName);	
			ctlTempName = ctlName.substring(ctlName.indexOf(":")+1,ctlName.length);
			
			
			ctlType=ctlTempName.substring(0,3);
			ctlReq=ctlTempName.substring(3,4);
			ctlErrName=ctlTempName.substring(4,ctlTempName.length);	
		}
		else{
			ctlType=ctlName.substring(0,3);
			ctlReq=ctlName.substring(3,4);
			ctlErrName=ctlName.substring(4,ctlName.length);	
		}
		var tempStr;
		tempStr="";
		for (var sl=0;sl<ctlErrName.length;sl++){
			tempStr=tempStr+ctlErrName.substring(sl, sl+1).replace("_"," ");
		}
		
			ctlErrName=tempStr;

		ctlErrName="\'"+ctlErrName+"\'";

		if (ctlObj.indexOf("select")>=0 ){
			if(document.forms[frmName].elements[i].selectedIndex >=0)
				ctlValue=document.forms[frmName].elements[i].options[document.forms[frmName].elements[i].selectedIndex].value;		
		}
		else
			ctlValue=document.forms[frmName].elements[i].value;	

// trim 
		tempCtlValue='';
booSpace=false;
		for (var sl=0;sl<ctlValue.length;sl++){
			tempChr=ctlValue.substring(sl, sl+1);
			if (tempChr!=' '){
				booSpace=true;
				tempCtlValue=tempCtlValue+tempChr;
			}
			else
				if (booSpace)
					tempCtlValue=tempCtlValue+tempChr;
			
		}
	
		ctlValue=tempCtlValue;
		document.forms[frmName].elements[i].value=ctlValue;
// end of trim

	
		if ((ctlReq=="R") && (ctlObj!="hidden")){
			if(ctlValue.length<=0){
				alert(ctlErrName+' is Required'); 
				document.forms[frmName].elements[i].focus();
				return false;	
			}
		}
	if(ctlValue.length>0){		

		switch (ctlType){
		case "Txt":
			if (!isBDLText(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "TxA":
			if (!isBDLSpecialText(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Int":
			if (!isBDLInteger(ctlValue)){
				alert(errInt+ctlErrName);
				document.forms[frmName].elements[i].value='0';
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;

		case "Flt":
			if (!isBDLFloat(ctlValue)){
				alert(errNum+ctlErrName);
				document.forms[frmName].elements[i].value='0';
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;

		case "Neg":
			if (!isBDLNegative(ctlValue)){
				alert(errNum+ctlErrName);
				if (isNaN(document.forms[frmName].elements[i].value))
				{
					return false;
				}
				else
				{
					break ;
				}
				document.forms[frmName].elements[i].value='0';
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;

		case "Pwd":
			if (!isBDLPassword(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Eml":
			if (!isBDLEMail(ctlValue)){
				alert(errEml+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;

		case "Tel":
			if (!isBDLTelephone(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Cur":
			if (!isBDLCurrency(ctlValue)) {
				alert(errCur+ctlErrName);
				document.forms[frmName].elements[i].focus();
				document.forms[frmName].elements[i].value = "";
				return false;
			}
			break;


		case "Fax":
			if (!isBDLFax(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;

		case "Pin":
			if (!isBDLPinCode(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Dat":
			
			if (!isBDLDate(ctlValue,tempDatFormat)){				
				alert(errDat+ctlErrName+'\nPlease enter date in '+tempDatFormat+' format');
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Amt":
			if (!isBDLAmount(ctlValue,ctlErrName,document.forms[frmName].elements[i].name)){
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "URL":
			if (ctlValue.substring(0,7)!="http://" && ctlValue.substring(0,7)!="HTTP://"){
				alert(ctlErrName+" should start with http://");
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Fld":
			if (!isBDLFolderName(ctlValue,ctlErrName)){
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Per":
			if (!isBDLPercentage(frmName,ctlValue,i)){
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;
		case "Sym":
			if (!isBDLSymbol(ctlValue)){
				alert(errTxt+ctlErrName);
				document.forms[frmName].elements[i].focus();
				return false;
			}
			break;

		default :
			break;
			
		}
	}
}
	return true;
}
function isBDLPercentage(FormName,a,i){
			if(a.length!=0){
				z=a.length;
						for(m=0;m<=z;m++){
							if(a.charAt(0)==" "){
								a=a.substring(1,a.length);
								var y=a.length;
								if(y==0){
									alert("Percentage is required");
									document.forms[FormName].elements[i].focus();
									return false;
								}
							}
						}
						if(isNaN(a)){
							alert("Sorry !! "+a+" is not a number !!");
							document.forms[FormName].elements[i].focus();
							return false;
						}
						else{
							if(a.charAt(0)=="-"){
								alert("Sorry !! Negative numbers are not allowed !!");
								document.forms[FormName].elements[i].focus();
								return false;
							}
							else if(a.charAt(0)=="+"){
								alert("Sorry !! Special characters are not allowed !!");
								document.forms[FormName].elements[i].focus();
								return false;
							}
							else if(parseFloat(document.forms[FormName].elements[i].value)>100){
								alert("Sorry !! Percentage cannot be greater than 100!!");
								document.forms[FormName].elements[i].focus();
								return false;
							}
							else{
								if(a.indexOf(".")!=-1){
									var b=a.substring(a.indexOf(".")+1,a.length);
									if(b.length>2){
									 	alert("In the decimal part you have entered more than two digits!! \n                          Please round it !!")
										document.forms[FormName].elements[i].focus();
										return false;
									}
									else{
										  //allow to proceed
										return true;
									}
								}		
								else{
										  //allow to proceed
										return true;
									}
						}
				}	
		
	}
}


function isBDLAmount(strVal,ctlErrName,FullName){
		if (isNaN(strVal)==true)
		{
			alert("Invalid Character Entered !! Please Check Up - in "+ctlErrName);
			//return false;
		}
		else if(strVal.charAt(0)=="-"){
					alert("Negative numbers are not allowed - in "+ctlErrName);
					return false;
		}
		else if(strVal.charAt(0)=="+"){
					alert("Special characters are not allowed - in "+ctlErrName);
					return false;
		}
		else if(strVal.charAt(0)=="0" && strVal.substring(0,strVal.indexOf(".")).length >1 && strVal.indexOf(".")!=-1){
					alert("Sorry !! first digit cannot be zero!! - in "+ctlErrName);
					return false;
		}
		else if(strVal.indexOf(".")!=-1){
				var b=strVal.substring(strVal.indexOf(".")+1,strVal.length);
				if(b.length>2){
					alert("In the paise part you have entered more than two digits - in "+ctlErrName);
					return false;
				}
				else if(FullName.charAt(3)=="R" && parseFloat(strVal)<=0){
					alert("Amount should be greater than zero !!");
					return false;	
				}
				else{
					return true;
				}
		}
		else if(FullName.charAt(3)=="R" && parseFloat(strVal)<=0){
			alert("Amount should be greater than zero !!");
			return false;	
		}


		else{
			return true;
		}

}


function isBDLInteger(strVal){
	var validStr='0123456789';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i,i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}

function isBDLNegative(strVal){
	var validStr='-0123456789.';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}
function isBDLFloat(strVal){
	var validStr='0123456789.';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	if (isNaN(strVal))	
		return false;
	return true ;

}


function isBDLTelephone(strVal){
	var validStr=' 0123456789-';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}


function isBDLPinCode(strVal){
	var validStr='0123456789 ';
	var temp;
	if (strVal.length>6)
		return false;
	
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}



function isBDLFax(strVal){
	var validStr=' 0123456789-';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}
function isBDLFolderName(strVal,ctlErrName){
	var validStr='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		//if(temp=="\'") return false;
		if (validStr.indexOf(temp) == -1){
			alert("Only alphanumeric characters are allowed in - "+ctlErrName);
			 return false ;
		}	
	}
	return true ;
}
function isBDLText(strVal){
	var validStr='0123456789-abcdefghijklmnopqrstuvwxyz #+_/()[],.:;?@!ABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if(temp=="\'") return false;
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}

function isBDLSpecialText(strVal){
	var validStr="'`~!@#$%^&*()_-+=|\0123456789-abcdefghijklmnopqrstuvwxyz /()[],.:;?{}ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var validStr=validStr + '"';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if(temp=="\'") return false;
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}

function isBDLSymbol(strVal){
	var validStr='0123456789-abcdefghijklmnopqrstuvwxyz #$~%^&*<>+_/()[],.:;?@!ABCDEFGHIJKLMNOPQRSTUVWXYZ \n';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		//if(temp=="\'") return false;
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}

function isBDLPassword(strVal){
	var validStr='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&*{}<>\^$\+=-';
	var temp;
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}
	return true ;

}


function isBDLEMail(strVal){

	var validStr='0123456789-abcdefghijklmnopqrstuvwxyz_@.ABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var temp;
        var fieldVal;
        
	for (var i=0; i<strVal.length; i++) {
		temp =  strVal.substring(i, i+1);
		if (validStr.indexOf(temp) == -1)  return false ;
	}

        
        fieldVal = strVal;
        
    //    if (CIsEmpty(fieldVal))
    //   {
    //        return true;
    //   }    
         
       /*  
        if (fieldVal.indexOf("@") <= 1  || fieldVal.indexOf(".") < 2 || fieldVal.length<6)
        {              
            return false;
        }
	
	*/
	
	if (fieldVal.indexOf("@") <= 1  ||  fieldVal.indexOf(".") <= 1 || fieldVal.length<6)
        {              
            return false;
        }

	

	var IntDiff = fieldVal.indexOf(".")-fieldVal.indexOf("@");
	
	if(IntDiff==1) return false;


	if(fieldVal.length-(fieldVal.indexOf(".")+1)==0) return false ;


        return true;
    
}

function isBDLCurrency(strVal) {
	var validStr= "0123456789.";
	var temp;

	var tmpStr;
	for (var j=0; j < strVal.length; j++) {
		tmpStr = strVal.charAt(0);
		if (tmpStr == " ") {
			strVal = strVal.substring(j, strVal.length - j);
			return false;
		}	
	}
	
	var tmpChar;
	var count = 0;

	for (var k=0; k < strVal.length; k++) {
		tmpChar = strVal.charAt(k);
		if (tmpChar == ".") {
			count = count + 1;
		}
	}
	if ((count == 0) && (isNaN(strVal))) {
		return false;
	}
		
	if (tmpStr == ".") {

		return false;
	}
	else if ((strVal.charAt(0) == "0") && (strVal.charAt(1) != ".")) {	

		return false;
	}
	else {
		if (isNaN(strVal)) {
			return false;			
		}
		else {
			for (var i=0; i<strVal.length; i++) {
				temp =  strVal.substring(i, i+1);
				if (validStr.indexOf(temp) == "-1")  return false ;
			}			
			return true;
		}
	}
}



function isBDLDate(strVal,dateFormat){

      var val=strVal;
      //var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2,4})$/;
	//var datePat = /^(\d{1,2})(\/)(\d{1,2})\2(\d{2,4})$/;
	//var datePat = /^(\d\d)(\/)(\d\d)(\/)(\d\d\d\d)$/;
	var datePat=/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/;
       var matchArray = val.match(datePat)
 
	if (matchArray == null)
		return false

// for dd/mm/yyyy format. For mm/dd/yyyy format month=matchArray[1] and day=matchArray[3]
	if (dateFormat.toLowerCase()=="dd/mm/yyyy"){
		month = matchArray[3]	// month
		day = matchArray[1]	// day
	}
	else 
	{
		month = matchArray[1]	// month
		day = matchArray[3]	// day
	}
		year = matchArray[5]
        
		
	if(parseFloat(year)==0)
		return false
	
	if (month < 1 || month > 12)
		return false

	if (day < 1 || day > 31)
		return false

	if ((month==4 || month==6 || month==9 || month==11) && day==31)
		return false
	if(parseInt(year) < 1900)
		return false
	
	if (month == 2)
	{
		
		var isleap = (year % 4 == 0 && (year % 100== 0 || year % 400 == 0))
		if (day>29 || (day==29 && !isleap))
			return false;
	}   
        
        	
	return true;

}

function TextareaLengthChecker(FmName,ObjName,Max)
{
  var temp=document.forms[FmName].elements[ObjName].value;
  if (temp.length>Max)
   {
	if (ObjName.substring(3,4)=="R")	
	 {	
alert(ObjName.substring(ObjName.indexOf('R')+1,ObjName.length)+'  ' + 'should not exceed' +' ' + Max +' ' + 'Characters');
		document.forms[FmName].elements[ObjName].focus();
		return false;
	 }	
	else
	 {

alert(ObjName.substring(ObjName.indexOf('O')+1,ObjName.length)+' ' +'should not exceed' +' ' + Max +' ' + 'Characters');
		document.forms[FmName].elements[ObjName].focus();
		return false;
	}	
  }	
 else
  return true;				
}


function BDLDateDiff(firstDate,secondDate,dateFormat){
// Send FirstDate and Seconddate in mm/dd/yyyy format
	if (dateFormat.toUpperCase()=="DD/MM/YYYY"){

		var d1=firstDate.split("/");	
		var date1Str=d1[1]+'/'+d1[0]+'/'+d1[2];
		var date1=new Date(date1Str);			
		var d2=secondDate.split("/");	
		var date2Str=d2[1]+'/'+d2[0]+'/'+d2[2];
		var date2=new Date(date2Str);			
	}
	else{
	var date1=new Date(firstDate);			
	var date2=new Date(secondDate);
	}
	var date1gmtstring=date1.toGMTString();
	var date2gmtstring=date2.toGMTString();
	var date1parse=Date.parse(date1gmtstring);
	var date2parse=Date.parse(date2gmtstring);
	var diff=(date1parse-date2parse);
	return diff;
}

function replace_(strT){
	var tempStr;
	tempStr='';
	for (var sl=0;sl<strT.length;sl++){
			tempStr=tempStr+strT.substring(sl, sl+1).replace("_"," ");
		}
	return tempStr;
}


function replaceApos(strT){
	var tempStr;
	tempStr='';
	for (var sl=0;sl<strT.length;sl++){
			tempStr=tempStr+strT.substring(sl, sl+1).replace("'","`");
		}
	return tempStr;
}



/******************** Alert Message ******************/
function DisplayAlert(MsgId)
{
	var BooStatus
	switch (MsgId)
	{
		case "1":
			BooStatus = confirm('Do you want to Save ?');
			return BooStatus;
		case "2":
			BooStatus = confirm('Do you want to Save Changes?');
			return BooStatus;
		case "3":
			BooStatus = confirm('Do you want to Delete ?');
			return BooStatus;
		case "4" :
			alert( "Access denied for Addition !!! ");
			return;
		case "5" : 
			alert( "Access denied for Modification !!!");
			return;	
		case "6" : 	
			alert('Recognition Date should not be greater then Current Date !');
			return;
		case "7" : 	
			alert('Access denied for deletion !');
			return;
		case "8" : 	
			alert('Level is Required !');
			return;
		case "9" : 	
			alert('Start Date should not be greater then Current Date !');
			return;
		case "10" :
			BooStatus = confirm('Are you sure to Admit the Applicant ?');
			return BooStatus;
		case "11" : 	
			BooStatus = confirm('Are you sure that the Applicant`s Admission is on Hold ?');
			return BooStatus;
		case "12" : 	
			BooStatus = confirm('Are you sure to reject the Applicant`s Admission ?');
			return BooStatus;
		case "13" :
			alert('Date of Birth should be less than Current Date !');
			return;
		case "14" :
			alert('Application Date should be less than or equal to Current Date !');
			return;
		case "15" :
			alert('Select any Group !');
			return;
		case "16":
			alert('Description is Required');
			return;
		case "17":
			alert('Attribute is Required');
			return;	
		case "18" :
			alert('No of Subject should be less than Selected Subject');
			return;
		case "19" :
			alert('Name is Required');
			return;
		case "20" :
			alert('No of Subject cannot be blank');
			return;
		case "21" :
			alert('Enter atleast one record');
			return;
		case "22" :
			alert('Access denied for Addition/Modification');
			return;
		case "23" :
			alert('Access denied');
			return;
		case "24" :
			alert('Level Code should be 3 Characters');
			return;
		case "25" :
			alert('Text Book is Required');
			return;
		case "26" :
			alert('Course is Required');
			return;
		case "27" :
			BooStatus = confirm('Do you want to remove students from this batch?..');
			return BooStatus;						
		case "28" :
			BooStatus = confirm('Are you sure to Admit the Student ?');
			return BooStatus;
		case "29":
			BooStatus = confirm('The related exam groups for this may also be deleted.Do you want to Delete ?');
			return BooStatus;
		case "30":
			alert('Section is Required');
			return;
		case "31":
			alert('Attendance Date Should not be greater than Current Date');
			return;	
		case "32":
			alert('From Date Should not be greater than To  Date');
			return;
		case "33":
			alert('To Date Should not be greater than Current  Date');
			return;	
		case "34":
			alert('Password does not match');
			return;
		case "35":
			alert('Old password is wrong');
			return;
		case "36":
			alert('Select atleast one Record to remove');
			return;	
		case "37":
			alert('Old and New password are same');
			return;
		case "38":
			alert('Zero not allowed');
			return;
		case "39":
			alert('Choose a date between the Start year & End year!..');
			return;
		
		case "40":
			alert('Already Exists!..');
			return; 
		case "41":
			BooStatus = confirm('Do you want to Remove?');
			return BooStatus; 
		case "42":
			alert("'Facility Type' is Required");
			return;
		case "43":
			alert('Select a Facility Type to Add Facility');
			return;
		case "44":
			alert('Select/Add a Facility Type to Add Facility');
			return;
		case "45":
			alert('Please select any information and then save !!');
			return;		
		case "46":
			alert('Select atleast one Document for the Student ! ! !');
			return;				
		case "47":
			alert('Returned Date should be greater than Received Date');
			return;		
		case "48":
			alert('Received Date is Required');
			return;	
		case "49":
			alert('Remarks should not exceed 100 characters');
			return;	
		case "50":
			alert('Check atleast one Student Add/Edit Activity');
			return;	
		case "51":
			alert('Check atleast one Staff Add/Edit Activity');
			return;
		case "52":
			alert('Check atleast one Student for the Academic Year');
			return;
		case "53":
			alert('Address Field should not exceed 100 characters');
			return;
		case "54":
			alert('Select a Activity Type to add Activity');
			return;
		case "55":
			alert('Check atleast one Student to Add/Edit Scholarship !');
			return;
		case "56":
			alert('Number of Records per page should be greater than Zero!');
			return;	
		case "57":
			alert('Date - Required');
			return;	
		case "58":
			alert('Amount - Required');
			return;	
		case "59":
			BooStatus = confirm('Scheduled Periods crosses Allocated periods, Want to Proceed ?');
			return BooStatus;	
		case "60":
			alert('From Date Should not be greater than To Date');
			return;	
		case "61":
			alert('Invalid Entry');
			return;	
		case "62":
			alert('Value Required');
			return;	
		case "63":
			alert('Select the ItemType');
			return;	
		case "64":
			alert('Select atleast one Item !!!');
			return;	
		case "65" :
			alert( "Access denied for Approve !!! ");
			return;
		case "66" :
			alert( "Date should not be greater than Current Date ! ");
			return;
		case "67" :
			alert( "Item Rate - Required !!! ");
			return;
		case "68" :
			alert( "Lead Time - Required !!! ");
			return;
		case "69" :
			alert( "Discount - Required !!! ");
			return;
		case "70" :
			alert( "As On Date - Required !!! ");
			return;
		case "71":
			BooStatus = confirm('Do you want Transfer ?');
			return BooStatus;	
		case "72":
			BooStatus = confirm('Do you want to Approve ?');
			return BooStatus;
		case "73":
			BooStatus = confirm('Given Quantity is greater than Pending Quantity Do you want to Continue ?');
			return BooStatus;
		case "74" :
			alert( "Given Quantity is greater then Total Quantity!!! ");
			return;
		case "75" :
			alert( "Given Quantity is greater then Receipt Quantity!!! ");
			return;
		case "76" : 	
			BooStatus = confirm('Facility has been already allocated to batch(s)\nWant to Share the facility ?');
			return BooStatus;
		case "77":
			alert( "Access denied for Transfer !!! ");
			return;
		case "78":
			alert( "Date should not be less than Purchase Order date !!! ");
			return;
		case "79":
			alert('Check atleast one Student Add/Edit Incentive');
			return;	
		case "80":
			alert('Check atleast one Staff Add/Edit Incentive');
			return;
		case "81" : 	
			alert('Event Date should be greater than or Equal to Current Date !');
			return;
		case "82" :
			alert( "Given Quantity is greater then Issued Quantity!!! ");
			return;
		case "83":
			alert('Check atleast one Student to Assign Document');
			return;
		case "84":
			alert('Exceeds Safety Stock');
			return;
		case "85" :
			alert( "Given Quantity is greater then Total Quantity!!! ");
			return;
		case "86" :
			BooStatus = confirm('Do you want to Send Email ?');
			return BooStatus;
		case "87" :
			alert('Application Date should be greater than Birth Date !');
			return;
		case "88" :
			alert('Incentive Amount Should be greater than 0 !');
			return;
		case "89" :
			alert('From Date Should not be Greater than Current Date !');
			return;
		case "90" :
			alert('Scholarship Amount Should be greater than 0 !');
			return;
		case "91" :
			alert('Description should not exceed 200 characters !');
			return;
		case "92" :
			alert('Amount should be greater than 0 !');
			return;
		case "93" :
			alert('Occupation Description should not exceed 250 characters !');
			return;
		case "94" :
			alert("'First Name' or 'Last Name' or 'Student Id' is Required");
			return;
		case "95" :
			alert("'Sponser Name' is Required");
			return;
		case "96" :
			alert('Scholarship Amount is Required !');
			return;
		case "97" :
			alert("Only Numbers are allowed in Amount");
			return;
		case "98" :
			alert("Invalid Date of Birth");
			return;
		case "99" :
			alert("'Number of Relatives' is Required");
			return;
		case "100" :
			alert("'Number of Relatives' should be greater than 0");
			return;
		case "101" :
			alert("Enter the Branch they study is Required");
			return;
		case "102" :
			alert("Relative Branch should not exceed 50 characters");
			return;
		case "103" :
			BooStatus = confirm('Do you want copy Fee Structures ?');
			return BooStatus;
		case "104" :
			alert('Expiry Date should be greater than Current Date');
			
		case "105" :
			BooStatus = confirm('Do you want Import Data?');
			return BooStatus;
		case "106" :
			BooStatus = confirm('Do you want Transfer  Data?');
			return BooStatus;
		
			
			
	}
}
/********************      End       ******************/

	function CheckAcademicDate(Dt,SDate,EDate,DateFormat)
	{	

		if(DateFormat == "dd/mm/yyyy")
		{
			var DatDiff =eval(BDLDateDiff(SDate,Dt,'dd/mm/yyyy'));
			var DatEDiff = eval(BDLDateDiff(Dt,EDate,'dd/mm/yyyy'));
		}
		else if(DateFormat == "mm/dd/yyyy")
		{
			var DatDiff =eval(BDLDateDiff(SDate,Dt,'mm/dd/yyyy'));
			var DatEDiff = eval(BDLDateDiff(Dt,EDate,'mm/dd/yyyy'));
		}
		
		if(DatDiff > 0)
		{			
			alert("Date should be greater than  Academic Year Start date :"+ SDate +" !..");			
			return;
		}
		else if(DatEDiff > 0)
		{
			alert("Date should be less than  Academic Year End date :"+ EDate +" !..");
			return ;
		}
		else
		{
			return true;
		}
		
	}
	
	function CheckAcademicDateFlag(Dt,SDate,EDate,DateFormat)
		{	
			if(DateFormat == "dd/mm/yyyy")
			{
				var DatDiff =eval(BDLDateDiff(SDate,Dt,'dd/mm/yyyy'));
				var DatEDiff = eval(BDLDateDiff(Dt,EDate,'dd/mm/yyyy'));
			}
			else if(DateFormat == "mm/dd/yyyy")
			{
				var DatDiff =eval(BDLDateDiff(SDate,Dt,'mm/dd/yyyy'));
				var DatEDiff = eval(BDLDateDiff(Dt,EDate,'mm/dd/yyyy'));
			}
			
			if(DatDiff > 0)
			{			
				alert("Date should be greater than  Academic Year Start date :"+ SDate +" !..");			
				return 0;
			}
			else if(DatEDiff > 0)
			{
				alert("Date should be less than  Academic Year End date :"+ EDate +" !..");
				return 0;
			}
			else
			{
				return 1;
			}
			
	}
	
	function CheckValue(InputValue,MaxValue)
	{
			if(parseFloat(InputValue)<=parseFloat(MaxValue))
			{
				return 1;
			}
			else
			{		
				alert('Value should be less than '+' ' + MaxValue);			
				return 0;
			}
	}
	
	
	function FormatNumber(InputNo)
	{
	
		return (Math.round(InputNo*Math.pow(10,2))/Math.pow(10,2));
	}
	
	function autoTab(txtBox, strLength, frmName, nextTextBox)
	{
	var currentEntry = txtBox;
//	alert(nextTextBox);
	var nextCtrl = document.getElementById(nextTextBox);
	
	if(nextCtrl == null){
		nextCtrl = document.getElementById("_ctl0:"+nextTextBox);
	}
	if(nextCtrl == null){
		return false;	
	}
	var nextEntry = nextCtrl;

	if(txtBox.value.length == strLength)
		nextEntry.focus();
	}
