/* File: SPR-menu.js */
/* JavaScript for SPR-Pages version 3 */
/* Menu definitions and javascript */


/* Get pagename to set menu  */

function get_pagename()
{
qpath = location.href;
split= qpath.lastIndexOf("/");
punt= qpath.indexOf(".");
leng = qpath.length;
qpath = qpath.substr(split+1,(leng-split));
//qpath = qpath.substr(split+1,(leng-split)-5);
//qpath = qpath.substr(split+1,((leng-split)-(leng-punt))-1);
return qpath;
}


/***********************************************
/* simplemenu gives only one menu line */

function simplemenu(url,mqtext){
  document.write('<div><a href="'+url+'">'+mqtext+'</a></div>');
}

/*
function simplemenutarget(url,mqtext,mqtarget){
  document.write('<div><a href="'+url+'" target="'+mqtarget+'">'+mqtext+'</a></div>');
}
*/
function simplemenutarget(url,mqtext,mqtarget){
  document.write('<div><a href="'+url+'" target="_top" >'+mqtext+'</a></div>');
}

/***********************************************
/* different menu headers */

function menuheaderexp(url,mqtext){
  document.write('<div class="menuheaders"><a href="'+url+'">'+mqtext+'</a></div>');
}

function menuheadertarget(url,mqtext,mqtarget){
  document.write('<div class="menuheaders"><a href="'+url+'?'+mqtarget+'">'+mqtext+'</a></div>');
}

function menuheaderclass(mqheaderclass,url,mqtext){
  document.write('<div class="'+mqheaderclass+'"><a href="'+url+'">'+mqtext+'</a></div>');
}


/***********************************************
/* assign menu class to submenu */
function menucategory(){
   document.write('<ul class="menucontents">');
}

function menucontentclass(mqcontentclass){
   document.write('<ul class="'+mqcontentclass+'">');
}


/***********************************************
/* add menu items in different formats */

function menuitem(url,mqtext){
  document.write('<li><a href="'+url+'">'+mqtext+'</a></li>');
}

/*
function newmenuitem(url,mqfile,mqtext){
       if  (get_pagename() == mqfile) {
                document.write('<li><span class="chosen">'+mqtext+'</span></li>'); }
              else {
                  document.write('<li><a href="'+url+mqfile+'.htm">'+mqtext+'</a></li>'); }
}

function phpmenuitem(url,mqfile,mqtext){
       if  (get_pagename() == mqfile) {
                document.write('<li><span class="chosen">'+mqtext+'</span></li>'); }
              else {
                  document.write('<li><a href="'+url+mqfile+'.php">'+mqtext+'</a></li>'); }
}

function phpmenuitemtarget(url,mqfile,mqtext,mqtarget){
       if  (get_pagename() == mqfile) {
                document.write('<li><span class="chosen">'+mqtext+'</span></li>'); }
              else {
                  document.write('<li><a href="'+url+mqfile+'.php?'+mqtarget+'">'+mqtext+'</a></li>'); }
}
*/

/**********************************************************************
/* this wil be the newmenuitem function */
/* filename must be with extension */

function newmenuitem(url,mqfile,mqtext){
       if  (get_pagename() == mqfile) {
                document.write('<li><span class="chosen">'+mqtext+'</span></li>'); }
              else {
                  document.write('<li><a href="'+url+mqfile+'">'+mqtext+'</a></li>'); }
}


/**********************************************
/* end of submenu */
function menuend(){
  document.write('</ul>');
}


///////////////////////////////////////////////////////////////////////////////////////
// Menustructuur1
function menu1(){
   home_menu('../');
   history_menu('../SprTheory/');
   bestresults_menu('../Deviations/');
   sens_menu('../Sensorchips/');
   exp_menu('../Experiments/');
   datafit_menu('../Datafitting/');
   document.write('<BR><BR>');
   contact_menu('../Contacts/');
   download_menu('../Downloads/');
   weblinks_menu('../Weblinks/');
   document.write('<br><br>');
   forum_menu('../Forum/');
   search_menu('../Search/');
}


/////////////////////////////////////////////////////////////////////////////////////
//  menus
function home_menu(prefix){
  simplemenu(prefix+'Index.php','Home');
}

function search_menu(prefix){
  simplemenu(prefix+'Search.php','Search');
}

function forum_menu(prefix){
  simplemenu(prefix+'Forum.php','Forum');
}

function blank_menu(prefix,mqpage,mqname){
  simplemenutarget(prefix+mqpage,mqname,'_top');
}

// History and SPR overview
function history_menu(prefix){
menuheaderexp(prefix+'Introduction.htm','SPR overview');
menucategory();
newmenuitem(prefix,'Introduction.htm','SPR overview');
newmenuitem(prefix,'SprHistory.htm','SPR History');
newmenuitem(prefix,'SprTheory.htm','SPR Theory');
newmenuitem(prefix,'SprInstrument.htm','Configurations');
newmenuitem(prefix,'SprSensor.htm','Sensor chips');
newmenuitem(prefix,'SprApplication01.htm','Using BIA');
newmenuitem(prefix,'Tabs/THome.php','Applications');
menuend();
}


// Disturbances and artifacts
function bestresults_menu(prefix){
menuheaderexp(prefix+'Deviations.php','Best results');
menucategory();
newmenuitem(prefix,'Instrument.php','Clean machine');
newmenuitem(prefix,'Disturbances.php','Disturbances');
newmenuitem(prefix,'Artifacts.php','Artifacts');
menuend();
}


//  Sensorchipsmenu
function sens_menu(prefix){
menuheaderexp(prefix+'Sensorchips.htm','Sensorchips');
menucategory();
newmenuitem(prefix,'CM5.htm','CM5');
newmenuitem(prefix,'CM4.htm','CM4');
newmenuitem(prefix,'CM3.htm','CM3');
newmenuitem(prefix,'CM7.htm','CM7');
newmenuitem(prefix,'C1.htm','C1');
newmenuitem(prefix,'NTA.htm','NTA');
newmenuitem(prefix,'HPA.htm','HPA');
newmenuitem(prefix,'L1.htm','L1');
newmenuitem(prefix,'SA.htm','SA');
newmenuitem(prefix,'AU.htm','AU');
newmenuitem(prefix,'SIA.htm','SIA');
menuend();
}


// Menu with the experimental section
function exp_menu(prefix){
menuheaderexp(prefix+'Experiments.php','Experiments');
menucategory();
newmenuitem(prefix,'Immobilization.php','Immobilization');
newmenuitem(prefix,'Association.php','Association');
newmenuitem(prefix,'Steadystate.php','Steady state');
newmenuitem(prefix,'Dissociation.php','Dissociation');
newmenuitem(prefix,'Regeneration.php','Regeneration');
menuend();
}


// Menu with Immobilization
function startexp_menu(prefix){
menuheaderexp(prefix+'Experiments.php','Experiments');
menucategory();
newmenuitem(prefix,'Immobilization.php','Introduction');
newmenuitem(prefix,'Sampleprep.php','Sampleprep');
newmenuitem(prefix,'Whichproc.php','Which proc?');
newmenuitem(prefix,'Howmuch.php','How much?');
newmenuitem(prefix,'Ligandprep.php','Ligand prep.');
newmenuitem(prefix,'Preconc.php','Pre-conc.');
newmenuitem(prefix,'Amine.php','Amine');
newmenuitem(prefix,'Thiol.php','Thiol');
newmenuitem(prefix,'Aldehyde.php','Aldehyde');
newmenuitem(prefix,'DNA.php','DNA');
menuend();
}


//Kineticmodels menu
function datafit_menu(prefix){
menuheaderexp(prefix+'FitIntroduction.php','Data fitting');
menucategory();
newmenuitem(prefix,'FitTheory.php','Theory');
newmenuitem(prefix,'FitModels.php','Kinetic models');
newmenuitem(prefix,'FitValidation.php','Validation');
menuend();
}


//Kineticmodels menu - models
function fitmodels_menu(prefix){
menuheaderexp(prefix+'FitIntroduction.php','Data fitting');
menucategory();
newmenuitem(prefix,'FitTheory.php','Theory');
newmenuitem(prefix,'FitModels.php','Kinetic models');
newmenuitem(prefix,'OneToOne.php','One to one');
newmenuitem(prefix,'MassTransfer.php','Mass transfer');
newmenuitem(prefix,'HetLigand.php','Het. Ligand');
newmenuitem(prefix,'Decaying.php','Decaying');
newmenuitem(prefix,'HetAnalyte.php','Het. Analyte');
newmenuitem(prefix,'Avidity.php','Avidity');
newmenuitem(prefix,'CChange.php','CChange');
newmenuitem(prefix,'FitValidation.php','Validation');
menuend();
}


//Contacts menu
function contact_menu(prefix){
menuheaderexp(prefix+'Contacts.php','Contact');
menucategory();
newmenuitem(prefix,'SprPagesBook.php','SPR-pages book');
newmenuitem(prefix,'Contribute/Contribute.php','Contribute');
newmenuitem(prefix,'Disclaimer.php','Disclaimer');
menuend();
}


//DownloadMenu
function download_menu(prefix){
menuheaderexp(prefix+'Download.php','Download');
menucategory();
newmenuitem(prefix,'Software.php','Software');
newmenuitem(prefix,'HowTo.php','HowTo');
newmenuitem(prefix,'Methods.php','Methods');
newmenuitem(prefix,'FAQ.php','FAQ');
menuend();
}

//////////////////////////////// menu3

//Kineticmodels menu3 - models
function fitmodels_menu3(prefix){
menuheaderclass('menuheaders',prefix+'FitIntroduction.php','Data fitting');
menucontentclass('menucontents');
newmenuitem(prefix,'FitTheory.php','Theory');
newmenuitem(prefix,'FitModels.php','Kinetic models');
newmenuitem(prefix+'Kineticmodels/','OneToOne.php','One to one');
newmenuitem(prefix+'Kineticmodels/','MassTransfer.php','Mass transfer');
newmenuitem(prefix+'Kineticmodels/','HetLigand.php','Het. Ligand');
newmenuitem(prefix+'Kineticmodels/','Decaying.php','Decaying');
newmenuitem(prefix+'Kineticmodels/','HetAnalyte.php','Het. Analyte');
newmenuitem(prefix+'Kineticmodels/','Avidity.php','Avidity');
newmenuitem(prefix+'Kineticmodels/','CChange.php','CChange');
newmenuitem(prefix,'FitValidation.php','Validation');
menuend();
}



//Weblinksmenu
function weblinks_menu(prefix){
menuheaderexp(prefix+'Weblinks.php','Weblinks');
menucategory();
newmenuitem(prefix,'Labelfree.php','Label free');
newmenuitem(prefix,'Machine.php','Machine');
newmenuitem(prefix,'Science.php','Science');
newmenuitem(prefix,'Software.php','Software');
newmenuitem(prefix,'SPRBooks.php','SPR books');
newmenuitem(prefix,'Suppliers.php','Suppliers');
newmenuitem(prefix,'Technique.php','Technique');
newmenuitem(prefix,'Webpages.php','Webpages');
menuend();
}

//////////////////////////
// New class menu for kineticmodels

function history_menuclass(prefix){
menuheaderclass('header1',prefix+'Introduction.htm','SPR overview');
menucontentclass('content1');
newmenuitem(prefix,'Introduction.htm','SPR overview');
newmenuitem(prefix,'SprHistory.htm','SPR History');
newmenuitem(prefix,'SprTheory.htm','SPR Theory');
newmenuitem(prefix,'SprInstrument.htm','Configurations');
newmenuitem(prefix,'SprSensor.htm','Sensor chips');
newmenuitem(prefix,'SprApplication01.htm','Using BIA');
newmenuitem(prefix,'SprApplication02.htm','Applications');
menuend();
}

// Disturbances and artifacts
function bestresults_menuclass(prefix){
menuheaderclass('header1',prefix+'Deviations.php','Best results');
menucontentclass('content1');
newmenuitem(prefix,'Instrument.php','Clean machine');
newmenuitem(prefix,'Disturbances.php','Disturbances');
newmenuitem(prefix,'Artifacts.php','Artifacts');
menuend();
}


//  Sensorchipsmenu
function sens_menuclass(prefix){
menuheaderclass('header1',prefix+'Sensorchips.htm','Sensorchips');
menucontentclass('content1');
newmenuitem(prefix,'CM5.htm','CM5');
newmenuitem(prefix,'CM4.htm','CM4');
newmenuitem(prefix,'CM3.htm','CM3');
newmenuitem(prefix,'CM7.htm','CM7');
newmenuitem(prefix,'C1.htm','C1');
newmenuitem(prefix,'NTA.htm','NTA');
newmenuitem(prefix,'HPA.htm','HPA');
newmenuitem(prefix,'L1.htm','L1');
newmenuitem(prefix,'SA.htm','SA');
newmenuitem(prefix,'AU.htm','AU');
newmenuitem(prefix,'SIA.htm','SIA');
menuend();
}


// Menu with the experimental section
function exp_menuclass(prefix){
menuheaderclass('header1',prefix+'Experiments.php','Experiments');
menucontentclass('content1');
newmenuitem(prefix,'Immobilization.php','Immobilization');
newmenuitem(prefix,'Association.php','Association');
newmenuitem(prefix,'Steadystate.php','Steady state');
newmenuitem(prefix,'Dissociation.php','Dissociation');
newmenuitem(prefix,'Regeneration.php','Regeneration');
menuend();
}


// Menu with Immobilization
function startexp_menuclass(prefix){
menuheaderclass('header1',prefix+'Experiments.php','Experiments');
menucontentclass('content1');
newmenuitem(prefix,'Immobilization.php','Introduction');
newmenuitem(prefix,'Sampleprep.php','Sampleprep');
newmenuitem(prefix,'Whichproc.php','Which proc?');
newmenuitem(prefix,'Howmuch.php','How much?');
newmenuitem(prefix,'Ligandprep.php','Ligand prep.');
newmenuitem(prefix,'Preconc.php','Pre-conc.');
newmenuitem(prefix,'Amine.php','Amine');
newmenuitem(prefix,'Thiol.php','Thiol');
newmenuitem(prefix,'Aldehyde.php','Aldehyde');
newmenuitem(prefix,'DNA.php','DNA');
menuend();
}


//Kineticmodels menu
function datafit_menuclass(prefix){
menuheaderclass('header1',prefix+'FitIntroduction.php','Data fitting');
menucontentclass('content1');
newmenuitem(prefix,'FitTheory.php','Theory');
newmenuitem(prefix,'FitModels.php','Kinetic models');
newmenuitem(prefix,'FitValidation.php','Validation');
menuend();
}


//Kineticmodels menu - models
function fitmodels_menuclass(prefix){
menuheaderclass('header1',prefix+'FitIntroduction.php','Data fitting');
menucontentclass('content1');
newmenuitem(prefix,'FitTheory.php','Theory');
newmenuitem(prefix,'FitModels.php','Kinetic models');
newmenuitem(prefix+'Kineticmodels/','OneToOne.php','One to one');
newmenuitem(prefix+'Kineticmodels/','MassTransfer.php','Mass transfer');
newmenuitem(prefix+'Kineticmodels/','HetLigand.php','Het. Ligand');
newmenuitem(prefix+'Kineticmodels/','Decaying.php','Decaying');
newmenuitem(prefix+'Kineticmodels/','HetAnalyte.php','Het. Analyte');
newmenuitem(prefix+'Kineticmodels/','Avidity.php','Avidity');
newmenuitem(prefix+'Kineticmodels/','CChange.php','CChange');
newmenuitem(prefix,'FitValidation.php','Validation');
menuend();
}


//Contacts menu
function contact_menuclass(prefix){
menuheaderclass('header1',prefix+'Contacts.php','Contact');
menucontentclass('content1');
newmenuitem(prefix,'SprPagesBook.php','SPR-pages book');
newmenuitem(prefix,'Contribute/Contribute.php','Contribute');
newmenuitem(prefix,'Disclaimer.php','Disclaimer');
menuend();
}


//DownloadMenu
function download_menuclass(prefix){
menuheaderclass('header1',prefix+'Download.php','Download');
menucontentclass('content1');
newmenuitem(prefix,'Software.php','Software');
newmenuitem(prefix,'HowTo.php','HowTo');
newmenuitem(prefix,'Methods.php','Methods');
newmenuitem(prefix,'PDFfiles.php','PDF files');
menuend();
}


//Weblinksmenu
function weblinks_menuclass(prefix){
menuheaderclass('header1',prefix+'Weblinks.php','Weblinks');
menucontentclass('content1');
newmenuitem(prefix,'Labelfree.php','Label free');
newmenuitem(prefix,'Machine.php','Machine');
newmenuitem(prefix,'Science.php','Science');
newmenuitem(prefix,'Software.php','Software');
newmenuitem(prefix,'SPRBooks.php','SPR books');
newmenuitem(prefix,'Suppliers.php','Suppliers');
newmenuitem(prefix,'Technique.php','Technique');
newmenuitem(prefix,'Webpages.php','Webpages');
menuend();
}
