/*тут небольшие скрипты*/

$(document).ready(function() {

    $('.frame_100').ifixpng();
    $('.frame_150 span').ifixpng();
    $('.d_main_img span').ifixpng();
    $('.stars a').ifixpng();
    $('.stars div').ifixpng();
    $('.vid_large_pic span').ifixpng();

    $("#footer_text").focus(function () {
        if($(this).attr("value") == "Поиск") {
            $(this).css('color','#000');
            $(this).attr("value","");
        }
    });
    $("#footer_text").blur(function () {
        if($(this).attr("value") =="") {
            $(this).css('color','#999');
            $(this).attr("value","Поиск");
        }
    });

    $("#b_h_f_s_text").focus(function () {
        if($(this).attr("value") == "Поиск") {
            $(this).css('color','#000');
            $(this).attr("value","");
        }
    });
    $("#b_h_f_s_text").blur(function () {
        if($(this).attr("value") =="") {
            $(this).css('color','#999');
            $(this).attr("value","Поиск");
        }
    });

    $("#m_h_a_r_t_text").focus(function () {
        if($(this).attr("value") == "Поиск") {
            $(this).css('color','#000');
            $(this).attr("value","");
        }
    });
    $("#m_h_a_r_t_text").blur(function () {
        if($(this).attr("value") =="") {
            $(this).css('color','#999');
            $(this).attr("value","Поиск");
        }
    });

    $("#input_openid").focus(function () {
        if($(this).attr("value") == "Например: user.livejournal.com") {
            $(this).css('color','#000');
            $(this).attr("value","");
        }
    });
    $("#input_openid").blur(function () {
        if($(this).attr("value") =="") {
            $(this).css('color','#999');
            $(this).attr("value","Например: user.livejournal.com");
        }
    });

$(".s_w_left").hover(function () {
    $(this).css("background-position", "left bottom");
}, function () {
    $(this).css("background-position", "left top");
    });

$(".s_w_right").hover(function () {
    $(this).css("background-position", "left bottom");
}, function () {
    $(this).css("background-position", "left top");
    });
$(".r_d_c_left").hover(function () {
    $(this).css("background-position", "left bottom");
}, function () {
    $(this).css("background-position", "left top");
    });

$(".r_d_c_right").hover(function () {
    $(this).css("background-position", "left bottom");
}, function () {
    $(this).css("background-position", "left top");
    });

$("textarea, .f_none div input:not('.sm_send_details div div label input')").focus(function () {
   $(this).css("border","1px solid #2a98d3");
   $(this).css("background","#fafcfc");
   $(this).css("color", "#000");
});
$("textarea, .f_none div input:not('.sm_send_details div div label input')").blur(function () {
   $(this).css("border","1px solid #ABC3CF");
   $(this).css("background","#EFF4F6");
   $(this).css("color", "#999");
});


slider_wide("carousel_00");
slider_wide("carousel_01");
slider_wide_second("carousel_second_00");
slider_wide_third("carousel_third_00");

});
var ar_positions = new Array();
ar_positions["carousel_00"] = 0;
ar_positions["carousel_01"] = 0;

var ar_positions_second = new Array();
ar_positions_second["carousel_second_00"] = 0;

var ar_positions_third = new Array();
ar_positions_third["carousel_third_00"] = 0;

/*1-й слайдер*/
function slider_wide (name) {
    $("#" + name + " .s_w_right").click(function () {
        if (ar_positions[name] < $("#" + name + " .s_w_inner ul li").length - 3) {
            $("#" + name + " .s_w_inner ul").animate({left: '-=813px'}, 1000 );
            ar_positions[name] += 3;
        }
    });

    $("#" + name + " .s_w_left").click(function () {
        if (ar_positions[name] > 0) {
           $("#" + name + " .s_w_inner ul").animate({left: '+=813px'}, 1000 );
           ar_positions[name] -= 3;
        }
    });
}

/*2-й слайдер*/
function slider_wide_second (name) {
    $("#" + name + " .w_s_s_right").click(function () {
        if (ar_positions_second[name] < $("#" + name + " .w_s_s_inner ul li").length - 5) {
            $("#" + name + " .w_s_s_inner ul").animate({left: '-=186px'}, 700 );
            ar_positions_second[name]++;
        }
    });

    $("#" + name + " .w_s_s_left").click(function () {
        if (ar_positions_second[name] > 0) {
           $("#" + name + " .w_s_s_inner ul").animate({left: '+=186px'}, 700 );
           ar_positions_second[name]--;
        }
    });
}

/*3-й слайдер*/
function slider_wide_third (name) {
    $("#" + name + " .r_d_c_right").click(function () {
        if (ar_positions_third[name] < $("#" + name + " .r_d_c_inner ul li").length - 4) {
            $("#" + name + " .r_d_c_inner ul").animate({left: '-=120px'}, 700 );
            ar_positions_third[name]++;
        }
    });

    $("#" + name + " .r_d_c_left").click(function () {
        if (ar_positions_third[name] > 0) {
           $("#" + name + " .r_d_c_inner ul").animate({left: '+=120px'}, 700 );
           ar_positions_third[name]--;
        }
    });
}