﻿// JavaScript Document
$(function() {
    $(".anyClass").jCarouselLite({
        auto: 800,
        speed: 1000,
        visible: 3,
        vertical: true

    });
});

$(function() {
    $("#partner").jCarouselLite({
        btnNext: ".next-p",
        btnPrev: ".prev-p",
        visible: 5
    });
});

$(function() {
    $("#tab-moi").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        visible: 4
    });
});

$(function() {
    $("#tab-banchay").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        visible: 4
    });
});

$(document).ready(function() {
    //Default Action
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content


    //On Click Event
    $("ul.tabs li").click(function() {
        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active content
        return false;
    });


});

function SetText() {
    if (this.document.getElementById("txtContentSearch").value == "")
        this.document.getElementById("txtContentSearch").value = ":: Nhập nội dung";
}
function ClearText() {
    if (this.document.getElementById("txtContentSearch").value == ":: Nhập nội dung")
        this.document.getElementById("txtContentSearch").value = "";
}
function toSearch() {
    var txtS = document.getElementById("txtContentSearch").value;
    if (txtS != "" && txtS != ":: Nhập nội dung")
        window.location = "/Page/Tim-kiem-tin-tuc.aspx?key=" + txtS + "&searchmode=anyword";
    else {
        alert('+ Bạn chưa nhập nội dung tìm kiếm.');
        return false;
    }
}
function runScript(e) {
    if (e.keyCode == 13) {
        toSearch();
        return false;
    }
}
