Date.prototype.toFormatString = function(fs)
{
	if(fs.length == 1)
	{ 
		return this.getFullYear() + fs + (this.getMonth() + 1) + fs + this.getDate(); 
	}
		fs = fs.replace("yyyy",this.getFullYear());
		if (this.getMonth() + 1 < 10) {
			fs = fs.replace("mm", '0'+(this.getMonth() + 1));
		}else{
			fs = fs.replace("mm", (this.getMonth() + 1));
		}
		if (this.getDate() < 10) {
			fs = fs.replace("dd", '0'+this.getDate());
		}else{
			fs = fs.replace("dd",this.getDate());
		}
		if (this.getHours() < 10) {
			fs = fs.replace("HH", '0'+this.getHours());
		}
		else {
			fs = fs.replace("HH", this.getHours());
		}
		if (this.getMinutes() < 10) {
			fs = fs.replace("MM", '0'+this.getMinutes());
		}
		else {
			fs = fs.replace("MM", this.getMinutes());
		}
		if (this.getSeconds() < 10) {
			fs = fs.replace("SS", '0'+this.getSeconds());
		}
		else {
			fs = fs.replace("SS", this.getSeconds());
		}
		fs = fs.replace("ms", this.getMilliseconds());
	return fs;
};

function openBook(bkid,page)
{
        var opdate = new Date().toFormatString('yyyy-mm-dd HH:MM:SS.ms');
		var url = 'reader/book-1-.htm?bkwzid='+bkid+'&opdate='+opdate+(page==null?'':'&order='+page);//encodeURIComponent()
		var options = 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,width=1024,height=710,top=50,left=50';
		window.open(url,'popup',options);
		return;
}