Template:Freiburg2013 Template3

From 2013.igem.org

', 'gi'), ''); if (this.iframe) { var doc = this.iframe.contentDocument; if (!doc && this.iframe.contentWindow) doc = this.iframe.contentWindow.document; if (!doc) { // Opera var pThis = this; setTimeout(function() { pThis.loadHTML(); }, 25); return; } doc.open(); doc.write(s); doc.close(); try { s = doc.getElementById(this.id).innerHTML; } catch (e) { try { s = this.iframe.document.getElementById(this.id).innerHTML; } catch (e) {} // opera } hs.discardElement(this.iframe); } else { regBody = /(]*>|<\/body>)/ig; if (regBody.test(s)) s = s.split(regBody)[hs.ieLt9 ? 1 : 2]; } } hs.getElementByClass(this.content, 'DIV', 'highslide-body').innerHTML = s; this.onLoad(); for (var x in this) this[x] = null; } }; hs.Slideshow = function (expKey, options) { if (hs.dynamicallyUpdateAnchors !== false) hs.updateAnchors(); this.expKey = expKey; for (var x in options) this[x] = options[x]; if (this.useControls) this.getControls(); if (this.thumbstrip) this.thumbstrip = hs.Thumbstrip(this); }; hs.Slideshow.prototype = { getControls: function() { this.controls = hs.createElement('div', { innerHTML: hs.replaceLang(hs.skin.controls) }, null, hs.container); var buttons = ['play', 'pause', 'previous', 'next', 'move', 'full-expand', 'close']; this.btn = {}; var pThis = this; for (var i = 0; i < buttons.length; i++) { this.btn[buttons[i]] = hs.getElementByClass(this.controls, 'li', 'highslide-'+ buttons[i]); this.enable(buttons[i]); } this.btn.pause.style.display = 'none'; //this.disable('full-expand'); }, checkFirstAndLast: function() { if (this.repeat || !this.controls) return; var exp = hs.expanders[this.expKey], cur = exp.getAnchorIndex(), re = /disabled$/; if (cur == 0) this.disable('previous'); else if (re.test(this.btn.previous.getElementsByTagName('a')[0].className)) this.enable('previous'); if (cur + 1 == hs.anchors.groups[exp.slideshowGroup || 'none'].length) { this.disable('next'); this.disable('play'); } else if (re.test(this.btn.next.getElementsByTagName('a')[0].className)) { this.enable('next'); this.enable('play'); } }, enable: function(btn) { if (!this.btn) return; var sls = this, a = this.btn[btn].getElementsByTagName('a')[0], re = /disabled$/; a.onclick = function() { sls[btn](); return false; }; if (re.test(a.className)) a.className = a.className.replace(re, ''); }, disable: function(btn) { if (!this.btn) return; var a = this.btn[btn].getElementsByTagName('a')[0]; a.onclick = function() { return false; }; if (!/disabled$/.test(a.className)) a.className += ' disabled'; }, hitSpace: function() { if (this.autoplay) this.pause(); else this.play(); }, play: function(wait) { if (this.btn) { this.btn.play.style.display = 'none'; this.btn.pause.style.display = ''; } this.autoplay = true; if (!wait) hs.next(this.expKey); }, pause: function() { if (this.btn) { this.btn.pause.style.display = 'none'; this.btn.play.style.display = ''; } clearTimeout(this.autoplay); this.autoplay = null; }, previous: function() { this.pause(); hs.previous(this.btn.previous); }, next: function() { this.pause(); hs.next(this.btn.next); }, move: function() {}, 'full-expand': function() { hs.getExpander().doFullExpand(); }, close: function() { hs.close(this.btn.close); } }; hs.Thumbstrip = function(slideshow) { function add (exp) { hs.extend(options || {}, { overlayId: dom, hsId: 'thumbstrip', className: 'highslide-thumbstrip-'+ mode +'-overlay ' + (options.className || '') }); if (hs.ieLt7) options.fade = 0; exp.createOverlay(options); hs.setStyles(dom.parentNode, { overflow: 'hidden' }); }; function scroll (delta) { selectThumb(undefined, Math.round(delta * dom[isX ? 'offsetWidth' : 'offsetHeight'] * 0.7)); }; function selectThumb (i, scrollBy) { if (i === undefined) for (var j = 0; j < group.length; j++) { if (group[j] == hs.expanders[slideshow.expKey].a) { i = j; break; } } if (i === undefined) return; var as = dom.getElementsByTagName('a'), active = as[i], cell = active.parentNode, left = isX ? 'Left' : 'Top', right = isX ? 'Right' : 'Bottom', width = isX ? 'Width' : 'Height', offsetLeft = 'offset' + left, offsetWidth = 'offset' + width, overlayWidth = div.parentNode.parentNode[offsetWidth], minTblPos = overlayWidth - table[offsetWidth], curTblPos = parseInt(table.style[isX ? 'left' : 'top']) || 0, tblPos = curTblPos, mgnRight = 20; if (scrollBy !== undefined) { tblPos = curTblPos - scrollBy; if (minTblPos > 0) minTblPos = 0; if (tblPos > 0) tblPos = 0; if (tblPos < minTblPos) tblPos = minTblPos; } else { for (var j = 0; j < as.length; j++) as[j].className = ''; active.className = 'highslide-active-anchor'; var activeLeft = i > 0 ? as[i - 1].parentNode[offsetLeft] : cell[offsetLeft], activeRight = cell[offsetLeft] + cell[offsetWidth] + (as[i + 1] ? as[i + 1].parentNode[offsetWidth] : 0); if (activeRight > overlayWidth - curTblPos) tblPos = overlayWidth - activeRight; else if (activeLeft < -curTblPos) tblPos = -activeLeft; } var markerPos = cell[offsetLeft] + (cell[offsetWidth] - marker[offsetWidth]) / 2 + tblPos; hs.animate(table, isX ? { left: tblPos } : { top: tblPos }, null, 'easeOutQuad'); hs.animate(marker, isX ? { left: markerPos } : { top: markerPos }, null, 'easeOutQuad'); scrollUp.style.display = tblPos < 0 ? 'block' : 'none'; scrollDown.style.display = (tblPos > minTblPos) ? 'block' : 'none'; }; // initialize var group = hs.anchors.groups[hs.expanders[slideshow.expKey].slideshowGroup || 'none'], options = slideshow.thumbstrip, mode = options.mode || 'horizontal', floatMode = (mode == 'float'), tree = floatMode ? ['div', 'ul', 'li', 'span'] : ['table', 'tbody', 'tr', 'td'], isX = (mode == 'horizontal'), dom = hs.createElement('div', { className: 'highslide-thumbstrip highslide-thumbstrip-'+ mode, innerHTML: '

'+ '<'+ tree[0] +'><'+ tree[1] +'>
'+ '
'+ '
'+ '
' }, { display: 'none' }, hs.container), domCh = dom.childNodes, div = domCh[0], scrollUp = domCh[1], scrollDown = domCh[2], marker = domCh[3], table = div.firstChild, tbody = dom.getElementsByTagName(tree[1])[0], tr; for (var i = 0; i < group.length; i++) { if (i == 0 || !isX) tr = hs.createElement(tree[2], null, null, tbody); (function(){ var a = group[i], cell = hs.createElement(tree[3], null, null, tr), pI = i; hs.createElement('a', { href: a.href, title: a.title, onclick: function() { if (/highslide-active-anchor/.test(this.className)) return false; hs.getExpander(this).focus(); return hs.transit(a); }, innerHTML: hs.stripItemFormatter ? hs.stripItemFormatter(a) : a.innerHTML }, null, cell); })(); } if (!floatMode) { scrollUp.onclick = function () { scroll(-1); }; scrollDown.onclick = function() { scroll(1); }; hs.addEventListener(tbody, document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll', function(e) { var delta = 0; e = e || window.event; if (e.wheelDelta) { delta = e.wheelDelta/120; if (hs.opera) delta = -delta; } else if (e.detail) { delta = -e.detail/3; } if (delta) scroll(-delta * 0.2); if (e.preventDefault) e.preventDefault(); e.returnValue = false; }); } return { add: add, selectThumb: selectThumb } }; hs.langDefaults = hs.lang; // history var HsExpander = hs.Expander; if (hs.ie && window == window.top) { (function () { try { document.documentElement.doScroll('left'); } catch (e) { setTimeout(arguments.callee, 50); return; } hs.ready(); })(); } hs.addEventListener(document, 'DOMContentLoaded', hs.ready); hs.addEventListener(window, 'load', hs.ready); // set handlers hs.addEventListener(document, 'ready', function() { if (hs.expandCursor || hs.dimmingOpacity) { var style = hs.createElement('style', { type: 'text/css' }, null, document.getElementsByTagName('HEAD')[0]), backCompat = document.compatMode == 'BackCompat'; function addRule(sel, dec) { if (hs.ie && (hs.uaVersion < 9 || backCompat)) { var last = document.styleSheets[document.styleSheets.length - 1]; if (typeof(last.addRule) == "object") last.addRule(sel, dec); } else { style.appendChild(document.createTextNode(sel + " {" + dec + "}")); } } function fix(prop) { return 'expression( ( ( ignoreMe = document.documentElement.'+ prop + ' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );'; } if (hs.expandCursor) addRule ('.highslide img', 'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;'); addRule ('.highslide-viewport-size', hs.ie && (hs.uaVersion < 7 || backCompat) ? 'position: absolute; '+ 'left:'+ fix('scrollLeft') + 'top:'+ fix('scrollTop') + 'width:'+ fix('clientWidth') + 'height:'+ fix('clientHeight') : 'position: fixed; width: 100%; height: 100%; left: 0; top: 0'); } }); hs.addEventListener(window, 'resize', function() { hs.getPageSize(); if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) { var node = hs.viewport.childNodes[i], exp = hs.getExpander(node); exp.positionOverlay(node); if (node.hsId == 'thumbstrip') exp.slideshow.thumbstrip.selectThumb(); } }); hs.addEventListener(document, 'mousemove', function(e) { hs.mouse = { x: e.clientX, y: e.clientY }; }); hs.addEventListener(document, 'mousedown', hs.mouseClickHandler); hs.addEventListener(document, 'mouseup', hs.mouseClickHandler); hs.addEventListener(document, 'ready', hs.setClickEvents); hs.addEventListener(window, 'load', hs.preloadImages); hs.addEventListener(window, 'load', hs.preloadAjax); }