$(function($) {

      $('.jclock').jclock();
      $(".g_main").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		visible: 5,
 	    circular: false
    });	  
    });

$(document).ready(function(){
 	    $(".btn-slide").click(function(){
		$("#panel").slideToggle("slow");
		$(this).toggleClass("active"); return false;});
});

function region(value) { 
    $("#slider").fadeOut("slow", function() {
    $("#slider").html($("#result"+value).html());
    $("#slider").fadeIn("fast");
    $.cookie('region', value, { expires: 30 });	  	
  });
}

function hover(value) { 
$("#title_gal").html($("#title"+value).html());
}

function unhover(value) { 
$('#title_gal').empty();
}

function hover2(value) { 
$("#menu-center").html($("#an"+value).html());
}

function unhover2(value) { 
$('#menu-center').empty();
}	
	


function rub(value) { 
    $("#result").fadeOut("slow", function() {
      $("#rub li span").removeClass("current");
      $('#loading').html("<center><img src=images/loading.gif style='margin-top:50px; '></center>");
      $("#item"+value).addClass("current");     
      $("#result").load("select2.php?rub="+value, function () {
      $('#loading').empty();
      $("#result").fadeIn("fast");
      $.cookie('rub', value, { expires: 30 });	  
      });     });    }

function doload4(value) { 
      $("#top_show").fadeOut("slow", function() {
      $("#show1 span").addClass("st6");     
      $('#show_load').html("<center><img src=images/loading.gif style='margin-top:45px; '></center>");
      $("#show1 span#sh"+value).removeClass("st6");
      $("#show1 span#sh"+value).addClass("st3");     
      $("#top_show").load("select4.php?id="+value, function () {
      $('#show_load').empty();
      $("#top_show").fadeIn("fast");
      });     });    }
	  
 function doload5(value) { 
      $("#top_com").fadeOut("slow", function() {
      $("#com1 span").addClass("st6");     
      $('#com_load').html("<center><img src=images/loading.gif style='margin-top:45px; '></center>");
      $("#com1 span#co"+value).removeClass("st6");
      $("#com1 span#co"+value).addClass("st3");     
      $("#top_com").load("select5.php?id="+value, function () {
      $('#com_load').empty();
      $("#top_com").fadeIn("fast");
      });     });    }	  
	  
 function reg_lenta(value) { 
      $("#lenta_news").fadeOut("slow", function() {
      $("#reg_ch span").addClass("st6");     
      $("#lenta_load").html("<center><img src=images/loading.gif style='margin-top:240px; '></center>");
      $("#reg_ch span#reg"+value).removeClass("st6");
      $("#reg_ch span#reg"+value).addClass("st3");     
      $("#lenta_news").load("select_reg.php?id="+value, function () {
      $("#lenta_load").empty();
      $("#lenta_news").fadeIn("fast");
      $.cookie('reg1', value, { expires: 30 });	  	
      });     });    }	  

jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};