// JavaScript Document

// Flash variables
var flashvars = {};
// Flash parameters
var params = {};
params.quality = "high";
params.wmode = "opaque";
params.menu = "true";
params.allowscriptaccess = "always";
params.base = "images/";
// Flash attributes
var attributes = {};

// Embed the flash
swfobject.embedSWF("images/slideshow.swf", "RightFlash", "300", "300", "9.0.45.0", false, flashvars, params, attributes);

// When DOM finishes loading
$(document).ready(function() {
	// Navigation menu (superfish plugin)
	$("ul.menu").superfish({
		hoverClass:  'menuhover',
		delay:		 200,
		animationOpen:   {height:'show'},
		animationClose:   {height:'hide'},
		speed:       'fast',
		autoArrows:  false,
		dropShadows: true
	});
	
	// Remove SKYPE phone number conversion
	window.setTimeout(function() {
		$('.skype_pnh_container').html('');
		$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
	}, 800);
	
	$("a.EmerChoiceButton").click(function() {
		var ResponseNum = $(this).attr("rel");
		var speed = "slow";
		
		$("div.EmerChoiceResponse").not(":hidden").animate({"opacity":"hide", "height":"hide"}, speed, function() {
			$("div.EmerChoiceResponse#" + ResponseNum).animate({"opacity":"show", "height":"show"}, speed);
		});
		
		if ($("div.EmerChoiceResponse").not(":hidden").length < 1) {
			$("div.EmerChoiceResponse#" + ResponseNum).animate({"opacity":"show", "height":"show"}, speed);
		}
	});
	
	$("a#optionsLink").click(function() {
		$("div.priceUpdates div.options").slideToggle("slow");
	});
	
	$("div.priceUpdatesListTable tr").mouseover(function() {
		$(this).addClass("Hover");
	}).mouseleave(function() {
		$(this).removeClass("Hover");
	});
	
	// Make forms not work yet
	$("form[name=ConstantContactHomeForm]").submit(function() {
		alert("Coming soon...");
		return false;
	});
});