// khai bao sup menu                       
                       
var menu_2 = new Array()
menu_2[0] = '<a href="index.php?option=com_content&view=category&layout=blog&id=152&Itemid=161&lang=vi"><font color=white><b>MC Cơ Bản</font></a>'
menu_2[1] = '<a href="index.php?option=com_content&view=article&id=1099"><font color=white><b>MC Nâng Cao</font></a>'
//menu_2[2] = '<a href="index.php?option=com_content&view=category&layout=blog&id=154&Itemid=165&lang=vi"><font color=white><b>Chuyên Biệt</font></a>'


var menu_3 = new Array()
menu_3[0] = '<a href="index.php?option=com_content&view=category&layout=blog&id=258&Itemid=303&lang=vi"><font color=white><b>Thông Tin Khóa Học</font></a>'
menu_3[1] = '<a href="index.php?option=com_content&view=category&layout=blog&id=259&Itemid=304&lang=vi"><font color=white><b>Ống Kính Học Viên</font></a>'
menu_3[2] = '<a href="index.php?option=com_content&view=category&layout=blog&id=260&Itemid=305&lang=vi"><font color=white><b>Lịch Học</font></a>'
menu_3[3] = '<a href="index.php?option=com_content&view=category&layout=blog&id=261&Itemid=306&lang=vi"><font color=white><b>Góc Học Viên</font></a>'

var menu_4 = new Array()

menu_4[0] = '<a href="http://connectionvn.com/CONNECT/"><font color=white><b>MC Cơ Bản</font></a>'
menu_4[1] = '<a href="index.php?option=com_content&view=article&id=1099"><font color=white><b>MC Nâng Cao</font></a>'
menu_4[2] = '<a href="index.php?option=com_content&view=category&layout=blog&id=253&Itemid=298&lang=vi"><font color=white><b>Nhận Diện Thương Hiệu</font></a>'
menu_4[3] = '<a href="San-Pham-Moi/kinh-gi-quy-khach-hang.html"><font color=white><b>Team Building</font></a>'
menu_4[4] = '<a href="index.php?option=com_content&view=category&layout=blog&id=255&Itemid=300&lang=vi"><font color=white><b>Cắm Hoa</font></a>'
menu_4[5] = '<a href="index.php?option=com_content&view=category&layout=blog&id=256&Itemid=301&lang=vi"><font color=white><b>Khiêu Vũ</font></a>'
menu_4[6] = '<a href="index.php?option=com_content&view=category&layout=blog&id=257&Itemid=302&lang=vi"><font color=white><b>Stylist</font></a>'

//var menu_5 = new Array()
//menu_5[0] = '<a href="#">Chưa Có dữ liệu</a>'
//menu_5[1] = '<a href="#">Chưa Có dữ liệu</a>'
//menu_5[2] = '<a href="#">Chưa Có dữ liệu</a>'
//menu_5[3] = '<a href="#">Chưa Có dữ liệu</a>'
       
// end khai bao submenu
                       
                        var disappeardelay=250 ; //menu disappear speed onMouseout (in miliseconds)
                        var horizontaloffset=0; //horizontal offset of menu from default location. (0-5 is a good value)

                        //No further editting needed

                        var ie4=document.all;
                        var ns6=document.getElementById&&!document.all;

                        if (ie4||ns6)
                        document.write('<div id="dropmenudiv" style="visibility:hidden;width:170px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

                        function getposOffset(what, offsettype){
                        var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
                        var parentEl=what.offsetParent;
                        while (parentEl!=null){
                        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
                        parentEl=parentEl.offsetParent;
                        }
                        return totaloffset;
                        }


                        function showhide(obj, e, visible, hidden, menuwidth){
                        if (ie4||ns6)
                        dropmenuobj.style.left=dropmenuobj.style.top=-100
                        dropmenuobj.widthobj=dropmenuobj.style
                        dropmenuobj.widthobj.width=menuwidth
                        if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
                        obj.visibility=visible
                        else if (e.type=="click")
                        obj.visibility=hidden
                        }

                        function iecompattest(){
                        return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
                        }

                        function clearbrowseredge(obj, whichedge){
                        var edgeoffset=0
                        if (whichedge=="rightedge"){
                        var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth : window.pageXOffset+window.innerWidth
                        dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
                        if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
                        edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
                        }
                        else{
                        var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
                        var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight : window.pageYOffset+window.innerHeight
                        dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
                        if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
                        edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
                        if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
                        edgeoffset=dropmenuobj.y
                        }
                        }
                        return edgeoffset
                        }

                        function populatemenu(what){
                        if (ie4||ns6)
                        dropmenuobj.innerHTML=what.join("")
                        }


                        function dropdownmenu(obj, e, menucontents, menuwidth){
                        if (window.event) event.cancelBubble=true
                        else if (e.stopPropagation) e.stopPropagation()
                        clearhidemenu()
                        dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
                        populatemenu(menucontents)

                        if (ie4||ns6){
                        showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
                        dropmenuobj.x=getposOffset(obj, "left")
                        dropmenuobj.y=getposOffset(obj, "top")
                        dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
                        dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
                        }

                        return clickreturnvalue()
                        }

                        function clickreturnvalue(){
                        if (ie4||ns6) return false
                        else return true
                        }

                        function contains_ns6(a, b) {
                        while (b.parentNode)
                        if ((b = b.parentNode) == a)
                        return true;
                        return false;
                        }

                        function dynamichide(e){
                        if (ie4&&!dropmenuobj.contains(e.toElement))
                        delayhidemenu()
                        else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
                        delayhidemenu()
                        }

                        function hidemenu(e){
                        if (typeof dropmenuobj!="undefined"){
                        if (ie4||ns6)
                        dropmenuobj.style.visibility="hidden"
                        }
                        }

                        function delayhidemenu(){
                        if (ie4||ns6)
                        delayhide=setTimeout("hidemenu()",disappeardelay)
                        }

                        function clearhidemenu(){
                        if (typeof delayhide!="undefined")
                        clearTimeout(delayhide)
                        }