/**
 * Determines the running version of IE if using IE
 * Forces compatibility mode for the appropriate version
 * 
 * @author Yannick Tessier <yannick@websyshq.com>
 * 
 */


var mode    = '';
var ua      = window.navigator.userAgent
var msie    = ua.indexOf ( "MSIE " )


function DetermineIEVersion()
{
    if ( msie > 0 )      // If Internet Explorer, return version number
    {
        return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
    }
    else                 // If another browser, return 0
    {
        return 0
    }
}


function IECompatibilityMode()
{
    switch(DetermineIEVersion())
    {
        case 7:
            mode = '<meta http-equiv="X-UA-Compatible" value="IE=7">';
        break;

        case 8:
            mode = '<meta http-equiv="X-UA-Compatible" value="IE=8">';
        break;

        case 9:
            mode = '<meta http-equiv="X-UA-Compatible" value="IE=9">';
        break;

        default:
            mode = '';
        break;
    }
    
    return mode;
}




