<!--
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function doZoom(size){
	var mn = document.getElementById('mn_Word');
	if(!mn){
		return;
	}
	var mnChild = mn.childNodes;
	mn.style.fontSize = size + 'px';
	for(var i = 0; i < mnChild.length; i++){
		if(mnChild[i].nodeType == 1){
			mnChild[i].style.fontSize = size + 'px';
		}
	}
}
function Collection(sSiteName)
{
	var newpage;
	switch (sSiteName.toLowerCase())
	{
		case 'baidu':
			newpage=window.open('http://cang.baidu.com/do/add?it='+encodeURIComponent(document.title.substring(0,76))+'&iu='+encodeURIComponent(location.href)+'&fr=ien#nw=1','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
		break;
		case 'qq':
			newpage=window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');
		break;
		case 'yahoo':
			newpage=window.open('http://myweb.cn.yahoo.com/popadd.html?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title), 'Yahoo','scrollbars=yes,width=780,height=550,left=80,top=80,status=yes,resizable=yes');
		break;
		case 'sina':
			newpage=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=2008&title='+escape(document.title)+'&url='+escape(document.location.href)+'&desc='+escape(document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'')),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes');
		break;
		case 'fanfou':
			newpage=window.open('http://fanfou.com/sharer?u='+encodeURIComponent(document.location.href)+'?t='+encodeURIComponent(document.title)+'?d='+encodeURIComponent(window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection():document.selection.createRange().text)+'?s=bl','sharer','toolbar=0,status=0,width=600,height=400')//){l.href=f+'.new'+p;};
		break;
		case '365key':
			newpage=window.open('http://www.365key.com/storeit.aspx?t='+escape(document.title)+'&u='+escape(document.location.href)+'&c='+escape(document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'')),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes');
		break;
		case 'yesky':
			newpage=window.open('http://hot.yesky.com/dp.aspx?t='+escape(document.title)+'&u='+escape(document.location.href)+'&c='+escape(document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():''))+'&st=2','_blank','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes');
		break;
		case 'wozhai':
			newpage=window.open('http://www.wozhai.com/wozhai/Cento.asp#t='+escape(document.title)+'&u='+escape(document.location.href)+'&c='+escape(document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'')),'wozhai','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes');
		break;
		default:break;		
	}
	newpage.focus();
}
function ShowPage_Tool()
{
	document.write('<div style=\'height:25px;line-height:25px;margin:0 0 0 0;padding:0 0 0 5;float:none;text-align:left;clear:both\'>');
    document.write('<b>共享收藏:<\/b>');
    document.write('<a href=\"javascript:Collection(\'baidu\');\" title=\"添加到百度搜藏\">百度收藏<\/a>');
    document.write('<a href=\"javascript:Collection(\'QQ\');\" title=\"收藏到QQ书签\">QQ书签<\/a>');
    document.write('<a href=\"javascript:Collection(\'yahoo\');\" title=\"添加到雅虎收藏\">雅虎收藏<\/a>');
    document.write('<a href=\"javascript:Collection(\'sina\');\" title=\"收藏的网页将被永久地保存到爱问ViVi收藏夹\">新浪ViVi<\/a>');
    document.write('<a href=\"javascript:Collection(\'fanfou\');\" title=\"分享到饭否\">饭否<\/a>');
    document.write('<a href=\"javascript:Collection(\'365key\');\"  title=\"功能强大的网络收藏夹，一秒钟操作就可以轻松实现保存带来的价值、分享带来的快乐\">365Key<\/a>');
    document.write('<a href=\"javascript:Collection(\'yesky\');\" title=\"推荐到天极网摘\">天极网摘<\/a>');
    document.write('<a href=\"javascript:Collection(\'wozhai\');\" title=\"收藏到我摘\">我摘<\/a>');
    document.write('</div>');
    
	document.write('<div style=\'height:25px;line-height:25px;margin:0 0 0 0;padding:0 10 0 0;float:none;text-align:right;clear:both\'>');
    document.write('<b>工具:<\/b>');
    document.write('<a href=\"javascript:doZoom(16);\">大<\/a><a href=\"javascript:doZoom(14);\">中<\/a><a href=\"javascript:doZoom(12);\">小<\/a>');
	document.write('<a href=\"javascript:window.close();\">关闭<\/a>');
    document.write('</div>');

	return;
}


function MyCookie()
{
	var Path;
	this.SetPath=function(strPath)
	{
		this.Path=strPath;
		return;
	}
	this.Get=function(strName)
	{
		var tCookies=document.cookie;
		var tArray=tCookies.split(";");
		for (var i=0;i<tArray.length;i++)
		{
			var ts=tArray[i].split("=");
			if (ts[0].trim()==strName)
			{
				return ts[1];
			}
		}
		return "";
	}
	this.Set=function(strName,strValue,nHour)
	{
		var tDate=new Date();
		tDate.setTime(tDate.getTime() + (nHour*3600*1000));
		var tCookie=strName.trim() + "=" + strValue +"; expires=" + tDate.toGMTString();
		if(this.Path)
		{
			tCookie=tCookie + "; path=" + this.Path;
		}
		document.cookie=tCookie;
		return;
	}
	this.Del=function(strName)
	{
		var tDate=new Date();
		tDate.setTime(tDate.getTime() - 1000);
		var tCookie=strName.trim() + "=" + strValue +";expire=" + tDate.toGMTString();
		if(this.Path)
		{
			tCookie=tCookie + "; path=" + this.Path;
		}
		document.cookie=tCookie;
		return;
	}
}

function ClickAd(strFrame,sID)
{
	var tIframe=document.createElement("Iframe");
	tIframe.src="/AdsClick.aspx?ID=" + sID;
	tIframe.width=1;	
	tIframe.height=1;	
	tIframe.left=1;	
	tIframe.top=1;
	var tObj=document.getElementById(strFrame)
	tObj.appendChild(tIframe);	
	return false;
}

function _tagAd()
{
	var ID,ShowMode,URL,Text,MediaSrc,Title,FontSize,FontColor,FontBold,Top,Left,Height,Width,ExpireDate,ExpireShowMode,ExpireURL,ExpireText,ExpireMediaSrc,ExpireTitle,ExpireFontSize,ExpireFontColor,ExpireBold;
}
function _tagAdsFrame()
{
	var ID,Name,Width,Height,AdColor,FrameColor;
}
function GetAdHtml(s_tagAdsFrame,s_tagAd)
{
	var str,ts,tv,tURL,tShowMode,tText,tMediaSrc,tTitle,FontSize,FontColor,FontBold,tDate;	
	tDate=new Date();	
	if (s_tagAd.ExpireDate > tDate)	
	{	
		tShowMode=s_tagAd.ShowMode;tURL=s_tagAd.URL;tText=s_tagAd.Text;tMediaSrc=s_tagAd.MediaSrc;tTitle=s_tagAd.Title;tFontSize=s_tagAd.FontSize;tFontColor=s_tagAd.FontColor;tFontBold=s_tagAd.FontBold;	
	}	
	else	
	{	
		tShowMode=s_tagAd.ExpireShowMode;tURL=s_tagAd.ExpireURL;tText=s_tagAd.ExpireText;tMediaSrc=s_tagAd.ExpireMediaSrc;tTitle=s_tagAd.ExpireTitle;tFontSize=s_tagAd.ExpireFontSize;tFontColor=s_tagAd.ExpireFontColor;tFontBold=s_tagAd.ExpireFontBold;	
	}	
	switch (tShowMode)
	{
		case 1://img
			ts="<a href=\'" + tURL + "\' title=\'" + tTitle + "\' target=\'_blank\'><img src=\'" + tMediaSrc + "\' border=\'0\' height=\'" + s_tagAd.Height +"\' width=\'" + s_tagAd.Width + "\'><\/a>";
			break;
		case 2://JS
			ts=tText;
			break;
		case 3://flash
			ts="<object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' width=\'" + s_tagAd.Width + "\' height=\'" + s_tagAd.Height + "\' codebase=\'http:\/\/fpdownload.adobe.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=9,0,0,0\'>";
			ts+="<param name=\'movie\' value=\'" + tMediaSrc + "\'><param name=\'play\' value=\'true\'><param name=\'loop\' value=\'true\'><param name=\'quality\' value=\'high\'>";
			ts+="<embed src=\'" + tMediaSrc + "\' quality=\'high\' pluginspage=\'http:\/\/www.macromedia.com\/shockwave\/download\/index.cgi?P1_Prod_Version=ShockwaveFlash\' type=\'application\/x-shockwave-flash\' width=\'" + s_tagAd.Width + "\' height=\'" + s_tagAd.Height + "\'><\/embed>";
			ts+="<\/object>";
			break;
		default: //0 or other,show text
			ts="<div style=\'position:absolute;text-align:center;overflow:hidden;top:2px;left:5px;font-size:" + tFontSize + "px;width:" + (s_tagAd.Width-8) + "px;height:" + (s_tagAd.Height-4) + "px;";
			tv=(s_tagAd.Height-6)/2;
			if (tFontSize >= tv )		
			{		
				ts+="line-height:" + (s_tagAd.Height-4) + "px;";		
			}		
			else		
			{		
				ts+="line-height:" + (tv-1) + "px;";		
			}		
			if (tFontBold==1)		
			{		
				ts+="font-weight:bold;";		
			}		
			ts+="\'>" + "<a href=\'" + tURL + "\' target=\'_blank\' title=\'" + tTitle + "\'><font color=\'" + tFontColor + "\'>" + tText + "<\/font><\/a><\/div>";		
			break;		
	}
	str="<div ID=\'Ads_ID" + s_tagAd.ID + "\' style=\'left:" + s_tagAd.Left + "px;top:" + s_tagAd.Top + "px;width:" + s_tagAd.Width + "px;height:" + s_tagAd.Height + "px;";
	str+="overflow:hidden;position:absolute;background-color:" + s_tagAdsFrame.AdColor + ";";
	str+="\' onclick=\"javascript:ClickAd(\'Ads_Frame" + s_tagAdsFrame.ID + "\',\'" + s_tagAd.ID + "\');\">" + ts + "<\/div>";	
	return str;
}
	
function ShowAds(s_tagAdsFrame,s_tagAds)
{
	document.writeln("");	
	document.writeln("<style>#Ads_Frame" + s_tagAdsFrame.ID + " a {text-decoration: none; } #Ads_Frame" + s_tagAdsFrame.ID + " a:hover {text-decoration: underline;}<\/style>");	
	document.write("<div id=\'Ads_Frame" + s_tagAdsFrame.ID + "\' style=\'text-align:center;overflow:hidden;float:none;position:relative;width:" + s_tagAdsFrame.Width + "px;height:" + s_tagAdsFrame.Height + "px;");
	if (s_tagAdsFrame.FrameColor)
	{
		document.write("background-color:" + s_tagAdsFrame.FrameColor + ";");
	}
	document.writeln("\'>");
	for (var i=0;i<s_tagAds.length;i++)	
	{	
		document.writeln(GetAdHtml(s_tagAdsFrame,s_tagAds[i]));	
	}	
	document.writeln("<\/div>");	
	return;
}
function JSAddFavorite(sURL,sSiteName)
{
  if ( window.sidebar && "object" == typeof( window.sidebar ) && "function" == typeof( window.sidebar.addPanel ))
  {
     //  firefox
     window.sidebar.addPanel(sSiteName,sURL,'');
  }
  else
  {
     //  ie
     window.external.addFavorite(sURL,sSiteName);
  }
}
-->