///////////////////////////////////////////////////////////////////////////////
//              z-blog
// 浣?   鑰?    鏈辩厞(zx.asd)
// 鐗堟潈鎵鏈?    rainbowsoft studio
// 鎶鏈敮鎸?    rainbowsoft@163.com
// 绋嬪簭鍚嶇О:    
// 绋嬪簭鐗堟湰:    
// 鍗曞厓鍚嶇О:    common.js
// 寮濮嬫椂闂?    2004.07.25
// 鏈鍚庝慨鏀?    
// 澶?   娉?    鍏ㄥ眬鑴氭湰
///////////////////////////////////////////////////////////////////////////////





//*********************************************************
// 鐩殑锛?   鍔犺浇鏍峰紡琛?
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function loadactivestylesheet(){

	var title=getcookie("sk")
	var a;

	if (title) {

		a = document.getelementsbytagname("link")[0];

		a.href=str00+"style/"+title+".css"

	}

}
//*********************************************************




//*********************************************************
// 鐩殑锛?   璁剧疆鏍峰紡琛?
// 杈撳叆锛?   title
// 杩斿洖锛?   鏃?
//*********************************************************
function setactivestylesheet(title){

	var a;

	if (title) {

		{
			setcookie("sk",title,365);
		}
		a = document.getelementsbytagname("link")[0];

		a.href=str00+"style/"+title+".css"

	}

}
//*********************************************************




//*********************************************************
// 鐩殑锛?   璁剧疆cookie
// 杈撳叆锛?   sname, svalue,iexpiredays
// 杩斿洖锛?   鏃?
//*********************************************************
function setcookie(sname, svalue,iexpiredays) {
	if (iexpiredays){
		var dexpire = new date();
		dexpire.settime(dexpire.gettime()+parseint(iexpiredays*24*60*60*1000));
		document.cookie = sname + "=" + escape(svalue) + "; expires=" + dexpire.togmtstring();
	}
	else{
		document.cookie = sname + "=" + escape(svalue);
	}
}
//*********************************************************




//*********************************************************
// 鐩殑锛?   杩斿洖cookie
// 杈撳叆锛?   name
// 杩斿洖锛?   cookie鍊?
//*********************************************************
function getcookie(sname) {

	var arr = document.cookie.match(new regexp("(^| )"+sname+"=([^;]*)(;|$)"));
	if(arr !=null){return unescape(arr[2])};
	return null;

}
//*********************************************************




//*********************************************************
// 鐩殑锛?   楠岃瘉淇℃伅
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function verifymessage() {

	var strname=document.getelementbyid("inpname").value;
	var stremail=document.getelementbyid("inpemail").value;
	var strhomepage=document.getelementbyid("inphomepage").value;
	var strarticle;

	if(document.getelementbyid("txaarticle").value){
		strarticle=document.getelementbyid("txaarticle").value;
	}
	else{
		strarticle=document.getelementbyid("txaarticle").innertext;
	}

	if(strname==""){
		alert(str01);
		return false;
	}
	else{
		re = new regexp("^[.a-za-z0-9\u4e00-\u9fa5]+$");
		if (!re.test(strname)){
			alert(str02);
			return false;
		}
	}

	if(stremail==""){
		alert(str01);
		return false;
	}
	else{
		re = new regexp("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$");
		if (!re.test(stremail)){
			alert(str02);
			return false;
		}
	}

	if(typeof(strarticle)=="undefined"){
		alert(str03);
		return false;
	}

	if(typeof(strarticle)=="string"){
		if(strarticle==""){
			alert(str03);
			return false;
		}
		if(strarticle.length>intmaxlen)
		{
			alert(str03);
			return false;
		}
	}

	document.getelementbyid("inparticle").value=strarticle;
	document.getelementbyid("inplocation").value=parent.window.location.href;
	if(!document.getelementbyid("frmsumbit").action){
		document.getelementbyid("frmsumbit").action=str00+"cmd.asp?act=cmt";
	}


	var bolremember=document.getelementbyid("chkremember").checked;

	if(bolremember==true){
		saverememberinfo();
	}
	else{
		setcookie("chkremember",bolremember,365);
	}

}
//*********************************************************




//*********************************************************
// 鐩殑锛?   鍔犺浇淇℃伅
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function loadrememberinfo() {

	var strname=getcookie("inpname")
	var stremail=getcookie("inpemail")
	var strhomepage=getcookie("inphomepage")
	var bolremember=getcookie("chkremember")

	if(bolremember=="true"){

		if(strname){document.getelementbyid("inpname").value=strname;};
		if(stremail){document.getelementbyid("inpemail").value=stremail;};
		if(strhomepage){document.getelementbyid("inphomepage").value=strhomepage;};
		if(bolremember){document.getelementbyid("chkremember").checked=bolremember;};

	}

}
//*********************************************************




//*********************************************************
// 鐩殑锛?   淇濆瓨淇℃伅
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function saverememberinfo() {

	var strname=document.getelementbyid("inpname").value;
	var stremail=document.getelementbyid("inpemail").value;
	var strhomepage=document.getelementbyid("inphomepage").value;
	var bolremember=document.getelementbyid("chkremember").checked;


	setcookie("inpname",strname,365);
	setcookie("inpemail",stremail,365);
	setcookie("inphomepage",strhomepage,365);
	setcookie("chkremember",bolremember,365);

}
//*********************************************************





//*********************************************************
// 鐩殑锛?   杈撳嚭ubb
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function exportubbframe() {

	objactive="txaarticle";

	document.write("<p id=\"ubbframe\" style=\"display:none;\"></p>")

	document.write("<p>")

	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[url]','[/url]'),true);\" style=\"padding:2px;cursor:pointer;\">[url]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[url=http://]','[/url]'),true);\" style=\"padding:2px;cursor:pointer;\">[url2]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[email]','[/email]'),true);\" style=\"padding:2px;cursor:pointer;\">[email]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[email=@]','[/email]'),true);\" style=\"padding:2px;cursor:pointer;\">[email2]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[b]','[/b]'),true);\" style=\"padding:2px;cursor:pointer;\">[b]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[i]','[/i]'),true);\" style=\"padding:2px;cursor:pointer;\">[i]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[u]','[/u]'),true);\" style=\"padding:2px;cursor:pointer;\">[u]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[s]','[/s]'),true);\" style=\"padding:2px;cursor:pointer;\">[s]</a>  ")
	document.write("<a alt=\"\" onmousedown=\"inserttext(objactive,replacetext(objactive,'[quote]','[/quote]'),true);\" style=\"padding:2px;cursor:pointer;\">[quote]</a>  ")

	document.write("<u><a style=\"cursor:pointer;text-align:right;\" onclick=\"insertubbface();if(document.getelementbyid('ubbframe').style.display=='none'){document.getelementbyid('ubbframe').style.display='block';}else{document.getelementbyid('ubbframe').style.display='none'};this.style.display='none'\">"+str06+"</a></u> ")

	document.write("</p>")
}
//*********************************************************




//*********************************************************
// 鐩殑锛?   鎻掑叆琛ㄦ儏鍥剧墖html浠ｇ爜
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function insertubbface() {

	if(!document.getelementbyid("ubbframe").innerhtml){

		var aryfilename="";
		var strfilename="";
		var strfacehtml="";

		aryfilename = strfacename.split("|");

		for (var i=0;i<aryfilename.length;i++)
		{
			strfilename = aryfilename[i];
			strfacehtml=strfacehtml + "<img src=\""+str00+"image/face/"+strfilename+".gif\" title=\""+strfilename+"\" alt=\""+strfilename+"\" width=\""+strfacesize+"\" height=\""+strfacesize+"\" onclick=\"inserttext(objactive,'[f]'+this.alt+'[/f]',false);\" style=\"padding:2px;cursor:pointer;\">"
		}
		document.getelementbyid("ubbframe").innerhtml=strfacehtml;
	}

}
//*********************************************************




//*********************************************************
// 鐩殑锛?   鑷姩鎻掑叆骞舵浛鎹?
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
var objactive;
function getactivetext(objhtml) {
	objactive=objhtml;
	if(document.selection){
		var obj=document.getelementbyid(objhtml);
		obj.currpos = document.selection.createrange().duplicate()
	}
}

function inserttext(objhtml,strtext,bolreplace) {
	if(strtext==""){return("")}
	var obj=document.getelementbyid(objhtml);
	if(document.selection){
		if (obj.currpos){
			if(bolreplace && (obj.value=="")){
				obj.currpos.text=strtext
			}
			else{
				obj.currpos.text+=strtext
			}
		}
		else{
			obj.value+=strtext
		}
	}
	else{
		if(bolreplace){
			obj.value=obj.value.slice(0,obj.selectionstart) + strtext + obj.value.slice(obj.selectionend,obj.value.length)
		}
		else{
			obj.value=obj.value.slice(0,obj.selectionstart) + strtext + obj.value.slice(obj.selectionstart,obj.value.length)
		}
	}
	//obj.focus();
}

function replacetext(objhtml,strprevious,strnext) {
	var obj=document.getelementbyid(objhtml);
	var strtext;
	if(document.selection && document.selection.type == "text"){
		if (obj.currpos){
			var range = document.selection.createrange();
			range.text = strprevious + range.text + strnext;
			return("");
		}
		else{
			strtext=strprevious + strnext;
			return(strtext);
		}
	}
	else{
		if(obj.selectionstart || obj.selectionend){
			strtext=strprevious + obj.value.slice(obj.selectionstart,obj.selectionend) + strnext;
			return(strtext);
		}
		else{
			strtext=strprevious + strnext;
			return(strtext);
		}
	}
}
//*********************************************************




//*********************************************************
// 鐩殑锛?   showmedia by ubb
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function showmedia(objhtml,strurl,strtype,intwidth,intheight)
{
	var strmedia="";
	var blnshow = false;
	var objmedia=objhtml;

	if(objmedia.innerhtml){blnshow = true};

	var re = new regexp("\.[a-z0-9]+$","ig");

	var strextend = re.exec(strurl);
	strextend="|"+string(strextend).tolowercase()+"|";

	if(strtype=="auto"){
		if(string("|.swf|").indexof(strextend)>=0){strtype="swf"}
		if(string("|.mov|.qt|").indexof(strextend)>=0){strtype="qt"}
		if(string("|.wmv|.wmp|.wm|.avi|.mp4|.mpg|.mpeg|.m3u|.pls|.wvx|.wax|.wmx|").indexof(strextend)>=0){strtype="wmv"}
		if(string("|.asf|.wma|.asx|.wav|.mp3|.mpa|.mp2|.m1a|.m2a|.aac|").indexof(strextend)>=0){strtype="wma"}
		if(string("|.rm|.ram|.rmvb|.rpm|.amr|.3gp|.3gpp|.3g2|.3gp2|.rt|.rp|.smi|.smil|").indexof(strextend)>=0){strtype="rm"}
		if(string("|.ra|").indexof(strextend)>=0){strtype="ra"}
	}

	if(blnshow){
		objmedia.innerhtml = strmedia;
	}
	else{
		switch(strtype){
			case "swf":
				strmedia="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+intwidth+"\" height=\""+intheight+"\"><param name=\"movie\" value=\""+strurl+"\"><param name=\"quality\" value=\"high\"><param name=\"play\" value=\"true\"><embed src=\""+strurl+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+intwidth+"\" height=\""+intheight+"\" play=\"true\"></embed></object>"
				break;
			case "qt":
				strmedia="<object classid=\"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\""+intwidth+"\" height=\""+intheight+"\" ><param name=\"src\" value=\""+strurl+"\" ><param name=\"autoplay\" value=\"true\" ><embed  src=\"qtmimetype.pntg\" type=\"image/x-macpaint\"pluginspage=\"http://www.apple.com/quicktime/download\" qtsrc=\""+strurl+"\" width=\""+intheight+"\" height=\""+intheight+"\" autoplay=\"true\" ></embed></object>"
				break;
			case "wmv":
				strmedia="<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" width=\""+intwidth+"\" height=\""+intheight+"\"><param name=\"showstatusbar\" value=\"-1\"><param name=\"autostart\" value=\"true\"><param name=\"filename\" value=\""+strurl+"\"><embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/windows/mediaplayer/\" src=\""+strurl+"\" autostart=\"true\" width=\""+intwidth+"\" height=\""+intheight+"\"></embed></object>"
				break;
			case "wma":
				strmedia="<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" height=\"45\" width=\"350\"><param name=\"showstatusbar\" value=\"-1\"><param name=\"autostart\" value=\"true\"><param name=\"filename\" value=\""+strurl+"\"><embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/windows/mediaplayer/\" src=\""+strurl+"\" autostart=\"true\" width=\"350\" height=\"45\"></embed></object>"
				break;
			case "rm":
				strmedia="<object classid=\"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa\" width=\""+intwidth+"\" height=\""+intwidth+"\"><param name=\"src\" value=\""+strurl+"\"><param name=\"controls\" value=\"imagewindow\"><param name=\"console\" value=\"one\"><param name=\"autostart\" value=\"true\"><embed src=\""+strurl+"\" width=\""+intwidth+"\" height=\""+intwidth+"\" type=\"audio/x-pn-realaudio-plugin\" nojava=\"true\" controls=\"imagewindow,controlpanel,statusbar\" console=\"one\" autostart=\"true\"></object>"
				break;
			case "ra":
				strmedia="<object classid=\"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa\" width=\"350\" height=\"36\"><param name=\"src\" value=\""+strurl+"\"><param name=\"controls\" value=\"controlpanel\"><param name=\"console\" value=\"one\"><param name=\"autostart\" value=\"true\"><embed src=\""+strurl+"\" type=\"audio/x-pn-realaudio-plugin\" nojava=\"true\" controls=\"controlpanel,statusbar\" console=\"one\" autostart=\"true\" width=\"350\" height=\"36\"></object>"
		}
		objmedia.innerhtml = strmedia;
	}
}
//*********************************************************




//*********************************************************
// 鐩殑锛?   insertquote to txaarticle
// 杈撳叆锛?   鏃?
// 杩斿洖锛?   鏃?
//*********************************************************
function insertquote(strname,strtext)
{
	objactive="txaarticle";

	var re;
	re=new regexp("<br/?>","ig");
	strtext=strtext.replace(re, "\n");
	re=new regexp("<[^>]*>","ig");
	strtext=strtext.replace(re, "");

	inserttext(objactive,"[quote=",false);
	inserttext(objactive,strname,false);
	inserttext(objactive,"]",false);
	inserttext(objactive,strtext,false);
	inserttext(objactive,"[/quote]",false);
}
//*********************************************************
document.writeln("");
<div style="text-indent:-9999px;">合作网站：<a href="http://www.niupixuan777.org.cn/">牛皮癣的治疗方法</a> <a href="http://www.qtq1111.cn/">监听器</a> <a href="http://www.chengdutv.org.cn/">成都卫星电视</a> <a href="http://www.qietingchina.cn/">手机监听器</a> <a href="http://www.zhishen.org.cn/">上海开保险箱</a> <a href="http://www.qiangsheng250.cn/">搬运</a> <a href="http://www.hangzhoutv.org.cn/">杭州安装卫星电视</a> <a href="http://www.shiyanxiang.info/">冷热冲击试验箱</a> <a href="http://www.lhc123.org.cn/">六合彩信息</a> <a href="http://www.lhc123.org.cn/">六合彩资料</a> <a href="http://www.sj123.org.cn/">手机追踪器</a> <a href="http://www.imqtq.cn/">手机窃听</a> <a href="http://www.lhc456.org.cn/">香港六合彩公司</a> <a href="http://www.lhc456.org.cn/">六合彩特码</a> <a href="http://www.gongxing974.cn/">公兴搬家</a> <a href="http://www.pajinsen120.net.cn/">帕金森综合症</a> <a href="http://www.sz-laser.com.cn/">专卖店设计</a> <a href="http://www.debang8586.cn/">上海德邦物流公司</a> <a href="http://www.pump800.com.cn/">自吸泵</a> <a href="http://www.lwzf.gov.cn/images/_notes/">上海卫星电视</a> <a href="http://www.jiechangyan777.com.cn/">结肠炎</a> <a href="http://www.tv777.org.cn/">北京卫星电视维修</a> <a href="http://www.tt999.net.cn/">天天搬场</a> <a href="http://www.zaoxie800.net.cn/">早泄怎么办</a> <a href="http://www.dazhongt.cn/">大众搬家电话</a> <a href="http://vic.sina.com.cn/news/27/2009/1214/8967.html">银屑病</a> <a href="http://www.gx99.net.cn/">公兴搬场公司</a> <a href="http://www.dazhongbanchang0974.cn/">上海搬运公司</a> <a href="http://www.010baidianfeng.org.cn/">白癜风的治疗方法</a> <a href="http://www.120shanqi.org.cn/">疝气</a> <a href="http://www.91ganxi.org.cn/">干洗</a> <a href="http://www.zhongtie518.cn/">中铁物流</a> <a href="http://www.cp1215.com.cn/">六合彩资料</a> <a href="http://www.cp1215.com.cn/">六合彩开奖</a> <a href="http://www.baidianfeng120.info/">白癜风的病因</a> <a href="http://www.qtq88.com.cn/">窃听器</a> <a href="http://www.menghuiganxi.cn/">干洗机</a> <a href="http://www.dianxian100.cn/">癫痫病</a> <a href="http://www.suzhoutv.com.cn/">苏州卫星电视维修</a> <a href="http://www.pack999.cn/">缠绕膜</a> </div>
