﻿// JScript 文件
function $(id)
{
    return document.getElementById(id);
}


function _sendlogin() 
{ 
var username=document.getElementById("SendEmail1_senduser").value;
var company=document.getElementById("SendEmail1_sendCompany").value; 
var phone=document.getElementById("SendEmail1_sendPhone").value;
var comment=document.getElementById("SendEmail1_sendcomment").value;
var email=document.getElementById("SendEmail1_sendemail").value;
var YCountry=document.getElementById("SendEmail1_sendYCountry").value;
if( comment=="")
   {
        alert("Please enter content.");       
   }
else
{
    if(company=="")
    {
        alert("Please input company！");
    }else
    {
        if(username=="")
        {
             alert("Please input name！");
        }
        else
		{ 
            if(email!= "")
            {
                var pattern = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
                if(pattern.test(email))
                {                    
                    if(phone!="")
                    { 
                        if(phone.length<50)
                        {
                           //var url="/AjaxSendEmail.aspx";
                           //var pars="name=" + escape(username)+"&company="+escape(company)+"&phone="+escape(phone)+"&email="+escape(email)+"&country="+escape(YCountry)+"&comment="+escape(comment); var editAjax=new Ajax.Request(url,{method:'get',parameters:pars,onComplete:GetEmail}); 
                           //localhost.href="?name=" + escape(username)+"&company="+escape(company)+"&phone="+escape(phone)+"&email="+escape(email)+"&country="+escape(YCountry)+"&comment="+escape(comment); var editAjax=new Ajax.Request(url,{method:'get',parameters:pars,onComplete:GetEmail}); 
                            $("aspnetForm").submit();
                        }
                        else
                        {
                            alert("The Telephone Number you entered is wrong.");
                        }
                    } 
                    else
                    {
                        alert("Please enter your Tel.");
                    }                   
                }
                else
                {
                    alert("The Email address you entered is wrong.");
                }
            }
            else
            {
                alert(" Please enter your Email adrsee.");
                
            }            
        }
    }
}

}
 function GetEmail(resaultObj){
	var xmls=resaultObj.responseXML;
	var suc=xmls.getElementsByTagName("result")[0].getAttribute("value");
	if(suc=="true"){}else{location.href="?";}
	} 



function Concel()
{
    $("control_big_small_button").style.display="none";
    $("sendmail_big_box").style.display="none";
    $("sendmail_small_box").style.display="block";
    $("SendEmail1_tishitrue").style.display="none";
    $("SendEmail1_tishierror").style.display="none";   
}

function Conver()
{
   
    
    $("control_big_small_button").style.width=document.body.offsetWidth;
    $("control_big_small_button").style.height=document.body.offsetHeight;
    function Z_Index2()
    {
        $("sendmail_big_box").style.display="block";
        $("control_big_small_button").style.display="block"; 
        $("sendmail_small_box").style.display="none";
    }
    Z_Index2();
}

window.onload=function onloaddiv()
{    
    if($("SendEmail1_action").value=="123" || $("SendEmail1_action").value=="456")
    {
        Concel();
    }
    else
    {
        $("control_big_small_button").style.display="none";
        $("sendmail_big_box").style.display="none";
        $("sendmail_small_box").style.display="block";
   }
}

function check(QQ)
{
    if(QQ.replace('<','').replace('>',"").length!=QQ.length){
        return false;
    }else
        return true;
}
