/*
	Name: Main JavaScript
	Description: Main JavaScript for Watton Group site
	Author: Josh Gerdes
	Author URI: http://beckerdesign.net
*/
$(document).ready(function() {
	// Set modal popup
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		default_width: 550,
		default_height: 364,
		allowresize: true, /* true/false */
		counter_separator_label: ' of ', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){},
		changepicturecallback: function(){
			// Fix for IE to show the full close button
			if($.browser.msie) $('.pp_content').css('height', $('.pp_content').height() + 20 + 'px'); 
		},
		iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no" scrolling="no"></iframe>'
	});
	
	// On page load check if cookie found
	if($.cookie('watton_visited') == null && $('body').hasClass('home')) {
		// Open form
		$("a[rel^='prettyPhoto']").click();

		// Set cookie for 5 minutes, so form will not autoload until after that time
		var date = new Date();
		date.setTime(date.getTime() + (5 * 60 * 1000));
		$.cookie('watton_visited', 'true', { expires: date });
	}
	
	//if($.browser.msie ) 
	$('.pp_content').css('height', '800px');
});
