$(function(){

    $("#carousel-rotator").jCarouselLite({
        btnNext: "#carousel-wrapper .right-button",
        btnPrev: "#carousel-wrapper .left-button",
        circular: true,
        visible: Math.min($("#carousel li").length, 7)
    });

    $("input[placeholder]").each(function(){
		var inp = $(this);
		BindEvents(inp, inp.attr("placeholder"));
	});
	
	$(".side-news .news-item:last").css({background: "none"});
	$("#opt-categories li:last").css({border: "none"});
	
	//if ((((Object.prototype.toString.call(window.opera)=='[object Opera]')||(/a/.__proto__=='//')||('MozOpacity' in document.body.style))&&(!document.querySelector))||(m=/*@cc_on!@*/0)||(((/source/.test(/a/.toString+''))||(window.chrome))&&(!window.openDatabase))){
		//$(".currency").html("Р");
	//}

});


function BindEvents(field, defaultValue) {
	field.val(defaultValue);
	field.focus(function() {
		if ($(this).val() == defaultValue) {
			$(this).val("");
		}
	}).blur(function() {
		if ($(this).val() == "") {
			$(this).val(defaultValue);
		}
	});
}
