$(document).ready(function(){
	
	$('body, img, div').pngFix();
	

	$("form#contactForm2").validate({
		errorClass: "inputError", 
		errorElement: "div",
		highlight: function(element, errorClass) {
			$(element).addClass("inputErrorHighlight");
		},
		unhighlight: function(element, errorClass) {
			$(element).removeClass("inputErrorHighlight").removeClass("inputError");
		}
	});

	$('#twitter').relatedTweets({
		debug:false, from_users:'autismsaas', status:1, realtime:1, n:5, show_avatar:0, show_source: 0, show_author:0, show_date: 0, stay_time: 8000, animate:'height'
	});
	
	
	$('a[href*=#]').each(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname && this.hash.replace(/#/,'') ) {
			var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']');
			var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
			
			if ($target) {
				var targetOffset = $target.offset().top;
				$(this).click(function() {
					$('html, body').animate({scrollTop: targetOffset}, 600);
					return false;
				});
			}
		}
	});

});




/* Cufon */
Cufon('#content-mid h1, #content-mid h2', {
	color:'#6699cc', 
	fontWeight: 'normal',
	textTransform: 'capitalize',   
	hover: {
		color: '#99ccff'
	}
});
Cufon.replace('.left-box-top h4, .right-box-top h4, .fullImage h5, .fullImage h5.right, #content-left h6');
