var req;function ShowDiv(divid){if(document.layers){document.layers[divid].visibility='show'}else{document.getElementById(divid).style.visibility='visible'}}function HideDiv(divid){if(document.layers){document.layers[divid].visibility='hide'}else{document.getElementById(divid).style.visibility='hidden'}}function renderNewDDL(){var DDLname=document.getElementById('DDLName').value;if(req.readyState==4){if(req.status==200){if(req.responseText==""){HideDiv(DDLname)}else{ShowDiv(DDLname);document.getElementById(DDLname).innerHTML=req.responseText}}else{document.getElementById(DDLname).innerHTML="There was a problem retrieving data:<br>"+req.statusText}}}function newXHTTPObj(){try{req=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP")}catch(oc){req=null}}if(!req&&typeof XMLHttpRequest!="undefined"){req=new XMLHttpRequest()}}function ajaxNewDDL(key,DDLname){var url;document.getElementById('DDLName').value=DDLname;newXHTTPObj();if('MakeKeyword'==DDLname){url="/proxy/makes_short.php?k="+key}if('PianoArea'==DDLname){url="/proxy/areas_ddl.php?k="+key}if(req!==null){req.onreadystatechange=renderNewDDL;req.open("GET",url,true);req.send(null)}}function updateMake(){var idx;if(document.forms.form1.pianosmakesddl){idx=document.forms.form1.pianosmakesddl.selectedIndex;document.getElementById('PianoMake').value=document.forms.form1.pianosmakesddl.options[idx].text}}function updateArea(){var idx;var text;if(document.forms.form1.s_area){idx=document.forms.form1.s_area.selectedIndex;text=document.forms.form1.s_area.options[idx].text;document.getElementById('AreaSearch').value=text}}
