/*
 * DrivingSales jQuery Library
 * File: 	jquery.ds.home.js
 * Purpose: homepage functions
 *
 * Copyright (c) 2010 DrivingSales, Inc.
 *
 * Date: 1/27/2010
 */

$(document).ready(function() {
	var cur_fi_frame = $("#featured .frame:first");

	// Hide featured frames
	$("#featured .frame").hide();
	cur_fi_frame.show();

	// Featured item menu function
	$("#featured .menu .item").hover(function() {
		cur_fi_frame.hide();
		$("#featured .item").removeClass('active');
		cur_fi_frame = $("#"+this.id+"_frame");
		$(this).addClass('active');
		cur_fi_frame.show();
	});
	
	// Search box functions
	var box = $("#search-home #search-input input");
	var savedColor = box.css('color');
	var waitColor = '#bababa';
	box.css('color', waitColor);
	waitColor = box.css('color'); // Firefox returns an rgb() value instead of a hex value, so we need to store the rgb value for comparison
	box.click(function() {
		if(box.css('color') == waitColor)
		{
			box.attr('value', '');
			box.css('color', savedColor);
		}
	});
	box.blur(function() {
		if(box.attr('value') == '')
		{
			box.css('color', waitColor);
			box.attr('value', 'Find people, topics and vendors');
		}
	});
	box.blur();
});
