function changeSelected(idElement){
	navigationContainer=document.getElementById('child');
	var navBarLinkCollection=navigationContainer.getElementsByTagName('a');
	var j;
	
	for(j=0;j<navBarLinkCollection.length;j++){
		if(navBarLinkCollection[j].id!=''){
			navBarLinkCollection[j].className='dropdown';
		}
	}
document.getElementById(idElement).className='dropdown active'
//document.getElementById('QuickSearch').action='http://cars.st701.com/quick_search/index';
document.getElementById('QuickSearch').method='POST';

if(idElement=='dropdown_cars'){
document.getElementById('parent').innerHTML='Car'; 
document.getElementById('QuickSearch').action='http://cars.st701.com/quick_search/index';
}
else if(idElement=='dropdown_motorcycles'){
document.getElementById('parent').innerHTML='Motorcycle';
document.getElementById('QuickSearch').action='http://cars.st701.com/quick_search/index';
}
else if(idElement=='dropdown_commercials'){
document.getElementById('parent').innerHTML='Commercial Vehicle';
document.getElementById('QuickSearch').action='http://property.st701.com/quick_search/index';
}
else if(idElement=='dropdown_condo'){
document.getElementById('parent').innerHTML='Condo / Apartment';
document.getElementById('QuickSearch').action='http://property.st701.com/quick_search/index';
}
else if(idElement=='dropdown_hdb'){
document.getElementById('parent').innerHTML='HDB / HUDC';
document.getElementById('QuickSearch').action='http://property.st701.com/quick_search/index';
}
else if(idElement=='dropdown_landed'){
document.getElementById('parent').innerHTML='Landed';
document.getElementById('QuickSearch').action='http://property.st701.com/quick_search/index';
}
else if(idElement=='dropdown_commercial'){
document.getElementById('parent').innerHTML='Commercial / Industrial';
document.getElementById('QuickSearch').action='http://property.st701.com/quick_search/index';
}
else if(idElement=='dropdown_shops'){
document.getElementById('parent').innerHTML='Products &amp; Services';
document.getElementById('QuickSearch').action='http://shops.st701.com/quick_search/index';
}
else if(idElement=='dropdown_jobs'){
document.getElementById('parent').innerHTML='All Jobs';
document.getElementById('QuickSearch').action='http://shops.st701.com/quick_search/index';
}
else if(idElement=='dropdown_directories'){
setSearchValue();
document.getElementById('parent').innerHTML='All Directories';
document.getElementById('QuickSearch').action='/dir/search';
document.getElementById('QuickSearch').method='GET';
}
else{document.getElementById('parent').innerHTML='Condo / Apartment';
}
document.getElementById("hiddenVertical").value=idElement;
}

function at_show_aux(parent,child)
{var p=document.getElementById(parent);var c=document.getElementById(child);var top=(c["at_position"]=="y")?p.offsetHeight+2:0;var left=(c["at_position"]=="x")?p.offsetWidth+2:0;for(;p;p=p.offsetParent)
{top+=p.offsetTop;left+=p.offsetLeft;}
c.style.position="absolute";c.style.visibility="visible";}

function at_show()
{var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);at_show_aux(p.id,c.id);clearTimeout(c["at_timeout"]);}

function at_hide()
{var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);c["at_timeout"]=setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'",30);}

function at_click()
{var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);if(c.style.visibility!="visible")at_show_aux(p.id,c.id);else c.style.visibility="hidden";return false;}

function setSearchValue(){
if(document.getElementById('search-input').value == 'Search for...')
{
	document.getElementById('search-input').value = " ";
}
document.getElementById('querystring').value = document.getElementById('search-input').value;
}

function at_attach(parent,child,showtype,position,cursor)
{var p=document.getElementById(parent);var c=document.getElementById(child);p["at_parent"]=p.id;c["at_parent"]=p.id;p["at_child"]=c.id;c["at_child"]=c.id;p["at_position"]=position;c["at_position"]=position;c.style.position="absolute";c.style.visibility="hidden";if(cursor!=undefined)p.style.cursor=cursor;switch(showtype)
{case"click":p.onclick=at_click;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;c.onclick=at_hide;break;case"hover":p.onmouseover=at_show;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;}}
