﻿document.write('<div id="massage_box" style="display:none">loading...</div>');
document.write('<div id="bgDiv" style="display:none"></div>');
function openWithIframe(tit,url,w,h){
    //屏幕背景变暗
	var sWidth,sHeight;
	sWidth=document.body.clientWidth;
	sHeight=document.body.scrollHeight;
	if(sHeight<window.screen.height){sHeight=window.screen.height;}
	document.getElementById("bgDiv").style.display="";
	document.getElementById("bgDiv").style.position="absolute";
	document.getElementById("bgDiv").style.top="0";
	document.getElementById("bgDiv").style.background="#000000";
	document.getElementById("bgDiv").style.filter="Alpha(Opacity=30);";
	document.getElementById("bgDiv").style.left="0";
	document.getElementById("bgDiv").style.width=sWidth + "px";
	document.getElementById("bgDiv").style.height=sHeight + "px";
	document.getElementById("bgDiv").style.zIndex = "10000";
    //显示层
    document.getElementById("massage_box").style.left = (document.body.clientWidth - w) / 2+"px";
    document.getElementById("massage_box").style.top = (screen.height - h) / 2-80+"px";
    document.getElementById("massage_box").style.screenx = (document.body.clientWidth - w) / 2+"px";//仅适用于Netscape
    document.getElementById("massage_box").style.screeny = (screen.height - h) / 2-80+"px";//仅适用于Netscape
    document.getElementById("massage_box").style.width = w+"px";
    document.getElementById("massage_box").style.height = h+"px";
    document.getElementById("massage_box").className = "massage_box";
	var popiframe;
	popiframe = '<div style="border-width:1 1 3 1; width:100%; height:100%; background:#fff; color:#666666; font-size:12px;zIndex:1000">';
	popiframe += '<div onmousedown="MDown(massage_box)" style="background:#666666; height:20px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;color:#fff;cursor:move;padding:0 0 4px 0">';
	popiframe += '<div style="display:inline; width:200px; position:absolute;padding:3px 0 0 5px;color:#ffffff" id="pop_title">'+tit+'</div>';
	popiframe += '<span onClick="closeWithIframe()" style="float:right; display:inline; cursor:pointer;padding:3px 5px 0 0;font-size:12px;color:#ffffff;">关闭</span>';
	popiframe += '</div>';
	popiframe += '<div style="padding:5px" ><iframe src="'+url+'" width="'+(w-11)+'px"  height="'+(h-36)+'px" frameborder=0 scrolling=no></iframe></div>';
	popiframe += '</div>';
    document.getElementById("massage_box").innerHTML=popiframe;
    document.getElementById("massage_box").style.display = "";
}

function closeWithIframe(){
    document.getElementById("massage_box").style.display="none";
    document.getElementById("bgDiv").style.display="none";
}
//浮动提示框功能 Begin ========================================
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMove

function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}

function MMove(){
if(Obj!=''){
  document.all(Obj).style.left=event.x-pX;
  document.all(Obj).style.top=event.y-pY;
  }
}

function MUp(){
if(Obj!=''){
  document.all(Obj).releaseCapture();
  Obj='';
  }
}

function SetHome(obj,url){
	try{
		obj.style.behavior='url(#default#homepage)';
		obj.setHomePage(url);
	}catch(e){
		if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch(e){
				alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
			};
		}else{
			alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'"+url+"'设置为首页。");
		};
	};
};

//添加到收藏夹
function AddFavorite(url,title)
{
    //var url='http://www.50fc.com/';
    try
    {
        window.external.addFavorite(url, title);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(title, url, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}

function fCopyToClicp()
{
    var clipBoardContent="";
    clipBoardContent+=this.location.href;
    window.clipboardData.setData("Text",clipBoardContent);
    alert("已经成功复制，可以粘贴到MSN/QQ发送给好友");
}
