﻿function showloading(isdisplay){
	if(isdisplay) {
		var xScroll, yScroll;
			
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY-300;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
			
		var windowWidth, windowHeight;
			
		if (self.innerHeight) {
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}	
	
		document.getElementById("loadinglayer").style.display = "block";
		document.getElementById("loadinglayer").style.width = pageWidth+"px";
		document.getElementById("loadinglayer").style.height = pageHeight+"px";
		document.getElementById("loadingdiv").style.display = "block";
		document.getElementById("loadingdiv").style.top = (yScroll-windowHeight+windowHeight/2+16)+"px";
		document.getElementById("loadingdiv").style.left = (pageWidth/2-50)+"px";
	} else {
		document.getElementById("loadinglayer").style.display = "none";
		document.getElementById("loadingdiv").style.display = "none";
	}
}
function doZoom(size){
	document.getElementById("article_content").style.fontSize=size+'px';
}	
function addMe(title){
      var url = document.location;
	  window.external.addFavorite(url,title);
}
function printArticle(){
	print();
}
function showIt(id,isDisplay){
	if(isDisplay){
		document.getElementById(id).style.display='';
	}else{
		document.getElementById(id).style.display='none';
	}
}
function hide(c_id){
 if (document.getElementById(c_id).style.display=="none") {
   var arrsort=document.getElementsByTagName("ul"); 
    for(var i=0;i<arrsort.length;i++)    {
       if(arrsort[i].id.indexOf("sort_")>-1)       {
        document.getElementById(arrsort[i].id).style.display="none";
       }
    }
     document.getElementById(c_id).style.display="";
 }
}
