var help = new Array();
help['fname']='Homeowners First Name';
help['lname']='Homeowners Last Name';
help['phone']='Homeowners Phone Nubmer 555/555-5555';
help['email']='Homeowners Email example@example.com';
help['oLoanDate']='Original loan date:  To find your original loan date, reference to your Mortgage Note, also known as an Adjustable Rate Note or Rider.  You can also contact the company who is servicing your loan for this information';
help['oLoanAmount']='Original Loan Amount: To find your original loan amount, reference to your Mortgage Note, also known as an Adjustable Rate Note or Rider.  You can also contact the company who is servicing your loan for this information.';
help['oLoanTerm']=' Original Loan Term in Months:  To find your original loan terms, reference to your Mortgage Note, also known as an Adjustable Rate Note or Rider.  You can also contact the company who is servicing your loan for this information.';
help['oInterestRate']='Original Interest Rate: To find your original interest rate, reference to your Mortgage Note, also known as an Adjustable Rate Note or Rider.  You can also contact the company who is servicing your loan for this information.';
help['interestOnly']='Is This an Interest Only Loan:  Are you given an option to make interest payment only?  If so, you have an interest only option loan. ';
help['cUnpaidBal']='Current Unpaid Balance:  Refer to your most recent mortgage statement, or contact the company who is servicing your loan for this information.';
help['cInterestRate']='Current Interest rate: Refer to your most recent mortgage statement, or contact the company who is servicing your loan for this information';
help['rTermLoan']='Remaining Term on the Loan in Months:  How many months are left to pay off your mortgage?  Start by referencing to your Mortgage Note, which will have your original Loan Date on it. This will help you understand how many months you’ve been paying on your loan since it originated.';
help['aPastDue']='If Past Due, How Many Months:  If you are unsure of how many months you\'re behind then check your most recent mortgage statement which should have this amount.  Take that amount and divide it by your mortgage payment, this will give you a ball park figure to work with.';
help['state']='The state the home is built in which state';
help['mMortPayment']='Monthly Mortgage Payment:  To find your monthly mortgage payment, reference to your mortgage statement to find out your principle and interest payment.';
help['mPropTaI']='Monthly Property Taxes & Insurance, also known as Escrow:  Refer to your most recent mortgage statement to help clarify what amount is your Taxes and Insurance payment.  Some homeowners pay their property taxes and insurance to a separate company other than the one servicing their mortgage.  ';
help['mHACD']='Properties associations fees for condo dues';
help['gMonthlyI']='Gross Monthly Income: This is your income before any taxes or other deductions are taken out.  Some of the common deductions are FICA, Federal Income tax, State Income Tax, Unemployment Insurance, Contractual Deductions and any Pre-Tax Medical Deductions.  If more than one person signed your mortgage, such as your spouse or a co-signer, add the gross monthly income of all borrowers and total this amount to come to your GROSS MONTHLY INCOME.';
help['tMontlyExpense']='Total Monthly Expenses: When accounting for all your monthly expenses, you want to account for every house hold expense. This could include but not limited to Auto expenses, Auto Fuel, Auto Insurance, Auto Loans, Child Care, Child Support/Alimony, Credit Cards (Minimum amounts only), Food, Installment loans, Medical Expenses, Health Insurance, second mortgage, Spending Money, Charity/Religious donations, Utilities (T.V., Internet, Phone, Electricity, Gas, Water/Sewer/Garbage) Cell phones and any other expense you might have. Don\'t add your first mortgage payment into this expenses amount. ';
help['eCMValue']='Estimated Current Market Value of Home: This is very important that this amount is accurate as possible.  If you aren\'t sure of the value of your property, you can contact an agent in your area that could assist you with a CMA, or BPO of your property.  You can also visit the link provided below for a free estimate of the current market value of your property.  <a href="http://www.zillow.com">www.zillow.com</a>  Enter your address under "find home values and listings."';

$(function(){

	$('.help').mouseover(function(event){
		var id = $(this).attr('id');
		var par = $(this).parent().parent().parent().attr('id');
		//alert(par);
		$('body').append("<div class='helpBox'></div>");
		$('.helpBox').append(help[id])
		var ht = $('.helpBox').height();
		
		if(par == 'form1' || par =='form2'){
			ht= ht/4;
			mouseY = event.clientY - ht;
		}else{
			ht= ht/1.4;
			mouseY = event.clientY - ht;
			
		}
		 
		  mouseX = event.clientX + 10;
		$('.helpBox').css('left', mouseX);
		$('.helpBox').css('top', mouseY);
		//alert(help[id]);
	});

	$('.help').mouseout(function(event){

		$('.helpBox').remove();

	});

});


$(function(){

	$('.colorme tr:even').addClass('even');

	$('.colormetr:odd').addClass('odd');

	$('.colorme th').addClass('th');

});

$(function(){
	$('#sub_f_1').click(function(){
		if ($("input[@name='q1']:checked").val() && $("input[@name='q2']:checked").val() && $("input[@name='q3']:checked").val() && $("input[@name='q4']:checked").val() && $("input[@name='q5']:checked").val() ){
			return true;
		}else{
			alert('Make sure you feel out all five questions accuracy = success');
			return false;
		}
		
	});
});
$(function(){
	$('#sub_f_2').click(function(){
		if ($("input[@name='fname']").val() &&
		 $("input[@name='lname']").val() &&
		 $("input[@name='phone']").val() && 
		 $("input[@name='email']").val() && 
		 $("input[@name='oLoanDate']").val() &&
		$("input[@name='oLoanAmount']").val() &&
		$("input[@name='oInterestRate']").val() &&
		$("input[@name='interestOnly']").val() &&
		$("input[@name='cUnpaidBal']").val() &&
		$("input[@name='cInterestRate']").val() &&
		$("input[@name='rTermLoan']").val() &&
		$("input[@name='aPastDue']").val() &&
		$("input[@name='state']").val() &&
		$("input[@name='mMortPayment']").val() &&
		$("input[@name='mPropTaI']").val() &&
		$("input[@name='mHACD']").val() &&
		$("input[@name='gMonthlyI']").val() &&
		$("input[@name='tMontlyExpense']").val() &&
		$("input[@name='eCMValue']").val() 
	){
			return true;
		}else{
			alert('Make sure you feel out all fields n\ accuracy = success');
			return false;
		}
		
	});
});
$(document).ready(function() {
		
		// Preload all rollovers
		$(".box img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.png$/ig,"_over.png");
			$("<img>").attr("src", rollON);
		});
		
		// Navigation rollovers
		$(".box a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			//alert(imgsrc);
			matches = imgsrc.match(/_over/);
			//alert(matches);
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.png$/ig,"_over.png"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		$(".box a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});
		
		$(".box a").click(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_click/);
			
			
			
		});
	
	});
	
$(document).ready( function(){

  $('.faq').corners("6px");
  $('.faqQu').corners("6px");
  $('.faqAn').corners("6px");

});

$(function(){

$("#submit").click(function(){
	_filterEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	_filterPhone = /^(1\s*[-\/\.]?)?(\((\d{3})\)|(\d{3}))\s*[-\/\.]?\s*(\d{3})\s*[-\/\.]?\s*(\d{4})\s*(([xX]|[eE][xX][tT])\.?\s*(\d+))*$/;

	var _alert = "";
	
	//billing info

	var _bill_first_name = $("#fname").val();

	var _bill_last_name =  $("#lname").val();

	var _bill_phone = $("#phone").val();

	var _bill_email = $("#email").val();
	
	var _failure = "Please fill in required fields:\n";

	//bill	

	_failure += (_bill_first_name == "")? "First Name \n": "";

	_failure += (_bill_last_name == "")? "last Name \n":"";

	_failure += (!_filterEmail.test(_bill_email))?"Inncorrect email\n":"";

	_failure += (!_filterPhone.test(_bill_phone))?"Inncorrect Phone\n":"";
	
	//if (!(_AgreeCheck).is(':checked')){ _failure += "Must Agree to Terms and Conditions \n";}

	//if (!$('.package').is(':checked')) { _failure += "Please Choose a Package \n";}

	if(_failure != "Please fill in required fields:\n"){

		alert(_failure);

		 return false ;

	}else{

		 return true;

	}
	
});
});
