var night_model=false;		//夜间阅读模式
var content_fontsize_big=false;		//夜间阅读模式

var header_bg_d = '#fff',
	header_border_d = '#e0e0e0',
	footer_bg_d = '#f0f0f0',
	body_bg_d = '#fff',
	article_title_d = '#333333',
	article_p_d = '#555555';
	code_bg_d = '#f7f7f7';
	code_border_d = '#e7e7eb';

var header_bg_n = '#161718',
	header_border_n = '#1f2021',
	footer_bg_n = header_bg_n,
	body_bg_n = '#1d1e1f',
	article_title_n = '#9da5ae',
	article_p_n = '#83868a';
	code_bg_n = '#2d2f31';
	code_border_n = '#333333';

var header = document.getElementById('allheader');
var footer = document.getElementById('footer');
var wrap = document.getElementById('wrap');
var articleInner = document.getElementById('articleInner');
var h1title = document.getElementsByTagName('h1');
var h2title = document.getElementsByTagName('h2');
var h3title = document.getElementsByTagName('h3');
var figure = document.getElementsByTagName('figure');
var pre = document.getElementsByTagName('pre');
var x = document.getElementsByTagName('p');


function setBackground(){
	var i = 0;

	night_model = !night_model;
	if(night_model == false){
    	header.style.background = header_bg_d;
    	footer.style.background = footer_bg_d;
    	header.style.borderColor = header_border_d;
    	wrap.style.background = body_bg_d;
    	articleInner.setAttribute('class','article-inner');

		for (i=0;i<h1title.length;i++){ 
		  	h1title[i].style.color = article_title_d;
		}
		for (i=0;i<h2title.length;i++){ 
		  	h2title[i].style.color = article_title_d;
		}
		for (i=0;i<h3title.length;i++){ 
		  	h3title[i].style.color = article_title_d;
		}
		for (i=0;i<figure.length;i++){ 
		  	figure[i].style.background = code_bg_d;
		  	figure[i].style.borderColor = code_border_d;
		}
		for (i=0;i<pre.length;i++){ 
		  	pre[i].style.background = code_bg_d;
		  	pre[i].style.color = '#525252';
		}
		for (i=0;i<x.length;i++){ 
		  	x[i].style.color = article_p_d;
		}
	}else{
    	header.style.background = header_bg_n;
    	footer.style.background = footer_bg_n;
    	header.style.borderColor = header_border_n;
    	wrap.style.background = body_bg_n;
    	articleInner.setAttribute('class','article-inner-night');

		for (i=0;i<h1title.length;i++){ 
		  	h1title[i].style.color = article_title_n;
		}
		for (i=0;i<h2title.length;i++){ 
		  	h2title[i].style.color = article_title_n;
		}
		for (i=0;i<h3title.length;i++){ 
		  	h3title[i].style.color = article_title_n;
		}
		for (i=0;i<figure.length;i++){ 
		  	figure[i].style.background = code_bg_n;
		  	figure[i].style.borderColor = code_border_n;
		}
		for (i=0;i<pre.length;i++){ 
		  	pre[i].style.background = code_bg_n;
		  	pre[i].style.color = article_p_n;
		}
		for (i=0;i<x.length;i++){ 
		  	x[i].style.color = article_p_n;
		}
	}
	
}

function setFontSize() {		//正文字号大小

	content_fontsize_big = !content_fontsize_big;
	if(content_fontsize_big == true){
		for (var i=0;i<x.length;i++){ 
		  	x[i].style.fontSize='1.2em';
		}
	} else {
		for (var i=0;i<x.length;i++){ 
		  	x[i].style.fontSize='1em';
		}
	}
}
@@ -963,17 +963,21 @@
 ');%0Avar 
-x
+all_p
  = docum
@@ -1849,33 +1849,37 @@
 %09%7D%0A%09%09for (i=0;i%3C
-x
+all_p
 .length;i++)%7B %0A%09
@@ -1874,33 +1874,37 @@
 gth;i++)%7B %0A%09%09  %09
-x
+all_p
 %5Bi%5D.style.color 
@@ -2687,25 +2687,29 @@
 %09for (i=0;i%3C
-x
+all_p
 .length;i++)
@@ -2708,33 +2708,37 @@
 gth;i++)%7B %0A%09%09  %09
-x
+all_p
 %5Bi%5D.style.color 
@@ -2891,33 +2891,37 @@
 %09for (var i=0;i%3C
-x
+all_p
 .length;i++)%7B %0A%09
@@ -2916,33 +2916,37 @@
 gth;i++)%7B %0A%09%09  %09
-x
+all_p
 %5Bi%5D.style.fontSi
@@ -2988,17 +2988,21 @@
 r i=0;i%3C
-x
+all_p
 .length;
@@ -3017,9 +3017,13 @@
 %09  %09
-x
+all_p
 %5Bi%5D.

fix bug: canvas x.clearRect is not a function. (cause var 'x' was redefined in dialog.js.)