//jibe configs
var searchConfig={'configs':
							{'priceBreaks':
										{0:'nomin',5:50000,10:75000,15:100000,20:150000,25:175000,30:200000,35:225000,40:250000,45:275000,50:300000,55:350000,60:400000,65:500000,70:600000,75:700000,80:800000,85:900000,90:1000000,95:2000000,100:'nomax'}
							}
				};


var dropOpen;
var isDropping=false;
$(document).ready(function(){	
	$('#contentRight,#header').hover(function(){$('.quickListStage .nav li.listItem .drop').hide();$('.j_tabNav').css({visibility:'visible'});	});
	$('.quickListStage .nav li.listItem').hover(function(){
							var drop=$(this).children('.drop');
							if(drop.is(":visible")){
								drop.hide();
								$('.j_tabNav').css({visibility:'visible'});								
							}else{
								if(isDropping==false){
									isDropping=true;
									$('.j_tabNav').css({visibility:'hidden'});
									$('.quickListStage .nav li.listItem .drop').hide();
									drop.slideDown('fast',function(){isDropping=false;});								
								}
							}
						});
});

//btn_over--
function btn_overs(sel, newImage){var theImage=document.getElementById(sel);theImage.src=newImage;}

//auto clear a text field when clicked
function clickclear(thisfield, defaulttext){if (thisfield.value == defaulttext){thisfield.value = "";}}

//submit a start search form
function startSearchSubmit(){
	var ui=document.getElementById("startSearchInput").value;
	if (ui!='Enter neighborhood or MLS#' && ui!=''){
		if (ui == parseInt(ui)){
			window.location = '/'+ui;
		}else{
			window.location = '/search#search/'+ui;
		}
	}
	return false;
}
//load flash in a div after page is loaded
function loadFlashInDiv(flash,theDiv){
	//alert (theDiv);
	var flash_width="100%";
	var flash_height="100%";
	var version='8,0,24,0';
	var str='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+flash_width+'" height="'+flash_height+'">';
	str+='<param name="movie" value="'+flash+'"><param name="quality" value="high"><param name="wmode" value="transparent"><param name="SCALE" value="noborder">';
	str+='<embed src="'+flash+'" width="'+flash_width+'" height="'+flash_height+'" wmode="transparent" scale="noborder" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
	var theTarg=document.getElementById(theDiv);
	theTarg.innerHTML=str;
}
