Shadowbox.init({
	handleOversize: "resize",
	overlayOpacity: 0.72
}); 

$(function() {
	if (top.location != location) top.location.href = document.location.href; 
	
	$('a[rel~="external"]').click(function(){$(this).attr('target','_blank');});

	$('#datepicker').datepicker({ dateFormat: 'yy/mm/dd', beforeShowDay: $.datepicker.noWeekends, minDate: new Date() });
	
	$('.field, textarea').focus(function() {
        if(this.title==this.value) {
            this.value = '';
        }
    }).blur(function(){
        if(this.value=='') {
            this.value = this.title;
        }
    });
	
	$("#top_nav").superfish({ 
		animation: {height:'show'}, 
		delay: 2000,
		speed: 'fast',
		autoArrows: true,
		dropShadows: true 
	});
});

window.onload = function(){
	if ($.cookies.get("gc") !== "gcread") {
		Shadowbox.open({
			content: 'http://www.sedationdentistry.ca/gift-certificate.php?title=Gift%20Certificate&image=/_img/gift-certificate3-home.jpg',
			player: "iframe",
			title: 'Get Your Gift Certificate Now!',
			modal: true,
			height: 324,
			width: 762
		});
		$.cookies.set("gc", "gcread", { expires: 48 });
	}
}
