$(document).ready(function() {
	$(".video").click(function() {
		$.fancybox({
				'padding'		: 0,
				'width'			: 624,
				'height'		: 412,
				'href'			: 'http://walkinbathtubs.com/wp-content/plugins/flv-embed/flvplayer.swf',
				'type'			: 'swf',
				'swf'			: {
					 'wmode'			: 'transparent',
					'allowfullscreen'	: 'true',
					'flashvars'			: 'height=412&width=624&file=http://walkinbathtubs.com/video/walkingBathVideo1.flv&image=http://walkinbathtubs.com/wp-content/uploads/2010/08/play_video_op3.jpg&link=http://walkinbathtubs.com/video/walkingBathVideo1.flv&overstretch=true&bufferlength=11&volume=100'
				}
			});
	
		return false;
	});
	if ($(".gallery").length) {
		$(".gallery-item a").attr('rel', 'gallery').fancybox({titleShow:false});
		$("p.stack_outline a").bind('click', function(event) {
			$(".gallery dl:first-child a").trigger('click');
			event.preventDefault();
		});
	} else {
		$("p.stack_outline a").fancybox();
	}
	
	$("a.submit").click(function(event) {
		if ($('form#form1').length) $('form#form1').submit();
		else if ($('form#form').length) $('form#form').submit();
		event.preventDefault();
	});
	
	$(".form input[type=text], .form textarea").focus(function() {
		if (this.value.indexOf('Enter')==0) this.value = '';
	});
	
	$(".contact-form").fancybox({
		'scrolling'		: 'no',
		'titleShow'		: false,
		'onClosed'		: function() {
			//$("#login_error").hide();
		}
	});
	
	$('.social li.twitter a').click(function(event) {
		(function(){window.twttr=window.twttr||{};var D=550,A=450,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,F=document,E;if(C>A){G=Math.round((C/2)-(A/2))}window.twttr.shareWin=window.open('http://twitter.com/share','','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');E=F.createElement('script');E.src='http://platform.twitter.com/bookmarklets/share.js?v=1';F.getElementsByTagName('head')[0].appendChild(E)}());
		event.preventDefault();
	});
	
	$('.social li.facebook a').click(function(event) {
		var d=document,f='https://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1297114121&u='+e(l.href)+'&t='+e(d.title);1;try{if (!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z) {a=function() {if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};if (/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0);
		event.preventDefault();
	});
	
});
