window.addEvent('domready', function() {
    opt = {'server':assets_dir};
    $$('.stripviewer').each(function(el,i){
        sv = new StripViewer(el, opt);
    },this);
    extra = $('extra');
    this.morph = new Fx.Morph(extra, {
        duration: 'short',
        transition: 'sine:in'
    });
    initClose();
    initForm();
    initJoin();
    doIE();
});

function sexyMessage(){
     window.addEvent('domready', function() {
          Sexy.info('<h1>Bedankt...</h1><p>...voor je interesse.<br/>We houden je op de hoogte!</p>');
          return false;
     });
}

function showExtra(){
    extra.fade(1);
    this.morph.start({
        'height': 150
    });
}

function hideExtra(){
    extra.fade(0);
    this.morph.start({
        'height': 0
    });
}

function initClose(){
    $('close').addEvent('click', function(){
        hideExtra();
    });
}

function initForm(){
    input = $('emailh');
    but = $('buth');
    input.addEvent('focus',function(){
        input.setStyle('background-image','url('+assets_dir+'style/images/input_hover.gif)');    
    });
}

function initJoin(){
    join = $('join');
    join.addEvent('mouseenter',function(){join.set('src',assets_dir+'style/images/join_hover.gif');});
    join.addEvent('mouseleave',function(){join.set('src',assets_dir+'style/images/join.gif');});
}

function doIE(){
    var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
    if(ie7 == false){
        $$('ietrouble').each(function(el,i){
            el.setStyle('margin-top','-30px');
        });
    }
}

function checkIE(){
        return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}