/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * www.sofut.com mysite
 * www.aixq.com blog
 */
function ajaxsend(actset,inputid,showmsg,pname)
{
	
    $.ajax({		
        beforeSend:function(){
            $("#msg").html("正在建立鏈接..");
        },
        dataType:"json",
        type: "post",
        url:"/ajax.php?act="+actset,
        data: $("#"+inputid+" :input").serialize(),		
        success: function(json){           
            if(json.msg)
            {  
				$("input[type=reset]").click(); 
				if(pname=="signedm"){					    
					alert(json.msg);
				}              
				if(pname=="shopcart"){					    
					window.location.href="/shopcart.html";
				}
				if(pname=="cart"){
					window.location.href="/cart.html";
					}
            }
            else
            {
                alert(json.error.join('\n')); 
				;
            }
          
        },
        error:function(){
             alert(json.error.join('\n')); 			
        }
    });
}
