function toggleblock(elementid) {
 if (document.getElementById(elementid).style.display == 'none') {
  document.getElementById(elementid).style.display = 'block';
  document.getElementById(elementid + '_minmax').innerHTML = "-";
 } else {
  document.getElementById(elementid).style.display = 'none';
  document.getElementById(elementid + '_minmax').innerHTML = "+";
 }
}

function schangetab(tabelname) {
 document.getElementById(tabelname).style.display = 'block';
 document.getElementById(tabelname + '_but').style.backgroundColor = '#008BB5';
 if (tabelname != 'swebmatches') {
  document.getElementById('swebmatches').style.display = 'none';
  document.getElementById('swebmatches_but').style.backgroundColor = '#80C5DA';
 }
 if (tabelname != 'smultimatches')  {
  document.getElementById('smultimatches').style.display = 'none';
  document.getElementById('smultimatches_but').style.backgroundColor = '#80C5DA';
 }
 if (tabelname != 'sbbcmatches') {
  document.getElementById('sbbcmatches').style.display = 'none';
  document.getElementById('sbbcmatches_but').style.backgroundColor = '#80C5DA';
 }
 if (tabelname != 'snewsmatches') {
  document.getElementById('snewsmatches').style.display = 'none';
  document.getElementById('snewsmatches_but').style.backgroundColor = '#80C5DA';
 }
}

function loadexpage(url, element_id){
 var exloadpage = false;
 if (window.XMLHttpRequest) { 
  exloadpage = new XMLHttpRequest(); 
 } else if (window.ActiveXObject) { 
  try { 
   exloadpage = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) { 
   try { 
    exloadpage = new ActiveXObject("Microsoft.XMLHTTP"); 
   } catch (e) {}
  }
 } else {
  return false;
 }
 exloadpage.onreadystatechange=function(){
  loadpage(exloadpage, element_id);
 }
 exloadpage.open('GET', url, true);
 exloadpage.send(null);
}

function loadpage(exloadpage, element_id){
if (exloadpage.readyState == 4 && (exloadpage.status==200 || window.location.href.indexOf("http")==-1)) {
  document.getElementById(element_id).innerHTML = exloadpage.responseText;
  schangetab('sbbcmatches');
 }
}

function getsresults() {
 document.getElementById('searchresout').innerHTML = '<div>Loading results for ' + document.getElementById("searchterm").value + '</div>';
document.getElementById('searchres').style.display = 'block';
 loadexpage('./returnsearch.php?q=' + document.getElementById("searchterm").value,'searchresout');
}

function closesearch() {
 document.getElementById('searchres').style.display = 'none';
}