﻿//author:350am 350am@163.com 2008-08
function doformajax(stype,gourl,dataType,dspid,buttomname,formdata){
 $.ajax({ 
		type: stype,
		url: gourl,  
		data: formdata,
		dataType: dataType, 
		beforeSend : function(){
		   $(dspid).show();
           $(dspid).html(ajloadpic+'数据提交中，请稍候...');
        },
		error: function(){
		   $(dspid).animate({height: 'hide', opacity: 'hide'}, 'slow',function(){
           $(dspid).html(errorpic+'服务器没有返回数据，可能服务器忙，请重试...');
		   $(dspid).animate({height: 'show', opacity: 'show'}, 'slow');
			 });
		}, 
		success: function(data){
		   if(data=='SubmitSuccess'){
		   $(dspid).html(okpic+"Success");
		   alert("提交成功!!你的留言将会在审核后显示");
		   self.location=ReturnSuccessUrl;  
		   }else{
		   $(dspid).animate({height: 'hide', opacity: 'hide'}, 'slow',function(){
		   $(dspid).html(errorpic+data);
		   $(dspid).animate({height: 'show', opacity: 'show'}, 'slow');
		   $(buttomname).attr({"disabled":false});
			 });
		   }
        }
	});
}
function Getajaxdata(stype,gourl,dataType,dspid){
 $.ajax({ 
		type: stype,
		url: gourl,  
		data: '',
		dataType: dataType, 
		beforeSend : function(){
           $(dspid).html(ajloadpic+"&nbsp;数据读取中，请稍候...");
        },
		error: function(){
           $(dspid).html(errorpic+'&nbsp;服务器没有返回数据，可能服务器忙，请重试...');
		}, 
		success: function(data){
		   $(dspid).animate({height: 'hide', opacity: 'hide'}, 'slow',function(){
		   $(dspid).html(data);
		   //document.getElementById("ly_data").innerHTML=eval(data);
		   $(dspid).animate({height: 'show', opacity: 'show'}, 'slow');
			 });
        }
	});
}
