jQuery(document).ready(function($){
	$(".slide, .top").anchorAnimate();
//	$('img[src$=".png"], #top-left-graphics-one, #top-left-graphics-two').ifixpng();
//	if ($.browser.msie) {
//	    var $elm = $("#bodywrap");
//    	var pos = $(elm).position();
//	    $elm.after("<div class='ie-shadow'></div>");
//    	$(".ie-shadow").width($(elm).width()).height($(elm).height()).css("left", (pos.left + 5) + "px").css("top",(pos.top + 5) + "px");
//	}


	//sign up form validation
	$('#news-submit').click(function(){
		var email = $('#news-email');
		var error = 0; 
		if ( email.val() == '' || email.val() == 'Please enter your email...' ) { 
			email.addClass('error');
			error++;
		}
		if ( error > 0 ) { 
			alert('Please complete all required fields'); 
			return false;	
		}
	});
	
	if ( $('body').hasClass('home') )  { 
		$.featureList(
		$("#tabs li"),
		$("#output li"), {
			start_item : 0
		});
	}
	
	$('#consultation').click(function(){ window.location.href = '/contact/'; });

});

jQuery.fn.anchorAnimate = function(settings) {
 	settings = jQuery.extend({
		speed : 1100
	}, settings);
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}

