function basename(path, suffix) { var b = path.replace(/^.*[\/\\]/g, ''); if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) { b = b.substr(0, b.length-suffix.length); } return b; } /* soundManager.debugMode = false; soundManager.url = '__modules/audioAssets/soundmanager/swf/'; soundManager.onload = function() { //soundManager.play('sound0', { onfinish: function() { this.play(); } }); } //////////////////////////////// //////////////////////////////// //////////////////////////////// //////////////////////////////// function playSound() { soundManager.play('sound0'); } function stopSound() { soundManager.stop('sound0'); } function pauseSound() { soundManager.pause('sound0'); } function resetButtons() { $('play').removeClass('active'); $('pause').removeClass('active'); $('stop').removeClass('active'); $('play').addClass('normal'); $('pause').addClass('normal'); $('stop').addClass('normal'); } //////////////////////////////// //////////////////////////////// //////////////////////////////// //////////////////////////////// */ window.addEvent('domready', function() { new SmoothScroll({ duration:700 }, window); var accordion = new Accordion('.toggler', '.element', { onActive: function(toggler, element) { toggler.setStyle('border-bottom', '1px solid rgb(90, 116, 68)'); }, onBackground: function(toggler, element) { toggler.setStyle('border-bottom', '0px none rgb(156,178,112)'); } }); $('navigation').getElements('a').each(function(el) { el.set("href", "#"+el.get("href").substr(1)); el.addEvent('click', function(ev) { newResetHighlight(); $('content').set('html', ' Loading'); ajax("__base/contentAjax.php?"+basename(el.href).substr(1)); newHighlight(el); }); }); if(window.location.hash) { ajax("__base/contentAjax.php?"+window.location.hash.substr(1)); $('navigation').getElements('a').each(function(el) { if(window.location.hash == el.get("href") && el.hasClass("item")) { newHighlight(el); } }); $$('a.toggler').each(function(el, i){ if(window.location.hash.substr(0, window.location.hash.indexOf('&')) == el.get("href").substr(0,el.get("href").indexOf('&'))) { accordion.display(i); } }); } else { accordion.display(); } }); function ajax(url) { new Request.HTML({ update: $('content'), evalScripts: true }).get(url); } function updateAdvertisingViews(adID) { var myRequest = new Request({method: 'get', url: '__base/advertising.php'}).send('updateViews=true&adID='+adID);} function correctPosition(oElement,oPos,oWhich) { while( oElement.offsetParent ) { oPos -= oElement['offset'+oWhich]; oElement = oElement.offsetParent; } oPos += document.documentElement['scroll'+oWhich] ? document.documentElement['scroll'+oWhich] : document.body['scroll'+oWhich]; return oPos; } /* */ function newResetHighlight() { $('navigation').getElements('a').each(function(el) { el.setStyles({'background-color': 'transparent'}); if(el.hasClass("item")) { el.setStyles({'color': '#FFFFFF'}); } }); } function newHighlight(el) { $('navigation').getElements('a.item').each(function(item) { if(el.get("href") == item.get("href")) { item.setStyle('background-color', 'rgb(156,178,112)'); } }); }