$(function() {
		   
	$('input[name=zipcode]').autotab({ maxlength: 5, format: 'alphanumeric' });
	
	$('#slider').cycle({ 
		fx:    'scrollHorz',
		timeout: 0,
		next: '#next',
		prev: '#prev'
	});
});

/* Validate Contact form */


function validateForm()
{

	var isError = false;

	var errStr = 'Could not proceed further, there is/are some error(s) in your form submission. Have a look on the error(s) below:\n\n';

	if ($.trim($("input[name=zipcode]").val()) == '') {
			
			errStr += '* Please Enter Zipcode.\n';	
			isError = true;

	}
	else {
		if ($.trim($("input[name=zipcode]").val()).length != 5) {
			errStr += '* Invalid Zipcode.\n';	
			isError = true;
		}
		
	}
	
	if (isError) {
		alert(errStr);

		return false;
	}

	else {
	//	alert(document.getElementById("insuranceType").value);
/*		if ($.trim($("select[name=insuranceType]").val()) == "Auto Insurance Quotes")
		   window.location="http://www.usacoverage.com/nm500/auto/";
		   
		else if ($.trim($("select[name=insuranceType]").val()) == "Health Insurance Quotes")
		   window.location="http://www.usacoverage.com/nm500/health-insurance-form.php";
		   
		else if ($.trim($("select[name=insuranceType]").val()) == "Life Insurance Quotes")
		   window.location="http://www.usacoverage.com/nm500/quoteform.php?msource=home";
		   
		else if ($.trim($("select[name=insuranceType]").val()) == "Medicare Insurance Quotes")
		   window.location="http://www.usacoverage.com/nm500/medicareform.php?msource=home";
		
*/		
		return true;
	}
}

