(function($){$.ifixpng=function(customPixel){$.ifixpng.pixel=customPixel;};$.ifixpng.getPixel=function(){return $.ifixpng.pixel||'http://www.ukrbiznes.com/catalog_files/img/pixel.gif';};var hack={ltie7:$.browser.msie&&$.browser.version<7,filter:function(src){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";}};$.fn.ifixpng=hack.ltie7?function(){return this.each(function(){var $$=$(this);var base=$('base').attr('href');if($$.is('img')||$$.is('input')){if($$.attr('src')){if($$.attr('src').match(/.*\.png([?].*)?$/i)){var source=(base&&$$.attr('src').substring(0,1)!='/')?base+$$.attr('src'):$$.attr('src');$$.css({filter:hack.filter(source),width:$$.width(),height:$$.height()}).attr({src:$.ifixpng.getPixel()}).positionFix();}}}else{var image=$$.css('backgroundImage');if(image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)){image=RegExp.$1;$$.css({backgroundImage:'none',filter:hack.filter(image)}).children().children().positionFix();}}});}:function(){return this;};$.fn.iunfixpng=hack.ltie7?function(){return this.each(function(){var $$=$(this);var src=$$.css('filter');if(src.match(/src=["']?(.*\.png([?].*)?)["']?/i)){src=RegExp.$1;if($$.is('img')||$$.is('input')){$$.attr({src:src}).css({filter:''});}else{$$.css({filter:'',background:'url('+src+')'});}}});}:function(){return this;};$.fn.positionFix=function(){return this.each(function(){var $$=$(this);var position=$$.css('position');if(position!='absolute'&&position!='relative'){$$.css({position:'relative'});}});};})(jQuery); 
$(document).ready(function(){$(".comm_text").focus(function(){if($(this).val()=="текст комментария"){$(this).val("");}});$(".comm_text").blur(function(){if($(this).val()==""){$(this).val("текст комментария");}});if(window.location.hash=="#add-comm"){$("#form_comm_main").show();}});function del_com(com_id){if(confirm("Вы действительно хотите удалить этот комментарий")){$("#form_del_comm"+com_id).submit();}else{alert("Будте осторожны ;)");}}
function show_com_form(num){$("div#add_comment"+num).toggle();}
function show_com_form_main(){$("#form_comm_main").toggle();}
function doResetComm(id_comm){$("div#add_comment"+id_comm).hide();}
function doResetCommMain(){$("#form_comm_main").hide();}
function doSubmitCommMain(){if($("#form_comm_main").children("textarea").val()=="текст комментария"||$("#form_comm_main").children("textarea").val()==""){alert("Введите текст комментария");return false;}else{return true;}}
function doSubmitComm(id_comm){if($("div#add_comment"+id_comm).children("form").children("textarea").val()=="текст комментария"||$("div#add_comment"+id_comm).children("form").children("textarea").val()==""){alert("Введите текст комментария");return false;}else{return true;}}
function show_registration_add_com(urle){show_registration_form('Для того, что бы добавить комментарий необходимо зарегистрироваться',urle);} 
function pagehover(w,w1)
{if(w=='pre')
{if(w1=='over')
{document.getElementById('pagepre').className='pagedivhov';document.getElementById('imgpre').src='http://www.ukrbiznes.com/news/img/pager/pagearrleft1.gif';}
if(w1=='out')
{document.getElementById('pagepre').className='pagediv';document.getElementById('imgpre').src='http://www.ukrbiznes.com/news/img/pager/pagearrleft.gif';}
return;}
if(w=='next')
{if(w1=='over')
{document.getElementById('pagenext').className='pagedivhov';document.getElementById('imgnext').src='http://www.ukrbiznes.com/news/img/pager/pagearrright1.gif';}
if(w1=='out')
{document.getElementById('pagenext').className='pagediv';document.getElementById('imgnext').src='http://www.ukrbiznes.com/news/img/pager/pagearrright.gif';}
return;}
if(w1=='over')
document.getElementById('page'+w).className='pagedivhov';if(w1=='out')
document.getElementById('page'+w).className='pagediv';return;} 
var start_tab;function loader_to_container(cont){$(cont).html("<div class='loader_in_container'><img src='img/ajax-loader.gif' /><div>");}
function set_event(ind){if(ind==0){var inb_page_1=$("#inb_hid_page").val();var inb_count_bl_1=$("#inb_hid_count_block").val();if(inb_page_1==1)$("#ind_news_block div.cont div.buttools div.inblist img.larr").css("cursor",'default').fadeTo(1,0.5);if(inb_page_1==inb_count_bl_1)$("#ind_news_block div.cont div.buttools div.inblist img.rarr").css("cursor",'default').fadeTo(1,0.5);$("#ind_news_block div.cont div.buttools div.inblist img").click(function(){if($(this).hasClass('larr')){if(inb_page_1==1)return;inb_page_1--;if(inb_page_1<=1){inb_page_1=1;$("#ind_news_block div.cont div.buttools div.inblist img.larr").css("cursor",'default').fadeTo(1,0.5);}
if(inb_page_1<inb_count_bl_1){$("#ind_news_block div.cont div.buttools div.inblist img.rarr").css("cursor",'pointer').css("cursor",'hand').fadeTo(1,1);}
loader_to_container('#ind_news_block div.inb_to_load_top');$.post("ajax/ajax.php",{action:'get_ind_top_news_content',inbaction:'switch_block',page:inb_page_1},function(data){$("#ind_news_block div.inb_to_load_top").html(data);});}else{if(inb_page_1==inb_count_bl_1)return;inb_page_1++;if(inb_page_1>=inb_count_bl_1){inb_page_1=inb_count_bl_1;$("#ind_news_block div.cont div.buttools div.inblist img.rarr").css("cursor",'default').fadeTo(1,0.5);}
if(inb_page_1>1){$("#ind_news_block div.cont div.buttools div.inblist img.larr").css("cursor",'pointer').css("cursor",'hand').fadeTo(1,1);}
loader_to_container('#ind_news_block div.inb_to_load_top');$.post("ajax/ajax.php",{action:'get_ind_top_news_content',inbaction:'switch_block',page:inb_page_1},function(data){$("#ind_news_block div.inb_to_load_top").html(data);});}});}
if(ind==1){page_event(ind);}
if(ind==2){page_event(ind);}}
function page_event(ind){var inb_ajax_page=1;$("#ind_news_block div.inb_ajaxList img.larr").hover(function(){if(inb_ajax_page!=1)
$(this).css("background-position",'bottom');},function(){if(inb_ajax_page!=1)
$(this).css("background-position",'top');});$("#ind_news_block div.inb_ajaxList img.rarr").hover(function(){if(inb_ajax_page!=4)
$(this).css("background-position",'bottom');},function(){if(inb_ajax_page!=4)
$(this).css("background-position",'top');});$("#ind_news_block div.inb_ajaxList img.larr").click(function(){if(inb_ajax_page==1)return;if(inb_ajax_page==4)$("#ind_news_block div.inb_ajaxList img.rarr").css("cursor",'pointer').css("cursor",'hand').css("background-position",'top');inb_ajax_page--;if(inb_ajax_page==1)$(this).css("cursor",'default').css("background-position",'0px 34px');$("#ind_news_block div.inb_ajaxList img.pajax").css("background-position",'0 -'+((inb_ajax_page-1)*7)+'');loader_to_container('#ind_news_block div.inb_lent_news');$.post("ajax/ajax.php",{action:'get_ind_top_news_content',inbaction:'pagination',ind:ind,page:inb_ajax_page},function(data){$("#ind_news_block div.inb_lent_news").html(data);});});$("#ind_news_block div.inb_ajaxList img.rarr").click(function(){if(inb_ajax_page==4)return;if(inb_ajax_page==1)$("#ind_news_block div.inb_ajaxList img.larr").css("cursor",'pointer').css("cursor",'hand').css("background-position",'top');inb_ajax_page++;if(inb_ajax_page==4)$(this).css("cursor",'default').css("background-position",'0px 34px');$("#ind_news_block div.inb_ajaxList img.pajax").css("background-position",'0 -'+((inb_ajax_page-1)*7)+'px');loader_to_container('#ind_news_block div.inb_lent_news');$.post("ajax/ajax.php",{action:'get_ind_top_news_content',inbaction:'pagination',ind:ind,page:inb_ajax_page},function(data){$("#ind_news_block div.inb_lent_news").html(data);});});}
$(document).ready(function(){start_tab=$("#ind_news_block .inb_tabs .tab").index($('#ind_news_block li.indtabcur').get(0));set_event(start_tab);$("#ind_news_block .inb_tabs .tab a").click(function(){var ind=$("#ind_news_block .inb_tabs .tab").index($(this).parent().get(0));if($(this).parent().hasClass('indtabcur')){if(ind==0)window.location='http://www.ukrbiznes.com/news';if(ind==1)window.location='http://www.ukrbiznes.com/news';if(ind==2)window.location='http://www.ukrbiznes.com/news/company';}
$("#ind_news_block .inb_tabs .tab").removeClass('indtabcur');$(this).parent().addClass('indtabcur');loader_to_container('#ind_news_block div.cont');$.post("ajax/ajax.php",{action:'get_ind_top_news_content',inbaction:'switch_tab',ind:ind},function(data){$("#ind_news_block div.cont").removeClass('stats_linenews');$("#ind_news_block div.cont").removeClass('stats_firmnews');$("#ind_news_block div.cont").removeClass('stats_topnews');$("#ind_news_block div.cont").html(data);set_event(ind);});return false;});}); 
function showNewsCpmments(){$("#new_full_comments_box").show();$("#form_comm_main").show();return false;}
$(document).ready(function(){if(window.location.hash=='#head-comm'){showNewsCpmments();}});function showMsgForm(){var obg;var p
var top;var left;obg=$("div.news_menu");p=obg.offset();top=p.top+10;left=p.left-35;$("div#msg").css({"top":top,"left":left});$("div#msg").show();return false;}
function checkMsg(){if(!isStringEmpty($("#msg_tema").val(),2)){alertbad("Вы не заполнили поле 'Тема сообщения'",$("#msg_tema"));return false;}
if(!isStringEmpty($("#msg_fio").val(),2)){alertbad("Вы не заполнили поле 'Ф.И.О.'",$("#msg_fio"));return false;}
if(!isStringEmpty($("#msg_mail").val(),2)||!isMail($("#msg_mail").val())){alertbad("Вы не заполнили<br/>или заполнили не коректно поле 'Ваш e-mail'",$("#msg_mail"));return false;}
if(!isStringEmpty($("#msg_text").val())){alertbad("Вы не заполнили поле 'Текст сообщения'",$("#msg_text"));return false;}
return true;}
function hideMsgFrom(){$("div#msg").hide();return false;}
function isMail(text){text=$.trim(text);var re=new RegExp("^[\._a-zA-Z0-9-]+@[\.a-zA-Z0-9-]+\.[a-z]{2,6}$");if(!re.test(text)){return false;}
return true;}
function isStringEmpty(text,limit){if(limit==null){limit=0;}
if($.trim(text).length<=limit){return false;}
return true;}
function alertgood(text,t){var m=$(t).offset();var w=$("body").width();if(m.left<w/2){l=m.left;}
else{l=w/2;}
$("<div class='msgood' style='position: absolute; top:"+(m.top+35)+"px; left: "+l+"px; background-color: #80a5c6; '><b>ub.Блоги</b><br/><br/>"+text+"</div>").appendTo("body");setTimeout("alertgoodHide()",1000);}
function alertgoodHide(){$(".msgood").fadeOut("slow",function(){$(".msgood").remove();});}
function alertbad(text,t,hide_list){if(hide_list){arrayId=hide_list.split(",");for(var i=0;i<arrayId.length;i++){$("#"+arrayId[i]).css("visibility","hidden");}}
var m=$(t).offset();var w=$("body").width();if(m.left<w/2){l=m.left;}
else{l=w/2;}
$("<div class='msbad' style='position: absolute; top:"+(m.top+35)+"px; left: "+l+"px; background-color: #c80000; '><a href='#' onclick='return alertbadHide(\""+hide_list+"\")'><img src='http://blog.ukrbiznes.com/img/close_div.gif'/></a><b>ub.Блоги</b><br/><br/>"+text+"</div>").appendTo("body");}
function alertbadHide(hide_list){if(hide_list){arrayId=hide_list.split(",");for(var i=0;i<arrayId.length;i++){$("#"+arrayId[i]).css("visibility","visible");}}
$(".msbad").fadeOut("fast",function(){$(".msbad").remove();});return false;}
function show_label_form(){$("div.add_label_form").show();}
function add_to_cart(id,rozdil){$.get("http://www.ukrbiznes.com/web_files/add_to_myitems.php",{action:"add_to_cart",id:id,rozdil:rozdil},function(data){if(data=='noreg')show_registration_form('Сервисом "В мои вещи" могут пользоваться только зарегистрированные пользователи','');if(data=='OK'){if(rozdil==9)alert("Этот товар добавлен в мои вещи");if(rozdil==8)alert("Это объявление добавлено в мои вещи");if(rozdil==4)alert("Эта фотонрафия добавлена в мои вещи");if(rozdil==1)alert("Это предприятие добавлено в мои вещи");if(rozdil==5)alert("Эта новость добавлена в мои вещи");if(rozdil==55)alert("Эта новость компании добавлена в мои вещи");if(rozdil==12)alert("Эта статья добавлена в мои вещи");if(rozdil==7)alert("Этот сайт добавлен в мои вещи");reload_header_myitems();}
if(data=='incart'){if(rozdil==9)alert("Этот товар уже есть в мои вещах");if(rozdil==8)alert("Это объявление уже есть в мои вещах");if(rozdil==4)alert("Эта фотонрафия уже есть в мои вещах");if(rozdil==1)alert("Это предприятие уже есть в мои вещах");if(rozdil==5)alert("Эта новость уже есть в мои вещах");if(rozdil==55)alert("Эта новость компании уже есть в мои вещах");if(rozdil==12)alert("Эта статья уже есть в мои вещах");if(rozdil==7)alert("Этот сайт уже есть в мои вещах");}
if(data=='error')alert("Ошибка при добавлении");});return;} 
(function($){$.ifixpng=function(customPixel){$.ifixpng.pixel=customPixel;};$.ifixpng.getPixel=function(){return $.ifixpng.pixel||'index_files/images/pixel.gif';};var hack={ltie7:$.browser.msie&&$.browser.version<7,filter:function(src){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";}};$.fn.ifixpng=hack.ltie7?function(){return this.each(function(){var $$=$(this);var base=$('base').attr('href');if($$.is('img')||$$.is('input')){if($$.attr('src')){if($$.attr('src').match(/.*\.png([?].*)?$/i)){var source=(base&&$$.attr('src').substring(0,1)!='/')?base+$$.attr('src'):$$.attr('src');$$.css({filter:hack.filter(source),width:$$.width(),height:$$.height()}).attr({src:$.ifixpng.getPixel()}).positionFix();}}}else{var image=$$.css('backgroundImage');if(image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)){image=RegExp.$1;$$.css({backgroundImage:'none',filter:hack.filter(image)}).children().children().positionFix();}}});}:function(){return this;};$.fn.iunfixpng=hack.ltie7?function(){return this.each(function(){var $$=$(this);var src=$$.css('filter');if(src.match(/src=["']?(.*\.png([?].*)?)["']?/i)){src=RegExp.$1;if($$.is('img')||$$.is('input')){$$.attr({src:src}).css({filter:''});}else{$$.css({filter:'',background:'url('+src+')'});}}});}:function(){return this;};$.fn.positionFix=function(){return this.each(function(){var $$=$(this);var position=$$.css('position');if(position!='absolute'&&position!='relative'){$$.css({position:'relative'});}});};})(jQuery); 
function reg_get_page_height()
{var h;if(document.height)
h=document.height;else
{if(document.body.scrollHeight)
h=document.body.scrollHeight;else
{if(document.body.style.pixelHeight)
h=document.body.style.pixelHeight;}}
return h;}
function regClientWidth()
{return document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientWidth:document.body.clientWidth;}
function regClientHeight()
{return document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight;}
$(document).ready(function(){$("body").prepend('<div id="reg_hide_page">&nbsp;</div>');$(window).keydown(function(event){switch(event.keyCode){case 27:hide_registration_form();break;}});});var registration_hide_elements;function show_registration_form(text,to_link)
{window.location.hash='#top';registration_hide_elements=$("object, iframe:visible, select:visible, .reg_form_hide_this");registration_hide_elements.hide().css("display",'none');$("#reg_pop_form .reg_content .regmessage").text(text);$("#reg_hide_page").height(reg_get_page_height()).show();$("#reg_pop_form table.regmain").css("top",(250));$("#reg_pop_form .reg_content form").attr("action",to_link);$("#reg_pop_form").show();$('.regimgpng').ifixpng();$("#reg_pop_form .reg_content .regform input[name=login]").get(0).focus();}
function show_registration_form_uf(text,link_arr)
{window.location.hash='#top';registration_hide_elements=$("object, iframe:visible, select:visible");registration_hide_elements.hide();$("#reg_pop_form .reg_content .regmessage").text(text);$("#reg_hide_page").height(reg_get_page_height()).show();$("#reg_pop_form table.regmain").css("top",(250));$("#reg_pop_form .reg_content form").attr("action","");$("#reg_pop_form .reg_content form").append("<input type='hidden' name='to_urlf' value="+link_arr[1]+"  />");$("#reg_pop_form .reg_content form").append("<input type='hidden' name='to_urlu' value="+link_arr[2]+"  />");$("#reg_pop_form").show();$('.regimgpng').ifixpng();$("#reg_pop_form .reg_content .regform input[name=login]").get(0).focus();}
function hide_registration_form()
{$("#reg_pop_form").hide();$("#reg_hide_page").hide();$("#reg_pop_form .reg_content .regmessage").text("");$("#reg_pop_form .reg_content .regmessage form").attr("action",'');registration_hide_elements.show();} 
var is_hide_all_serv=true;$(document).ready(function(){$("#main_header_cont .header_png").ifixpng();header_show_what_reg();$(window).keydown(function(event){switch(event.keyCode){case 27:header_hide_sel_reg();break;}});$("#main_header_cont div.header_menu a.allmenu").click(function(){show_hide_serv();return false;});$("object").each(function(){$(this).find("embed").removeAttr('wmode');$(this).find("param[name=wmode]").attr('value','transparent');$(this).find("embed").attr('wmode','transparent');});});function show_hide_serv(){if(is_hide_all_serv){header_hide_premiumbanner();$("#main_header_cont div.header_menu div.toallmenu").show();$("#header_arr_img").css("background-position",'top');is_hide_all_serv=false;}else{$("#main_header_cont div.header_menu div.toallmenu").hide();header_show_premiumbanner();$("#header_arr_img").css("background-position",'bottom');is_hide_all_serv=true;}}
function header_hide_premiumbanner(){var h=$("#premiumbanner_id1").height();$("#premiumbanner_id1").css("height",h+"px");$("#premiumbanner_id1").append("<span id='tempspan'>&nbsp;</span>");$("#premiumbanner_id2").hide();if($("#premiumbanner_id2").get(0)==null)$("#"+hide_this_element_n+"").hide();}
function header_show_premiumbanner(){$("#premiumbanner_id1 span#tempspan").remove();$("#premiumbanner_id2").show();$("#premiumbanner_id1").css("height","auto");if($("#premiumbanner_id2").get(0)==null)$("#"+hide_this_element_n+"").show();}
function header_get_page_height()
{var h;if(document.height)
h=document.height;else
{if(document.body.scrollHeight)
h=document.body.scrollHeight;else
{if(document.body.style.pixelHeight)
h=document.body.style.pixelHeight;}}
return h;}
function header_show_what_reg(){$("body").prepend('<div id="header_hige_page"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></div>');$("body").prepend('<div id="header_sel_reg" align="center"><table cellpadding="0" cellspacing="0"><tr height="7px"><td style="background:url(http://www.ukrbiznes.com/header_files/img/regtl.png) no-repeat;" width="7px" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td><td style="background:url(http://www.ukrbiznes.com/header_files/img/trep.png) repeat-x" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td><td style="background:url(http://www.ukrbiznes.com/header_files/img/regtr.png) no-repeat;" width="7px" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td></tr><tr height="7px"> <td style="background:url(http://www.ukrbiznes.com/header_files/img/lrep.png) repeat-y;" width="7px" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td><td><div style="background-color:white; padding:15px;"> <div class="header_close_pop"><a href="#">Закрыть окно</a></div><div class="header_sel_fild"><input type="radio" value="1" name="hhsel" id="header_s1" checked="checked" /><a href="http://ukrbiznes.com/register_firm_step1.php">Я хочу зарегистрировать свое предприятие в каталоге</a><a href="http://www.ukrbiznes.com/register.php"><img src="http://www.ukrbiznes.com/header_files/img/que.gif" /></a></div><div class="header_sel_fild"><input type="radio" value="2" name="hhsel" id="header_s2" /><a href="http://ukrbiznes.com/register_user_step1.php">Я хочу зарегистрироваться как обычный пользователь</a><a href="http://www.ukrbiznes.com/register.php"><img src="http://www.ukrbiznes.com/header_files/img/que.gif" /></a><div class="header_sel_des">Завести почту, получить блог, комментировать портал...</div></div><div class="header_sel_but" align="center"><input type="button" value="Регистрация" />&nbsp;&nbsp;<input type="button" value="Отмена" /></div></div></td><td style="background:url(http://www.ukrbiznes.com/header_files/img/rrep.png) repeat-y;" width="7px" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td></tr><tr height="7px"><td style="background:url(http://www.ukrbiznes.com/header_files/img/regbl.png) no-repeat;" width="7px" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td><td style="background:url(http://www.ukrbiznes.com/header_files/img/brep.png) repeat-x;" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td><td style="background:url(http://www.ukrbiznes.com/header_files/img/regbr.png) no-repeat;" width="7px" class="headerregimgpng"><img src="http://www.ukrbiznes.com/header_files/img/pixel.gif" /></td></tr></table></div>');}
var is_hide_header_ext_search=false;function header_ext_search()
{if(is_hide_header_ext_search)
{$("#header_menu_sel").hide();$("#header_ext_search").show();$(".header_ext_search").html('свернуть');is_hide_header_ext_search=false;}
else
{$("#header_ext_search").hide();$("#header_menu_sel").show();$(".header_ext_search").html('больше');is_hide_header_ext_search=true;}}
var header_in_hide;function header_show_sel_reg(){header_in_hide=$("object:visible, iframe:visible,select:visible");header_in_hide.hide();var h=header_get_page_height();$("#header_hige_page").css('height',h).show();$("#header_sel_reg").show();$(".headerregimgpng").ifixpng();$("#header_sel_reg div.header_sel_but input").click(function(){var index=$("#header_sel_reg div.header_sel_but input").index(this);if(index==1)
header_hide_sel_reg();else{var val=$("#header_sel_reg div.header_sel_fild input:checked").attr("value");if(val==1)window.location.href="http://www.ukrbiznes.com/register_firm_step1.php";if(val==2)window.location.href="http://www.ukrbiznes.com/register_user_step1.php";}
return false;});$("#header_sel_reg div.header_close_pop a").click(function(){header_hide_sel_reg();return false;});}
function header_hide_sel_reg(){header_in_hide.show();$("#header_hige_page").hide();$("#header_sel_reg").hide();} 
