document.write("<scr"+"ipt id=\"myajax\"></scr"+"ipt><div id=\"waiting\" onclick=\"hideWaiting();\" style=\"display:none;position:absolute;z-index:999;top:30%; left:40%;border:1px #F7D670 solid; background-color:#FFFBEC; height:20px; line-height:20px; padding-left:25px;width:250px; font-size:12px;\"><span class=\"float\"><img src=\"image/loadinfo_net2b.gif\" alt=\"&#31561;&#24453;\"></span><span id=\"waitcont\" class=\"float\">&#27491;&#22312;&#21457;&#36865;&#65292;&#35831;&#31245;&#20505;&#46;&#46;&#46;&#46;&#46;&#46;</span></div>");

function sendSms() {
	var phone = document.getElementById("vphone").value;
	var msgcont = document.getElementById("neirong").value;

	if(!msgcont || msgcont.length==0){
		showWaiting(" &#30701;&#20449;&#20869;&#23481;&#19981;&#33021;&#20026;&#31354;&#65281; ");
		return;
	}

	var validStr="0123456789,";
	phone = phone.replace(/\r\n/g,",").replace(/(\s*)/g, "");
	if(!phone || phone.length==0){
		showWaiting(" &#30005;&#35805;&#21495;&#30721;&#19981;&#33021;&#20026;&#31354;&#65281; ");
		return;
	}

	for(i=0;i<phone.length;i++){
		if(validStr.indexOf(phone.charAt(i))==-1){
			showWaiting(" &#30005;&#35805;&#21495;&#30721;&#19981;&#33021;&#20026;&#31354;&#65281; ");
			return;
		}
	}
	showWaiting("&#27491;&#22312;&#21457;&#36865;&#65292;&#35831;&#31245;&#20505;&#46;&#46;&#46;&#46;&#46;&#46;");
	var sendSmsUrl = "http://caas.my2my.cn/sendSMSProxySecond.jsp?phone="+phone+"&msgcont="+unicode(msgcont);
	document.getElementById("myajax").src = sendSmsUrl;
};

function showSendResult(msg){
	if(msg.replace(/(\s*)/g, "").length == 1)
	{
		showWaiting("&#21457;&#36865;&#25104;&#21151;&#65281;");
	}else if(msg.replace(/(\s*)/g, "").length > 1)
	{
		showWaiting(" &#21457;&#36865;&#22833;&#36133;&#33; ");
	}else
	{
		showWaiting(" &#21457;&#36865;&#22833;&#36133;&#33; ");
	}
};

function hideWaiting(){
	JsUtil.fadeOut("waiting");
    document.getElementById("waitcont").innerHTML = "";
};

function showWaiting(str){
	document.getElementById("waitcont").innerHTML = str;
	var tempWaiting = document.getElementById("waiting");
	tempWaiting.style.display='block';
	tempWaiting.style.left = vLeft;
    tempWaiting.style.top = vTop;
	JsUtil.fadeIn("waiting");
	Hide();
	hideTimeout();
};

function hideTimeout(){
	setTimeout(hideWaiting,3000);   
};

function unicode(s){ 
    var len=s.length; 
    var rs=""; 
    for(var i=0;i<len;i++){ 
        var k=s.substring(i,i+1); 
        rs+="fen"+s.charCodeAt(i); 
    } 
    return rs; 
};















var timeo;
var curAlpha = 0;
var JsUtil = {  
    fadeIn: function(id){
	    JsUtil.clear();
        this.fade(id, true);  
    },  
    fadeOut: function(id){
	    JsUtil.clear();
        this.fade(id, false);  
    },
	clear: function(){
	    if(timeo){
		    window.clearTimeout(timeo);
		}
	},
    fade: function(id, flag){
        var target = document.getElementById(id);  
        target.alpha = curAlpha;
        target.style.opacity = (target.alpha / 100);  
        target.style.filter = 'alpha(opacity=' + target.alpha + ')';   
        (function(){
            target.style.opacity = (curAlpha / 100);  
            target.style.filter = 'alpha(opacity=' + curAlpha + ')';  
            if (flag) {  
                curAlpha++;  
                if (curAlpha <= 100) {  
                    timeo = setTimeout(arguments.callee, 15);
                }  
            }  
            else {  
                curAlpha--;  
                if (curAlpha >= 0) {  
                    timeo = setTimeout(arguments.callee, 15);
                }  
            }  
        })();  
    }  
};
