
function popup(url,windowName, params) {

	   	newOpenedWindow = window.open(url,windowName,params);
	  	newOpenedWindow.moveTo(0,0);

}



var max_font=24;
var min_font=9;
var def_fs=12;



function increaseFont(){
  var objs = document.getElementsByName("divResizeFont");
  
  var font_size
  for (var j=0;j<objs.length;j++){
  obj = objs[j];
  var childNodes = obj.childNodes;
  var font_size_from_object = obj.style["fontSize"];
  var font_size_from__file = getcss("div#divResizeFont p, div, a, ul, li , td","fontSize");	
	if(font_size_from_object)
		font_size=font_size_from_object;
	else if(font_size_from__file) 
		font_size=font_size_from__file;
	else
		font_size=def_fs;

  	font_size = parseInt(font_size);

  	if (font_size < max_font) {
		font_size = font_size + 1;
  
	}
	formatNode(childNodes, font_size);
	
  	obj.style.fontSize = font_size+"px";
  }

}

function formatNode(childNodes, font_size){

	if(childNodes) {
		for(var i=0;i<childNodes.length;i++) {
			var currNode = childNodes[i];
			if(currNode.nodeName.toLowerCase() == "p" ||currNode.nodeName.toLowerCase() == "td" || currNode.nodeName.toLowerCase() == "a" || currNode.nodeName.toLowerCase() == "ul" ||currNode.nodeName.toLowerCase() == "li") {
				if  (currNode.nodeName.toLowerCase() == "ul") {
					var currNode1 = currNode.childNodes;
					for(var j=0;j<currNode1.length;j++) {
						if (currNode1[j].nodeName.toLowerCase() == "li"){
							currNode1[j].style.fontSize = font_size+"px";
						}
					}
				} else {
					currNode.style.fontSize = font_size+"px";
				}
			}
		}	
	}
}
function decreaseFont (){
   var objs = document.getElementsByName("divResizeFont");
   var font_size
  for (var j=0;j<objs.length;j++){
  obj = objs[j];
  var childNodes = obj.childNodes;
  var font_size_from_object = obj.style["fontSize"];
  var font_size_from_object = obj.style["fontSize"];
  var font_size_from__file = getcss("div#divResizeFont p, div, a, td","fontSize");	
	if(font_size_from_object)
		font_size=font_size_from_object;
	else if(font_size_from__file) 
		font_size=font_size_from__file;
	else
		font_size=def_fs;

  	font_size = parseInt(font_size);

  	if (min_font < font_size) {
		font_size = font_size - 1;
  
	}
	formatNode(childNodes, font_size);
	 obj.style.fontSize = font_size+"px";
	 }
}


function getcss( selector, property ) {
	var stl=document.styleSheets && document.styleSheets[0];
	var iter;
	var allRules;
	if(stl) {
		allRules = stl.rules ? stl.rules : stl.cssRules;
		 if(allRules) {
			iter = allRules.length; 
			while (iter--) {
				if(allRules[iter].selectorText.toLowerCase() === selector.toLowerCase()) {
					return ( allRules[iter].style[property] );
				}
			}
		}
	}
return null;
}

