	function ShowHover(var1){
	var2 = "sm";
	if(var1=="item2"){var2="med";}
	if(var1=="item3"){var2="med";}
	if(var1=="item4"){var2="big";}
	document.getElementById(var1).style.background = 'url(images/menu_bg_hover_'+var2+'.jpg) no-repeat center';
	}
	
	function HideHover(var1){
	document.getElementById(var1).style.background = 'url(images/1x1.gif)';
	}

	function changeTabBG(var1,var2,var3){
		document.getElementById('tabTable').style.background = 'url(images/tab_'+var1+'.jpg) no-repeat top';
		document.getElementById('div_'+var1).style.display = 'block';
		document.getElementById('div_'+var2).style.display = 'none';
		document.getElementById('div_'+var3).style.display = 'none';
	}
	
		
		//jQuery
		  function ChangeClass(var1,var2,var3){
				//show all inactive buttons
			$('td [title=featured]').removeClass(var2);
			 $('td [title=featured]').addClass(var3);
			 //hide all featured news
			 $('div [title=featured_div]').fadeOut('normal');

			 //show our selected featured news item
			 $('#'+var1+'_div').fadeIn('normal');
			 //put active class on selector button
			 $('#'+var1).addClass(var2);
			}
	
			
			function ShowFaq(var1){
						
					 $('#'+var1).removeClass('faq_reg');
					 $('#'+var1).addClass('faq_on');
					 $('#'+var1+'_div').slideDown('normal');
			}
			function HideFaq(var1){
					$('#'+var1+'_div').slideUp(function(){
						$('#'+var1).addClass('faq_reg');
						$('#'+var1).removeClass('faq_on');
					});
			}

			
			function GlossaryShow(var1){
					//remove all highlighted
					$('td [title=glo]').removeClass('gl_on');
					$('td [title=glo]').addClass('gl_off');
					//add highlighting to selected.
					$('#'+var1).removeClass('gl_off');
					$('#'+var1).addClass('gl_on');
					
					$('#glossary_holder').html(" "); //empty current contents
					$('#glossary_holder').append('<div id="loading" class="glossary_title" align="center"> <img align="absmiddle" src="images/loading.gif" alt="Currently Loading" id="loading" /> Loading, please wait.</div>'); //show loading image.
					
					$.ajax({  //get stuff from database through file get_alphabet.php
					url: '/js/get_alphabet.php', //file location
					type: 'POST',
					data: 'letter=' + var1, // pass variable to get_alphabet.php
					
					success: function(result) 
						{
								$('#loading').fadeOut(500, function() {
									$(this).remove();
								});
								$('#glossary_holder').append( result );
						}
					});
					
			}
			
			
			function printRates(var1){
				$.jPrintArea('#'+var1);
			}
			
			
			function checkSubmit(){
	var s = document.getElementById('type_of_loan');
	var b=document.getElementById('amount');
	var n=document.getElementById('creditProfile');
	var d=document.getElementById('creditProfile');
	var url = '';
	ret=true;
	s.style.backgroundColor='';
	b.style.backgroundColor='';
	mess="";
	mess2="";
	mess3="";
	if(s.selectedIndex == 0){
		//alert('Please Select Loan Type');
		s.style.backgroundColor='#ffa5a5';
		mess='Type of Mortgage';
		ret=false;
	//	document.forms[0].action = url;
		} 
		if (b.selectedIndex == 0){
		b.style.backgroundColor='#ffa5a5';
		mess2=',Mortgage Amount';
		ret=false;}
		if (n.selectedIndex == 0)
		{
		n.style.backgroundColor='#ffa5a5';
		mess3=',Your Credit Profile';
		ret=false;}
		if (!ret) {alert("Please Select:" + mess+' '+mess2+' '+mess3);
		return ret;
		} 
		else {
	if(s.selectedIndex == 1){url = 'http://lowermortgage.ca/mortgage-form.php?'}
	if(s.selectedIndex == 2){url = 'http://lowermortgage.ca/mortgage-refinance-form.php?'}
	
	document.ff0.action = url+'amount='+b.value+'&'+'creditProfile='+d.value;
	//window.location = url+'amount='+b.value+'&'+'creditProfile='+d.value;
	document.ff0.submit();
}
 }
 
function checkFieldBack(fieldObj) {
//alert(fieldObj.value);
	if (fieldObj.value!=0) {
	
		fieldObj.style.backgroundColor='#FFFFFF';
	}
}
