/* * Clinical Trials JS * */ function crossfader() { //might be nice to rewrite this function so it uses prototype and scriptaculous //in line with the rest of the platform var useBSNns; if (useBSNns) { if (typeof(bsn) == "undefined") bsn = {} var _bsn = bsn; } else { var _bsn = this; } _bsn.Crossfader = function (divs, fadetime, delay ) { this.nAct = -1; this.aDivs = divs; for (var i=0;i -1) { document.getElementById( this.aDivs[this.nOldAct] ).style.opacity = 1 - op; document.getElementById( this.aDivs[this.nOldAct] ).style.filter = "alpha(opacity="+(100 - ieop)+")"; } if (this.nTime == this.nDur) { clearInterval( this.nID2 ); if (this.nOldAct > -1) document.getElementById( this.aDivs[this.nOldAct] ).style.visibility = "hidden"; var p=this; this.nID1 = setInterval(function() { p._newfade() }, this.nDelay); } } _bsn.Crossfader.prototype._easeInOut = function(t,b,c,d) { return c/2 * (1 - Math.cos(Math.PI*t/d)) + b; } } function imagefader() { //Put the Redirect forms into an array var form_id=new Array; if (document.getElementById('home_page_1')) { form_id[0]=document.getElementById('home_page_1'); } var cf = new Crossfader( new Array('cf1','cf2','cf3'), 1000, 5000 ); } function imagedisplay() { $('cf1').toggleClassName("displayimage"); $('cf2').toggleClassName("displayimage"); $('cf3').toggleClassName("displayimage"); } function capsDiseaseBox(){ //TODO tidy this up, could be made massively quicker. Is unmaintainable at the moment //could probably be rewritten to about six lines var box; var i; var a; var temp; box=document.getElementById('filter_diseases').length; for(i=1;i