menu_location = 70;

function writeClick() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="154" height="73">');
	document.write('<param name="movie" value="flash/logoclick.swf">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="flash/logoclick.swf" width="154" height="73" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');	
	document.write('</object>');		
}

function switchSearch(section) {
	hideAll();
	var view_item = document.getElementById(section + "_search");
	var bottom_tab = document.getElementById("bottom_tab");
	switch(section) {
		/*	
		case 'auto': bottom_tab.style.left = "70px"; break
		case 'homes':bottom_tab.style.left = "205px"; break		
		case 'jobs':bottom_tab.style.left = "358px"; break
		*/
		case 'auto': menu_location = 70; break
		case 'homes': menu_location = 206; break
		case 'jobs': menu_location = 358; break				

	}
	moveItem();
	view_item.style.display = "block";
}

function moveItem() {
	var bottom_tab = document.getElementById("bottom_tab");
	if(parseInt(bottom_tab.style.left) < menu_location) {
		bottom_tab.style.left = (parseInt(bottom_tab.style.left) + (menu_location - parseInt(bottom_tab.style.left)) / 3) + "px";
		time = setTimeout("moveItem()", 20);
	} else if(parseInt(bottom_tab.style.left) > menu_location) {
		bottom_tab.style.left = (parseInt(bottom_tab.style.left) - ((menu_location - parseInt(bottom_tab.style.left)) / 3) * -1) + "px";
		time = setTimeout("moveItem()", 20);
	} else {
		try { clearTimeout(time); } catch(e) { /* no timeout */ }
	}
}

function hideAll() {
	var jobs = document.getElementById("jobs_search");
	var homes = document.getElementById("homes_search");
	var auto = document.getElementById("auto_search");
	jobs.style.display = "none";
	homes.style.display = "none";
	auto.style.display = "none";	
}

function searchNew() {
	var olddiv = document.getElementById("usedform");
	var newdiv = document.getElementById("newform");
	olddiv.style.display = "none";
	newdiv.style.display = "block";	
}

function searchUsed() {
	var olddiv = document.getElementById("newform");
	var newdiv = document.getElementById("usedform");
	olddiv.style.display = "none";
	newdiv.style.display = "block";	
}
