﻿//--- Menu Top ----
$(document).ready(function () {
  $('.sub').hide();
  $('#nav li.mntop').each(function(){
    var li=$(this);
    li.hover(function(){
        li.children('.sub').show();
        li.children('a').addClass("ihover");
    },function(){
        li.children('.sub').hide();
        li.children('a').removeClass("ihover");
    });
  });
});

//-- Tab Home BDS ---
$(document).ready(function() {
    //When page loads...
    $(".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 href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        return false;
    });

});

//--- Onclick Enter ---
function doClick(buttonName,e)
{
    var key;
    if(window.event)
        key = window.event.keyCode;     //IE -
    else
        key = e.which;     //firefox
    if (key == 13)
    {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(buttonName);
        if (btn != null)
        { 
            //If we find the button click it
            btn.click();
            event.keyCode = 0
        }
    }
}

//------- Xem bản đồ
 function viewmap(id)
{
    window.open('googlemap.aspx?id='+ id,"",'resizable=1,HEIGHT=600,WIDTH=800,top=0' + ((screen.height - 800)/2) + ',left=' + ((screen.width - 684)/2));	        
}
//-------- Thêm bản đồ
function Updatemap()
{
    window.open('UpdateGoogleMap.aspx',"",'resizable=1,HEIGHT=485,WIDTH=640,top=0' + ((screen.height - 800)/2) + ',left=' + ((screen.width - 684)/2));	        
}
//--- Xem ảnh lớn
function LargerPicture(picName)
{
    window.open('viewImage.aspx?'+ picName,"",'resizable=1,HEIGHT=200,WIDTH=200,top=0' + ((screen.height - 800)/2) + ',left=' + ((screen.width - 684)/2));	        
}
function btnUpload1_onclick(Url) 
{
    window.open(Url,null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
}
// Tiện ích cần thiết
function banggiadat(){window.open('http://www.thanhnien.com.vn/_layouts/NgoaiTe.aspx','my_new_window','scrollbars=1, resizable=no, width=420, height=400');}
function giavang(){window.open('http://www.sacomreal-s.com.vn/gold.html','my_new_window','scrollbars=no, resizable=no, width=500, height=300');}
function tygia(){window.open('http://hostc1.tvsi.com.vn/','my_new_window','scrollbars=no, resizable=no, width=800, height=600');}
function ngoaite(){window.open('http://www.sacomreal-s.com.vn/exchange.htm','my_new_window','scrollbars=no, resizable=no, width=500, height=300');}
function chungkhoan(){window.open('http://hostc1.tvsi.com.vn/','my_new_window','scrollbars=no, resizable=no, width=800, height=600');}
