$(document).ready(function() {
	$('#gallery')
	.cycle({ 	
		speed:   2500, 
		timeout: 5000, 
		next:   '#gallery', 
		pause:   1
	});	
	
	$("img#view_image").click(function () { 
      	var height = $("#gallery").height();
      	var collapseButton = http_root + "/_img/buttons/click_collapse_image.jpg";
      	var openButton = http_root + "/_img/buttons/click_view_image.jpg";
      
		if(height == 351){
			$("#gallery").animate({height:"220px"}); 
			$(".rotating_image_inner").animate({height:"220px"});  
			$(".rotating_image_inner img").animate({marginTop:"-40px"}); 
			$("img#view_image").attr("src", openButton);
			$("img#view_image").animate({top:"182px"});
		}else{  
			$("#gallery").animate({height:"351px"}); 
			$(".rotating_image_inner").animate({height:"351px"});  
			$(".rotating_image_inner img").animate({marginTop:"0px"}); 
			$("img#view_image").attr("src", collapseButton);
			$("img#view_image").animate({top:"314px"}); 
		}
    });


});

//Navigation Drop Down Function
$(document).ready(function(){
	if($.fn.hoverIntent)
	{
		$("ul.levelone li.drop").hoverIntent({
			sensitivity: 3, 
			interval: 100, 
			over: showMenu, 
			timeout: 600, 
			out: hideMenu
		});
		
		$("ul.levelthree li.drop").hoverIntent({
			sensitivity: 3, 
			interval: 100, 
			over: showMenu, 
			timeout: 600, 
			out: hideMenu
		});
	}
});
	
function showMenu(){$(this).children("ul").slideDown("fast");}
function hideMenu(){$(this).children("ul").fadeOut('slow');}
	
//Summer show coming soon
$(document).ready(function() {

	$("img#summer").click(function (){
		$("#summer_soon").show();
	});
});

$(document).ready(function() {

  jQuery.fn.slideToggle = function(speed, easing, callback) {
	return this.animate({height: 'toggle'}, speed, easing, callback);  
  };

  jQuery.fn.fadeToggle = function(speed, easing, callback) {
	return this.animate({opacity: 'toggle'}, speed, easing, callback);  
  };

  if($("#impulse_login_form"))
  {
  	 $('#impule_login_form #email').focus();
  } 
  
});

//Info button hover functions
 $(document).ready(function(){
	$("img.infoimage").mouseover(function ()
	{
		$(this).attr('src', http_root+'/_img/info_button.png');
	});
	$("img.infoimage").mouseout(function ()
	{
		$(this).attr('src', http_root+'/_img/info_button_dark.png');
	});
 });

$(document).ready(function() {

	temp = $('<div class="enlarge_caption">click to enlarge</div>');
	fheight = 600;
	fwidth = 900;
	$("a.fancybox").fancybox({
		'hideOnContentClick': false,
		'frameWidth': fwidth,
		'frameHeight': fheight
	}).append(temp);

	$("a.fancyboxthumb").fancybox({
		'hideOnContentClick': false,
		'frameWidth': fwidth,
		'frameHeight': fheight
	});
});

$(document).ready(function() {
	$("a.fancybox_info").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 600,
		'frameHeight': 225
	});
	
	$("a.comment_add").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 600,
		'frameHeight': 225
	});	
});

/*
$(function(){
	$("#left_media_col .list_item").quickpaginate({ perpage: 4, showcounter: true, pager : $("#pagination") });
});

$(function(){
	$("#content .list_item").quickpaginate({ perpage: 10000, showcounter: true, pager : $(".pagination") });
});
*/

$(function(){
	$("#gallery_thumbnails a").quickpaginate({ perpage: 25, showcounter: true, pager : $(".pagination") });
});

$(function(){
	temp = $('<div class="tinyWarning"><b>Note:</b> Any link pasted from a word document will open in the same window and navigate visitors away from your page.</div>');
	$("li textarea").after(temp);
});

function hide_submit(){
	document.getElementById('submit').className='submitHide';
	document.getElementById('submit').setAttribute("disabled","disabled");
}

function show_submit(){
	document.getElementById('submit').className='submitShow';
	document.getElementById('submit').disabled=false;
}

