var b2bcontext_u;
var b2bcontext_h;
var b2bcontext_id;
var b2bcontext_background;
var b2bcontext_otr;
var b2bcontext_subotr;
var b2bcontext_loc = window.location + '';
if(b2bcontext_loc.search(/\?/) == -1)
{
    b2bcontext_h = b2bcontext_loc;
    b2bcontext_h = b2bcontext_h.replace (/^http:\/\//, '');
    b2bcontext_h = b2bcontext_h.replace (/^www\./, '');
    b2bcontext_h = b2bcontext_h.replace (/\/.*$/, '');
}
else
{
    var b2bcontext_ar1 = b2bcontext_loc.split("?");
    var b2bcontext_ar2 = b2bcontext_ar1[1].split("&");
    for (var b2bcontext_i=0; b2bcontext_i < b2bcontext_ar2.length; b2bcontext_i++)
    {
        var b2bcontext_par = b2bcontext_ar2[b2bcontext_i].split("=");
        if(b2bcontext_par[0] == 'u')             b2bcontext_u           = b2bcontext_par[1];
        if(b2bcontext_par[0] == 'h')             b2bcontext_h           = b2bcontext_par[1];
        if(b2bcontext_par[0] == 'background')    b2bcontext_background  = b2bcontext_par[1];
        if(b2bcontext_par[0] == 'otr')           b2bcontext_otr         = b2bcontext_par[1];
        if(b2bcontext_par[0] == 'subotr')        b2bcontext_subotr      = b2bcontext_par[1];
    }
}

if(typeof(b2bcontext_form_w) != 'undefined')
{
    if(b2bcontext_form_w.match(/^\d+$/)) b2bcontext_form_w += 'px';
}
else
{
    b2bcontext_form_w = '700px'
}

if(typeof(b2bcontext_form_h) != 'undefined')
{
    if(b2bcontext_form_h.match(/^\d+$/)) b2bcontext_form_h += 'px';
}
else
{
    b2bcontext_form_h = '1600px'
}

var params = [];
if (b2bcontext_h != undefined)
    params.push ('h=' + b2bcontext_h);
if (b2bcontext_u != undefined)
    params.push ('u=' + b2bcontext_u);
if (params.length)
{
    params.push ('page_key=725865d904be067afa1f');
    var script = '<img src="http://b2bcontext.ru/service/counter.pl?' + params.join ('&', params) + '">';
    document.write(script);
}

document.write('<iframe src="http://b2bcontext.ru/service/tender/t_tender.pl?u='+((b2bcontext_u != undefined) ? b2bcontext_u : '')+
                '&h='+((b2bcontext_h != undefined) ? b2bcontext_h : '')+'&background='+b2bcontext_background+
                '&otr='+b2bcontext_otr+'&subotr='+b2bcontext_subotr+'&link_tenderform='+b2bcontext_loc+
                '" style="width: '+b2bcontext_form_w+'; height: '+b2bcontext_form_h+';" scrolling="no" frameBorder="0"></iframe>');

