
//Homepage boxes
function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = jQuery(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
jQuery(document).ready(function() {
	equalHeight(jQuery(".equalize"));
});


//News Scroller (Widget)
//jQuery(document).ready(function() {
 
 //	jQuery('.news-scroller').cycle({ 
	//    fx: 'scrollVert',
	//	speed: 1000,
	//	rev: true,
	//	timeout: 1000,
	//	next: '.news-next', 
	//    prev: '.news-previous'
	// });      
 
//});



//Contact Form
jQuery(document).ready(function() {

	//Define URL to PHP mail file
	url = jQuery("meta[name=template_url]").attr('content') + "/sendmail.php";
	
	//Activate jQuery form validation
	jQuery("#jaybich-contact").validate({
	
		submitHandler: function() {
		
			//Define data string
			var datastring = jQuery("#jaybich-contact").serialize();
			
			//Submit form
			jQuery.ajax({
				type: "POST",
				url: url,
				data: datastring,
				success: function(){
					jQuery('#jaybich-contact').slideUp();
					jQuery('#sent').fadeIn();
				}
			});
		}
	
	});
			
});

//Comments Form
jQuery(document).ready(function() {
	
	//Activate jQuery form validation
	jQuery(".comments-form").validate();
			
});

//Portfolio thumbnail
//jQuery(document).ready(function(){
	
//	jQuery('.portfolio-box a.thumb').each(function(){
//	    if(this.href.match(/\.(jpe?g|png|bmp|gif|tiff?)$/i)){
//	        jQuery(this).addClass('image');
//	    } else {
//	    	jQuery(this).addClass('video');
//	    }
//	});

//	jQuery('.portfolio-box a').hover(function() {
		
		//Show darkenned hover over thumbnail image
//		jQuery(this).find('img').stop(true, true).animate({opacity:0.5},400);

//	}, function() {
		
		//Hide darkenned hover over thumbnail image
//		jQuery(this).find('img').stop(true, true).animate({opacity:1},400);
			
//	});

//});

//Wordpress Gallery Lightbox Integration
//jQuery(document).ready(function(){
	
//	jQuery('.gallery-item a').each(function(){
//	    if(this.href.match(/\.(jpe?g|png|bmp|gif|tiff?)$/i)){
//	        jQuery(this).attr('rel','lightbox');
//		}
//	});

//});

//Innititate Pretty Photo
//jQuery(document).ready(function(){
//	jQuery("a[rel^='lightbox']").prettyPhoto({theme:'light_rounded'});
//});


