function setElementOpacity(sElemId, nOpacity)
{
var opacityProp = getOpacityProperty();
var elem = document.getElementById(sElemId);
if (!elem || !opacityProp) return;
if (opacityProp=="filter")
{
nOpacity *= 100;
var oAlpha = elem.filters['DXImageTransform.Microsoft.alpha'] || elem.filters.alpha;
if (oAlpha) oAlpha.opacity = nOpacity;
else elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";
}
else
{
elem.style[opacityProp] = nOpacity;
}
}
function getOpacityProperty()
{
if (typeof(document.body.style.opacity) == 'string')
{
return 'opacity';
}
else if (typeof(document.body.style.MozOpacity) == 'string')
{
return 'MozOpacity';
}
else if (typeof(document.body.style.KhtmlOpacity) == 'string')
{
return 'KhtmlOpacity';
}
else if ((typeof(document.body.filters) != 'unknown') && (navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5))
{
return 'filter';
}
return false;
}
function view_advertisement ( header, text, url, href, keyword, bid, advertisement_subotr_weight, result_weigth )
{
var nWidth = 700;
var nHeigth = 200;
var left = (window.screen.width - nWidth) / 2;
var top = (window.screen.height - nHeigth) / 2;
var view_win = window.open("", "_blank", "width="+nWidth+", height="+nHeigth+", left="+left+", top="+top+", toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes");
view_win.document.open();
view_win.document.write("
Объявление `" + header + "`");
view_win.document.write("");
view_win.document.write("| Заголовок: | " +header + " |
");
view_win.document.write("| Текст: | " +text + " |
");
view_win.document.write("| Ссылка: | " + url + " |
");
view_win.document.write("
");
view_win.document.write("| Слово: | `" +keyword + "` |
");
view_win.document.write("| Ставка: | " +bid + " |
");
view_win.document.write("| Семантический вес объявления: | " +advertisement_subotr_weight + " |
");
view_win.document.write("| Итоговый вес объявления: | " +result_weigth + " |
");
view_win.document.write("");
view_win.document.close();
}
var first_blok_27373; // Необязательно
function b2bctbLoadUpdate_27373(update_num)
{
if (document.getElementById('b2bctb_script_container' + (update_num) + '_' + b2bctb_[27373].id) != null)
{
var b2bctb_time_of_load_update = b2bctb_time_of_loading_27373;
var b2bctb_update_key = 'Bn5D09fCa92cKszj' + parseInt(100000000 * Math.random() );
var count = b2bctb_[27373].count;
var src_update_27373 = src_27373.replace (/div_conteiner_id/, 'update_key='+b2bctb_update_key+'&div_conteiner_id');
if (src_update_27373.match (/count_from=\d+/))
{
src_update_27373 = src_update_27373.replace (/count_from=\d+/, 'count_from='+count*(update_num-2));
src_update_27373 = src_update_27373.replace (/count_total=\d+/, 'count_total='+count*100);
}
else
{
src_update_27373 = src_update_27373.replace (/count=\d+/, 'count='+count+'&count_from='+count*(update_num-2)+'&count_total='+count*100);
}
document.getElementById('b2bctb_script_container' + update_num + '_' + b2bctb_[27373].id).src = src_update_27373 + Math.random();
var b2bctb_update_27373 = setInterval(function() {
b2bctb_time_of_loading_27373 += 40;
var b2bctb_conteiner_temp_in = document.getElementById('b2bcontext_div_conteiner_temp_' + b2bctb_[27373].id ).innerHTML;
if( b2bctb_conteiner_temp_in.match(b2bctb_update_key) &&
(b2bctb_time_of_loading_27373 > (b2bctb_time_of_load_update + 8000)) )
{
b2bctb_update_27373 = clearInterval(b2bctb_update_27373);
if (b2bcontext_browser != "msie")
{
var b2bctb_opacity = 0;
var b2bctb_set_conteiner_alpha = setInterval(function() {
setElementOpacity ('b2bcontext_div_conteiner_' + b2bctb_[27373].id, b2bctb_opacity);
b2bctb_opacity+=0.02;
if(b2bctb_opacity > 1) b2bctb_set_conteiner_alpha = clearInterval(b2bctb_set_conteiner_alpha);
}, 10 );
}
//if(!is_IE)
// Если объявления в полученном блоке ещё есть...
if (document.getElementById('b2bcontext_div_conteiner_temp_' + b2bctb_[27373].id ).innerHTML.match (/exists_advertisements/)
&& document.getElementById('b2bctb_script_container' + (update_num + 1) + '_' + b2bctb_[27373].id) != null)
{
if (update_num == 3)
first_blok_27373 = document.getElementById('b2bcontext_div_conteiner_' + b2bctb_[27373].id).innerHTML;
document.getElementById('b2bcontext_div_conteiner_' + b2bctb_[27373].id ).innerHTML = document.getElementById('b2bcontext_div_conteiner_temp_' + b2bctb_[27373].id ).innerHTML;
b2bctbLoadUpdate_27373(update_num+1);
}
else // Если объявлений больше нет...
{
if (first_blok_27373)
document.getElementById('b2bcontext_div_conteiner_' + b2bctb_[27373].id ).innerHTML = first_blok_27373;
}
}
}, 40 );
}
}
if((b2bctb_[27373].type == 1) && (typeof(b2bctb_[27373].by_tender) == "undefined"))
{
if((typeof(b2bctb_[27373].count_from) == "undefined") || (typeof(b2bctb_[27373].count_total) == "undefined"))
{
var count_total_27373 = 0;
for (var ii in b2bctb_)
{
if((b2bctb_[ii].type != 1) || (typeof(b2bctb_[ii].by_tender) != "undefined")) continue;
count_total_27373 += b2bctb_[ii].count;
}
if (b2bctb_[27373].count != count_total_27373)
{
var count_from_27373 = 0;
for (var ii in b2bctb_)
{
if ((b2bctb_[ii].type != 1) || (typeof(b2bctb_[ii].by_tender) != "undefined")) continue;
if (ii != 27373)
{
count_from_27373 += b2bctb_[ii].count;
}
else
{
break;
}
}
b2bctb_[27373].count_from = count_from_27373;
b2bctb_[27373].count_total = count_total_27373;
}
}
}
var b2bctb_b_count_27373;
if((b2bctb_[27373].type == 2) && (typeof(b2bctb_[27373].by_tender) == "undefined"))
{
b2bctb_b_count_27373 = 0;
for (var ii in b2bctb_)
{
if ((b2bctb_[ii].type != 2) || (typeof(b2bctb_[ii].by_tender) != "undefined")) continue;
b2bctb_b_count_27373++;
}
}
var src_27373 = 'http://b2bcontext.ru/service/advertisement/getcontent'+
'?div_conteiner_id='+b2bctb_[27373].id+
'&type='+b2bctb_[27373].type+
'&w='+b2bctb_[27373].w;
if(typeof(b2bctb_[27373].h) != "undefined") src_27373+= '&h='+b2bctb_[27373].h;
var b2bcontext_browser;
var b2bcontext_ua = navigator.userAgent.toLowerCase();
if (b2bcontext_ua.indexOf("msie") != -1 && b2bcontext_ua.indexOf("opera") == -1 && b2bcontext_ua.indexOf("webtv") == -1)
{
b2bcontext_browser = "msie";
}
if (b2bcontext_ua.indexOf("opera") != -1)
{
b2bcontext_browser = "opera";
}
if (b2bcontext_ua.indexOf("gecko") != -1)
{
b2bcontext_browser = "gecko";
}
if (b2bcontext_ua.indexOf("safari") != -1)
{
b2bcontext_browser = "safari";
}
if((b2bcontext_browser != "opera") && (b2bcontext_browser != "gecko") && (b2bcontext_browser != "safari"))
{
if(typeof(b2bctb_[27373].is_utf8) != "undefined") src_27373+= '&is_utf8='+b2bctb_[27373].is_utf8;
if(typeof(b2bctb_[27373].is_koi8) != "undefined") src_27373+= '&is_koi8='+b2bctb_[27373].is_koi8;
}
if( (top != self) && (document.referrer.search(/http:\/\/(www\.)?(\w+\.)?b2bcontext\.ru\/admin/i) == 0) ) src_27373+= '&tester_engine=1';
if(typeof(b2bctb_[27373].by_tender) != "undefined") src_27373+= '&by_tender='+b2bctb_[27373].by_tender;
if(typeof(b2bctb_[27373].background) != "undefined") src_27373+= '&background='+b2bctb_[27373].background;
if(typeof(b2bctb_[27373].border) != "undefined") src_27373+= '&border='+escape(b2bctb_[27373].border);
if(typeof(b2bctb_[27373].direction) != "undefined") src_27373+= '&direction='+b2bctb_[27373].direction;
if(typeof(b2bctb_[27373].count) != "undefined") src_27373+= '&count='+b2bctb_[27373].count;
if(typeof(b2bctb_[27373].count_from) != "undefined") src_27373+= '&count_from='+b2bctb_[27373].count_from;
if(typeof(b2bctb_[27373].count_total) != "undefined") src_27373+= '&count_total='+b2bctb_[27373].count_total;
if(typeof(b2bctb_b_count_27373) != "undefined") src_27373+= '&b_count='+b2bctb_b_count_27373;
if(typeof(b2bctb_[27373].deny_more) != "undefined") src_27373+= '&deny_more='+b2bctb_[27373].deny_more;
if(typeof(b2bctb_[27373].zayavka_family) != "undefined") src_27373+= '&zayavka_family='+b2bctb_[27373].zayavka_family;
if(typeof(b2bctb_[27373].zayavka_size) != "undefined") src_27373+= '&zayavka_size='+b2bctb_[27373].zayavka_size;
if(typeof(b2bctb_[27373].zayavka_weight) != "undefined") src_27373+= '&zayavka_weight='+b2bctb_[27373].zayavka_weight;
if(typeof(b2bctb_[27373].zayavka_color) != "undefined") src_27373+= '&zayavka_color='+b2bctb_[27373].zayavka_color;
if(typeof(b2bctb_[27373].pre_header_location) != "undefined") src_27373+= '&pre_header_location='+b2bctb_[27373].pre_header_location;
if(typeof(b2bctb_[27373].pre_header_short) != "undefined") src_27373+= '&pre_header_short='+b2bctb_[27373].pre_header_short;
if(typeof(b2bctb_[27373].pre_header_background) != "undefined") src_27373+= '&pre_header_background='+b2bctb_[27373].pre_header_background;
if(typeof(b2bctb_[27373].pre_header_family) != "undefined") src_27373+= '&pre_header_family='+b2bctb_[27373].pre_header_family;
if(typeof(b2bctb_[27373].pre_header_size) != "undefined") src_27373+= '&pre_header_size='+b2bctb_[27373].pre_header_size;
if(typeof(b2bctb_[27373].pre_header_weight) != "undefined") src_27373+= '&pre_header_weight='+b2bctb_[27373].pre_header_weight;
if(typeof(b2bctb_[27373].pre_header_color) != "undefined") src_27373+= '&pre_header_color='+b2bctb_[27373].pre_header_color;
if(typeof(b2bctb_[27373].elem_spacing) != "undefined") src_27373+= '&elem_spacing='+b2bctb_[27373].elem_spacing;
if(typeof(b2bctb_[27373].elem_background) != "undefined") src_27373+= '&elem_background='+b2bctb_[27373].elem_background;
if(typeof(b2bctb_[27373].elem_border) != "undefined") src_27373+= '&elem_border='+escape(b2bctb_[27373].elem_border);
if(typeof(b2bctb_[27373].header_family) != "undefined") src_27373+= '&header_family='+b2bctb_[27373].header_family;
if(typeof(b2bctb_[27373].header_size) != "undefined") src_27373+= '&header_size='+b2bctb_[27373].header_size;
if(typeof(b2bctb_[27373].header_weight) != "undefined") src_27373+= '&header_weight='+b2bctb_[27373].header_weight;
if(typeof(b2bctb_[27373].header_color) != "undefined") src_27373+= '&header_color='+b2bctb_[27373].header_color;
if(typeof(b2bctb_[27373].header_hover_color) != "undefined") src_27373+= '&header_hover_color='+b2bctb_[27373].header_hover_color;
if(typeof(b2bctb_[27373].header_line_h) != "undefined") src_27373+= '&header_line_h='+b2bctb_[27373].header_line_h;
if(typeof(b2bctb_[27373].text_family) != "undefined") src_27373+= '&text_family='+b2bctb_[27373].text_family;
if(typeof(b2bctb_[27373].text_size) != "undefined") src_27373+= '&text_size='+b2bctb_[27373].text_size;
if(typeof(b2bctb_[27373].text_weight) != "undefined") src_27373+= '&text_weight='+b2bctb_[27373].text_weight;
if(typeof(b2bctb_[27373].text_color) != "undefined") src_27373+= '&text_color='+b2bctb_[27373].text_color;
if(typeof(b2bctb_[27373].text_line_h) != "undefined") src_27373+= '&text_line_h='+b2bctb_[27373].text_line_h;
if(typeof(b2bctb_[27373].url_family) != "undefined") src_27373+= '&url_family='+b2bctb_[27373].url_family;
if(typeof(b2bctb_[27373].url_size) != "undefined") src_27373+= '&url_size='+b2bctb_[27373].url_size;
if(typeof(b2bctb_[27373].url_weight) != "undefined") src_27373+= '&url_weight='+b2bctb_[27373].url_weight;
if(typeof(b2bctb_[27373].url_color) != "undefined") src_27373+= '&url_color='+b2bctb_[27373].url_color;
if(typeof(b2bctb_[27373].date_absent) != "undefined") src_27373+= '&date_absent='+b2bctb_[27373].date_absent;
if(typeof(b2bctb_[27373].date_family) != "undefined") src_27373+= '&date_family='+b2bctb_[27373].date_family;
if(typeof(b2bctb_[27373].date_size) != "undefined") src_27373+= '&date_size='+b2bctb_[27373].date_size;
if(typeof(b2bctb_[27373].date_weight) != "undefined") src_27373+= '&date_weight='+b2bctb_[27373].date_weight;
if(typeof(b2bctb_[27373].date_color) != "undefined") src_27373+= '&date_color='+b2bctb_[27373].date_color;
if(typeof(b2bctb_[27373].links_family) != "undefined") src_27373+= '&links_family='+b2bctb_[27373].links_family;
if(typeof(b2bctb_[27373].links_size) != "undefined") src_27373+= '&links_size='+b2bctb_[27373].links_size;
if(typeof(b2bctb_[27373].links_weight) != "undefined") src_27373+= '&links_weight='+b2bctb_[27373].links_weight;
if(typeof(b2bctb_[27373].links_color) != "undefined") src_27373+= '&links_color='+b2bctb_[27373].links_color;
if (b2bcontext_browser != "msie") setElementOpacity( 'b2bcontext_div_conteiner_' + b2bctb_[27373].id, 0 );
document.getElementById('b2bctb_script_container2_' + b2bctb_[27373].id).src = src_27373 + '&' + Math.random();
var b2bctb_banner_loaded_27373 = 0;
var b2bctb_time_of_loading_27373 = 0; // ms
var b2bctb_check_first_load_27373 = setInterval(function() {
b2bctb_time_of_loading_27373 += 40;
var b2bctb_conteiner_in_27373 = document.getElementById('b2bcontext_div_conteiner_' + b2bctb_[27373].id ).innerHTML;
if(b2bctb_conteiner_in_27373 != '')
{
if(b2bctb_[27373].type == 2) b2bctb_banner_loaded_27373 = 1;
b2bctb_check_first_load_27373 = clearInterval(b2bctb_check_first_load_27373);
setTimeout('void(0)', 100);
//if(!is_IE)
if (b2bcontext_browser != "msie")
{
var b2bctb_opacity_27373 = 0.2;
var b2bctb_set_conteiner_alpha_27373 = setInterval(function() {
setElementOpacity( 'b2bcontext_div_conteiner_' + b2bctb_[27373].id, b2bctb_opacity_27373 );
b2bctb_opacity_27373 += 0.02;
if(b2bctb_opacity_27373 > 1) b2bctb_set_conteiner_alpha_27373 = clearInterval(b2bctb_set_conteiner_alpha_27373);
}, 10 );
}
if (b2bctb_conteiner_in_27373.match(/a3cT712QFc7N34D4/) && (b2bctb_[27373].type == 1) &&
(document.getElementById('b2bcontext_div_conteiner_temp_' + b2bctb_[27373].id) != null) )
{
var b2bctb_time_of_first_load = b2bctb_time_of_loading_27373;
src_27373 = src_27373.replace (/div_conteiner_id/, 'index_and_load=1&div_conteiner_id');
document.getElementById('b2bctb_script_container3_' + b2bctb_[27373].id).src = src_27373 + Math.random();
var b2bctb_check_index_and_load_27373 = setInterval(function() {
b2bctb_time_of_loading_27373 += 40;
var b2bctb_conteiner_temp_in = document.getElementById('b2bcontext_div_conteiner_temp_' + b2bctb_[27373].id ).innerHTML;
if ((b2bctb_conteiner_temp_in != '') &&
(b2bctb_time_of_loading_27373 > (b2bctb_time_of_first_load + 4000)))
{
b2bctb_check_index_and_load_27373 = clearInterval(b2bctb_check_index_and_load_27373);
document.getElementById('b2bcontext_div_conteiner_' + b2bctb_[27373].id ).innerHTML = document.getElementById('b2bcontext_div_conteiner_temp_' + b2bctb_[27373].id ).innerHTML;
//if(!is_IE)
if (b2bcontext_browser != "msie")
{
var b2bctb_opacity = 0;
var b2bctb_set_conteiner_alpha = setInterval(function() {
setElementOpacity( 'b2bcontext_div_conteiner_' + b2bctb_[27373].id, b2bctb_opacity );
b2bctb_opacity+=0.02;
if(b2bctb_opacity > 1) b2bctb_set_conteiner_alpha = clearInterval(b2bctb_set_conteiner_alpha);
}, 10 );
}
}
}, 40 );
}
//
if( !b2bctb_conteiner_in_27373.match(/a3cT712QFc7N34D4/) && (b2bctb_[27373].type == 1) &&
(b2bctb_[27373].update == 1) )
{
b2bctbLoadUpdate_27373(3);
}
}
}, 40 );