﻿var i=0;
var j=100;
var s,h;
var objshow;
var objhidd;
function change_show(){
	i=i+20; 
	objshow.style.filter = "Alpha(Opacity=" + i + ")";
	if(i>=100){
		clearInterval(s);
		i=0;
	}
}
function change_hidden(){
	j=j-15;
	objhidd.style.filter = "Alpha(Opacity=" + j + ")";
	if(j<=0){
		clearInterval(h);
		j=100;
		objhidd.style.display="none";
	}
}

function alpha_show(x){
	objshow = eval(x);
	if(s){clearInterval(s);}
	s = setInterval(change_show,1);
}
function alpha_hidden(x){
	objhidd = eval(x);
	if(h){clearInterval(h);}
	h = setInterval(change_hidden,1);
}

function locationTo(x) {
	top.document.location.replace("http://" +x+ ".ersoso.com");
}

function movein(x) {
	x.style.backgroundColor="FFE9C6"
}
function moveout(x) {
	x.style.backgroundColor="FFFFFF"
}


function trim(str) { 
	str = str.replace(/(^\s*)/g, "")
	str = str.replace(/(\s*$)/g, "")
	str = str.replace(/(^\r\n*)/ig,"")
	return str
} 
function ltrim (str) { 
	return str.replace(/^\s+/g,""); 
} 
function rtrim(str) { 
	return str.replace(/\s+$/g,""); 
}

function xmlHttp(inurl) {
try{
	var aVersions = ["MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];
	var xml

	for (var i = 0; i < aVersions.length; i++) {
		try {
			xml = new ActiveXObject(aVersions[i])
			break
		} catch (oError) {}
	}

	xml.open("GET", inurl, false)
	xml.send(null)

	if (xml.readyState==4) return Bin2Str(xml.ResponseText)
	//return Bin2Str(xml.responseBody)
	}
catch(err) {}
}

function Bin2Str(Binary){ 
	if (Binary==null)	return ""
	var axRs = new ActiveXObject("ADODB.RecordSet")
	axRs.Fields.Append("Binary2String",201,1)
	axRs.open()
	axRs.addNew()
	axRs(0).appendChunk(Binary)
	axRs.update()
	var Result = axRs(0).value
	axRs.Close()
	//Result = Result.replace(/\x20|\x0d\x0a/g,"")
	Result = Result.replace(/\x0d\x0a/g,"")
	return Result
	axRs=null;Result=null;
}

//顶部城市导航
function topnavshow() {
	top.document.location.replace("http://www.ersoso.com?t=all");
	//var topnav = document.getElementById("topnav");
	//if (topnav.style.display=="none") {
	//	document.getElementById("topnavspan").style.color="red";
	//	topnav.style.display="";
	//	topnav.style.filter="Alpha(Opacity=20)";
	//	alpha_show("topnav");
	//}
}


function topnavshow11() {
	if (topnav.style.display=="none") {
		topnavspan.style.color="red";
		topnav.style.display="";
		topnav.style.filter="Alpha(Opacity=20)";
		alpha_show("topnav");
	}

}
function topnavhidd() {
	document.getElementById("topnav").style.display="none";
	document.getElementById("topnavspan").style.color="blue";
}
function topnavclick() {
	window.event.cancelBubble=true;
}

//正文页用户管理
function errpost() {
	objvalue="";
	obj = document.getElementsByName("errtype");
	for(i=0;i<obj.length;i++)　
		if(obj[i].checked)	{
			objvalue=obj[i].value
			break
		}

	if (objvalue=="") {
		alert("请选择反馈类型！")
		return
	}

	objlen = trim(document.errform.elements["errtext"].value).length
	if (objvalue=="3" && (objlen<10 || objlen>800)) {
		alert("请填写详细的反馈内容，不低于10个字！")
		document.errform.elements["errtext"].select()
		document.errform.elements["errtext"].focus()
		return
	}
	document.errform.submit()
}
function pwdchk() {
	objlen =document.loginform.elements["password"].value.length
	if (objlen<4 || objlen>20) {
		alert("请填写管理密码，长度为4～20！")
		document.loginform.elements["password"].select()
		document.loginform.elements["password"].focus()
		return false
	}
	return true
}

function suggest() {
	top.document.location.replace("?op=suggest");
}
function login() {
	top.document.location.replace("?op=login");
}

function suggest_() {
	str = top.document.location.href;
	reg=new RegExp("[a-z]*.htm");
	str = str.replace(reg,"s.htm"); 
	top.document.location.replace(str);
}
function login_() {
	str = top.document.location.href;
	reg=new RegExp("[a-z]*.htm");
	str = str.replace(reg,"l.htm"); 
	top.document.location.replace(str);
}

function search() {
	objlen = trim(document.searchform.elements["s"].value).length
	if (objlen>30) {
		alert("抱歉，文本太长！请控制在30字以内。")
		return false
	}
	if (objlen==0) {
		document.searchform.elements["s"].style.color="white"
		document.searchform.elements["s"].value = "二手交易信息"
	}
	return true
}
function imgsearch() {
	if (search())	document.searchform.submit()
}
function navcity() {
	document.write("<div onclick='topnavclick()' id='topnav' style='display:none;' class='leftul'>");
	document.write("<a href='http://beijing.ersoso.com'>北京</a> <a href='http://shanghai.ersoso.com'>上海</a> <a href='http://tianjin.ersoso.com'>天津</a> <a href='http://chongqing.ersoso.com'>重庆</a><span style='position:absolute;right:14px;'><a style='color:red;font-size:12px;' href='http://www.ersoso.com/?t=all'>更多</a> <span style='color:red;cursor:pointer;' onclick='topnavhidd()'>关闭</span></span>");
	document.write("<div id='ttline1'><div></div></div>");
	document.write("<ul><li class='t1'>C</li><li class='t2'><a href='http://chengdu.ersoso.com'>成都</a> <a href='http://changsha.ersoso.com'>长沙</a> <a href='http://changchun.ersoso.com'>长春</a></li><li class='t1'>F</li><li><a href='http://fuzhou.ersoso.com'>福州</a> <a href='http://foshan.ersoso.com'>佛山</a></li></ul>");
	document.write("<ul><li class='t1'>G</li><li class='t2'><a href='http://guangzhou.ersoso.com'>广州</a> <a href='http://guiyang.ersoso.com'>贵阳</a> <a href='http://guilin.ersoso.com'>桂林</a></li><li class='t1'>H</li><li><a href='http://hefei.ersoso.com'>合肥</a> <a href='http://haikou.ersoso.com'>海口</a> <a href='http://haerbin.ersoso.com'>哈尔滨</a> <a href='http://hangzhou.ersoso.com'>杭州</a></li></ul>");
	document.write("<ul><li class='t1'>J</li><li class='t2'><a href='http://jinan.ersoso.com'>济南</a> <a href='http://jilin.ersoso.com'>吉林</a></li><li class='t1'>K</li><li><a href='http://kunming.ersoso.com'>昆明</a> <a href='http://kaifeng.ersoso.com'>开封</a></li></ul>");				document.write("<ul><li class='t1'>L</li><li class='t2'><a href='http://lanzhou.ersoso.com'>兰州</a> <a href='http://lasa.ersoso.com'>拉萨</a> <a href='http://lianyungang.ersoso.com'>连云港</a></li><li class='t1'>N</li><li><a href='http://nanning.ersoso.com'>南宁</a> <a href='http://nanjing.ersoso.com'>南京</a> <a href='http://nanchang.ersoso.com'>南昌</a></li></ul>");
	document.write("<ul><li class='t1'>S</li><li class='t2'><a href='http://shenyang.ersoso.com'>沈阳</a> <a href='http://shenzhen.ersoso.com'>深圳</a> <a href='http://shijiazhuang.ersoso.com'>石家庄</a></li><li class='t1'>T</li><li><a href='http://taiyuan.ersoso.com'>太原</a> <a href='http://tangshan.ersoso.com'>唐山</a></li></ul>");
	document.write("<ul><li class='t1'>W</li><li class='t2'><a href='http://wuhan.ersoso.com'>武汉</a> <a href='http://wulumuqi.ersoso.com'>乌鲁木齐</a></li><li class='t1'>X</li><li><a href='http://xining.ersoso.com'>西宁</a> <a href='http://xian.ersoso.com'>西安</a> <a href='http://xiamen.ersoso.com'>厦门</a></li></ul>");
	document.write("<ul><li class='t1'>Y</li><li class='t2'><a href='http://yinchuan.ersoso.com'>银川</a> <a href='http://yangzhou.ersoso.com'>扬州</a> <a href='http://yantai.ersoso.com'>烟台</a> <a href='http://yiwu.ersoso.com'>义乌</a></li><li class='t1'>Z</li><li><a href='http://zhengzhou.ersoso.com'>郑州</a> <a href='http://zhuhai.ersoso.com'>珠海</a> <a href='http://zhongshan.ersoso.com'>中山</a></li></ul>");
	document.write("</div>");
}
function StrInChk (InString,RefString) {
	if(InString.length==0) 	return false
	for (Count=0; Count < InString.length; Count++)  {
		TempChar= InString.substring (Count, Count+1)
		if (RefString.indexOf (TempChar, 0)==-1)  
		return (false)
	}
	return true
}
function hiddinnertxt(x) {
	var myDate = new Date();
	var nowtime = ""+myDate.getYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate()+" "+myDate.getHours()+":"+myDate.getMinutes()+":"+myDate.getSeconds()
	document.getElementById("hidddiv").innerHTML="<div id='tipbox'><div class='title'><span>本条信息已经被取消！</span></div><div style='margin-top:10px'>" +nowtime+ "<br>本条信息已完成交易，或被用户取消，信息内容已删除!</div></div><h1>"+x+"</h1><br><br><br>"
}
