function toggleadvsearch() {
	if (document.getElementById('searchbox').style.visibility=="hidden") {
		document.getElementById('searchbox').style.visibility="";
	} else {
		document.getElementById('searchbox').style.visibility="hidden";
	}
}

function populate(o) {
  d=document.getElementById('searchfield');
  v=o.options[o.selectedIndex].value;
  if(!d){return;}            
  var mitems=new Array();
  mitems['clients']=['ID','First Name','Last Name','Company Name','Email Address','Address 1','Address 2','City','State','Postcode','Country','Phone Number','CC Number'];
  mitems['orders']=['Order ID','Order #','Order Date','Amount'];
  mitems['services']=['ID','Domain','Client Name','Package','Billing Cycle','Status','Username','Dedicated IP','Subscription ID'];
  mitems['domains']=['ID','Domain','Client Name','Registrar','Status','Subscription ID'];
  mitems['invoices']=['Invoice #','Client Name','Invoice Date','Amount','Status'];
  mitems['tickets']=['Ticket #','Subject','Email Address'];
  d.options.length=0;
  cur=mitems[o.options[o.selectedIndex].value];
  if(!cur){return;}
  d.options.length=cur.length;
  for(var i=0;i<cur.length;i++) {
    d.options[i].text=cur[i];
    d.options[i].value=cur[i];
  }
  if(v == 'hosting' || v == 'domains' || v == "clients") { 
    document.getElementById('searchfield').selectedIndex = 1; 
  }
}