Template:Team:HKU-HKBU/script.js



function isCurrentPage { return (document.URL == this.address); }

function TopTab(leftSpaceWidth, tabWidth, text, filename) { this.leftSpaceWidth = leftSpaceWidth; this.tabWidth = tabWidth; this.text = text; this.address = "http://2009.igem.org/Team:HKU-HKBU/" + filename;

this.isCurrentPage = isCurrentPage; this.addToTopNav = addToTopNav; }

function addToTopNav { document.write("\     \    \      " + this.text + "\    "); }

function loadTopNav { var tabs = new Array; tabs[0] = new TopTab(347, 104, "Brainstorming", "Brainstorming"); tabs[1] = new TopTab(2, 55, "Team", "Team"); tabs[2] = new TopTab(2, 64, "Gallery", "Gallery"); tabs[3] = new TopTab(2, 75, "Calendar", "Calendar"); tabs[4] = new TopTab(2, 77, "Protocols", "Protocols"); tabs[5] = new TopTab(2, 136, "Acknowledgements", "Acknowledgements"); tabs[6] = new TopTab(2, 69, "Contact", "Contact");

var i = 0;

document.write(" "); for (i in tabs) tabs[i].addToTopNav; }

function LeftTab(topSpaceHeight, topLineHeight, bottomLineHeight, level, text, filename, jumpOut) { this.topSpaceHeight = topSpaceHeight; this.topLineHeight = topLineHeight; this.bottomLineHeight = bottomLineHeight; this.level = level; this.text = text; this.address = "http://2009.igem.org/Team:HKU-HKBU/" + filename; this.jumpOut = jumpOut;

this.isCurrentPage = isCurrentPage; this.levelClass = levelClass; this.indent = indent; this.addToLeftNav = addToLeftNav; }

function levelClass { switch (this.level) { case 1: return "tabone"; case 2: return "tabtwo"; default: return "tabzero"; } }

function indent { switch (this.level) { case 1: return "> "; case 2: return ">> "; default: return ""; } }

function addToLeftNav { document.write("\     \     \    \      " + this.indent + this.text + "\   \     "); }

function loadLeftNav { var tabs = new Array;

tabs[0] = new LeftTab(12, 0, 2, 0, "HOME", "Home", false); tabs[1] = new LeftTab(12, 0, 2, 0, "PROJECT", "Project", false); tabs[2] = new LeftTab(0, 0, 1, 1, "Parts", "Parts", true); tabs[3] = new LeftTab(0, 0, 1, 1, "Micro-Motor", "Motor_Overview", false); tabs[4] = new LeftTab(0, 0, 0, 2, "Overview", "Motor_Overview", false); tabs[5] = new LeftTab(0, 0, 0, 2, "Membrane Version", "Motor_Membrane_Version", false); tabs[6] = new LeftTab(0, 0, 0, 2, "Silicon Version", "Motor_Silicon_Version", false); tabs[7] = new LeftTab(0, 0, 1, 2, "Methodology", "Motor_Methodology", false); tabs[8] = new LeftTab(0, 0, 1, 1, "Polar Expression", "Polar_Expression_Design", false); tabs[9] = new LeftTab(0, 0, 0, 2, "Design", "Polar_Expression_Design", false); tabs[10] = new LeftTab(0, 0, 0, 2, "Results", "Polar_Expression_Results", false); tabs[11] = new LeftTab(0, 0, 1, 2, "Methodology", "Polar_Expression_Methodology", false); tabs[12] = new LeftTab(0, 0, 1, 1, "Speed Control", "Speed_Control_Design", false); tabs[13] = new LeftTab(0, 0, 0, 2, "Design", "Speed_Control_Design", false); tabs[14] = new LeftTab(0, 0, 0, 2, "Results", "Speed_Control_Results", false); tabs[15] = new LeftTab(0, 0, 1, 2, "Methodology", "Speed_Control_Methodology", false); tabs[16] = new LeftTab(0, 0, 1, 1, "Modeling", "Modeling", false); tabs[17] = new LeftTab(0, 0, 0, 1, "Applications", "Applications", false); tabs[18] = new LeftTab(12, 0, 2, 0, "HUMAN PRACTICE", "Human_Practice", false); tabs[19] = new LeftTab(0, 0, 1, 1, "Questionnaire", "Human_Practice_Questionnaire", false); tabs[20] = new LeftTab(0, 0, 1, 1, "Website", "Human_Practice_Website", false); tabs[21] = new LeftTab(0, 0, 1, 1, "Interview", "Human_Practice_Interview", false); tabs[22] = new LeftTab(0, 0, 0, 1, "Lecture", "Human_Practice_Lecture", false);

tabs[2].address = "http://partsregistry.org/cgi/partsdb/pgroup.cgi?pgroup=iGEM2009&group=HKU-HKBU"; tabs[3].address = "./Motor_Overview"; tabs[8].address = "./Polar_Expression_Design"; tabs[12].address = "./Speed_Control_Design";

var i = 0; for (i in tabs) tabs[i].addToLeftNav; }

function Logo(sponsorAddress, pictureAddress, alt) { this.sponsorAddress = sponsorAddress; this.pictureAddress = pictureAddress; this.alt = alt;

this.addToLogos = addToLogos; }

function addToLogos { document.write("\    \      \     "); }

function loadLogos { var logos = new Array; logos[0] = new Logo("http://www.hku.hk/", "http://2009.igem.org/wiki/images/8/8a/HKU-HKBU_HKU_240_60.png", "The University of Hong Kong"); logos[1] = new Logo("http://www.hku.hk/facmed/", "http://2009.igem.org/wiki/images/3/31/HKU-HKBU_HKU_medicine_240_60.png", "The University of Hong Kong Li Ka Shing Faculty of Medicine"); logos[2] = new Logo("http://www.hku.hk/biochem/", "http://2009.igem.org/wiki/images/a/ad/HKU-HKBU_HKU_biochem_240_60.png", "Department of Biochemistry, The University of Hong Kong"); logos[3] = new Logo("http://www.hku.hk/science/", "http://2009.igem.org/wiki/images/b/bf/HKU-HKBU_HKU_science_240_60.png", "Faculty of Science, The University of Hong Kong"); logos[4] = new Logo("http://www.hkbu.edu.hk/", "http://2009.igem.org/wiki/images/4/47/HKU-HKBU_HKBU_240_60.png", "Hong Kong Baptist University"); logos[5] = new Logo("http://www.sci.hkbu.edu.hk/", "http://2009.igem.org/wiki/images/a/af/HKU-HKBU_HKBU_science_240_60.png", "Faculty of Science, Hong Kong Baptist University"); logos[6] = new Logo("http://physics.hkbu.edu.hk/", "http://2009.igem.org/wiki/images/f/f2/HKU-HKBU_HKBU_physics_240_60.png", "Department of Physics, Hong Kong Baptist University"); logos[7] = new Logo("http://www.bio-rad.com/", "http://2009.igem.org/wiki/images/b/b7/HKU-HKBU_biorad_240_60.png", "Bio-Rad Laboratories"); logos[8] = new Logo("http://www.delta.com/", "http://2009.igem.org/wiki/images/3/3c/HKU-HKBU_delta_240_60.png", "Delta Air Lines - Airline Tickets and Airfare to Worldwide Destinations"); logos[9] = new Logo("http://www.genetimes.com.cn/", "http://2009.igem.org/wiki/images/b/b3/HKU-HKBU_genetimes_240_60.png", "Genetimes Technology, Inc."); logos[10] = new Logo("http://www.invitrogen.com/", "http://2009.igem.org/wiki/images/8/84/HKU-HKBU_invitrogen_240_60.png", "Invitrogen.com a Provider of Essential Life Science Technologies");

var i = 0;

for (i in logos) logos[i].addToLogos; }

function removeTitle{ var el = document.getElementsByTagName("h1")[0]; if (el != null) { if (el.childNodes) { for (var i = 0; i < el.childNodes.length; i++) { var childNode = el.childNodes[i]; el.removeChild(childNode); }   }  } }

function modifyTopBar{ var el = document.getElementById("tabs"); var aNodes = el.getElementsByTagName("a"); for (var i = 0; i < aNodes.length; i++) { if (aNodes[i].getAttribute("href") == document.URL) { aNodes[i].style.backgroundPosition="0% -42px"; var sNode = aNodes[i].getElementsByTagName("span")[0]; sNode.style.backgroundPosition="100% -42px"; }   } }