// JavaScript Document

$(document).ready(function(){  
	$(".menu a").hover(function() {
		$(this).next("em").show();
	}, function() {
		$(this).next("em").hide();
	});
	
	$("em.sub01").hover(function() {
		$("em.sub01").show();
	}, function() {
		$(this).hide();
	});
	
	$("em.sub02").hover(function() {
		$("em.sub02").show();
	}, function() {
		$(this).hide();
	});
	
	$("em.sub03").hover(function() {
		$("em.sub03").show();
	}, function() {
		$(this).hide();
	});
	
	$("em.sub04").hover(function() {
		$("em.sub04").show();
	}, function() {
		$(this).hide();
	});
	
	$('#featured_area').innerfade({
		speed: 'slow',
		timeout: 5000,
		type: 'sequence',
		containerheight: '300px'
	});
	
	$(".text_switch").focus(function(){
		if($(this).val() == $(this).attr("rel"))
		{
			$(this).val("");
			$(this).removeClass("default_text");
		}
	});
	
	$(".text_switch").blur(function(){
		if($(this).val() == "")
		{
			$(this).val($(this).attr("rel"));
			$(this).addClass("default_text");
		}
	});
	
	$(".text_switch").each(function(){
		if($(this).val() == $(this).attr("rel") && $(this).attr("rel") != "")
		{
			$(this).addClass("default_text");
		}
	});
	
	$(".text_switch_submit").submit(function(){
		$(".text_switch").unbind("focus").unbind("blur");
		$(".text_switch").each(function(){
			if($(this).val() == $(this).attr("rel"))
			{
				$(this).val("");
			}
		});
	});
	
	$("#search_results_button").click(function(){
		$("#form_search").submit();
		return false;
	});	
			
	$("a[rel^='prettyPhoto']").prettyPhoto();
});