
function getElementComputedStyle(elem, prop)
{
  if (typeof elem!="object") elem = document.getElementById(elem);
  
  // external stylesheet for Mozilla, Opera 7+ and Safari 1.3+
  if (document.defaultView && document.defaultView.getComputedStyle)
  {
    if (prop.match(/[A-Z]/)) prop = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
    return document.defaultView.getComputedStyle(elem, "").getPropertyValue(prop);
  }
  
  // external stylesheet for Explorer and Opera 9
  if (elem.currentStyle)
  {
    var i;
    while ((i=prop.indexOf("-"))!=-1) prop = prop.substr(0, i) + prop.substr(i+1,1).toUpperCase() + prop.substr(i+2);
    return elem.currentStyle[prop];
  }
  
  return "";
}

var zoomXpx = 0;
function zoomX(v){

	var vv=parseInt(v);
	

//	var shoustfoo = document.getElementsByTagName('*');
	var shoustfoo = $('body');

	for( var i = shoustfoo.length-1, j; j = shoustfoo[i]; i-- ) { 
//			var shoustFontSizeA=parseInt(window.getComputedStyle(j,null).fontSize); 

		fs=getElementComputedStyle(j,'fontSize');

		var shoustFontSizeA=parseInt(fs);
		if(shoustFontSizeA+vv>=0) {
			if(fs.substring(fs.length-2)=="px") {
				var px=parseInt(shoustFontSizeA+vv);
				

				if(px >= 9 && px <= 13){
					zoomXpx=Number(zoomXpx)+Number(vv);
					setCookie('zoomXpx',zoomXpx, 3650);
				}
				
				if(px<9) {
					px=9;
				}
				if(px>13) {
					px=13;
				}
				

				void(j.style.fontSize=px+'px');
			}
			if(fs.substring(fs.length-1)=="%") {
				void(j.style.fontSize=parseInt(shoustFontSizeA+vv)+'%');
			}
		}
	}
}

function zoomXinit() {
	px = getCookie('zoomXpx');
	if(!isNaN(px)) {
		zoomX(px);
	}else{
		setCookie('zoomXpx',0, 3650);
	}
}




