﻿//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+'Requested data.....');
        },
		error: function(){
		   $(dspid).animate({height: 'hide', opacity: 'hide'}, 'slow',function(){
           $(dspid).html(errorpic+'Error procedures, failure to send data...');
		   $(dspid).animate({height: 'show', opacity: 'show'}, 'slow');
			 });
		}, 
		success: function(data){
		   if(data=='SubmitSuccess'){
		   $(dspid).html(okpic+"Success");
		   alert("Successful");
		   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 Getproajax(stype,gourl,dataType,dspid){
 $.ajax({ 
		type: stype,
		url: gourl,  
		data: '',
		dataType: dataType, 
		beforeSend : function(){
		   $(dspid).show();
           $(dspid).html(ajloadpic+"&nbsp;Loading...");
        },
		error: function(){
		   $(dspid).animate({height: 'hide', opacity: 'hide'}, 'slow',function(){
           $(dspid).html(errorpic+'Error procedures, failure to send data...');
		   $(dspid).animate({height: 'show', opacity: 'show'}, 'slow');
			 });
		}, 
		success: function(data){
                               if(data!=""){
		   $(dspid).animate({height: 'hide', opacity: 'hide'}, 'slow',function(){
		   $(dspid).html(data);
		   $(dspid).animate({height: 'show', opacity: 'show'}, 'slow');
			 });
}else{
 $(dspid).hide();
}
        }
	});
}
function Getproajax2(stype,gourl,dataType,dspid){
 $.ajax({ 
		type: stype,
		url: gourl,  
		data: '',
		dataType: dataType, 
		beforeSend : function(){
		   $(dspid).show();
           $(dspid).html(ajloadpic+"&nbsp;Loading...");
        },
		error: function(){
           $(dspid).html(errorpic+'Error procedures, failure to send data...');
		}, 
		success: function(data){
		   $(dspid).html(data);
        }
	});
}
