// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function showLongDescription(name) {
    // immediately hide the clicked link to avoid showing little focus rectangle in IE
    var el = document.getElementById(name + 'DownLink');
    if (el) el.style.display = 'none';
    el = document.getElementById(name + 'UpLink');
    if (el) el.style.display = 'inline';
    
    if (typeof document.body.style.maxHeight != "undefined") {
        // IE 7, mozilla, safari, opera 9
        if (document.getElementById(name + 'ShortDescription'))
            new Effect.SlideUp(name + 'ShortDescription', {delay:0,duration:1.5});
        new Effect.SlideDown(name + 'LongDescription', {delay:0,duration:1.5});
    } else {
        // IE6, older browsers
        // The SlideDown doesn't work in IE6, and BlindUp/Down doesn't work in IE7
        if (document.getElementById(name + 'ShortDescription'))
            new Effect.BlindUp(name + 'ShortDescription', {delay:0,duration:1.5});
        new Effect.BlindDown(name + 'LongDescription', {delay:0,duration:1.5});
    }
}

function hideLongDescription(name) {
    // immediately hide the clicked link to avoid showing little focus rectangle in IE
    var el = document.getElementById(name + 'UpLink');
    if (el) el.style.display = 'none';
    el = document.getElementById(name + 'DownLink');
    if (el) el.style.display = 'inline';
    
    if (typeof document.body.style.maxHeight != "undefined") {
       // IE 7, mozilla, safari, opera 9
       if (document.getElementById(name + 'ShortDescription'))
           new Effect.SlideDown(name + 'ShortDescription', {delay:0,duration:1.5});
       new Effect.SlideUp(name + 'LongDescription', {delay:0,duration:1.5});
    } else {
       // IE6, older browsers
       // The SlideDown doesn't work in IE6, and BlindUp/Down doesn't work in IE7
       if (document.getElementById(name + 'ShortDescription'))
           new Effect.BlindDown(name + 'ShortDescription', {delay:0,duration:1.5});
       new Effect.BlindUp(name + 'LongDescription', {delay:0,duration:1.5});
    }
}

