//
// GetRichSlowly site specific javascript.
// Copyright 2009 GetRichSlowly, All Rights Reserved
//

var rp = 0;

$(function()
{
	$("#s").focus(function()
	{
		if ($(this).val() == " -- Search -- ")
		{
			$(this).val("");
			$(this).css("color","black");
		}
	});

	$("#s").blur(function()
	{
		if ($(this).val() == "")
		{
			$(this).val(" -- Search -- ");
			$(this).css("color","silver");
		}
	});

	$("#e").focus(function()
	{
		if ($(this).val() == " -- Enter your email -- ")
		{
			$(this).val("");
			$(this).css("color","black");
		}
	});

	$("#e").blur(function()
	{
		if ($(this).val() == "")
		{
			$(this).val(" -- Enter your email -- ");
			$(this).css("color","silver");
		}
	});
	
	$("#type").change(function()
	{
		if ($(this).val() == "cd")
		{
			$("#firststep-term").css("visibility","visible");
		}
		else
		{
			$("#firststep-term").css("visibility","hidden");
		}
	}); 

	$('#submit-button').live('click', function(){ $(this).unbind('click'); }).bind('click', function(){
		var loc = '';
		switch($('#sh_rpFilter').val())
		{
			case '3':
				loc = 'cdrates/?term=' + $('#sh_rtFilter').val() + '&amount=' + $('#sh_amtFilter').val();
				break;
			default:
				loc = 'moneymarketsavings/?&amount=' + $('#sh_amtFilter').val();
				break;
		}
		document.location.href = 'http://' + document.domain + '/blog/' + loc;
		return false;
	});

	$('#sh_l_cntr > div').each(function() 
	{
		$(this).children('ul').children('li:eq(5)').css("width","130px");
		$(this).children('ul').children('li:eq(5)').children('ul').children('li').css("width","130px");
	});


});

