﻿vdco_width = typeof vdco_width == 'string' ? vdco_width : '990px';
vdco_height = typeof vdco_height == 'string' ? vdco_height : '29px';
vdco_border = typeof vdco_border == 'number' ? vdco_border : 0;
vdco_text_color = typeof vdco_text_color=='string'?vdco_text_color:'#FFF';
vdco_text_hover_color = typeof vdco_text_hover_color=='string'?vdco_text_hover_color:'#FFF';
vdco_bg_color = typeof vdco_bg_color=='string'?vdco_bg_color:'#E67817';
vdco_bg_hover_color = typeof vdco_bg_hover_color=='string'?vdco_bg_hover_color:'#E67817';
vdco_serviceURL = typeof vdco_serviceURL=='string'?vdco_serviceURL:'http://megadoc.vn/Upload.aspx';
var url = "http://megaplus.vn/MenuWidget/";
var time;
var str = '';
str += '<link href="'+url+'css/widget.css" rel="stylesheet" type="text/css" media="all"  />';
str += '<style rel="stylesheet" type="text/css" media="all">';
str +='ul.megawg_top_menu li,ul.megawg_top_menu li a{color:'+vdco_text_color+';}';
str +='.wg_sub_nav{background-color:'+vdco_bg_color+';}';
str+='ul.megawg_top_menu li:hover,ul.wg_sub_nav li:hover{background-color:'+vdco_bg_hover_color+';}';
str+='ul.megawg_top_menu li a:hover{color:'+vdco_text_hover_color+';}';
str +='</style>';
str += '<div class="megavnn_service_widget">';
str +='<div id="megawg_menutop" class="megawg_menutop" style="width: ' + vdco_width + ';height:' + vdco_height + ';border:solid ' + vdco_border + 'px #006699;background-color:' + vdco_bg_color + '">';
//str += '</div></div>';
document.write(str);
function wg_getItem(items) {
    document.getElementById("megawg_menutop").innerHTML = items;
    var links=document.getElementById("megawg_menutop").getElementsByTagName("a");
	
    for(i=0;i<links.length;i++)
    {
        if(links[i].className=='wg_link_item'&&links[i].href.indexOf(location.hostname)>0&&location.hostname!='megaplus.vn' && location.hostname!='www.megaplus.vn')
            links[i].id="wg_current_service";
    }
        
}
function wg_showOther()
{
    if(document.getElementById("wg_sub_nav").style.display=='none')
        document.getElementById("wg_sub_nav").style.display='block';
    else
        document.getElementById("wg_sub_nav").style.display='none';
    return false;
    
}
function wg_show()
{
    clearTimeout(time);
}
function wg_hide()
{
    document.getElementById("wg_sub_nav").style.display='none';    

}
function wg_hideOther()
{
	time=setTimeout("wg_hide()",500);
    //return false;
}