$(document).ready(function() {
 $('.textBox h3').hover(function() {
 	$(this).addClass('hover');
 	$(this).css('background','url(images/arrowHomeHover.jpg) no-repeat 95% 50%');
 },function () {
 	$(this).removeClass('hover');
 	$(this).css('background','url(images/arrowBox.gif) no-repeat 95% 50%');
 });
});

$(function(){
	$("select#referer").change(function(){
		var refererValue = $(this).val();
		if (refererValue == 'Other (please specify)') {
			var refererValueHTML = "<label for='other_referer'>Other <span class=\"req\">*</span></label><input type='text' id='other_referer' name='other_referer'/>";
			$("p#otherReferer").html(refererValueHTML);
		}
		else if (refererValue == "Magazine") {
			var refererValueHTML = "<label for='magazine_detail'>Specify <span class=\"req\">*</span></label><input type='text' id='magazine_detail' name='magazine_detail'/>";
			$("p#otherReferer").html(refererValueHTML);
		}
		else if (refererValue == "Direct Mailer from Gen3") {
			var refererValueHTML = "<label for='mailer_detail'>Specify <span class=\"req\">*</span></label><input type='text' id='mailer_detail' name='mailer_detail'/>";
			$("p#otherReferer").html(refererValueHTML);
		}
		else {
			$("p#otherReferer").html("");
		}
	});
	
	var staticRefererValue = $("select#referer").val();
	if (staticRefererValue == 'Other (please specify)') {
		var refererValueHTML = "<label for='other_referer'>Other <span class=\"req\">*</span></label><input type='text' id='other_referer' name='other_referer'/>";
		$("p#otherReferer").html(refererValueHTML);
	}
	else if (staticRefererValue == 'Magazine') {
		var refererValueHTML = "<label for='magazine_detail'>Specify <span class=\"req\">*</span></label><input type='text' id='magazine_detail' name='magazine_detail'/>";
		$("p#otherReferer").html(refererValueHTML);
	}
	else if (staticRefererValue == 'Direct Mailer from Gen3') {
		var refererValueHTML = "<label for='mailer_detail'>Specify <span class=\"req\">*</span></label><input type='text' id='mailer_detail' name='mailer_detail'/>";
		$("p#otherReferer").html(refererValueHTML);
	}
	
});

$(document).ready(function() {
  $('#prodList').find('dd').hide().end().find('dt').click(function() {
     $(this).next().slideToggle();
 	$('#prodList').find('dd').hide().end();
 	return false;
   });   
});

$(document).ready(function(){
    $("a.readYes").click(function () {
      if ($(".optional").is(":hidden")) {
        $(".optional").slideDown("slow");
      } else {
        $(".optional").hide();
      }
      return false;
    });
    $("a.readNo").click(function () {
    	if ($(".optional").is(":visible")) {
        $(".optional").slideUp("slow");
      } else {
        $(".optional").show();
      }
      return false;
    });  
  });

jQuery().ready(function(){
		jQuery('#navigation').accordion({
			active: false,
			header: '.head',
			navigation: true,
			event: 'mouseover',
			fillSpace: false,
			animated: 'easeslide'
		});
});

jQuery().ready(function(){
		jQuery('.updates').accordion({
			active: false,
			header: '.head',
			navigation: true,
			event: 'mouseover',
			fillSpace: false,
			animated: 'easeslide'
		});
});
