var resize_locked = 0; var dj_locked = 0; var strip_locked = 0; var height; var initialized = 0; var profilepage = 'profile'; function init(){ if(initialized == 0){ initialized = -1; pngfix(); // setup scroll elements trackwidth = 984; screenwidth = window.getWidth(); if($defined($('scroller'))){ djs = $$(".dj"); djs.each(function(el, i){ el.addEvent('click', function(){ var dj_id = $(el).getAttribute('dj_id'); var dj_nr = $(el).getAttribute('dj_nr'); click_dj(dj_id); }); }); } if($defined($('controller'))){ $('controller').setStyle('opacity', 0.7); } $$('.controller').each(function(el, i){ el.setStyle('opacity', 0.7); }); if($defined($('roster'))){ setupDJs(dj_link_width); height = Math.max(document.body.clientHeight, 560 + $('roster').offsetHeight); } else { height = Math.max(document.body.clientHeight, 560); } // setup overlay $('overlay').setStyle('height', height+"px"); window.fireEvent('init'); EB.processAttributes(); window.addEvent('resize', function(){ if(!resize_locked){ resize_locked = 1; reresize(); setTimeout("reresize(); resize_locked = 0;", 2500); } }); menuFx = new Fx.Base(); $('menuartists').addEvent('mouseenter', function(){ artistmenu_show(); }); $('artistsmenu').addEvent('mouseleave', function(){ artistmenu_hide(); }); $$('#menu a').addEvent('mouseleave', function(){ if(this.id != 'menuartists'){ artistmenu_hide(); } }); $$('.submenu').addEvent('mouseenter', function(){ new Fx.Style(this, 'backgroundColor', {duration: 500}).start('#ffffff', '#000000'); }); release(); initialized = 1; } } var menuFx; function artistmenu_show(){ menuFx.stop(); menuFx = new Fx.Style($('artistsmenu'), 'height', {duration: 500}).start($('artistsmenu').getSize().size.y, $('artistsmenu').getSize().scrollSize.y); } function artistmenu_hide(){ menuFx.stop(); menuFx = new Fx.Style($('artistsmenu'), 'height', {duration: 500}).start($('artistsmenu').getSize().size.y, 0); } // // ARTIST ROSTER // var djswidth = 0; var dj_link_width = 195; var djs = new Array(); function setupDJs(in_dj_link_width){ // calc data djswidth = 984; var names = $$('.dj_name'); var columns = Math.floor(trackwidth/in_dj_link_width); var leftover = Math.floor((trackwidth%in_dj_link_width)/2); var djspercolumn = Math.ceil(names.length / columns); if((columns*djspercolumn) - names.length >= djspercolumn){ // handle empty columns leftover+=Math.round(in_dj_link_width/2); } // generate columns var column = 0; for(i=0;i0){ column++; $('dj_name_'+i).setStyle('marginTop', (-14*djspercolumn)+"px"); } $('dj_name_'+i).setStyle('marginLeft', (column*dj_link_width)+"px"); } // show $('roster').setStyle('width', djswidth-leftover+"px"); //$('roster').setStyle('marginLeft', (-1 * Math.round(djswidth/2)) + "px"); $('roster').setStyle('display', 'block'); } function filter_style(cat){ var link = $('category_status_'+cat); var catdjs = $$('.category'+cat); var links = $$('.category_filter'); if(link.hasClass('inactive')){ link.removeClass('inactive'); catdjs.each(function(el, i){ new Fx.Style($(el), 'opacity', {duration: 500}).start($(el).getStyle('opacity'), 1); }); } else { link.addClass('inactive'); catdjs.each(function(el, i){ found = 0; links.each(function(lnk, j){ if(!$(lnk).hasClass('inactive') && $(el).hasClass('category'+$(lnk).getAttribute('category'))){ found = 1; } }); if(found == 0){ new Fx.Style($(el), 'opacity', {duration: 500}).start(1,0); } }); } } // // GUI HANDLERS // function click_dj(in_dj_id){ if(!dj_locked){ appear('http://www.platinum-agency.nl/page=site.'+profilepage+'/id='+in_dj_id+'/profile.html', 497, 555); } } // // SCROLL STRIP // var sFx; var moving = 0; function prev(in_el){ if(moving == 0){ moving = 1; el = $(in_el); cur = $(el).getStyle('marginLeft').toInt(); if(-cur+408 >= (el.getSize().size.x/2)){ el.setStyle('marginLeft', '-8px'); cur = 0; } sFx = new Fx.Style(in_el, 'marginLeft', {duration: 500, onComplete: function(){ moving = 0; }}).start(cur, cur-408); } } function next(in_el){ if(moving == 0){ moving = 1; el = $(in_el); cur = $(el).getStyle('marginLeft').toInt(); if(cur >= 0){ moving = 0; return; cur = -$$('.firststrip').length*408; } sFx = new Fx.Style(in_el, 'marginLeft', {duration: 500, onComplete: function(){ moving = 0; }}).start(cur, cur+408); } } function djprev(in_el){ if(moving == 0){ moving = 1; el = $(in_el); cur = $(el).getStyle('marginLeft').toInt(); if(-cur+208 >= (el.getSize().size.x/2)){ el.setStyle('marginLeft', '-8px'); cur = 0; } sFx = new Fx.Style(in_el, 'marginLeft', {duration: 500, onComplete: function(){ moving = 0; }}).start(cur, cur-208); } } function djnext(in_el){ if(moving == 0){ moving = 1; el = $(in_el); cur = $(el).getStyle('marginLeft').toInt(); if(cur >= 0){ cur = -$$('.firststrip').length*208; } sFx = new Fx.Style(in_el, 'marginLeft', {duration: 500, onComplete: function(){ moving = 0; }}).start(cur, cur+208); } } var current = new Array(); function homeprev(in_el, in_i){ if(moving == 0){ moving = 1; if(!$defined(current[in_i])){ current[in_i] = 1; } $('dj_title_'+in_i+'_'+current[in_i]).setStyle('display', 'none'); el = $(in_el); cur = $(el).getStyle('marginLeft').toInt(); if(current[in_i] == $$('.firststrip'+in_i).length-1){ current[in_i] = -1; } if(-cur+208 > (el.getSize().size.x/2)){ el.setStyle('marginLeft', '0px'); cur = 0; } sFx = new Fx.Style(in_el, 'marginLeft', {duration: 500, onComplete: function(){ moving = 0; }}).start(cur, cur-208); current[in_i]++; $('dj_title_'+in_i+'_'+current[in_i]).setStyle('display', 'block'); } } function homenext(in_el, in_i){ if(moving == 0){ moving = 1; if(!$defined(current[in_i])){ current[in_i] = 1; } $('dj_title_'+in_i+'_'+current[in_i]).setStyle('display', 'none'); el = $(in_el); cur = $(el).getStyle('marginLeft').toInt(); if(cur >= 0){ cur = -$$('.firststrip'+in_i).length*208; } else if(current[in_i] <= 0){ current[in_i] = $$('.firststrip'+in_i).length; } sFx = new Fx.Style(in_el, 'marginLeft', {duration: 500, onComplete: function(){ moving = 0; }}).start(cur, cur+208); current[in_i]--; $('dj_title_'+in_i+'_'+current[in_i]).setStyle('display', 'block'); } } // // OVERLAY // var oStatus = 1; var oAjax; function appear(in_url, in_width, in_height){ if(oStatus == 0){ $('overlay_content').setHTML(''); $('overlay_content').setStyle('width', in_width+"px"); $('overlay_content').setStyle('height', in_height+"px"); $('overlay_content').setStyle('marginLeft', -1 * Math.round(in_width/2)+"px"); oStatus = -1; var oFX = new Fx.Style('overlay', 'opacity', {duration: 500, onComplete: function(){ oStatus = 1; if(in_url != "undefined"){ // load ajax content oAjax = new Ajax(in_url, {evalScripts: true, onComplete: function(){ pngfix(); var ocFX = new Fx.Style('overlay_content', 'opacity', {duration: 500}); $('overlay_content').setStyles({'opacity': 0, 'display': 'block', 'margin-top': window.getScrollTop()+((height/2)-Math.round(in_height/2))+"px"}); ocFX.start(0,1); }, update: 'overlay_content', autoCancel: true}); oAjax.request(); } }}); $('overlay').setStyle('opacity', 0); $('overlay').setStyle('display', 'block'); oFX.start(0, 0.5); } } function reappear(in_url, in_width, in_height){ if(oStatus == 1){ // make content disappear oStatus = -1; var ocFX = new Fx.Style('overlay_content', 'opacity', {duration: 500, onComplete: function(){ $('overlay_content').setHTML(''); $('overlay_content').setStyle('width', in_width+"px"); $('overlay_content').setStyle('height', in_height+"px"); $('overlay_content').setStyle('marginLeft', -1 * Math.round(in_width/2)+"px"); // load ajax content oAjax = new Ajax(in_url, {evalScripts: true, onComplete: function(){ pngfix(); var ocFX = new Fx.Style('overlay_content', 'opacity', {duration: 500}); $('overlay_content').setStyles({'opacity': 0, 'display': 'block', 'margin-top': window.getScrollTop()+((height/2)-Math.round(in_height/2))+"px"}); ocFX.start(0,1); oStatus = 1; }, update: 'overlay_content', autoCancel: true}); oAjax.request(); }}); ocFX.start(1,0); } else if(oStatus == 0) { appear(in_url, in_width, in_height); } } function disappear(){ if(oStatus == 1){ oStatus = -1; var ocFX = new Fx.Style('overlay_content', 'opacity', {duration: 500, onComplete: function(){ $('overlay_content').setStyle('display', 'none'); }}); ocFX.start(1,0); var oFX = new Fx.Style('overlay', 'opacity', {duration: 500, onComplete: function(){ $('overlay').setStyle('display', 'none'); oStatus = 0; }}); oFX.start(0.5, 0); } } function release(){ var oFX = new Fx.Style('overlay', 'opacity', {duration: 500, onComplete: function(){ $('overlay').setStyle('display', 'none'); oStatus = 0; $('overlay').setHTML(""); }}); oFX.start(0.8, 0); } function reresize(){ if($defined($('roster'))){ setupDJs(dj_link_width); height = Math.max(document.body.clientHeight, 560 + $('roster').offsetHeight); } else { height = Math.max(document.body.clientHeight, 560); } // re-setup overlay $('overlay').setStyle('height', height+"px"); } function pngfix(){ var arVersion = navigator.appVersion.split("MSIE"); var version = parseFloat(arVersion[1]); if ((version >= 5.5 && version < 7) && (document.body.filters)){ var png_images = $$('.pngfix'); png_images.each(function(element) { var img = $(element); if(!img.hasClass('pngfixed')){ img.addClass('pngfixed'); var imgID = (img.id) ? "id='" + img.id + "' " : "" var imgClass = (img.className) ? "class='" + img.className + "' " : "" var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " var imgStyle = "display:inline-block;" + img.style.cssText if (img.align == "left") imgStyle = "float:left;" + imgStyle if (img.align == "right") imgStyle = "float:right;" + imgStyle if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle var strNewHTML = "" img.outerHTML = strNewHTML } }); } }