var remain = 1;

function autoGo(isSuccess,url){
	if(isSuccess){
		setInterval(
			function(){
				try{
				if(remain == 0){
					$("#remainTime").empty().append('0');
					location.href = url;
				}else{
					remain--;
					$("#remainTime").empty().append(remain);
				}
				}catch(e){}
			},
			1000
		);
	}else{
		setInterval(
			function(){
				try{
				if(remain == 0){
					$("#remainTime").empty().append('0');
					if(typeof url == 'undefined' || url == ''){
						history.go(-1);
					}else{
						location.href = url;
					}
				}else{
					remain--;
					$("#remainTime").empty().append(remain);
				}
				}catch(e){}
			},
			1000
		);
	}
}


