function GetPage(funName,mainID,tagName,onClass,offClass,flag,styleID){
	this.funName = funName;
	this.mainID = mainID;
	this.tagName = tagName;
	this.onClass = onClass;
	this.offClass = offClass;
	this.flag = flag; 
	this.styleID = styleID;
	this.pObj = document.getElementById(mainID).getElementsByTagName(tagName);  
	for(var i=1;i<this.pObj.length;i++){
		this.pObj[i].name=i; 
		this.pObj[i].fun=funName;
		this.pObj[i].onclick =function(){eval(this.fun).changeNav(this.name)};
	}  
	this.pObj[flag].className=onClass; 
	this.changeNav(flag);
}
GetPage.prototype.changeNav = function(v){	 
		var styleName = '';
		switch(v){
			case 1:
			styleName = 'blue';
			break;
			case 2:
			styleName = 'yellow';
			break;
			case 3:
			styleName = 'green';
			break;
			case 4:
			styleName = 'pink';
			break;
			case 5:
			styleName = 'red';
			break;
			case 6:
			styleName = 'brown';
			break; 
			
			default:
			styleName = 'blue';
			break;

		}
		this.pObj[this.flag].className=this.offClass; 
		this.pObj[v].className=this.onClass; 
		this.flag=v;
		document.getElementById(this.styleID).href='http://book.qq.com/css/bookapp/'+ styleName +'.css'
		document.cookie = "chapterstyle=" + v + "; path=/;expires=Thursday,01-Jan-2099 00:00:00 GMT;";;
}


function changeSize(mode,id){
	var size = 14;
	var line = 24;
	switch(mode){
		case 'small':
		size = 12;
		line = 21;
		break;

		case 'middle':
		size = 14;
		line = 24;
		break;

		case 'large':
		size = 16;
		line = 27;
		break;
		
	}	
	document.getElementById(id).style.fontSize = size + "px";
	document.getElementById(id).style.lineHeight = line + "px";
	document.cookie = "chaptersize=" + mode + "; path=/;expires=Thursday,01-Jan-2099 00:00:00 GMT;";;
}