//search input
function infoto(obj, wz) {
    if (obj.value.length > 0) {
        if (wz == "trade") ToPage("http://buy.stonemsn.com/" + wz + "/search.htm?" + escape(obj.value));
        if (wz == "company") ToPage("http://company.stonemsn.com/" + wz + "/search.htm?" + escape(obj.value));
        if (wz == "picture") ToPage("http://pic.stonemsn.com/" + wz + "/search.htm?" + escape(obj.value));
        if (wz == "info") ToPage("http://news.stonemsn.com/" + wz + "/search.htm?" + escape(obj.value));
        if (wz == "expo") ToPage("http://expo.stonemsn.com/" + wz + "/search.htm?" + escape(obj.value));
        if (wz == "bussion") ToPage("http://trade.stonemsn.com/" + wz + "/search.htm?" + escape(obj.value));
    } else {
        alert('请输入您要搜索的关键字内容');
        return false;
    }
}
function SearchmenuDisp(wz){
	document.getElementById("Searchmenu_"+wz).className='item1';
}

//jump to page
function ToPage(url) {
    window.document.location.href = url;
}

// change class style with obj
function aboutMouse(obj,v){
	obj.className=v;
}

//auto small the picture
function autosmall(a){
	var picw=a.width;
	if(a.width>150) a.width=150
}

//show the classlist in index page of company
function showclass(v){
	if(v==0){
		//class
		document.getElementById("LeftClassContent").style.display="";
		document.getElementById("LeftMenu1").className="leftclass11";
		document.getElementById("LeftCityContent").style.display="none";
		document.getElementById("LeftMenu2").className="leftclass20";
	}else{
		//city
		document.getElementById("LeftClassContent").style.display="none";
		document.getElementById("LeftMenu1").className="leftclass10";
		document.getElementById("LeftCityContent").style.display="";
		document.getElementById("LeftMenu2").className="leftclass21";
	}
}

//picture show in info page
function showpic(pict,picno,picurl){
	for(var i=0; i<pict; i++){
		document.getElementById("NewPic"+(i+1)).className="item0";
	}
	document.getElementById("NewPic"+picno).className="item1";
	document.getElementById("NewPicUrl").src=picurl;
}

//tradeclass show in index page
function showtradec(showi){
	for(var i=1;i<15;i++){
		var a=document.getElementById("tradebc"+i);
		if(a){
			if(i==showi){
				document.getElementById("tradebc"+i).className='menu1';
				document.getElementById("tradesc"+i).className='show1';
			}else{
				document.getElementById("tradebc"+i).className='menu0';
				document.getElementById("tradesc"+i).className='show0';
			}
		}
	}
}

//righttitleclass in index page
function righttitleshow(obj,obj1,objv){
	if(objv==0){
		document.getElementById(obj+'0').className='titlea1';
		document.getElementById(obj+'1').className='titlea0';
		document.getElementById(obj1+'0').style.display='';
		document.getElementById(obj1+'1').style.display='none';
	}else{
		document.getElementById(obj+'1').className='titlea1';
		document.getElementById(obj+'0').className='titlea0';
		document.getElementById(obj1+'0').style.display='none';
		document.getElementById(obj1+'1').style.display='';
	}
}

//default menu in index page
function menushow(obj,obj1,objv){
	for(var i=1;i<15;i++){
		var a=document.getElementById(obj+i);
		if(a){
			if(i==objv){
				document.getElementById(obj+i).className=obj1;
				document.getElementById(obj+i+'Content').style.display='';
			}else{
				document.getElementById(obj+i).className='';
				document.getElementById(obj+i+'Content').style.display='none';
			}
		}
	}
}

//picture show in expo picture page
function expoimgshow(obj) {
    if (obj.width > 600) obj.width = 600;
}

//expo search in expo picture page
function exposearch(objk, objy1, objm1, objy2, objm2) {
    var key = document.getElementById(objk).value;
    var y1 = document.getElementById(objy1).value;
    var m1 = document.getElementById(objm1).value;
    var y2 = document.getElementById(objy2).value;
    var m2 = document.getElementById(objm2).value;
    if (key.length > 0) {
        ToPage("/expo/search/" + y1 + "/" + m1 + "/" + y2 + "/" + m2 + "/1.htm?" + escape(key));
        return true;
    } else {
        alert('请输入您要搜索的关键字内容');
        return false;
    }
}

//load pic
function loadpic(imgUrl,imgObj){
	var imgshow=new Image();
	 imgshow.src = imgUrl;
	 imgshow.onload = function() {
		 document.getElementById(imgObj).src = this.src;
	 }
}