var strtitle
strtitle=document.title
self.onError=null;
    
function PopOldFriend(){
	SubscibeWindow=window.open('/comm/login/OldFriend.htm','SomeWin','toolbar=no,scrollbars=no,menubar=no,left=100,top=60,width=400,height=360');
	SubscibeWindow.focus()
SubscibeWindow.focus();}


function WinOpen(filename){
	//filename="http://www.xinxihua.cn"+filename
	NewWin=window.open(filename,'',"toolbar=0,location=0,status=0,menubar=0,resizable=1,scrollbars=1,top=0,left=0,width=780,height=547");
	NewWin.focus();
}

function xd(filename){
	//filename="http://www.xinxihua.cn"+filename
	if (filename!=""){
	if (filename=="*") {Sorry();}
	else
	{
	NewWin=window.open(filename,'','');
	NewWin.focus();
	}
	}
}

function Redirect(filename){
	//filename="http://www.xinxihua.cn"+filename
	if (filename!=""){
	if (filename=="*") {Sorry();}
	else
	{
	//top.location.href=filename;
	window.open(filename);
	}
	}
}

var temp;
function checkstatus(){
window.status="致信网 www.mie168.com";
temp=setTimeout("checkstatus()",3000);
}
checkstatus()

function urlencode(str) {
//供行业搜索中用
	var ms = "%25#23 20+2B?3F<3C>3E{7B}7D[5B]5D|7C^5E~7E`60";
	var msi = 0;
	var i,c,rs,ts ;
	while (msi < ms.length) {

		c = ms.charAt(msi);
		rs = ms.substring(++msi, msi +2);
		msi += 2;
		i = 0;
		while (true)	{ 
			i = str.indexOf(c, i);
			if (i == -1) break;
			ts = str.substring(0, i);
			str = ts + "%" + rs + str.substring(++i, str.length);
		}
	}
	return str;
}


function Shutit(){
window.close()
}

function SetCookie(dataName,datavalue)
{
	var expireDate;
	expireDate = new Date;
		if (expireDate.getYear() < 100) {
			expireDate.setYear(expireDate.getYear() + 1900 + 1);
		} else {
			expireDate.setYear(expireDate.getYear() + 1);
		} 
var   nameString=dataName+"=" + datavalue + ";expires=" + expireDate.toGMTString() + ";";
document.cookie=nameString+";path=/";
return true;
}
//if (top.frames.length!=0) {window.parent.HideLeft()}


function GetCookie(name){
	var cname = name + "=";               
	var dc = document.cookie;
	if (dc.length > 0) {              
		begin = dc.indexOf(cname);
		if (begin != -1) {           
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return unescape(dc.substring(begin, end));
			        }
	}
	return "";
}

var currentpos,timer; 
function initialize() 
	{ 
	timer=setInterval("scrollwindow()",1000); 
} 

function sc(){ 
	clearInterval(timer); 
} 

function scrollwindow() 
	{ 
	currentpos=document.body.scrollTop; 
	window.scroll(0,++currentpos); 
	if (currentpos != document.body.scrollTop) 
	sc(); 
	} 
document.onmousedown=sc 
//document.onmousedown=right
document.ondblclick=initialize 


function OpenImg(ImgPath,ImgNo){
	//NewWin=window.open(unescape(ImgPath),'',"toolbar=0,location=0,status=0,menubar=0,resizable=1,scrollbars=1,top=50,left=100");
	NewWin=window.open('/showimg.asp?n='+ImgNo+'&p='+ImgPath,'',"toolbar=0,location=0,status=0,menubar=0,resizable=1,scrollbars=1,top=50,left=100");
	NewWin.focus();
}

function WriteMoreRelation(theKeyword){
 document.write("<div align=right><font color=#008040>☆</font><a href='/search/mie168.asp?stype=b&keyword="+theKeyword+"' target=_blank>更多文章</a>&nbsp;&nbsp;")
 document.write( "<font color=#008040>☆</font><a href='/search/mie168.asp?stype=r&keyword="+theKeyword+"' target=_blank class=tl >相关栏目</a>&nbsp;&nbsp; ")
 document.write(  "<font color=#008040>☆</font><a href='/search/mie168.asp?stype=h&keyword="+theKeyword+"' target=_blank class=tl>相关图片</a>&nbsp;&nbsp;")
 document.write(  "<font color=#008040>☆</font><a href='/search/mie168.asp?stype=d&keyword="+theKeyword+"' target=_blank class=tl>相关网站</a>&nbsp;&nbsp;")
 document.write(  "<font color=#008040>☆</font><a href='/search/mie168.asp?stype=c&keyword="+''+"' target=_blank class=tl>相关网页</a>")
  }
//相关网页中 theKeyword 暂时屏避

function doPrint() {
	if (window.print) {
		var p_TableTrue = document.all.p_TableTrue.innerHTML;
		if (p_TableTrue != '') {
		document.all.p_Table.innerHTML = '<center><table width="700" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="top" class="bgc_whiter">  ' + p_TableTrue + '</td>  </tr> </table></center><div align=center id="p_TableTrue"></div>';
	}
	window.print();
	}
}


