<!-- 栏目频道切换按钮-->
function getObj(objName){
	return(document.getElementById(objName));
}
function changeOver(objName,objId,num,contentid){
    for(i=0;i<num;i++){
		getObj(objName+i).className="h_bg2";
		getObj(contentid+i).style.display = "none";
	}
	getObj(objName+objId).className="h_bg1";
	getObj(contentid+objId).style.display = "";
}

function bgOver(thisObj){
	thisObj.style.background="#F8F8F8";
}
function bgOut(thisObj){
	thisObj.style.background="";
}

function ProductsSearch(){
	if(document.FormSearch.keyword.value == ''){
		alert('请输入搜索关键字.');
		document.FormSearch.keyword.focus();
		return false;
	}
	if(document.FormSearch.time.value == ''){
		alert('请输入天数.其中0表示当天');
		document.FormSearch.time.focus();
		return false;
	}
	return true;
}

function ProductsSearch(){
	    if(document.FormSearch.keyword.value == ''){
			alert('请输入搜索关键字.');
			document.FormSearch.keyword.focus();
			return false;
		}
		if(document.FormSearch.time.value == ''){
			alert('请输入天数.其中0表示当天');
			document.FormSearch.time.focus();
			return false;
		}
		return true;
		}

function help()
{
    var helpmess;
    helpmess="-------中国二手叉车网搜索功能说明-------\r\n\r\n"+
         "1.关键字必须填写.填写的关键字可以是产品名称、\r\n\r\n"+
		 "　产品型号、品牌、公司名.\r\n\r\n"+
         "2.天数必须填写,默认为7天之内，其中0表示当天,\r\n\r\n"+
         "　1表示一天之内,2表示两天之内,依次类推...\r\n\r\n"+
         "3.价格范围可填可不填，默认10000~500000，其中\r\n\r\n"+
		 "　复选框打勾表示搜索所有价格也包含有面议,此时\r\n\r\n"+
		 "　默认价格范围不起作用，否则只搜索默认价格的\r\n\r\n"+
		 "　范围且不包含面议,此时默认价格范围可按用户\r\n\r\n"+
		 "　搜索要求更改,并起作用.\r\n\r\n"+
         "4.产品分类和地区分类可选可不选，其选择大小分类\r\n\r\n" +
		 "　由用户搜索范围决定.\r\n\r\n"+
		 "------------如有问题请与我们联系---------";
    alert(helpmess);

}

function UserLogin(){
	if(document.FormLogin.adm_user.value == ''){
		alert('请输入用户名.');
		document.FormLogin.adm_user.focus();
		return false;
	}
	if(document.FormLogin.adm_pass.value == ''){
		alert('请输入密码');
		document.FormLogin.adm_pass.focus();
		return false;
	}
	return true;
	}
	
function companySearch(){
	if(document.FormSearch.coKeyword.value == ''){
		alert('请输入搜索关键字.');
		document.FormSearch.coKeyword.focus();
		return false;
	}
	return true;
}

function showul(ulclsname,liclsname,showmorename,layername)
{
	if(null == layername)
		layername = "showlayer";
	var showmore = document.getElementById(showmorename);
	var Lshow = document.getElementById(layername);
	if(showmore)
	{
		if(showmore.className == "showmore")
		{
			Lshow.innerHTML = "<A class=blackLineLink href=javascript:showul('"+ulclsname+"','more','"+showmorename+"','"+layername+"')><font color=#FF0000>&lt;&lt;简洁显示</font></A>";
			showmore.className = "showless";
			disp = "block";
		}
		else
		{
			Lshow.innerHTML = "<A class=blackLineLink href=javascript:showul('"+ulclsname+"','more','"+showmorename+"','"+layername+"')><font color=#FF0000>更多&gt;&gt;</font></A>";
			showmore.className = "showmore";
			disp = "none";
		}
	}
	var es = document.getElementsByTagName('ul');
	for (var i=0;i<es.length;i++)
	{
		var e = es.item(i);
		if( e && e.className && e.className == ulclsname)//find obj
		{
			for (var j = 0; j < e.childNodes.length; j++) {
				var child = e.childNodes.item(j);
				if (child && (child.tagName == 'li' || child.tagName == 'LI') && child.className && child.className == liclsname)child.style.display=disp;
			}
		}
	}
}

<!--
//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        //ImgD.alt=image.width+"×"+image.height;
        }
    }
} 
//-->

//图片缩放开始
//改变图片大小
function resizepic(thispic)
{
if(thispic.width>700) thispic.width=700;
}
//无级缩放图片大小
function bbimg(o)
{
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}
//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
//图片缩放结束

//图片上传
function openUploadFile(path,width,height)
{
	if (width!=""){
	var filewidth = width;
	}else{
	var filewidth = 410;
	}
	if (height!=""){
	var fileheight = height;
	}else{
	var fileheight = 155;
	}
	if (filepath!=""){
	var filepath=path;
	}else{
	var filepath = 'uploadimg.php?' + window.parent.document.getElementById('imgurl').value;
	}
	if (window.showModalDialog!=null){
		
	var showx = event.screenX + event.offsetX;
	var showy = event.screenY + event.offsetY + 5;

	var retval = window.showModalDialog(filepath, window, "dialogWidth:"+ filewidth +"px; dialogHeight:"+ fileheight +"px; dialogLeft:" + showx + "px; dialogTop:" + showy + "px; help: no; scroll: no; status:no; directories:yes;scrollbars:no;Resizable=yes;");
	
	if(retval!=null)
	return retval;
	
	}else{
	
	window.open(filepath,"","width="+ filewidth +",height="+ fileheight +",menubar=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes");

	return;
	
	}
}