﻿function ForwardEmail() {
window.open('/common/emailforward.aspx','emailforward','height=524, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
}
function WriteEditor() {
        window.location = 'mailto:info@techtarget.com.cn?subject=%b6%c1%d5%df%b7%b4%c0%a1&body=%b1%e0%bc%ad%c4%fa%ba%c3%2c%0d%20%20%ce%d2%cf%eb%be%cd%b1%be%c6%aa%ce%c4%d5%c2%b7%a2%b1%ed%c8%e7%cf%c2%c6%c0%c2%db%a3%ac('+ window.location.href +')%cf%a3%cd%fb%d3%d0%bb%fa%bb%e1%bf%af%b5%c7%a1%a3';
}
function MSN(event) {
var MSN1="";
var headline = document.getElementById("headline").innerHTML;
MSN1=window.location.href.replace(/\?source=.*/g,"");
MSN1="推荐一篇TechTarget中国的文章：" + headline + " （www.SearchSMB.com.cn）\r\n" + MSN1 + "?source=MSN";

document.getElementById("HeadURL").innerHTML="<textarea id=copyall rows=6 cols=80 style='font-size:12px; color:#303030;border:0px; background-color:whitesmoke; padding:15px 15px 15px 15px; overflow:auto;' onblur='hidetoolpanel();'>" + MSN1 + "</textarea>" + "<div style='color:#303030;font-size:12px;margin-left:10px;background: url(../../pictures/format/dot3.gif) repeat-x top; padding-top: 4px; padding-bottom:3px;'>您可以复制上方文本框中的文字，并通过MSN或邮件发送给您的好友</div>";
document.getElementById("WrapHeadURL").style.display = "block";
document.getElementById("WrapHeadURL").style.left = event.clientX+document.body.scrollLeft - 250;
document.getElementById("WrapHeadURL").style.top = event.clientY+document.body.scrollTop + 30;
document.getElementById("copyall").focus();
document.getElementById("copyall").select();
}
function Blog(event) {
var MSN1="";
var headline = document.getElementById("headline").innerHTML;
MSN1=window.location.href.replace(/\?source=.*/g,"");

var Blog1="<span style='font-size:8px;color:990000'>&#9600;</span>&nbsp;";

Blog1 +="<a target=_blank style='color:0066cc;font-weight:bolder;font-size:14px' href=" + MSN1 + "?source=blog>" + headline + "</a>";

document.getElementById("HeadURL").innerHTML="<textarea id=copyall rows=6 cols=80 style='font-size:12px; color:#303030;border:0px; background-color:whitesmoke; padding:15px 15px 15px 15px; overflow:hidden;' onblur='hidetoolpanel();'>" + Blog1 + "</textarea>" + "<div style='color:#303030;font-size:12px;margin-left:10px; background: url(../../pictures/format/dot3.gif) repeat-x top; padding-top: 4px; padding-bottom:3px;'>您可以复制上方文本框中的文字，并粘贴到支持HTML编辑功能的博客或者论坛中</div>";
document.getElementById("WrapHeadURL").style.display = "block";
document.getElementById("WrapHeadURL").style.left = event.clientX+document.body.scrollLeft - 330;
document.getElementById("WrapHeadURL").style.top = event.clientY+document.body.scrollTop + 30;
document.getElementById("copyall").focus();
document.getElementById("copyall").select();
}
function PrintArticle(id)
{
    window.open("print.aspx?id="+ id);
}
function hidetoolpanel() {
    document.getElementById("WrapHeadURL").style.display = "none";
}
//直接显示登录窗口(url以#结尾)
var obj = gid("Panel_Login");
if (obj != null) {
    var url = window.location.href;
    var len = url.length;
    if (url.substring(len - 1, len) == "#")
        login("loginattach")
}

//复制加出处信息
document.body.oncopy = function () {
    setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "\r\nTechTarget中国原创内容，原文链接："+location.href; clipboardData.setData("text", text); } }, 100 ) 
}

//画中画功能脚本
//var state = false;
//var obj = gname("span");
//var iCount = obj.length;
//var j=0;
//var myobj;
//for(var i=0; i< iCount; i++)
//{
//	if(obj[i].className == "displayclass")
//	{	
//	    j++;
//		if(j==2)
//		{
//			////obj[i].innerHTML = "<div style='text-align:center; width=540px;'><div style='text-align:right; padding:10px 20px 10px 0;'><a href='#ContinueReading'><img src='btn_read.gif' border='0'></a></div><div><hr><br/><a id='ContinueReading'></a>这是画中画<img src='' width='100' height='100'><br/><br/><hr></div></div>";
//			obj[i].innerHTML = "<div style='text-align:center; width=540px; border-top:dashed 1px #c7c7c7;border-bottom:dashed 1px #c7c7c7;'><div><br/><a id='ContinueReading'></a><img src='http://www.searchcio.com.cn/tar/images/300_250_01.gif' width='300' height='250'><br/><br/></div></div>";
//			obj[i].className = "displayclass2";
//			state = true;
//			break;
//		}	
//	}
//}
