//加入收藏夹
function addCookie()
{
    if (document.all)
       {
         window.external.addFavorite('http://www.bolmedia.com.cn','蓝海传媒');
       }
      else if (window.sidebar)
      {
          window.sidebar.addPanel('蓝海传媒', 'http://www.bolmedia.com.cn', "");
    }
}
//设为首页
function setHomepage()
{
if (document.all)
    {
       document.body.style.behavior='url(#default#homepage)';
       document.body.setHomePage('http://http://www.bolmedia.com.cn');
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
   { 
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
         } 
         catch (e) 
         { 
   alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" ); 
         }
    } 
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage','http://www.bolmedia.com.cn');
}
}
function $(Id)	{
	return document.getElementById(Id);
}
function showMenu (baseID, divID) {
    baseID = $(baseID);
    divID  = $(divID);
    if (showMenu.timer) clearTimeout(showMenu.timer);
	hideCur();
    divID.style.display = 'block';
	showMenu.cur = divID;

    if (!divID.isCreate) {
        divID.isCreate = true;
		divID.onmouseover = function () {
		if (showMenu.timer) clearTimeout(showMenu.timer);
		hideCur();
		divID.style.display = 'block';
	};

        function hide () {
            showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
        }

        divID.onmouseout = hide;
        baseID.onmouseout = hide;
    }
	function hideCur () {
		showMenu.cur && (showMenu.cur.style.display = 'none');
	}
}
var flag=false;
function DrawImage(ImgD,width,height){
var image=new Image();
var iwidth = width; //定义允许图片宽度
var iheight = height; //定义允许图片高度
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ 
ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}

ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.height>iheight){ 
ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
}
} 
