- Impact
- 18
Code:
<script language="javascript">
function checkform(form){
if(form["q"].value == ""){
alert("Please insert keyword(s) to search for");
form["q"].focus();
return false ;
}
return true;
}
function toProperCase(astring){
return astring.toLowerCase().replace(/\w+/g,function(s){return s.charAt(0).toUpperCase() + s.substr(1);})
}
function changemode(newmode){
document.all.m.value=newmode.toLowerCase();
document.all.sixBtn.value=toProperCase(newmode)+' Search';
document.all.web.className="standardmode";
document.all.Local.className="standardmode";
document.all.Images.className="standardmode";
document.all.News.className="standardmode";
document.all.Video.className="standardmode";
document.all.Domains.className="standardmode";
document.getElementById(newmode).className="newmode";
if(newmode == "Local"){
document.all.q.style.width="192px";
document.getElementById("localSearchBar").innerHTML="ย <input name=\"location\" id=\"location\" size=\"27\" value=\"Location (eg: NY or Zip Code)\" onFocus=\"if(this.value=='Location (eg: NY or Zip Code)'){this.select();}\" />";
}
else{
document.all.q.style.width="384px";
document.getElementById("localSearchBar").innerHTML="";
}
}
</script>
a) what do I need to do to this code to make it compatible with firefox?
b) how would I integrate it so that it chooses the right code for the right browser
c) are there any other browsers that I need to code it for?
Thanks a lot
Tom







