if(typeof(newsid)!="undefined"){
var s_starttime=Math.round((new Date).getTime()/1000);var ajax = window.ActiveXObject ? new window.ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();window.onbeforeunload = function () {var s_endtime=Math.round((new Date).getTime()/1000);if((s_endtime-s_starttime)<45){ajax.open("GET", "/asp/Up.asp?t2="+s_endtime+"&t1="+s_starttime+"&n="+newsid, false);ajax.send(null);}};}
function inputcheck(inputname,patrnstr,alertstr,returnbox)
{
	var s=document.getElementById(inputname).value;
	eval("var patrn="+patrnstr+";");
	if(!patrn.test(s))
	{
		if(returnbox)
		{document.getElementById(returnbox).style.visibility='visible';document.getElementById(returnbox).innerHTML='<font color="red">'+alertstr+'</font>'; }
		else
		{alert(alertstr); }
		document.getElementById(inputname).focus();
		return false;
	}
	else
	{
		return true;
	}
}

var gb2utf8=function(data){
var glbEncode=[],t,i,j,len;
gb2utf8_data=data;
execScript("gb2utf8_data = MidB(gb2utf8_data, 1)+' '", "vbscript");
t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2");
t=t.split("@");
i=0;
len=t.length;
while(++i<len){
j=t[i].substring(0,4)
if(!glbEncode[j]) {
gb2utf8_char = eval("0x"+j);
execScript("gb2utf8_char=Chr(gb2utf8_char)","vbscript");
glbEncode[j]=escape(gb2utf8_char).substring(1,6);
}
 t[i]=glbEncode[j]+t[i].substring(4);
}
gb2utf8_data=gb2utf8_char=null;
return unescape(t.join("%")).slice(0,-1);}
function postform()
{
var args=postform.arguments; 
var url = args[0];
var poststr="";
for (i=1; i<(args.length); i++) 
{ poststr+="p"+i+"="+encodeURIComponent(escape(args[i]))+"&";} 
i=args.length-1;
if(encodeURIComponent(escape(args[i])).indexOf("returnbox")!=-1)
{var returnbox=encodeURIComponent(escape(args[i]));}
if(returnbox)
{eval("document.getElementById('"+returnbox+"').innerHTML='<img src=\"/image/loading1.gif\"> 稍等，正在载入内容。';")}
else
{document.getElementById("returnbox").innerHTML='<img src="/image/loading1.gif"> 稍等，正在载入内容。';}
poststr+="p=x"
var xmlhttp;
try{xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');}catch(e){
try{xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');}catch(e){
try{xmlhttp= new XMLHttpRequest();}catch(e){}}}
xmlhttp.open("post", url, true)
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=GB2312");
xmlhttp.send(poststr);
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){//关闭显示条
if(xmlhttp.status==200){
var loginbool=window.Event?xmlhttp.responseText:gb2utf8(xmlhttp.responseBody);//编码转换
if(returnbox){document.getElementById(returnbox).style.visibility='visible';
document.getElementById(returnbox).innerHTML=loginbool+' <a href="javascript:location.reload()">刷新</a>';}
else{document.getElementById("returnbox").style.visibility='visible';
document.getElementById("returnbox").innerHTML=loginbool+' <a href="javascript:location.reload()">刷新</a>';}}else{var loginbool=window.Event?xmlhttp.responseText:gb2utf8(xmlhttp.responseBody);//编码转换
document.getElementById(returnbox).innerHTML='致命错误'+xmlhttp.status+':<br>'+loginbool+' <a href="javascript:location.reload()">刷新</a>';}}}}

function getform(url,returnbox)
{
var args=getform.arguments; 
var cjoin= args[2];
var xmlhttp;
try{xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');}catch(e){
try{xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');}catch(e){
try{xmlhttp= new XMLHttpRequest();}catch(e){}}}
xmlhttp.onreadystatechange=function(){
if((xmlhttp.readyState==4)&&document.getElementById(returnbox)){//关闭显示条
if(xmlhttp.status==200){
var loginbool=window.Event?xmlhttp.responseText:gb2utf8(xmlhttp.responseBody);//编码转换
document.getElementById(returnbox).style.visibility='visible';
if(!cjoin)
{document.getElementById(returnbox).innerHTML=loginbool;}
else{document.getElementById(returnbox).innerHTML+=loginbool;}}else{//否则弹出错误信息
var loginbool=window.Event?xmlhttp.responseText:gb2utf8(xmlhttp.responseBody);//编码转换
document.getElementById(returnbox).innerHTML='致命错误'+xmlhttp.status+':<br>'+loginbool+' <a href="javascript:location.reload()">刷新</a>';}}}
xmlhttp.open("GET", url, true)
xmlhttp.send();}

function MM_reloadPage(init) { //reloads the window if Nav4 resized 
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { 
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} 
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); 
} 
MM_reloadPage(true); 
function MM_findObj(n, d) { //v4.0 
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 
if(!x && document.getElementById) x=document.getElementById(n); return x; 
} 
function showhelp() { //v3.0 
document.getElementById("menu1").innerHTML=arguments[1]
var oldobj,url,title,i,p,v,obj,vid,args=showhelp.arguments;
var evt = arguments[0]||window.event; 
var mX = evt.x ? evt.x : evt.pageX;
var mY = evt.y ? evt.y : evt.pageY;
var a;
if(window.event)
{ a =document.documentElement.scrollTop;}
else{a=0;}
obj=MM_findObj("menu1");
if (obj.style) { 
obj=obj.style;
obj.visibility='visible';
if(mX<=170){mX=170;}
obj.top=mY+a-10+'px' ;obj.left=mX-170+'px';} } 
function Center(d){
var h,tab,w;
tab=document.getElementById(d);
if(IsIe()==7) h=Math.floor((document.documentElement.clientHeight-tab.clientHeight)*3/8);
else h=Math.floor(((IsIe()>0?document.body.offsetHeight:window.innerHeight)-tab.clientHeight)*3/8);
tab.style.top=(h-50)+"px";
if(IsIe()==7) w=Math.floor((document.documentElement.clientWidth-tab.clientWidth)*3/8);
else w=Math.floor(((IsIe()>0?document.body.offsetWidth:window.innerWidth)-tab.clientWidth)*3/8);
tab.style.left=w+"px";
//alert(document.documentElement.clientHeight);
}
function IsIe(){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie>0) msie=parseInt(ua.substring(msie+5,ua.indexOf(".",msie)));
return msie;
}
function $(eid)
{
	return document.getElementById(eid);
}
function red(str)
{ return '<font color="red">'+str+'<font>'}

 function addjustimg(eid,iwidth,c)
{
	var allimg,w,h;
	allimg=document.getElementById(eid).getElementsByTagName("img");
	for(i=0;i<allimg.length;i++){w=parseInt(allimg[i].width);h=parseInt(allimg[i].height);if(w>=iwidth){allimg[i].height=iwidth/(w/h);allimg[i].width=iwidth;}}
	if(c!=false){document.getElementById(eid).onclick=function(e){var clicktag,tagsrc;if(!e){e = window.event;clicktag=e.srcElement.tagName;tagsrc=e.srcElement.src;}else{clicktag=e.target.tagName;tagsrc=e.target.src;}if(clicktag=='IMG'){window.open(tagsrc)}}}
}
function copyurl(url,content){
	var c=(typeof(content)!="undefined"?content:document.title);;
	var u=(typeof(url)!="undefined"?url:location.href);
	if(c=='我的简历'){window.clipboardData.setData("Text","这是"+c+"，如果有适合的工作记得帮我推荐一下或者通知我啊\n"+u);alert("复制成功,您可以把这个网址发布到您的博客/QQ空间/常去的论坛宣传自己，或者粘贴到您的QQ/MSN上发给您的好友请他们帮你留意合适的工作!");postaction('复制自己的网址');}else{window.clipboardData.setData("Text","感觉这个\""+c+"\"很不错，对你可能很点帮助，给你看看\n"+u);alert("复制成功,您可以把这个网址收藏到您的博客/QQ空间/常去的论坛，或者粘贴到您的QQ/MSN上推荐给您的好友!");postaction('推荐好友')}
}
function addfav(url,content)
{
	var c=(typeof(content)!="undefined"?content:document.title);;
	var u=(typeof(url)!="undefined"?url:location.href);
	postaction('收藏')
	window.external.AddFavorite(u,' ★'+c)
}
function fz(c){
	if(document.getElementsByTagName("blockquote")(0)){document.getElementsByTagName("blockquote")(0).outerHTML='';}
	if($("midgad")){$("midgad").outerHTML='';}
	//if($("relative1ul")){$('content').innerHTML+='<br/>其他对您有帮助的文章'+$("relative1ul").innerHTML.replace(/<li>/ig,'').replace(/<li>/ig,'');}
	var oMessage=document.all(c); 
	var oTextRange=document.body.createTextRange(); 
	with (oTextRange) { 
	moveToElementText(oMessage); 
	execCommand("SelectAll"); }
    	document.execCommand('Copy');
	postaction('转载文章')
	postaction('good|'+newsid)
	alert('复制成功，您可以粘贴到您的博客/个人空间/常去的论坛，这样以后想看这篇文章就不怕找不到啦！')
}
function postaction(a)
{getform('/useraction.asp?u='+location.href+'&t='+document.title+'&a='+a,'');}
function show(cid){$(cid).style.display='block';}
function hid(cid){$(cid).style.display='none';}
function goto(u){window.open(u,"_blank");}
function addjustimg(eid,iwidth,c)
{
	var allimg,w,h;
	allimg=document.getElementById(eid).getElementsByTagName("img");
	for(i=0;i<allimg.length;i++){w=parseInt(allimg[i].width);h=parseInt(allimg[i].height);if(w>=iwidth){allimg[i].height=iwidth/(w/h);allimg[i].width=iwidth;}}
	if(c!=false){document.getElementById(eid).onclick=function(e){var clicktag,tagsrc;if(!e){e = window.event;clicktag=e.srcElement.tagName;tagsrc=e.srcElement.src;}else{clicktag=e.target.tagName;tagsrc=e.target.src;}if(clicktag=='IMG'){window.open(tagsrc)}}}
}
function getcookies(name)//取cookies函数        
{var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));if(arr != null) return arr[2]; return null;}
if(document.getElementById("friend1")){document.getElementById("friend1").onclick=function(){postaction(getcookies("usercityname")+'广告');}}
if(document.getElementById("cse-search-box")){}
else{document.getElementsByName("frmSearch")[0].onsubmit=function(){postaction("搜索:"+document.getElementsByName("word")[0].value);return true;}}
if(document.getElementById("words")){addjustimg('words',0,false);}
if(document.getElementById("content")){addjustimg('content',600,false);}
if($("relative1ul")&&$("rightlist1ul")){$("rightlist1ul").innerHTML=$("relative1ul").innerHTML;}
if($("top_navlink")&&$("gad")&&(location.href.indexOf("jianli5")==-1)){$("gad").innerHTML=$("top_navlink").innerHTML;}
/*来路2010-5-5*/
var forref='';
try{forref=top.document.referrer;}catch(e){}
try{forref=window.parent.document.referrer;}catch(e){}
if(forref!=''){document.write ('<iframe src="/asp/l.asp?u='+escape(forref)+'" width="0" height="0"  frameborder="0" scrolling="no"></iframe>')}

/*googlerelative*/
if(($("baiduad"))||($("contentlist"))||$("content")||$("001ppbody"))
{
	var checkTd_related=document.createElement("blockquote");
	if(document.getElementById("baiduad"))
	{var otr_related=document.getElementById("baiduad");}
	else if(document.getElementById("001ppbody"))
	{var otr_related=document.getElementById("001ppbody");checkTd_related=document.createElement("div");}
	else if(document.getElementById("content"))
	{var otr_related=document.getElementById("main");checkTd_related=document.createElement("div");}
	else
	{var otr_related=document.getElementById("contentlist");}
	checkTd_related.innerHTML="<h3><a href='http://qun.qq.com/#search/tx/61672435' target='_blank'><img src='/images/hot.gif' border=0 />500人 SEO 交流群，群号：61672435  </a></h3><h3><a href='http://qun.qq.com/#search/tx/84676354' target='_blank'><img src='/images/hot.gif' border=0 />500人产品经理实名交流群 84676354 验证信息需注明单位 </a></h3><div id='relatedlinks_container_div'></div>";
	if(document.getElementById("baiduad"))
	{otr_related.insertBefore(checkTd_related,otr_related.childNodes[0]);}
	else
	{otr_related.appendChild(checkTd_related);}
	
	
	  var escFun = window.encodeURIComponent ? window.encodeURIComponent : escape;
  var relatedlinks_js = document.createElement("script");
  relatedlinks_js.setAttribute("charset", "utf-8");
  relatedlinks_js.src = "http://relatedlinks.googlelabs.com/client/client.js?url=" +
      escFun(document.URL) + "&referrer=" + escFun(document.referrer) +
      "&relatedlinks_id=10532_1183963845482116112&title=" + escFun(document.title);
  document.getElementsByTagName("head")[0].appendChild(relatedlinks_js);
}
if($("content")||$("001ppbody"))
{
	document.write('<script src="/asp/setrelative.asp"></script>');
}
