/* js/models/realtime.js */

var RealTimeModel=Backbone.Model.extend({
	defaults:{
		name:"realtime",
		theme:"全部",
		page:1
	}
});
/* js/models/theme.js */

var ThemeModel=Backbone.Model.extend({
	defaults:{
		name:"theme",
		active:"全部",
	},
	url:"servlet/Theme.do"
//	url:"http://wr52b5.natappfree.cc/bjfzxWebapp/servlet/Theme"
		
});
/* js/models/top.js */
var TopModel=Backbone.Model.extend({
	defaults:{
		name:"top10",
		tpl:"indexTpl",
		now:function(){

			var time=new Date();	
			var h=time.getHours();
			if(h==0){
				var time=new Date(time.getTime()-4*60*60*1000);
				var y=time.getFullYear();
				var m=time.getMonth()+1;
					m=(m<10)?"0"+m:m;
				var d=time.getDate();
					d=(d<10)?"0"+d:d;
				var h=time.getHours();
					return y+"-"+m+"-"+d+" "+h+"点至24点";
				
			}else if(h==8){
				var time=new Date(time.getTime()-12*60*60*1000);
				var y=time.getFullYear();
				var m=time.getMonth()+1;
					m=(m<10)?"0"+m:m;
				var d=time.getDate();
					d=(d<10)?"0"+d:d;
				var h=time.getHours();
					return y+"-"+m+"-"+d+" "+h+"点至" +y+"-"+m+"-"+(d+1)+' 8点'
			}else{
					
				var y=time.getFullYear();
				var m=time.getMonth()+1;
					m=(m<10)?"0"+m:m;
				var d=time.getDate();
					d=(d<10)?"0"+d:d;
				var h=time.getHours();
					//h=(h<10)?"0"+h:h;
					return y+"-"+m+"-"+d+" "+(h-4)+"点至"+h+"点";	
			}
			
		}(),
		time:function(){
			var time="";
			var t=new Date();
			var y=t.getFullYear();
			var m=t.getMonth()+1;
				m=(m<10)?"0"+m:m;
			var d=t.getDate();
				d=(d<10)?"0"+d:d;
			var h=t.getHours();
				h=(h<10)?"0"+h:h;
				time=y+"-"+m+"-"+d+" "+h+":00:00";				
			return time;
		}()
		
	},
	initialize:function(){
		var selt=this;
		this.on("change:time",function(a,b){
			var t=helper.getFulltimePoint(b);
			this.set("now",t);
		});
	},
	url:"servlet/Index.do"
//	url:"http://wr52b5.natappfree.cc/bjfzxWebapp/servlet/Index"
});