﻿function styleSizer(strer)
{
	if(strer=='miniFont') document.body.style.fontSize = 'small';
	if(strer=='mediumFont') document.body.style.fontSize = 'medium';
	if(strer=='largeFont') document.body.style.fontSize = 'larger';
}

function PostBack()
{
    Dialog.info('<div style="font-size:12px;">正在提交，请稍候...</div>',{
        width:300,
        height:100,
        className:"spread",
        showProgress: true,
        destroyOnClose:true
    });
    new Ajax.Request("/Register.aspx?t=" +(new Date()).toString() ,{
		method:"post",
		parameters: Form.serialize($("form1")),
		onSuccess:function(msg){RequestSuccess(msg);}
	});
}

function RequestSuccess(msg)
{
    Dialog.closeInfo();
    if(msg.responseText == "SUCCESS")
    {
        Alert('注册成功！', '');
        location.href="/";
    }
    else
    {
        Alert(msg.responseText, '确定');
    }
}

function Alert(message, okLabel)
{
    var win = Dialog.alert(message, 
    {
	    width:300,
	    height:100,
	    className:"spread",
	    okLabel: "关闭",
	    onOk:function(win)
	    {
		    return true;
	    },
	    destroyOnClose:true
    });
    var re = '<div style="font-size:12px;" >';
    re += message;
    re += "</div>";
    if(okLabel.length > 0 ) re += '<input type="button" style="margin:10px; border:1px solid #fff; backgorund:#ccc;" name="btnClose" value="' + okLabel + '" onclick="Dialog.okCallback();" />'
    win.setHTMLContent(re);
}
