// Function for LaToile Quebec ( KeyWord Variable)

function get_keyword(name){
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null )
    return "";
    else
    return results[1];
}
// End function get_keyword

function GetFlagDE( Posi )
{
    // Tag DE en fonction (actif)
    var ActifDE = false; // TRUE: Tag DE, FALSE: Tag DFP

    var ExceptionDE =
    {
    //button : 1,
    //advertorial : 1
    }

    return ( ExceptionDE[ Posi ] ) ? true : ActifDE; //DETag flag
}

function GetPosition( Pos, Obj )
{
    var NameTranslation = {
        fr :
        {
            skyscraper: 'bouton_7',
            special1: 'special_1',
            special2: 'special_2',
            superbanner: 'bandeau',
            bigbox: 'boite',
            button: 'bouton_4',
            popup: 'popup',
            advertorial: 'publireportage',
            banner: 'bandeau_1'
        },
        en :
        {
            skyscraper: 'button_7',
            special1: 'special_1',
            special2: 'special_2',
            superbanner: 'superbanner',
            bigbox: 'boite',
            button: 'button_4',
            popup: 'popup',
            advertorial: 'publireportage',
            banner: 'banner'
        }
    }

    return NameTranslation[ Obj.language ][ Pos ];
}

function GetDim( Posi )
{
    var tab = new Array;

    tab[ "superbanner" ] = "728x90,468x60";
    tab[ "bigbox" ] = "300x250";
    tab[ "skyscraper" ] = "120x600,160x600";
    tab[ "popup" ] = "500x500";
    tab[ "banner" ] = "468x60";
    tab[ "slimbanner" ] = "970x30";
    tab[ "button" ] = "120x60,234x60,234x90";
    tab[ "advertorial" ] = "306x140";
    tab[ "special" ] = "160x60";
    tab[ "special1" ] = "160x60";
    tab[ "special2" ] = "160x60";

    return tab[ Posi ];
}

