//仿真百度留言板
window.onresize = baiduResizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
String.prototype.Trim = function(){return this.replace(/^\s+|\s+$/g,"");}
function baidu_collapse(obj){
ct = document.getElementById('tab_c_'+(2+3));
if(ct.style.display=="none"){
ct.style.display="";
obj.src=obj.src.replace("b.gif","a.gif");
} else {
ct.style.display="none";
obj.src=obj.src.replace("a.gif","b.gif");
}
baiduResizeDiv();
}
function baiduMsg()
{
try{
divTop = parseInt(document.getElementById("eMeng").style.top,10);
divLeft = parseInt(document.getElementById("eMeng").style.left,10);
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth;
document.getElementById("eMeng").style.visibility="visible";
objTimer = window.setInterval("baidu_move_div()",10);
}catch(e){}
}
function baiduResizeDiv()
{
i+=1;
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10);
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10);
}catch(e){}
}
function baidu_move_div()
{
try{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer);objTimer = window.setInterval("baiduResizeDiv()",1);
}
divTop = parseInt(document.getElementById("eMeng").style.top,10);
document.getElementById("eMeng").style.top = divTop - 2;
}catch(e){}
}
function valid_message()
{
objMess = lea_mess.message;
objContact = lea_mess.contact;
objMess.value = objMess.value.Trim();
objContact.value = objContact.value.Trim();
strMess = objMess.value;
strContact = objContact.value;
if (strMess.length > 200)
{
alert('您的留言过长,请减少至200字内,谢谢!');
return false;
}
if (strContact.length > 50)
{
alert('您的联系方式过长,请减少至50字内,谢谢!');
return false;
}
if ((strMess.length < 1 || strMess==objMess.defaultValue) && strContact.length>0)
{
alert('您还没有填写留言内容,请在留言内容框内填写完提交,谢谢!');
return false;
}
if ((strContact.length < 1 || strContact==objContact.defaultValue) && strMess.length>0)
{
alert('您还没有填写联系方式,请在联系方式框内填写完提交,谢谢!');
return false;
}
if ((strContact.length < 1 && strMess.length<1) || (strMess==objMess.defaultValue && strContact==objContact.defaultValue))
{
alert('您好,留言不能为空,谢谢!');
return false;
}
if(!confirm('您确定发送留言吗?'))
{
return false;
}
lea_mess.submit();
msee_init();
}
function msee_init () {
lea_mess.message.value = lea_mess.message.defaultValue;
lea_mess.contact.value = lea_mess.contact.defaultValue;
}
function baiduMessbox(shape,color,userid){
var styles='position:absolute;top:0px;left:0px;z-index:99999;visibility:hidden;';
var copic='
';
if(shape>1) window.onload = baiduMsg;
else {styles='';copic=''}
var s;
if(shape==2) {
s='