function newPopup(options){
    var title = options.title;
    var width = options.width;
    var height = options.height;
    var week = new Array("日期","星期一","星期二","星期三","星期四","星期五","星期六","星期日");
    var tableHtml = '';
    tableHtml += '<table border="0" cellspacing="0" cellpadding="5" class="timeZone">';
    tableHtml +='<tr>' +
        '<th><input type="checkbox" id="selectAll"/></th><th>'+week[0]+'</th>' +
        '<th><input type="checkbox" id="selectBeforeDawn" data-index="2"/><span>00：00 - 05：00</span></th>' +
        '<th><input type="checkbox" id="selectMorning" data-index="3"/><span>06:00 - 11：00</span></th>' +
        '<th><input type="checkbox" id="selectAfternoon" data-index="4"/><span>12:00 - 17:00</span></th>' +
        '<th><input type="checkbox" id="selectNight" data-index="5"><span>18:00 - 23：00</span></th>' +
        '</tr>';
    var hour = '';
    var int =0;
    for(var i=0;i < 4;i++){
        hour += '<td>';
        var span = '';
        for(var j=0;j<6;j++){
            span +='<span>'+int+'</span>';
            int++;
        }
        hour += span;
        hour += '</td>';
    };

    for(var i=0; i < week.length-1; i++){
        tableHtml+='<tr><td><input type="checkbox" id="selectAll_'+(i+1)+'" class="select"/></td><td>'+week[i+1]+'</td>';
        tableHtml+=hour;
    };
    tableHtml += '</table><div class="area-bottom"><a id="confirm" class="btn-success">确定</a></div>';
	var template = '<div id="schedule_mask" class="mask"></div>'+
	'<div id="schedule_popup" class="popup" style="z-index:110; ">'+
		'<div class="title">'+
			'<strong>'+title+'</strong>'+
			'<span class="close-tag"></span>'+
			'<span class="restore-tag"></span>'+
			'<span class="max-tag"></span>'+
		'</div>'+
		'<div class="popup-content">'+
			tableHtml+
		'</div>'+
	'</div>';
    $("#schedule_layout").append(template);

    var popup = $("#schedule_popup");
    popup.css({
        'width':width,
        'left':($(window).width() - parseInt(width))/2 + 'px'
    });
    popup.css({
        height:height,
        top:($(window).height() - parseInt(height))/3 + 'px'
    });


	this.opt = $.extend({
		masker: true,
		width:'54%',
		height:'50%',
		title:'',
		zIndex: 110,
		forceRemove:false
	},options);

    this.mask = $("#schedule_mask");
    this.max = popup.find('.max-tag');
	this.restore = popup.find('.restore-tag');
    this.content = popup.find('.popup-content');
    this.close = popup.find('.close-tag');
	this.close.click(function(){
		this.hide();
		this.mask.hide();
	}.bind(this));
	this.hide = function(){
		if (this.opt.forceRemove) {
			popup.empty().remove();
			this.mask.empty().remove();
		}else{
			popup.hide();
			this.mask.hide();
		}
		$(document.body).css({overflow:'auto'});
	};
	this.show = function(){
		popup.show();
		this.mask.show();
	}
	this.remove = function(){
		popup.remove();
		this.mask.remove();
	}
}