﻿function requestCoupon()
{
    $.ajax({
                url : '/worldcup.aspx?rd='+Math.random(),
                type : 'get',
                data : 'operate=req',
                dataType : 'html',
                success : function(html){
                //alert(html);
                    if(html=="")
                    {
                        alert("Unknown Error!");
                        return;
                    }
                    if(html=="onehour")
                    {
                        alert("You have gained a coupon successfully,please retry later.");
                        return;
                    }
                    if(html=="false")
                    {
                        alert("Create coupon error! Please try later!");
                        return;
                    }
                    
                    //success
                    $("#spancode").html(html);
                    $("#divsjb").fadeIn();
                }
            });
}

function closeshow()
{
    $("#spancode").html("");
    $("#divsjb").fadeOut();
}