var wWidth, wHeight, kier=0.52, fadeTo=0.5, fxTime=700, TD1, TD2, animated;
$(function() {
    IFRAME = $('iframe');
    TD1 = $('table td:first');
    TD2 = $('table td:last');

    resize();
    TD1.add(TD2).mouseover(function() {
        tendTo(this);
    })
})

$(window).resize(function() {resize();})

function resize() {
    wWidth=$(window).width();
    wHeight=$(window).height();
    TD1.css({
        height: wHeight,
        width: wWidth/2
    })
}
function tendTo(elem) {
    if(animated==elem) return;
    animated=elem;
    
    var changeTo = wWidth-wWidth*kier, tdFadeTo=1;    
    TD1.stop();TD2.stop();
    if(elem == TD1.get(0)) {
        changeTo = wWidth*kier;
        TD2.animate({opacity:fadeTo}, {duration:fxTime});
    } else {
        tdFadeTo=fadeTo;
        TD2.animate({opacity: 1}, {duration:fxTime})
    }
    
    TD1.animate({width:changeTo, opacity:tdFadeTo}, {duration:fxTime})
}
