$("document").ready( function(){
	//$("input[name*='username']").focus();
	$("a[rel=external]").attr('target','_blank');
	
	$("#homeServices").liteAccordion({
		containerWidth: 920,
		containerHeight: 200
	});
	
	var autoHeight = false;
	var tabID = (document.URL.substr(document.URL.length-1,1)-1);
	
	if($.browser.msie && parseFloat($.browser.version) <= 7.0) { autoHeight = true; };
	
	if (isNaN(tabID) == false && tabID > -1){
		$("#accordion").accordion({
			collapsible: true,
			active: tabID,
			autoHeight: autoHeight
		});
	}else{
		$("#accordion").accordion({
			collapsible: true,
			active: false,
			autoHeight: autoHeight
		});
	};
	
	$("ul.sf-menu")
		.superfish({
			animation : { opacity:"show",height:"show"}
		})

	.find(">li:has(ul)")
		.mouseover(function(){
			$("ul", this).bgIframe({opacity:false});
		})
		.find("a")
			.focus(function(){
				$("ul", $(".nav>li:has(ul)")).bgIframe({opacity:false});
			});
	$("a.ovalbutton").click(function() {
		var criteria = document.getElementById("criteria").value;
		var gotourl = "dspShowSearchResults.cfm?criteria="+criteria;
		window.location = gotourl;
	});
	$("a.ovalbutton2").click(function() {
		var firstName = document.getElementById("firstName").value;
		var lastName = document.getElementById("lastName").value;
		var email = document.getElementById("email").value;
		var gotourl = "<cfoutput>#request.myself##xfa.Signup#</cfoutput>&firstName="+firstName+"&lastName="+lastName+"&email="+email;
		window.location = gotourl;
	});
	$(".accordion h4:first").addClass("active");
	$(".accordion p:not(:first)").hide();

	$(".accordion h4").click(function(){
		$(this).next("p").slideToggle("fast")
		.siblings("p:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h4").removeClass("active");
	});
	$(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
	$(".stripeMe tr:even").addClass("alt");
});


