window.onload = function(e) {
  if(!e) {
    window.attachEvent('onresize',minWidth);
	minWidth();
  }
  removeOdds(document.documentElement);// delete text node(space and enter)
}
function minWidth() {
  var body = document.getElementsByTagName('body')[0];
  var html = document.documentElement;
  if(html.clientWidth<990) {
    body.style.width = '990';
  }
  else {
    body.style.width = 'auto';
  }
}



/*This function find text node and get them in array*/
function findOdds(node, arr) {
  var space = /^[^\u0021-\uffff]*$/g;
  if(node.nodeType == 3) {
    if(node.nodeValue.match(space)) {
      arr.push(node);
    }
  }
  else if(node.nodeType == 1) {
    for(var n = node.firstChild; n; n = n.nextSibling) {
      findOdds(n, arr);
    }
  }
}
/*
    function removeOdds(node) delete bad text node
*/
function removeOdds(node) {
  var odds = new Array();
  findOdds(node, odds);
  for(var i = 0; i < odds.length; i++) {
    odds[i].parentNode.removeChild(odds[i]);
  }
}
