/*前台注册条js处理 slj 2011-01-26*/
 function include(strSrc)
{ 
        document.write('<script type="text/javascript" src="'+ strSrc +'"></script>');
}
function includeStyle(strSrc)
{
    document.write('<link href="'+ strSrc +'" rel="stylesheet" type="text/css" />');
    
}
include("/_common/gui/gui.js");
includeStyle("/_common/gui/css/gui.css");
function Msg(msg,fn)
{
	var alertMsg=new gUI.msg({content:msg,model:'alert'});
	if(fn!=null)
	{
		alertMsg.addCallBack(fn);
	}
	alertMsg.show();
} 
function CheckMembercount(theForm,msg) {
	 if (TrimString(" ", theForm.userid.value) =="" ){
	 /*alert("<?{$left_bracket}?><?{$diy_userid}?><?{ $right_bracket}?><?{ $MSG_notblank}?>");
	 theForm.userid.value = "";
	 theForm.userid.focus(); */
	 Msg(msg['id'],function(){theForm.userid.value = "";
	 theForm.userid.focus(); });
	 return(false);
	 }
	if (TrimString(" ", theForm.passwd.value) =="" ){
	 /*alert("<?{ $left_bracket}?><?{ $diy_passwd}?><?{ $right_bracket}?><?{ $MSG_notblank}?>");
	 theForm.passwd.value = "";
	 theForm.passwd.focus();*/
	 Msg(msg['password'],function(){theForm.passwd.value = "";
	 theForm.passwd.focus();});  
	 return(false);
	}
	theForm.passwd.value=hex_md5(theForm.passwd.value);
	return(true);
}
function alertMessage(msg,url)
{
    if(msg!="")
    {
        var alertMsg=new gUI.msg({content:msg,model:'alert'});
        if(url!="")
        {
            alertMsg.addCallBack(function(){window.location.href=url;});
        }
        alertMsg.show();
    }
}
 var xmlHttp=false;
try{
    xmlHttp=new XMLHttpRequest();
}
catch(e1)
{
    try{
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e2)
    {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
}
function registerDeal(urlreg)
{
    var url = "/alltemp/registerdeal.php";
    
    strPOST = "";
    iFlag = xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlHttp.send(strPOST);
    xmlHttp.onreadystatechange = function(){
        if(xmlHttp.readyState==4&&xmlHttp.status==200)
        {
            var responseData=xmlHttp.responseText;
            var element=responseData.split('|');
            if(element[0]=="false"&&element[1]!="")
            {
                Msg(element[1]);
            }
            else if(element[0]=="true")
            {
                if(window.google && window.chrome )
                {
                    var reg=window.open(urlreg,'','resizable=yes,menubar=false,status=false,scrollbars=yes,top='+(screen.height-600)/2+',left='+(screen.width-800)/2+',width=800,height=600');
                    return reg;
                }
                else
                {
                    var reg=window.open(urlreg,'','resizable=yes,menubar=false,status=false,scrollbars=yes,top='+(screen.height-600)/2+',left='+(screen.width-800)/2+',width=800,height=600');
                    return reg;
                }
                
            }
        }
    }
    
}
