function addImgLink(divID) {
	var msgarea = getbyid(divID);
	var imgs = msgarea.getElementsByTagName('img');
	for (i=0; i<imgs.length; i++) {
		if (imgs[i].parentNode.tagName.toLowerCase() != 'a') {
			imgs[i].title = '点击图片可在新窗口打开';
			imgs[i].style.cursor = 'hand';
			//imgs[i].onload = function() {if(this.width >630) {this.resized=true; this.width=630;}
			imgs[i].onclick = function() { window.open("/for/showpic.htm?pic="+escape(this.src)); }
			if(imgs[i].width >600) {imgs[i].resized=true; imgs[i].width=600; }
		}
	}
}


function getbyid(id) {
	if (document.getElementById) {
		return document.getElementById(id);
	} else if (document.all) {
		return document.all[id];
	} else if (document.layers) {
		return document.layers[id];
	} else {
		return null;
	}
}

function AddFav(num){
	if(num==0){
		url = "http://www.civilcn.com";
		title = "土木工程网 - civilcn.com";
	}else{
		url = document.location.href;
		title = document.title;
	}	
 if ( window.sidebar && "object" == typeof( window.sidebar ) && "function" == typeof( window.sidebar.addPanel ) ){
   //  firefox
   window.sidebar.addPanel( title, url, '' );
 }else if ( document.all && "object" == typeof( window.external ) ){
   //  ie
   window.external.addFavorite( url, title );
 }
}

function copyToClipBoard(str)
{
 var clipBoardContent=str;
 clipBoardContent+=':' + window.document.location.href;
 window.clipboardData.setData("Text",clipBoardContent);
 alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友！\r\n\r\n内容如下：\r\n\r\n" + clipBoardContent);
}

window.defaultStatus = "土木工程网 请记住网址 www.civilcn.com"
