
function getObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {

return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {

return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {

return document.layers[objectId];
    } else {
return false;
    }
}

function displayList(n,dHeight){ 
       var h = getObject('content'+ n).offsetHeight;
       var max_h = dHeight;
  
       
       var anim = function(){   
        h += 15;
        if(h >= max_h){ 
              getObject('content'+ n).style.height = dHeight;
              getObject('img'+ n).src="4/-.gif";
              if(tt){window.clearInterval(tt);}
        }
        else{
                getObject('content'+ n).style.display="block";
                getObject('content'+ n).style.height = h + "px";
        }
      }
     var tt = window.setInterval(anim,2);
}

function hiddenList(n,dHeight){
       var h = getObject('content'+ n).offsetHeight;
     var anim = function(){
        h -= 15;
        
        if(h <= 5){
              getObject('content'+ n).style.display="none";
             getObject('img'+ n).src="4/+.gif";
             if(tt){window.clearInterval(tt);}
         }
         else{
             getObject('content'+ n).style.height = h + "px";
         }
     }
     var tt = window.setInterval(anim,2);
}

function showClassList(n,dHeight){
var dHeight=dHeight

   if(getObject('content'+ n).style.display == "none"){ 
       getObject('tdTitle' + n).title = "点击收缩"
    getObject('showTxt' + n).innerText = "(点击收缩)"
       displayList(n,dHeight); // 显示内容框
   }
//   else{
 //      getObject('tdTitle' + n).title = "点击展开"
 //   getObject('showTxt' + n).innerText = "(点击展开)"
 //   hiddenList(n,dHeight); 
//}
}

//提交内容判断
function check()
{
if(document.form.title.value=="") 
{ 
alert("请填写您的污水简介，如污水性质、日排水量等."); 
this.form.title.focus(); 
return false; 
} 
else if(document.form.title.value.length<4) 
{ 
alert("您填写的污水简介过于简单!"); 
this.form.title.focus(); 
return false; 
} 
if(document.form.content.value=="") 
{ 
alert("请填写您的具体需求！"); 
this.form.content.focus(); 
return false; 
} 

if(document.form.company.value=="") 
{ 
alert("请填写您的单位名称！"); 
this.form.company.focus(); 
return false; 
}
if(document.form.contact.value=="") 
{ 
alert("请填写联系人！"); 
this.form.contact.focus(); 
return false; 
} 
if(document.form.tel.value=="") 
{ 
alert("请填写您的联系电话，您的联系方式将不对外公开，请放心填写！"); 
this.form.tel.focus(); 
return false; 
}
}

