
var link = $('head').find('link[href*=bestad]');

if (link.length > 0) {

    var parseSelector = $;

    var futura;
    var language;
    
    if(typeof locale != 'undefined')
    {
    	language = locale;
    }
    else
    {
    	language = $('#input_siteName').val();
    }
     
    if(typeof language != 'undefined' && (language == 'ru_RU' || language == 'ja_JP' || language == 'es_CO'))
    {
	futura = { src: 'http://bestads.redbull.com/Flash/sifr/sans.swf' };
    }
    else
    {
    	futura = { src: 'http://bestads.redbull.com/Flash/sifr/futura.swf' };
    }

    sIFR.useStyleCheck = true;

    sIFR.activate(futura);

    $(document).ready(function() {
        sIFR.replace(futura, {
            selector: '#sec_header h2, #bestAdCommentLeft',
            css: '.sIFR-root { background-color: #FFFFFF; text-transform:uppercase; font-weight:bold; }',
            wmode: 'transparent'
        });

        sIFR.replace(futura, {
            selector: '#ad_type h3.sifr',
            css: '.sIFR-root { background-color: #FFFFFF; width:135px; text-transform:uppercase; font-weight:bold; text-align:center;}',
            wmode: 'transparent'
        });

        sIFR.replace(futura, {
            selector: 'h2.sifr',
            css: '.sIFR-root { background-color: #FFFFFF; text-transform:uppercase; font-weight:bold;}',
            wmode: 'transparent'
        });

        sIFR.replace(futura, {
            selector: '.CreateAdCallout div.Black',
            css: [
                    '.sIFR-root { background-color: #FFFFFF; text-transform:uppercase; font-weight:bold; text-align:center}',
                    'a { text-decoration:none; color:#000000; }',
                    'a:hover { text-decoration:none; color:#000000; }'
                    ],
            wmode: 'transparent',
            selectable: true,
            fitexactly: true,
            preventwrap: true,
            forcesingline: true
        });

        sIFR.replace(futura, {
            selector: '.CreateAdCallout  div.Blue',
            css: [
                    '.sIFR-root { background-color: #FFFFFF; text-transform:uppercase; font-weight:bold; color:#54B4DC; text-align:center}',
                    'a { text-decoration:none; color:#54B4DC; }',
                    'a:hover { text-decoration:none; color:#54B4DC; }'
                    ],
            wmode: 'transparent',
            selectable: true,
            fitexactly: true,
            preventwrap: true,
            forcesingline: true
        });
    });
}
