﻿function ResizeImages(){
   var myimg,oldwidth;
   var maxwidth=500;
   var obj=document.getElementById("contentMain").getElementsByTagName("img")
   for(i=0;i<obj.length;i++){
     if(obj[i].width > maxwidth){
        obj[i].width = maxwidth;
		obj[i].onclick=function(){open(this.src)}
		obj[i].alt = "点击查看大图";
		obj[i].style.cursor="pointer";
		obj[i].border =1 ;
     }
   }
}

/*可同时用于IE和Firefox的加入收藏夹函数
调用如下:
<a target="_top"  href="javascript:addBookmark(document.title);">将本页加入收藏夹</a>
*/
function addBookmark(title) {
	var url=parent.location.href;
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,""); 
	}
	else if( document.all ) {
		window.external.AddFavorite( url, title);
	}
	else if( window.opera && window.print ) {
		return true;
	}
}

function copyToClipBoard(){
	var clipBoardContent=''; 
	clipBoardContent+=document.title+"\r\n";
	clipBoardContent+=location.href;
	window.clipboardData.setData("Text",clipBoardContent);
	alert("已复制链接及标题，请粘贴到MSN/QQ等发给好友!");
}

function menu_sub_switch(id)
{
	if(document.getElementById(id).style.display=='none'){
		document.getElementById(id).style.display = '';
	}else{
		document.getElementById(id).style.display = 'none';
	}
}