// From function

//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="#FFFFFF"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}





// Print Function

function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2); 
	}
}


// Drop Down Box Function


function newGo2(box) {
if ((-1 < box.selectedIndex) &&
(box.options[box.selectedIndex].value.lastIndexOf('virtualcenter.com')
!= -1)) {
 document.forms[0].action = box.options[box.selectedIndex].value;
 document.forms[0].submit();
   return true;
  }
if ((-1 < box.selectedIndex) && (box.options[box.selectedIndex].value !=
'nil')) {
  val = box.options[box.selectedIndex].value;
  if (val.lastIndexOf(',') != -1) {
   window.open ((val.substring(0,val.lastIndexOf(","))),
(val.substring((val.lastIndexOf(",")+1) , val.length)));
  } else {
   window.open (val, '_top');
    }
  }
   return true;
}

// Popup Windows





// Search Engine Script
                
                
function startSearch(){
searchString = document.searchForm.searchText.value; 
if(searchString != ""){
searchEngine = document.searchForm.whichEngine.selectedIndex + 1;
finalSearchString = "";

if(searchEngine == 1){
finalSearchString = "http://www.google.co.uk/search?q=" + searchString;
}
if(searchEngine == 2){
finalSearchString = "http://uk.search.yahoo.com/search/uk?p=" + searchString + "&hc=0&hs=0";
}
if(searchEngine == 3){
finalSearchString = "http://search-dyn.excite.co.uk/search.php?offset=0&external=1&language=en&maxCount=&excitetype=web&key=" + searchString;
}
if(searchEngine == 4){
finalSearchString = "http://search.lycos.co.uk/cgi-bin/pursuit?query=" + searchString + "&x=45&y=11";
}
if(searchEngine == 5){
finalSearchString = "http://www.ask.co.uk/reply.asp?ask=" + searchString + "&x=45&y=11";
}
if(searchEngine == 6){
finalSearchString = "http://www.mirago.co.uk/scripts/qhandler.asp?lstMatches=-2&lstDates=0&lstScope=0&lstSortBy=0&chkOnePerSite=on&chkDetails=on&qtab=1&txtSearch=" + searchString + "&x=45&y=11";
}


location.href = finalSearchString;
}
}
