$(document).ready(function(){
	$("a#contact").click(function(){
		$("#popup").fadeIn(500);
	});
	
	$("a#contactpop").click(function(){
		$("#contact").fadeIn(500);
	});
	
	$("a#close").click(function(){
		$("#contact").fadeOut(500);
	});
	
	$("#popup").click(function(){
		$('body').removeClass('overlay');
		$('#container').removeClass('overlay');
		$(this).fadeOut(500);
	});
	
	$("img.instop").click(function(){
		$("").removeClass('overlay');
	});
	
	
	//ratings
	
	$('.hover-star').rating({ 
		focus: function(value, link){ 
		var tip = $('#hover-test'); 
		tip[0].data = tip[0].data || tip.html(); 
		tip.html(link.title || 'value: '+value); 
		}, 
		blur: function(value, link){ 
		var tip = $('#hover-test'); 
		$('#hover-test').html(tip[0].data || ''); 
		} 
});

	//top cycle
	
	$('#cta').cycle({
		fx:     'fade',
		speed:   300,
		timeout: 3000,
		next:   '#cta',
		pause:   1
	});
	
	//morepopup
	
	$(".laurel-links a#more").click(function(){
		$("#more-popup").fadeIn(50);
	});
	
	$("#more-popup a.hide").click(function(){
		$("#more-popup").hide();
	});
	
	//show hide toggle call
	$("a.show").click(function(){
		$("#show-box").toggle();
		$(this).text($(this).text() == 'Show +' ? 'Hide -' : 'Show +');
		return false;
	});
	
	//slideshow cycle
	
	 $('.slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:1000,
		timeout:250
	});
	
	$('.slideshow2').cycle({
		fx: 'scrollUp', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:1500,
		timeout:700
	});

	//photo gallery slideshow
	
	$('#tour').before('<ul id="navi">').cycle({ 
    fx:     'fade', 
    speed:  'normal', 
    timeout: 0, 
    pager:  '#navi', 
     
    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"><img src="' + slide.src + '" width="50" height="50" /></a></li>'; 
    } 
});

	//review page form
	
			$("#postreview textarea").val("Enter your review").addClass("default");
			$("#postreview textarea").focus(function(){
			$(this).attr("rows",5).addClass("on").val("");
			$(".review-details").show();
			
			});
			//$("#postreview textarea").blur(function(){
			//$(this).val("Enter your review").removeAttr("rows",5).addClass("default").removeClass("on");
			//});
			
			$("a.cancel").click(function(){
				$(".review-details").hide();
				$("#postreview textarea").val("Enter your review").removeAttr("rows",5).addClass("default").removeClass("on");
			});


	
	$("#slider2").easySlider({
		prevText: 'Previous Slide',
		nextText: 'Next Slide',
	});

});