﻿// JavaScript Document
function confirm_check(url,mess)
{
	anser=confirm(mess)
	
	if(anser==true)
		window.location = url
}
function linkto(url) {
    window.location = url
}

var index = 0;
var indexhoatdong = 0;

function showslide() {

    divclass = ".line" + index;
    $(divclass).fadeOut("slow");
    if (index == $(".logoline").length) {
        index = 0;
    }
    index = index + 1;
    divclass = ".line" + index;
    $(divclass).fadeIn("slow");

    setTimeout("showslide()", 3000);
}

function showhoatdongslide() {
    divclass = ".otherline" + indexhoatdong;
    $(divclass).fadeOut("slow");
    if (indexhoatdong == $(".hoatdongline").length) {
        indexhoatdong = 0;
    }
    indexhoatdong = indexhoatdong + 1;
    divclass = ".otherline" + indexhoatdong;
    $(divclass).fadeIn("slow");

    setTimeout("showhoatdongslide()", 6000);
}

$(document).ready(function () {

    $('#txtsearch').click(function () {
        $('#txtsearch').val("");
    })

    $('#txtsearch').blur(function () {
        $('#hidden-search').val($('#txtsearch').val());
        $('#txtsearch').val("Tìm kiếm ...");
    })

    var hcol1 = $(".dung-sidebar").height();
    var hcol2 = $(".dung-maincontent-show").height();
    var maxcol = Math.max(hcol1, hcol2);

    $(".dung-sidebar").height(maxcol);
    $(".dung-maincontent-show").height(maxcol);

    showslide();
    showhoatdongslide();

});
