		function checkalphachar(iptValue)
		{ 
			var temp,validChars,flag
		
		  	flag = true
		  	flag1=false
		 
		   	validChars1 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " 
		  	validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " 
		  	temp = iptValue
		  
		  	for (i=0; i<temp.length; i++)
			{
		    	if (validChars1.indexOf(temp.charAt(i)) >= 0)
				{
		           flag1 = true
		           break
		     	}
		  	}   
		     
			if (temp.length == 0)
			{
				return false;
		  	}
		  	else
			{
		    	for (i=0; i<temp.length; i++)
				{
		        	if (validChars.indexOf(temp.charAt(i)) < 0)
					{
		           		flag = false
		           		break
		        	}
		     	}  
		     	if ( (flag) && (flag1))
					return true;
		     	else
					return false;
		  	}    
		}
		
		function checknumber(iptValue)
		{ 
			var temp,validChars,flag
		  	flag = true
		  	flag1=false
		
		  	validChars1 = "0123456789 " 
		  	validChars = "0123456789 " 
		  	temp = iptValue
		  
		  	for (i=0; i<temp.length; i++)
			{
		    	if (validChars1.indexOf(temp.charAt(i)) >= 0)
				{
		        	flag1 = true
		           	break
		     	}
		  	}   
		    if (temp.length == 0)
			{
				return false;
		  	}
		  	else
			{
		    	for (i=0; i<temp.length; i++)
				{
		        	if (validChars.indexOf(temp.charAt(i)) < 0)
					{
		           		flag = false
		           		break
		        	}
		     	}  
		     	if ( (flag) && (flag1))
					return true;
		     	else
					return false;
		  	}    
		}
		
		function chgcountry()
		{
			country = document.mahindra.country[document.mahindra.country.selectedIndex].value
			if(country != 'India')
			{
				document.mahindra.res_phone_country_code.value = ""
				document.mahindra.off_phone_country_code.value = ""
				document.mahindra.city.selectedIndex = document.mahindra.city.length-1
				document.mahindra.state.selectedIndex = document.mahindra.state.length-1
			}
			else
			{
				document.mahindra.res_phone_country_code.value = "91"
				document.mahindra.off_phone_country_code.value = "91"
				document.mahindra.city.selectedIndex = 0
				document.mahindra.state.selectedIndex = 0
			}
		}

		function chg_state_city()
		{
			country = document.mahindra.country[document.mahindra.country.selectedIndex].value
			if(country != 'India')
			{
				document.mahindra.city.selectedIndex = document.mahindra.city.length-1
				document.mahindra.state.selectedIndex = document.mahindra.state.length-1
			}
		}
		
	function chgstatecity(reg)
	{
		if(reg == 1)
		{
			state_name = document.mahindra.state[document.mahindra.state.selectedIndex].value
			if((state_name != 0) && (state_name != 'Other'))
			{
				document.mahindra.city.length = 1
				city_name = city[document.mahindra.state.selectedIndex].split(",");
				for(i=0;i<city_name.length;i++)
				{
					document.mahindra.city[i+1] = new Option(city_name[i])
					document.mahindra.city[i+1].value = city_name[i]
				}
				document.mahindra.city[i+1] = new Option("Other")
				document.mahindra.city[i+1].value = "Other"
			}
		}
		country = document.mahindra.country[document.mahindra.country.selectedIndex].value
		if(country != 'India')
		{
			document.mahindra.city.selectedIndex = document.mahindra.city.length-1
			document.mahindra.state.selectedIndex = document.mahindra.state.length-1
		}
	}		
		
		function off_phone()
		{
			country = document.mahindra.country[document.mahindra.country.selectedIndex].value
			if(country == 'India')
			{
				document.mahindra.off_phone_code.focus()
			}
		}
		
		function res_phone()
		{
			country = document.mahindra.country[document.mahindra.country.selectedIndex].value
			if(country == 'India')
			{
			    document.mahindra.res_phone_code.focus()
			}
		}
	function isStringName(s) //Checks whether the string contains only alphabets, . and _
	{  
	    var i;
		var bag="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. '-_"
	    for (i = 0; i < s.length; i++)
	    {   
	        var c = s.charAt(i);
	        if (bag.indexOf(c) == -1) return false;
	    }
	    return true;
	}