﻿// JScript 文件

var agt=navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));

var intEmailDelay=5;//设置divSendMail显示速度，越大越慢

var intInterval=8;//透明度递增递减值，div淡入淡出平滑度，越小越细腻
function IeTrueBody()
{
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ShowSendMail(evt)
{
    var div=document.getElementById("divSendMail"); 
    div.style.display="block";
    div.style.top=evt.clientY+IeTrueBody().scrollTop-10+'px';
    div.style.left=evt.clientX+IeTrueBody().scrollLeft-90+'px';  
    ShowEmail();      
}
function ShowEmail()
{
    var div=document.getElementById("divSendMail"); 
    div.filters.alpha.opacity+=intInterval;
    if (div.filters.alpha.opacity<100) 
         setTimeout("ShowEmail()",intEmailDelay); 
}
function clearSendMail()
{
    if(navigator.userAgent.indexOf("Firefox")>0)
    {
        document.getElementById("divSendMail").style.display="none";
    }
    CloseEmail();
}
function CloseEmail()
{
    var div=document.getElementById("divSendMail"); 
    div.filters.alpha.opacity-=intInterval;
    if (div.filters.alpha.opacity>0) 
    {
        setTimeout("CloseEmail()",intEmailDelay);
    }
    if(div.filters.alpha.opacity<1)
    {
        div.style.display="none";
    }
}
function validator()
{
    var Email=document.form1.txtMailAddress.value;
    var reg="^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$";
    var re = new RegExp(reg);
    if(!re.test(Email))
    {
       document.getElementById("divMessage").innerHTML="<font color=red>不是有效的Email地址</font>";
       return false;
    }                
}

 function ValidatorComment()
 {
    var tempObj = document.getElementById("txtContent");
    var strCommentContent=tempObj.value;
    if(strCommentContent=="")
    {
       alert("对不起评论内容不能为空");
       return false;
    }
    else
    {
       return true;
     }
 }//end function ValidatorComment()
 
 function ShowBigPic(PicEle)
 {
 document.getElementById("BigPic").src=PicEle.src;
 document.getElementById("HyBigPic").href=PicEle.src;
 }

