//preload for all non-input type buttons that are linked images
var str="/images/";
var btnImages=new Array('btn_green_search', //0
												'btn_findmatch', //1
												'btn_tour_neighborhoods', //2
												'btn_search_by_neighbor',//3
												'srchnav_neighborhood',//4
												'srchnav_advanced',//5
												'srchnav_quick',//6
												'icon_printpage',//7
												'icon_sendtofriend',//8
												'icon_tomyhomes', //9
												'btn_view_agents_list', //10
												'myfavnav_savedhomes', //11
												'myfavnav_savedsearches',//12
												'myfavnav_myprofile',//13
												'btn_download_flash',//14
												'btn_view_featured',//15
												'btn_advanced_search',//16
												'btn_createaccount',//17
												'btn_relocating',//18
												'btn_blog',//19
												'btn_pdf_openhouses916',//20
												'btn_pdf_buyingpower'//21
												);
if (document.images) {
var btnOffImage=new Array();
var btnOnImage=new Array();
for (i=0;i<22;i++){
	btnOffImage[i]=new Image();
	btnOffImage[i].src=str+btnImages[i]+".gif";
	btnOnImage[i]=new Image();
	btnOnImage[i].src=str+btnImages[i]+"-over.gif";
	}
}
	
// image swapping for all non-input type buttons that are linked images
function imgOver(name,file) {
		if (document.images) obj=eval(document.images[name]);
		if (obj) obj.src=btnOnImage[file].src;
}
	
function imgOut(name,file) {
		if (document.images) obj=eval(document.images[name]);
		if (obj) obj.src=btnOffImage[file].src;
}



//preload for all the buttons
if (document.images) {
btn_go_on = new Image();
btn_go_on.src = "/images/btn_go-over.gif";
btn_go_off = new Image();			
btn_go_off.src = "/images/btn_go.gif";
btn_view_openhouse_on = new Image();
btn_view_openhouse_on.src = "/images/btn_view_openhouse-over.gif";
btn_view_openhouse_off = new Image();			
btn_view_openhouse_off.src = "/images/btn_view_openhouse.gif";
btn_viewall_openhouse_on = new Image();
btn_viewall_openhouse_on.src = "/images/btn_viewall_openhouse-over.gif";
btn_viewall_openhouse_off = new Image();			
btn_viewall_openhouse_off.src = "/images/btn_viewall_openhouse.gif";
btn_save_search_on = new Image();
btn_save_search_on.src = "/images/btn_save_search-over.gif";
btn_save_search_off = new Image();
btn_save_search_off.src = "/images/btn_save_search.gif";
btn_search_on = new Image();
btn_search_on.src = "/images/btn_search-over.gif";
btn_search_off = new Image();
btn_search_off.src = "/images/btn_search.gif";
btn_update_search_on = new Image();
btn_update_search_on.src = "/images/btn_update_search-over.gif";
btn_update_search_off = new Image();
btn_update_search_off.src = "/images/btn_update_search.gif";
btn_view_other_photos_on = new Image();
btn_view_other_photos_on.src = "/images/btn_view_other_photos-over.gif";
btn_view_other_photos_off = new Image();
btn_view_other_photos_off.src = "/images/btn_view_other_photos.gif";
btn_view_tour_on = new Image();
btn_view_tour_on.src = "/images/btn_view_tour-over.gif";
btn_view_tour_off = new Image();
btn_view_tour_off.src = "/images/btn_view_tour.gif";
btn_show_me_home_on = new Image();
btn_show_me_home_on.src = "/images/btn_visit_home-over.gif";
btn_show_me_home_off = new Image();
btn_show_me_home_off.src = "/images/btn_visit_home.gif";
btn_show_me_home1_on = new Image();
btn_show_me_home1_on.src = "/images/btn_visit_home-over.gif";
btn_show_me_home1_off = new Image();
btn_show_me_home1_off.src = "/images/btn_visit_home.gif";
btnRegister_on = new Image();
btnRegister_on.src = "/images/btn_register-over.gif";
btnRegister_off = new Image();
btnRegister_off.src = "/images/btn_register.gif";
btnCancel_on = new Image();
btnCancel_on.src = "/images/btn_cancel-over.gif";
btnCancel_off = new Image();
btnCancel_off.src = "/images/btn_cancel.gif";
btnSubmit_on = new Image();
btnSubmit_on.src = "/images/btn_submit_over.gif";
btnSubmit_off = new Image();
btnSubmit_off.src = "/images/btn_submit.gif";
btnShowListings_on = new Image();
btnShowListings_on.src = "/images/btn_view_agents_list-over.gif";
btnShowListings_off = new Image();
btnShowListings_off.src = "/images/btn_view_agents_list.gif";
btn_createaccount_on = new Image();
btn_createaccount_on.src = "/images/btn_createaccount-over.gif";
btn_createaccount_off = new Image();
btn_createaccount_off.src = "/images/btn_createaccount.gif";
btn_blog_on = new Image();
btn_blog_on.src = "/images/btn_blog-over.gif";
btn_blog_off = new Image();
btn_blog_off.src = "/images/btn_blog.gif";
btn_pdf_openhouses916_on = new Image();
btn_pdf_openhouses916_on.src = "/images/btn_pdf_openhouses916-over.gif";
btn_pdf_openhouses916_off = new Image();
btn_pdf_openhouses916_off.src = "/images/btn_pdf_openhouses916.gif";
btn_pdf_buyingpower_on = new Image();
btn_pdf_buyingpower_on.src = "/images/btn_pdf_buyingpower-over.gif";
btn_pdf_buyingpower_off = new Image();
btn_pdf_buyingpower_off.src = "/images/btn_pdf_buyingpower.gif";
}

//General rollover function for most of the buttons
function ButtonFX(btn, t) {
	if (document.getElementById) {
	document.getElementById(btn).src = (t? eval(btn+"_on.src") : eval(btn+"_off.src"));
	}
}

//preload home detail buttons
if (document.images) {
	btnSaveHomeon = new Image();
	btnSaveHomeon.src = "/images/btn_save_to_myhomes-over.gif";
	btnViewDetailson = new Image();
	btnViewDetailson.src = "/images/btn_view_details-over.gif";
	btnSaveHomeoff = new Image();
	btnSaveHomeoff.src = "/images/btn_save_to_myhomes.gif";
	btnViewDetailsoff = new Image();
	btnViewDetailsoff.src = "/images/btn_view_details.gif";
	
	btnRemoveHomeon = new Image();
	btnRemoveHomeon.src = "/images/btn_removehome-over.gif";
	btnRemoveHomeoff = new Image();
	btnRemoveHomeoff.src = "/images/btn_removehome.gif";

	btnViewOpenHouseon = new Image();
	btnViewOpenHouseon.src = "/images/btn_view_openhouse-over.gif";
	btnViewOpenHouseoff = new Image();
	btnViewOpenHouseoff.src = "/images/btn_view_openhouse.gif";

	//preload for search results paging
	btn_previous_on = new Image();
	btn_previous_on.src = "/images/btn_previous-over.gif";
	btn_previous_off = new Image();			
	btn_previous_off.src = "/images/btn_previous.gif";
	btn_next_on = new Image();
	btn_next_on.src = "/images/btn_next-over.gif";
	btn_next_off = new Image();			
	btn_next_off.src = "/images/btn_next.gif";
	
	btnmyfav_previous_on = new Image();
	btnmyfav_previous_on.src = "/images/btnmyfav_previous-over.gif";
	btnmyfav_previous_off = new Image();			
	btnmyfav_previous_off.src = "/images/btnmyfav_previous.gif";
	btnmyfav_next_on = new Image();
	btnmyfav_next_on.src = "/images/btnmyfav_next-over.gif";
	btnmyfav_next_off = new Image();			
	btnmyfav_next_off.src = "/images/btnmyfav_next.gif";
	
	btn_back_on = new Image();
	btn_back_on.src = "/images/btn_back_to_results-over.gif";
	btn_back_off = new Image();
	btn_back_off.src = "/images/btn_back_to_results.gif";
	
	//Continue buttons for Login
	btnContinue_on = new Image();
	btnContinue_on.src = "/images/btn_continue-over.gif";
	btnContinue_off = new Image();
	btnContinue_off.src = "/images/btn_continue.gif";
	
	
}

/* functions for home detail buttons below
different function because there are many duplicates on the page 
and the function above uses the ID - cannot have duplicate ID's */
function SaveHomeBtnOn(btn) {
	if (btn) btn.src=btnSaveHomeon.src;
}
function SaveHomeBtnOff(btn) {
	if (btn) btn.src=btnSaveHomeoff.src;
}

function ViewDetailsBtnOn(btn) {
	if (btn) btn.src=btnViewDetailson.src;
}
function ViewDetailsBtnOff(btn) {
	if (btn) btn.src=btnViewDetailsoff.src;
}

function RemoveHomeBtnOn(btn) {
	if (btn) btn.src=btnRemoveHomeon.src;
}
function RemoveHomeBtnOff(btn) {
	if (btn) btn.src=btnRemoveHomeoff.src;
}

//functions for search paging buttons
function PreviousBtnOn(btn) {
	if (btn) btn.src=btn_previous_on.src;
}
function PreviousBtnOff(btn) {
	if (btn) btn.src=btn_previous_off.src;
}
function NextBtnOn(btn) {
	if (btn) btn.src=btn_next_on.src;
}
function NextBtnOff(btn) {
	if (btn) btn.src=btn_next_off.src;
}
function BackBtnOn(btn) {
	if (btn) btn.src=btn_back_on.src;
}
function BackBtnOff(btn) {
	if (btn) btn.src=btn_back_off.src;
}
//My Favorite paging buttons
function MyfavPreviousBtnOn(btn) {
	if (btn) btn.src=btnmyfav_previous_on.src;
}
function MyfavPreviousBtnOff(btn) {
	if (btn) btn.src=btnmyfav_previous_off.src;
}
function MyfavNextBtnOn(btn) {
	if (btn) btn.src=btnmyfav_next_on.src;
}
function MyfavNextBtnOff(btn) {
	if (btn) btn.src=btnmyfav_next_off.src;
}

//Go button functions for Quick Search
function GoOn(btn) {
	if (btn) btn.src=btn_go_on.src;
}
function GoOff(btn) {
	if (btn) btn.src=btn_go_off.src;
}

function ContinueOn(btn) {
	if (btn) btn.src=btnContinue_on.src;
}
function ContinueOff(btn) {
	if (btn) btn.src=btnContinue_off.src;
}

//View listing functions
function ViewListOn(btn) {
	if (btn) btn.src=btnShowListings_on.src;
}
function ViewListOff(btn) {
	if (btn) btn.src=btnShowListings_off.src;
}

