// JavaScript Document
function $(sID) {return document.getElementById(sID);}
function AddFavorite()
{
	var sURL = document.location.href;
    var sTitle = document.title;
   try
   {
       window.external.addFavorite(sURL, sTitle);
   }
   catch (e)
   {
       try
       {
           window.sidebar.addPanel(sTitle, sURL, "");
       }
       catch (e)
       {
           alert("加入收藏失败，请使用Ctrl+D进行添加");
       }
   }
}

function share(str)
{
	var sURL = document.location;
	event.returnValue=false; 
	var s = str + ":" + sURL;
	clipboardData.setData('Text',s); 
	alert("地址复制成功，快与您的好友分享您的喜悦吧！")
}

function view(n,w,h)
{
	var o = $("mask");
	var b = $("face");
	$("top").style.display = "none";
	document.body.style.overflow = "hidden";
	document.body.style.height = document.documentElement.clientHeight + "px";
	o.style.display = "block";
	b.style.display = "block";
	o.style.height = document.documentElement.clientHeight + "px";
	b.style.height = h;
	b.style.width = w;
	b.style.left = (document.body.clientWidth-w)/2;
	b.style.top = (document.body.clientHeight-h)/2;
	b.style.background = 'url("images/image0' + n + '.jpg")';
}

function cls()
{
	$("mask").style.display = "none";
	$("face").style.display = "none";
	$("top").style.display = "block"
	document.body.style.overflow = "visible";
}