// JavaScript Document

function submitenter(e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   return quote('smartfinancial','1391');
   return false;
   }
else
   return true;
}

function quote(affil_name,theme_id)
{
	var url;
	var qt = document.getElementById('type').value;
	if (qt != '')
	{
		var affil = 99719;
		var af = document.getElementById('affil');
		if (af)
		{
			affil = af.value;
		}
		var z = document.getElementById('zip').value;
		url = 'https://www.smartfinancial.com/forms/'+ qt+ '/?a='+ affil+ '&t='+ theme_id +'&c='+ affil_name;
		if (/^\d{5}$/.test(z))
		{
			url += '&zip='+ z;
		}
		document.location.href = url;
		return false;
	}
	return false;
}

function hoverMenu(linkid,containerid)
{
		$('.submenuWrapper').css('display','none');
		$('a#'+linkid).hover(
			function() { $('#'+containerid).fadeIn('fast').css('display', 'block'); },
			function() { $('#'+containerid).css('display', 'none'); });
		$('#'+containerid).hover(
			function() { $('#'+containerid).css('display', 'block'); },
			function() { $('#'+containerid).css('display', 'none'); });
	}
