$(document).ready(function(){
	//$('#NOOFCHILDREN').attr('disabled', 'disabled');
	//$('input[name=CHILDLIVINGWITHME]').attr('disabled', 'disabled');
	//$('#MatriForm').validate();
	$('#religion').change(function(){
		
		$rel = $('#religion').val();
		$.ajax({
		  type: 'POST',
		  url: 'includes/regAjax.php',
		  data: {action : 'getCaste' , id : $rel},
		  success: function(ret){
			$html = null;
			
			
			$html += '<option value="Does not matter" selected="">Does not matter</option>';
			$.each(ret,function(index,el){
				
           		//alert (el.castname);
				$html += "<option value = '" + el.castname + "'>" + el.castname + "</option>"; 
			
			});
				if($html=='null<option value="Does not matter" selected="">Does not matter</option><option value=undefined>undefined</option>'){
					$html="";
					$html += '<option value="Does not matter" selected="">Does not matter</option>';
					$("#caste").attr('disabled','disabled');
				}
				$("#caste").empty().append($html);
				
			
	
		  },
		  dataType: 'json'
		});
	});

	//-------------------------------------------------
		
		/*$('input[name=MARITAL_STATUS]').click(function(){

				$rval = $('input[name=MARITAL_STATUS]:checked').val();
				if($rval == 1){
				
					$('#NOOFCHILDREN').attr('disabled', 'disabled');
					$('input[name=CHILDLIVINGWITHME]').attr('disabled', 'disabled');
				
				}else{
					$('#NOOFCHILDREN').attr('disabled', '');
					$('input[name=CHILDLIVINGWITHME]').attr('disabled', '');
			
				}
		
		});*/

	//-------------------------------------------------
	

	/*$('#txtName').change(function(){
		
		$uname = $('#txtName').val();
		$.ajax({
		  type: 'POST',
		  url: 'includes/regAjax.php',
		  data: {action : 'checkAval' , id : $uname},
		  success: function(ret){
			$html = null;
			if(ret ==1){
				$('#userdiv').html("This username is available");
			}else{
				$('#userdiv').html("This username is not available.Please choose another username");
				$('#txtName').trigger('focus');
				$('#txtName').val('');
			}
	
		  },
		  dataType: 'html'
		});
	
	});*/




});
