var nWinExist=0; // признак открытия доп.окна
var nWinBExist=0; // признак открытия большого доп.окна
var nWinExistXY=0; // признак открытия доп.окна с координатами
var name_field;
var nPostidEx=-1; // уже открытая форма комментариев

var aCharts = new Array("175", "179", "180");
var aCharts_BK = new Array("181", "182", "183");
var aCharts_BMO = new Array("184", "185", "186", "187");

function setActive(chartname,charts,value) {
     document.getElementById(chartname).src = "http://kotirovki.in.ua/graph/graphs.php?g=" + charts[value];
}

function init() {
   // float-кнопки слева
   var cBrow = document.getElementById('browser').getAttribute('name');
   var nLeftDop = 0;
   $('.float_fix').css("display", "block");
   if (cBrow == 'firefox')
     nLeftDop = 0;
   //var fl_left = parseInt($("#page_table").css("width").substring(0,$("#page_table").css("width").indexOf("px"))) + nLeftDop + "px";
   /* этот блок для подвижного float-div
   var fl_left = ($(window).width() - parseInt($("#page_table").css("width").substring(0,$("#page_table").css("width").indexOf("px"))))/2 + nLeftDop + "px";
   var fl_top = $(window).height() + $(document).scrollTop() - 275 + "px";
   $('.float').css("top", fl_top);
   $('.float').css("left", fl_left);
   $('.float').css("display", "block");
   $(window).scroll(function () { 
      fl_left = ($(window).width() - parseInt($("#page_table").css("width").substring(0,$("#page_table").css("width").indexOf("px"))))/2 + nLeftDop + "px";
      fl_top = $(window).height() + $(document).scrollTop() - 275 + "px";
	  $('.float').css("left", fl_left);
  	  $('.float').animate({top:fl_top},30);
	  //$('.float').animate({top:fl_top},{duration:20});
   });
   $(window).resize(function () { 
      fl_left = ($(window).width() - parseInt($("#page_table").css("width").substring(0,$("#page_table").css("width").indexOf("px"))))/2 + nLeftDop + "px";
      fl_top = $(window).height() + $(document).scrollTop() - 275 + "px";
	  $('.float').css("left", fl_left);
  	  $('.float').animate({top:fl_top},25);
   });
   */
   $(".float_fix").click(function(){
	 winopxysc('./modules/mult.php',650,820);
   });
   // скроллинг
   $('#content_news').cycle({ 
   fx:     'scrollHorz',
   easing: 'easeInOutExpo',
   prev:   '#prev',
   next:   '#next',
   height: 1300,
   timeout: 100000
   });
   $('#content_obyaz').cycle({ 
   fx:     'scrollHorz',
   easing: 'easeInOutExpo',
   prev:   '#prev_obyaz',
   next:   '#next_obyaz',
   height: 900,
   timeout: 100000
   });
   $("#c_1").css("display", "block");
   //закругляем углы
   $('div.inside').wrap('<div class="outer"></div>');
   $("#inside").corner("round 8px").parent().css('padding','2px').corner("round 10px");
   $(".block-tagadelic").corner("round 8px");
   $("#nbu").corner("round 8px");
   $("#radio").corner("round 8px");
   $("#blog_anonce").corner("round 8px");
   $(".block").corner("round 8px");
   $(".top").corner("corners top round 8px");
   $(".reklama_vajno").corner("round 6px");
   $(".informer").corner("round 3px");
   $("#page_table").corner("round 3px");
   $("#window_a").corner("round 6px");

   // функции fisheye
   $('#fisheye').css("display","block");
   $("#fisheye").hover(function() {
	 $(this).css({'z-index' : '10'});
		$(this).css('margin-left', '-50px');
		$("#aCharts").animate({
			width: '250px',
			height: '200px'
		}, 400);
   }, function() {
		$(this).css({'z-index' : '0'});
		$(this).css('margin-left', '0px');
		$("#aCharts").animate({
			width: '200px',
			height: '200px'
		}, 250);
   });
   // функции всплывающих окон
   $('#windowMax').hide();
   $('#wSetting').bind(
	   'click',
		function(event) {
			if ($('#window').css('display') == 'none') {
              if (window.event) {
                evt = window.event;
                if (evt.pageX) {
                  nX = evt.pageX;
                  nY = evt.pageY;
                }    		  
      		    else if (evt.clientX) {
    		      nX = evt.clientX + document.body.scrollLeft - document.body.clientLeft;
    		      nY = evt.clientY + document.body.scrollTop - document.body.clientTop;
    		      if (document.body.parentElement && document.body.parentElement.clientLeft) {
                    var bodParent = document.body.parentElement;
                    nX += bodParent.scrollLeft - bodParent.clientLeft; 
                    nY += bodParent.scrollTop - bodParent.clientTop; 
                  }
                }
              }
    		  else {
    		    nX = event.pageX;
    		    nY = event.pageY;
    		  }
    		  var nTop = nY - 140;
     		  nTop +=  'px';
			  $('#window').animate({opacity: "show", top: nTop}, "slow");
			  loadOptions();
		      $('#window').show();
			}
		}
	);
	$('#windowClose').bind(
		'click',floatWindowClose);
	$('#windowMin').bind(
		'click',
		function()
		{
			$('#windowContent').SlideToggleUp(300);
			$('#window').animate({height:30},300).get(0).isMinimized = true;
			$(this).hide();
			$('#windowResize').hide();
			$('#windowMax').show();
		}
	);
	$('#windowMax').bind(
		'click',
		function()
		{
			var windowSize = $.iUtil.getSize(document.getElementById('windowContent'));
			$('#windowContent').SlideToggleUp(300);
			$('#window').animate({height:windowSize.hb+43}, 300).get(0).isMinimized = false;
			$(this).hide();
			$('#windowMin, #windowResize').show();
		}
	);
	$('#window').Resizable(
		{
			minWidth: 200,
			minHeight: 60,
			maxWidth: 700,
			maxHeight: 400,
			dragHandle: '#windowTop',
			handlers: {
				se: '#windowResize'
			},
			onResize : function(size, position) {
				var windowContentEl = $('#windowContent').css('width', size.width - 25 + 'px');
				if (!document.getElementById('window').isMinimized) {
					windowContentEl.css('height', size.height - 48 + 'px');
				}
			}
		}
	);
    $(window).resize(function () { 
      var aSizes = GetSizes();
      wWidth = aSizes.pageWidth + 'px';
      wHeight = aSizes.pageHeight + 120 + 'px';
      $("#wblack").css("width", wWidth).css("height", wHeight);
    });
	$('#windowClose_a').bind(
		'click',
        function(event) {		
            $("#wblack").css("display", "none");
			$('#window_a').hide();
		}
    );
}

// первая загрузка - реклама
function firstAdvert() {
  var cBrow = BrowserDetect.browser;
  var aSizes = GetSizes();
  wWidth = aSizes.pageWidth + 'px';
  wHeight = aSizes.pageHeight + 120+ 'px';
  if (cBrow == 'Explorer') {
    wSt = aSizes.winScrollTop + 300 + 'px';
    $("#window_a").css("top", wSt);
  }
  $("#wblack").css("width", wWidth).css("height", wHeight).css("display", "block");
  $('#window_a').animate({opacity: "show"}, "slow");
  $('#window_a').show();
  $('#windowClose_a').stopAll().fadeIn(30000,0, function(){$(this).show();});
}  

// работа с всплывающими окнами
function loadOptions() {
  $("#windowResult").hide();
  $("#windowContent").show();
  //$("#wFloatName").append("Наши новости:  Отправить ссылку");
  $("#window").css('width', '430px');
  $("#window").css('min-width', '430px');
}
function floatWindowClose() {
  $('#window').hide();
}
function make_senhref(inForm) {
  var useremail = inForm.useremail.value;
  var content = inForm.content.value;
  var sendemail = inForm.sendemail.value;
  var control = inForm.control.value;
  $.post('http://novosti.bvl.com.ua/sendhref.php',{useremail: useremail, content: content, sendemail: sendemail, control: control},function(data) {
    succesUpdate(data);
  }
  );
}
function succesUpdate(data) {
  $("#windowResult").empty();
  $("#windowContent").hide();
  $("#window").css('height', '150px');
  if (data!=0) {
    $("#control_numb").empty().append(data);
    $("#windowResult").append("<div style='height: 150px; text-align: center; padding: 90 0 0 0px;'><a class=text><b>Ваше сообщение успешно отправлено!</b></a></div>");
  }
  else {
    $("#windowResult").append("<div style='height: 150px; text-align: center; padding: 90 0 0 0px;'><a class=text><b>Ваше сообщение не отправлено!</b></a></div>");
  }
  $("#windowResult").show();
}
// конец работы со вспл.окнами

// окно для радио
function popupw(URL,w,h,uid,dp,id){ 
if(!w||w<100)w=100; 
if(!h||h<100)h=100; 
if(!id)id=''; 
var www;if(!uid) uid='';if(!dp) dp=''; 
www=window.open(URL+id,'aod'+uid,'width='+w+',height='+h+',top=0,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar =no,status=no,resizable=yes,left=60,screenX=60,top=100,screenY=100'+dp); 
return false; 
} 
function pppwnew(URL) {return popupw(URL, 390, 100, 'rambleraudioplayer', false, '');} 
// конец окна для радио

function ShowHide(pid1)
{
  var container = document.getElementById("tr_" + pid1);		
  if (container!=null)
  {
    if (container.style.display != "none")
      container.style.display = 'none';
    else
      container.style.display = 'block';
  }
}

function winop(cPage) {
 if (nWinExist==1) {
   windop.close();
   nWinExist=0;
 }
 windop = window.open(cPage,"mywin","toolbar=yes,resizable=yes,scrollbars=yes,height=500,width=700,left=100,top=30");
 nWinExist=1;
} 

function winopxy(cPage,nHeight,nWidth) {
// height +30 width +20 
 if (nWinExistXY==1) {
   windopxy.close();
   nWinExistXY=0;
 }
 windopxy = window.open(cPage,"mywin","toolbar=no,scrollbars=no,height="+nHeight+",width="+nWidth+",left=50,top=50");
 nWinExistXY=1;
}

function winopxysc(cPage,nHeight,nWidth) {
// height +30 width +20 
 if (nWinExistXY==1) {
   windopxy.close();
   nWinExistXY=0;
 }
 windopxy = window.open(cPage,"mywin","toolbar=no,scrollbars=yes,resizable=yes,height="+nHeight+",width="+nWidth+",left=100,top=30");
 nWinExistXY=1;
}

function winbop(cPage) {
 if (nWinBExist==1) {
   winbdop.close();
   nWinBExist=0;
 }
 winbdop = window.open(cPage,"mywinb","");
 nWinBExist=1;
}


function fconfirm(inForm)
{
  var cError="Форма не заполнена:";
  if (inForm.name=='forget_form')
  {
    if (inForm.useremail.value=='')
      cError=cError+"\n- Не введен E-mail";
    if (inForm.control.value=='')
      cError=cError+"\n- Не введено контрольное число";
  }  
  if (inForm.name=='message_form')
  {
    if (inForm.author.value=='')
      cError=cError+"\n- Вы не представились";
    if (inForm.useremail.value=='')
      cError=cError+"\n- Не введен E-mail";
    if (inForm.mescont.value=='')
      cError=cError+"\n- Нет текста сообщения";
    if (inForm.control.value=='')
      cError=cError+"\n- Не введено контрольное число";
  }  
  if (inForm.name=='gbook_form')
  {
    if (inForm.author.value=='')
      cError=cError+"\n- Вы не представились";
    if (inForm.useremail.value=='')
      cError=cError+"\n- Не введен E-mail";
    if (inForm.contgbook.value=='')
      cError=cError+"\n- Нет текста сообщения";
    if (inForm.control.value=='')
      cError=cError+"\n- Не введено контрольное число";
  }  
  if (inForm.name=='login_form')
  {
    if (inForm.username.value=='')
      cError=cError+"\n- Нет выражения для поиска";
  }
  if (inForm.name=='poisk_form')
  {
    if (inForm.poisk.value=='')
      cError=cError+"\n- Нет выражения для поиска";
  }
  if (inForm.name=='coment_form')
  {
    if (inForm.author.value=='')
      cError=cError+"\n- Вы не представились";
    if (inForm.useremail.value=='')
      cError=cError+"\n- Не введен E-mail";
    if (inForm.contcoment.value=='')
      cError=cError+"\n- Нет комментария";
  }  
  if (inForm.name=='new_blog_form')
  {
    if (inForm.content.value==0)
      cError=cError+"\n- Не выбрана категория";
    if (inForm.mainrazd.value==0)
      cError=cError+"\n- Не выбрана подкатегория";
    if (inForm.statusblog.value==0)
      cError=cError+"\n- Не выбран статус блога";
    if (inForm.nameblog.value=='')
      cError=cError+"\n- Нет названия блога";
    if (inForm.keywords.value=='')
      cError=cError+"\n- Нет ключевых слов";
    if (inForm.contblog.value=='')
      cError=cError+"\n- Нет текста блога";
    if (inForm.useremail.value=='')
      cError=cError+"\n- Не введен E-mail";
  }
  if (inForm.name=='sendhref_form')
  {
    if (inForm.sendemail.value=='')
      cError=cError+"\n- Не введен E-mail адресата";
    if (inForm.useremail.value=='')
      cError=cError+"\n- Не введен Ваш E-mail";
    if (inForm.content.value=='')
      cError=cError+"\n- Нет сообщения";
    if (inForm.control.value=='')
      cError=cError+"\n- Не введено контрольное число";
  }  
  if (cError!="Форма не заполнена:")
    alert (cError);
  else
  {
    if (confirm("Подтверждаете выполнение операции ?")) {
      if (inForm.name=='sendhref_form')
        make_senhref(inForm);
      else
        inForm.submit();
    }
  }
}


var hotkey=13;
var inFormObj;
if (document.layers)
  document.captureEvents(Event.KEYPRESS);

function confirmobj(inForm,inFormOb)
{
  if (confirm("Подтверждаете выполнение операции ?"))
  {
    inFormObj=inFormOb;
    inFormObj.value=true;
    inForm.submit();
  }
}  

function pressonoff(onoff,inFormOb)
{
  inFormObj=inFormOb;
  if (inFormObj==null)
  {
    document.onkeypress=null;
    return;
  }
  if (onoff==1)
    document.onkeypress=mypress;
  else
    document.onkeypress=null;
}

function mypress(key)
{
  if (document.layers)
  {
    if (key.which==hotkey)
      inFormObj.value=inFormObj.value+"<BR>";
  }
  else if (!document.all)
  {
    if (key.which==hotkey)
      inFormObj.value=inFormObj.value+"<BR>";
  }

  if (document.all)
  {
    if (event.keyCode==hotkey)
      inFormObj.value=inFormObj.value+"<BR>";
  }
}

function fnApplyTag(inForm, sTag) {
  if (inForm.name=='subrazd_form') {
    if (document.selection) 
       var selection = document.selection.createRange().text;
    else        
       var selection = inForm.anotac.value.substring(inForm.anotac.selectionStart, inForm.anotac.selectionEnd);
    inForm.anotac.value=inForm.anotac.value.replace(new RegExp(selection, ''), '['+sTag+']'+selection+'[/'+sTag+']');
  } else {
    if (document.selection) 
       var selection = document.selection.createRange().text;
    else        
       var selection = inForm.message.value.substring(inForm.message.selectionStart, inForm.message.selectionEnd);
    inForm.message.value=inForm.message.value.replace(new RegExp(selection, ''), '['+sTag+']'+selection+'[/'+sTag+']');
  }
}

function pastesmile_com(inForm,text)
{
  if (inForm) 
  {
    if (document.selection) { 
      if (name_field=='message') 
        inForm.message.focus();
      else
        inForm.ftitle.focus();
  	  
  	  inForm.document.selection.createRange().text = text;
    } 
    else {
      if (name_field=='message') 
        inForm.message.value += text;
      else
        inForm.ftitle.value += text;
    }
  }
}


function ShowHide_Com(pid1,pid2)
{
  var container1 = document.getElementById("ttr_" + pid1);		
  var container2 = document.getElementById("ttr_" + pid2);		
  var container3 = document.getElementById("ttr_3");		
  if (container1)
  {    
    if (container1.style.display != "none")
    {
    }   
    else
      container1.style.display = 'block';
  }
  if (container2)
  {    
    if (container2.style.display != "none")   
      container2.style.display = 'none';
  }
  if (container3)
  {    
    if (pid1==2)
    {
      if (container3.style.display != "none")   
      {
      }
      else  
        container3.style.display = 'block';
    }
    if (pid1==1)
    {
      if (container3.style.display != "none")   
        container3.style.display = 'none';
    }
  }
}

function chTab(nTab) 
{

  if (nTab==1) {
    $('#c_1').css('display', 'block');
    $('#c_2').css('display', 'none');
    $('#c_3').css('display', 'none');
    $('#c_4').css('display', 'none');
    $('#c_5').css('display', 'none');
//    $('#c_1').css('opacity', 0.3);
//    $('#c_1').stopAll().fadeTo(800,1, function(){$('#c_1').Show();});
    $('#tab1l').css('background', 'url(/images/tabwl.png) no-repeat');
    $('#tab1c').css('background', 'url(/images/tabwc.png)');
    $('#tab1r').css('background', 'url(/images/tabwr.png) no-repeat 100% 0%');
    $('#tab2l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab2c').css('background', 'url(/images/tabbc.png)');
    $('#tab2r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');

    $('#tab3l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab3c').css('background', 'url(/images/tabbc.png)');
    $('#tab3r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab4l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab4c').css('background', 'url(/images/tabbc.png)');
    $('#tab4r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab5l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab5c').css('background', 'url(/images/tabbc.png)');
    $('#tab5r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
  }
  if (nTab==2) {
    $('#c_2').css('display', 'block');
    $('#c_1').css('display', 'none');
    $('#c_3').css('display', 'none');
    $('#c_4').css('display', 'none');
    $('#c_5').css('display', 'none');
    $('#tab1l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab1c').css('background', 'url(/images/tabbc.png)');
    $('#tab1r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab2l').css('background', 'url(/images/tabwl.png) no-repeat');
    $('#tab2c').css('background', 'url(/images/tabwc.png)');
    $('#tab2r').css('background', 'url(/images/tabwr.png) no-repeat 100% 0%');

    $('#tab3l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab3c').css('background', 'url(/images/tabbc.png)');
    $('#tab3r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab4l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab4c').css('background', 'url(/images/tabbc.png)');
    $('#tab4r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab5l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab5c').css('background', 'url(/images/tabbc.png)');
    $('#tab5r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
  }
  if (nTab==3) {
    $('#c_3').css('display', 'block');
    $('#c_1').css('display', 'none');
    $('#c_2').css('display', 'none');
    $('#c_4').css('display', 'none');
    $('#c_5').css('display', 'none');
    $('#tab1l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab1c').css('background', 'url(/images/tabbc.png)');
    $('#tab1r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab3l').css('background', 'url(/images/tabwl.png) no-repeat');
    $('#tab3c').css('background', 'url(/images/tabwc.png)');
    $('#tab3r').css('background', 'url(/images/tabwr.png) no-repeat 100% 0%');
    
    $('#tab2l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab2c').css('background', 'url(/images/tabbc.png)');
    $('#tab2r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab4l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab4c').css('background', 'url(/images/tabbc.png)');
    $('#tab4r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab5l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab5c').css('background', 'url(/images/tabbc.png)');
    $('#tab5r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
  }
  if (nTab==4) {
    $('#c_4').css('display', 'block');
    $('#c_1').css('display', 'none');
    $('#c_2').css('display', 'none');
    $('#c_3').css('display', 'none');
    $('#c_5').css('display', 'none');
    $('#tab1l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab1c').css('background', 'url(/images/tabbc.png)');
    $('#tab1r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab4l').css('background', 'url(/images/tabwl.png) no-repeat');
    $('#tab4c').css('background', 'url(/images/tabwc.png)');
    $('#tab4r').css('background', 'url(/images/tabwr.png) no-repeat 100% 0%');
    
    $('#tab3l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab3c').css('background', 'url(/images/tabbc.png)');
    $('#tab3r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab2l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab2c').css('background', 'url(/images/tabbc.png)');
    $('#tab2r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab5l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab5c').css('background', 'url(/images/tabbc.png)');
    $('#tab5r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
  }
  if (nTab==5) {
    $('#c_5').css('display', 'block');
    $('#c_1').css('display', 'none');
    $('#c_2').css('display', 'none');
    $('#c_3').css('display', 'none');
    $('#c_4').css('display', 'none');
    $('#tab1l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab1c').css('background', 'url(/images/tabbc.png)');
    $('#tab1r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab5l').css('background', 'url(/images/tabwl.png) no-repeat');
    $('#tab5c').css('background', 'url(/images/tabwc.png)');
    $('#tab5r').css('background', 'url(/images/tabwr.png) no-repeat 100% 0%');
    
    $('#tab3l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab3c').css('background', 'url(/images/tabbc.png)');
    $('#tab3r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab4l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab4c').css('background', 'url(/images/tabbc.png)');
    $('#tab4r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
    $('#tab2l').css('background', 'url(/images/tabbl.png) no-repeat');
    $('#tab2c').css('background', 'url(/images/tabbc.png)');
    $('#tab2r').css('background', 'url(/images/tabbr.png) no-repeat 100% 0%');
  }
}

function LiteMainMenu(nDiv,lLite)
{
  if (lLite)
    $('#nMMDiv'+nDiv).css('background', 'url(/images/menugl.gif)');
  else
    $('#nMMDiv'+nDiv).css('background', 'url(/images/menug.gif)');
}

function LiteLeftMenu(nDiv,lLite)
{
  if (lLite)
    $('#nLMDiv'+nDiv).css('background', '#F4F8FB');
  else
    $('#nLMDiv'+nDiv).css('background', '#e6edf5');
}

function chPicture(cPicture,nWidth){
  cPicture = '"/images/content/'+cPicture+'.jpg"';
  var cDivContent = '<A href='+cPicture+' class=thickbox><IMG style="BORDER: #D9D9D9 1px solid; padding: 1px;" src='+cPicture+' width='+nWidth+' border=0 align=middle HSPACE=0 VSPACE=0 ALT="Увеличить изображение"></A>';    
  var cZoomContent = '<IMG SRC=/images/lupa.gif BORDER=0 ALIGN=middle HSPACE=2 WIDTH=16 HEIGHT=16 VSPACE=0><A HREF='+cPicture+' class=thickbox>увеличить изображение</A>';
  $("#cPicture").empty().hide();  
  $("#cPicture").append(cDivContent).show("slow");  
  $("#cZoom").empty();  
  $("#cZoom").append(cZoomContent);  
}

function chVajno(cPicture, nWidth, cHref, cOpisan, cZag, cDP){
  cPicture = '"/images/content/'+cPicture+'.jpg"';
  var cDivContent = '<A href='+cHref+'><IMG style="BORDER: #FFFFFF 1px solid;" src='+cPicture+' width='+nWidth+' border=0 align=middle HSPACE=0 VSPACE=0></A>';    
  var cDivZagol = '<A class=hrefw href='+cHref+'><b>'+cZag+'</b></A>';    
  var cDivOpisan = '<A class=greytext>'+cOpisan+'</A>';    
  var cDivDP = '<A class=textwhite11>'+cDP+'</A>';    
  $("#cPicture").empty().append(cDivContent);  
  $("#cVopisan").empty().append(cDivOpisan);  
  $("#cVzagol").empty().append(cDivZagol);  
  $("#cVDatePub").empty().append(cDivDP);  
}

function Comment_Div(nPostid) 
{
  if (nPostidEx >= 0) {
    if (nPostidEx != nPostid) 
      $('#comment_div'+nPostidEx).css('display', 'none');
    else
      $('#comment_div'+nPostidEx).hide("slow");  
    $('#nComHref'+nPostidEx).empty();  
    
    if (nPostidEx==0)
      $('#nComHref'+nPostidEx).append('Написать комментарий');  
    else
      $('#nComHref'+nPostidEx).append('Ответить');  
    if (nPostidEx == nPostid) {
      nPostidEx = -1;
      return;
    }
  }

  if (nPostidEx != nPostid) {
    $('#nComHref'+nPostid).empty();  
    $('#comment_div'+nPostid).show("slow");  
    $('#nComHref'+nPostid).append('Скрыть');  
    nPostidEx = nPostid;
  }
}

function informer_code(inForm, aRazdel, nCount){
  var inf_width = inForm.inf_width.value;
  var inf_height = inForm.inf_height.value;
  var inf_count = inForm.inf_count.value;

  var cParams = '<div style="width: ' + inf_width + 'px; height: ' + inf_height + ';"><iframe src="http://novosti.bvl.com.ua/informer.php?razdel=';
  var nValue = 'inForm.razdel999.value';
  if (eval(nValue) == 1) {
    cParams += 'all:';
  }
  else {
    for (i=0; i < nCount; i++) {
       nValue = 'inForm.razdel' + aRazdel[i] +'.value';
       if (eval(nValue) == 1) 
         cParams += eval(aRazdel[i]) + ':';  
    }
  }
  cParams += '&count=' + inf_count + '" width=100% height=100% frameborder=no scrolling=auto style="margin: 5 0 5 0px"></iframe></div>';
  var cCode = cParams;
  inForm.infcode.value = cCode;
  
  inForm.infcode.select();
  Copied = inForm.document.selection.createTextRange()();
  Copied.execCommand('Copy');
}

function informer_code_js(inForm, aRazdel, nCount){
  var cParams = '<script type="text/javascript"><!-- ';
  cParams += 'razdel = ';
  
  var nValue = 'inForm.razdel999.value';
  if (eval(nValue) == 1) {
    cParams += 'all;';
  }
  else {
    var lFirst = true;
    for (i=0; i < nCount; i++) {
       nValue = 'inForm.razdel' + aRazdel[i] +'.value';
       if (eval(nValue) == 1) {
         if (!lFirst) cParams += ',';
         else lFirst = false;
         cParams += eval(aRazdel[i]);  
       }
    }
    cParams += ';';  
  }
  cParams += ' //--></script><script type="text/javascript" src="http://novosti.bvl.com.ua/scripts/informer.js"></script>';

  var cCode = cParams;
  inForm.infcode.value = cCode;

  //inForm.infcode.select();
  //Copied = inForm.document.selection.createTextRange()();
  //Copied.execCommand('Copy');
}

function  GetSizes() {
    var w=document.documentElement; var d=document.body;
    var tww = document.compatMode=='CSS1Compat' && !window.opera?w.clientWidth:d.clientWidth;
    var twh = document.compatMode=='CSS1Compat' && !window.opera?w.clientHeight:d.clientHeight;
    var sl = (window.scrollX)?window.scrollX:(w.scrollLeft)?w.scrollLeft:d.scrollLeft;
    var st = (window.scrollY)?window.scrollY:(w.scrollTop)?w.scrollTop:d.scrollTop;
    var wW1 = (window.innerHeight && window.scrollMaxY)?d.scrollWidth:(d.scrollHeight > d.offsetHeight)?d.scrollWidth:(w && w.scrollHeight > w.offsetHeight)?w.scrollWidth:d.offsetWidth;
    var wH1 = (window.innerHeight && window.scrollMaxY)?d.scrollHeight:(d.scrollHeight > d.offsetHeight)?d.scrollHeight:(w && w.scrollHeight > w.offsetHeight)?w.scrollHeight:d.offsetHeight;
    var wW2 = (self.innerHeight)?self.innerWidth:(w && w.clientHeight)?w.clientWidth:d.clientWidth; var pW = (wW1 < wW2)?wW2:wW1;
    var wH2 = (self.innerHeight)?self.innerHeight:(w && w.clientHeight)?w.clientHeight:d.clientHeight; var pH = (wH1 < wH2)?wH2:wH1;
    pW = ($.browser.msie)?pW:Math.max(w.scrollWidth, w.clientWidth, d.scrollWidth, d.offsetWidth);
    pH = ($.browser.msie)?pH:Math.max(w.scrollHeight, w.clientHeight, d.scrollHeight, d.offsetHeight);
    if (window.opera){ tww = (d.scrollWidth==d.clientWidth)?w.clientWidth:tww; twh = (d.scrollHeight==d.clientHeight)?w.clientHeight:twh;}
    return { 
        winWidth:tww, 
        winHeight: twh, 
        winScrollLeft: sl, 
        winScrollTop: st, 
        pageWidth: pW, 
        pageHeight: pH
    } 
}

// - End of JavaScript - -->

