

function nextFeature() {
	var api = $("div.scroll").scrollable({api: true});
	api.nextPage();
}

function fieldCheck(el,defaultText) {
	var val = el.value;
	if(val == defaultText) {
		el.value = "";
	} else if(val == "") {
		el.value = defaultText;
	}
}

function takeAction() {
	$.ajax({
   		type: "POST",
   		url: "/wp-content/themes/mcintyrev2/lib/ajax/validateForm.php",
   		data: $('#take-action').serialize() + '&form=takeaction',
   		success: function(msg){
   			//reset
   			$('#take-action #fullname').removeClass("error");
   			$('#take-action #phone').removeClass("error");
   			$('#take-action #address').removeClass("error");
   			$('#take-action #zip').removeClass("error");
   			$('#take-action #email').removeClass("error");
     		if(msg == "") {
     			$('div.take-action').html('<br><br><br><br>Thank you! You have been added to our list.');
     		} else {
     			var e = new Array();
     			e = msg.split("|");
     			for(var i in e) {
     				$('#take-action #' + e[i]).addClass("error");
     			}
     			alert("Please check the boxes below.");
     		}
   		}
 	});
 	return false;
}

function contact() {
	$.ajax({
   		type: "POST",
   		url: "/wp-content/themes/mcintyrev2/lib/ajax/validateForm.php",
   		data: $('#contact').serialize() + '&form=contact',
   		success: function(msg){
   			//reset
   			$('#contact input[name=u_name]').removeClass("error");
   			$('#contact input[name=email]').removeClass("error");
   			$('#contact textarea').removeClass("error");
     		if(msg == "") {
     			$('form#contact').html('Thank you for contacting the McIntyre Campaign.');
     		} else {
     			var e = new Array();
     			e = msg.split("|");
     			for(var i in e) {
     				$('#contact input[name=' + e[i] +']').addClass("error");
     				$('#contact textarea[name=' + e[i] +']').addClass("error");
     			}
     			alert("Please check the boxes below.");
     		}
   		}
 	});
 	return false;
}

function gotoAristotle() {
	window.location = 'https://www.campaigncontribution.com/version6e/process/info.asp?id=3820FAED-2134-4789-B531-EDDCD3EDC314&jid=&firstname=' + $('#firstname').val() + '&lastname=' + $('#lastname').val() + '&address1=&city=&state=&zip=&email=' + $('#email').val() + '&amount=' + $('input[name=amount]:checked').val() + '&employer=&occupation=&homephone=' + $('#phone').val() + '&layout=';
}

function mapOver(e) {
	alert(e.id);
}

