﻿jQuery(document).ready(function(){jQuery(".vote input, .list_question input").each(
function() {changeRadioStart(jQuery(this)); }); });
function changeRadio(el)
{ var el = el, input = el.find("input").eq(0); var nm=input.attr("name"); jQuery(".niceRadio input").each( function() { if(jQuery(this).attr("name")==nm) { jQuery(this).parent().removeClass("radioChecked"); } }); if(el.attr("class").indexOf("niceRadioDisabled")==-1) { el.addClass("radioChecked"); input.attr("checked", true); } return true; } function changeVisualRadio(input) { var wrapInput = input.parent(); var nm=input.attr("name"); jQuery(".niceRadio input").each( function() { if(jQuery(this).attr("name")==nm) { jQuery(this).parent().removeClass("radioChecked"); } }); if(input.attr("checked")) { wrapInput.addClass("radioChecked"); } } function changeRadioStart(el) { try { var el = el, radioName = el.attr("name"), radioId = el.attr("id"), radioChecked = el.attr("checked"), radioDisabled = el.attr("disabled"), radioTab = el.attr("tabindex"), radioValue = el.attr("value"); if(radioChecked) el.after("<span class='niceRadio radioChecked'>"+ "<input type='radio'"+ "name='"+radioName+"'"+ "id='"+radioId+"'"+ "checked='"+radioChecked+"'"+ "tabindex='"+radioTab+"'"+ "value='"+radioValue+"' /></span>"); else el.after("<span class='niceRadio'>"+ "<input type='radio'"+ "name='"+radioName+"'"+ "id='"+radioId+"'"+ "tabindex='"+radioTab+"'"+ "value='"+radioValue+"' /></span>"); if(radioDisabled) { el.next().addClass("niceRadioDisabled"); el.next().find("input").eq(0).attr("disabled","disabled"); } el.next().bind("mousedown", function(e) { changeRadio(jQuery(this)) }); el.next().find("input").eq(0).bind("change", function(e) { changeVisualRadio(jQuery(this)) }); if(jQuery.browser.msie) { el.next().find("input").eq(0).bind("click", function(e) { changeVisualRadio(jQuery(this)) }); } el.remove(); } catch(e) { } return true; }

$(document).ready(function(){
    $('#first_menu ul li').hover(
        function() {
            $(this).find('ul:first').stop(true, true);
            $(this).find('ul:first').slideDown();
            $(this).addClass("active");
        },
        function() {
            $(this).find('ul:first').slideUp('fast');
            $(this).removeClass("active");
        }
    );
});
$(document).ready(function(){
	$("#windowOpen").click(function(){
		$(".user_panel_login").toggle("fast");
		$(this).toggleClass("active");
		return false;
	});
	$(".windowclose").click(function(){
		$(".user_panel_login").toggle("fast");
		$(this).toggleClass("active");
		return false;
	});
});
  $(function() {
            
      $("input.foto_input_1").filestyle({ 
          image: "../images/choose-file.jpg",
          imageheight : 22,
          imagewidth : 82,
          width : 100
      });    
  });






$(document).ready(function(){
   $("input.niceCheck, #allow_subscribe, .niceCheckchec input").hide().after("<div class=\"cb\"></div>");
   $(":checked").next().addClass("checked");
   $("div.cb").click(function () {
      var input_cb = $(this).prev("input")
      if (input_cb.is(':checked'))
      {
         $(this).removeClass("checked");
         input_cb.attr('checked', false);
      }
      else 
      {
         $(this).addClass("checked");
         input_cb.attr('checked', true);
      }
   });
});












obj_hours=document.getElementById("hours");
 
name_month=new Array ("Января","Февраля","Марта", "Апреля","Мая", "Июня","Июля","Августа","Сентября", "Октября","Ноября","Декабря");
name_day=new Array ("Воскресенье","Понедельник", "Вторник","Среда","Четверг", "Пятница","Суббота");
 
function wr_hours()
{
time=new Date();
 
time_sec=time.getSeconds();
time_min=time.getMinutes();
time_hours=time.getHours();
time_wr=((time_hours<10)?"0":"")+time_hours;
time_wr+=":";
time_wr+=((time_min<10)?"0":"")+time_min;
 
time_wr=""+time_wr+", "+name_day[time.getDay()]+" "+time.getDate()+" "+name_month[time.getMonth()];
 
obj_hours.innerHTML=time_wr;
}
 
wr_hours();
setInterval("wr_hours();",1000);
