
//////////////////////////////////////////////////////////////////////////////
// Author: David Mosley, E-mail: David.Mosley@fundp.ac.be or davmos@fcmail.com
// August 1998.

var currentid = 1;

function setli(id) {
  
  if (id != "") {
   document.getElementById(currentid).className = "";
	 document.getElementById(id).className = "currentTab";
	 currentid = id;
	} 
	
}


/* --------------------------------------------------------------------*/
/* Search Function */


/* Allows the processing of a search mode based on selection */
function CMSSearch(type,buttonname,mode) {

  /* Check for a blank option */
  if (mode == "") {
     return false;
  } 
  /* Simple search - ensure keyword is not blank and does not contain illegal characters. */        
  if (type != "advanced") {      

     if (document.search.keyword.value.length < 4) {
        alert("Please enter a keyword. This needs to be at least 4 characters.");
        document.search.keyword.focus(); 
        return false; 
     }
     newlocation = "http://" + document.location.host + "/cmsea/search.php?searchstring=" + document.search.keyword.value + "&mode=" + mode + "&dosearch=yes";
  } else {
     newlocation = "http://" + document.location.host + "/cmsea/criteria.php?mode=" + mode;
  }

	if (parent.frames[2]) {
     parent.frames[2].location = newlocation;
	} else {
	   parent.frames[1].location = newlocation;
	}
  return false;

}



/* -----------------------------------------------------------------*/


function open_window(url){
         mywin=window.open (url,"win",'toolbar=1,location=0,directories=0,status=0,scrollbars,menubar,resizable,width=600,height=610');
}

function open_window_lge(url){
         mywin=window.open (url,"win",'toolbar=0,location=0,directories=0,status=0,scrollbars,menubar,resizable,width=900,height=860');
}

function open_window_small(url) {
   mywin=window.open (url,"win",'toolbar=0,location=0,directories=0,status=0,scrollbars,resizable,width=600,height=500');
}

function open_window_medium(url) {
 
   mywin=window.open (url,"win",'toolbar=0,location=0,directories=0,status=1,scrollbars,menubar,resizable,width=800,height=800');
}

function open_window_xsmall(url) {
   mywin=window.open (url,"win",'toolbar=0,location=0,directories=0,status=0,scrollbars,resizable,width=400,height=280');
}
