$(document).ready(function(){

$("#header ul li a").each(function(i){
	$(this).prepend('<sup></sup>');
	$(this).append('<sub></sub>');
});
$("#footer ul li a").each(function(i){
	$(this).prepend('<sup></sup>');
	$(this).append('<sub></sub>');
});
$("#header ul li a, #footer ul li a").hover(function(){
$(this).addClass("hover");
},function(){
$(this).removeClass("hover");
});	
$("#infoblocks a").eq('1').css({margin: '0 11px'});

//replace ();
function replace (){
$(".cats .cat").each(function(i){
	$(this).append("<div>&nbsp;</div>");
});

$(".cats .cat span").each(function(i){
	var sp_id = $(this).attr("id");
	$(".cats").children("a."+sp_id).clone().append(".cats .cat #"+sp_id).parent(".cat").children("div");
});

}


$(".cats .cat").click(function(){

$(".cats a").slideUp("slow");

var span_id = $(this).children("span").attr("id");
$(this).parent(".cats").children("a."+span_id).slideDown("slow");



//$(this).children("a").slideDown("slow");

$(".cats div").removeAttr("id");
$(this).attr("id" , "this");

});




$(".cpt_product_lists form").hover(function(){
$(this).children(".item").attr("id" , "thisitem");
	},function(){
$(this).children(".item").removeAttr("id");
});

$(".vote form p").click( function() {
	var way = $(".vote form p");
	way.removeClass("selected");
	way.children("input[@type='radio']").removeAttr("checked");
	$(this).parent("form").children(".inp-text21").children("input").attr("disabled","disabled");
	//.val('');
	$(this).addClass("selected");
	$(this).children("input[@type='radio']").attr("checked","checked");

	if ($(this).children("input[@type='radio']").val() == 'else') {
		$(this).parent("form").children(".inp-text21").children("input").removeAttr("disabled");
	}
	else {
	//alert($(this).children("input[@type='radio']").val());
	}
});


	/*
	$("#micons li").hover(function(){
		$("#msq").css({display: "block"});
		var offset = $(this).offset();
		var tp = offset.top + 'px';
		var lt = offset.left + 'px';
		$("#msq").animate({top: tp, left: lt}, 100);
			},function(){
		$("#msq").css({display: "none"});
	});
	
	var off_l = $("#servicons").offset();
	$("#msq2").css({left: off_l.left+'px'});
	$("#servicons li").hover(function(){
		var offset = $(this).offset();
		var lt = offset.left + 'px';
		$("#msq2").animate({left: lt}, 100);
		$("#msq2").css({display: "block"});
			},function(){
		$("#msq2").css({display: "none"});
	});
	
	$(window).resize( function() { 
		lenta();
	} );
	lenta();
	
	function lenta (){
		var lenta_m = $("#redblock").height() - 315;
		$("#lenta .m").css({height: lenta_m+'px'});
	}
	
	
	$("#button").hover(function(){
		$(this).css({backgroundPosition: "0px -26px"});
			},function(){
		$(this).css({backgroundPosition: "0px 0px"});
	});	
	$("#topmenu li a ").hover(function(){
		$(this).children("span, sub, sup").addClass("hover");
			},function(){
		$(this).children("span, sub, sup").removeClass("hover");;
	});	
	
	
	*/
	
	if ($.browser.opera) {
		$("input:text").css({padding: "0px"});
	}
});

