$(document).ready(function(){
	
	//Open all links with rel="external" in new window
	$('a[rel="external"]').click( function() {
			window.open( $(this).attr('href') );
			return false;
    });
	
	//Clear value in search input box
	$(function() {
		swapValues = [];
		$(".s_input,.newsletter .f_input").each(function(i){
			swapValues[i] = $(this).val();
			$(this).focus(function(){
				if ($(this).val() == swapValues[i]) {
					$(this).val("");
				}
			}).blur(function(){
				if ($.trim($(this).val()) == "") {
					$(this).val(swapValues[i]);
				}
			});
		});
	});
	
	//Insert embellishment if browser window is greater than
	var width = $(document).width();
	if(width >= 1075) {	
		$('.s_submit').after('<div class="embellish"></div><div class="leaf"></div>');
	}
	$(window).resize(function(){
		var width2 = $(document).width();
	 	if(width2 < 1075) {	
			$('.embellish,.leaf').hide();
		}
		else if(width2 > 1075) {	
			$('.embellish,.leaf').show();
		}
	});
	
	//Zebra Stripe
	$('table tr:odd').addClass('odd');
	
	$('.price').css('margin-top','-7px');	
	$('.featured .row:last').addClass('no-border');
	
	if ($('#inspirational-places a').length != 0) {
		$("#inspirational-places a").fancybox({
			'zoomOpacity'			: true,
			'overlayShow'			: false,
			'zoomSpeedIn'			: 500,
			'zoomSpeedOut'			: 500
		});
	};
	
	if ($('#gallery').length != 0) {
		$("#gallery a").fancybox({
			'zoomOpacity'			: true,
			'overlayShow'			: false,
			'zoomSpeedIn'			: 500,
			'zoomSpeedOut'			: 500
		});
	};
	
	if ($('#image-holder').length != 0) {
		$("#image-holder a").fancybox({
			'zoomOpacity'			: true,
			'overlayShow'			: false,
			'zoomSpeedIn'			: 500,
			'zoomSpeedOut'			: 500
		});
	};
	
	if ($('a.iframe').length != 0) {
		$("a.iframe").fancybox({
			'frameHeight' : 500	   
		});
	};
	
	/*$('#delivery-address').hide();
	$(".checkbox").click(function () {
    	$("#delivery-address").toggle();
    });*/
	
});
