function PageSize(){ 
	
	var xScroll, yScroll; 
	
	if (window.innerHeight && window.scrollMaxY) { 
	xScroll = document.body.scrollWidth; 
	yScroll = window.innerHeight + window.scrollMaxY; 
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 
	xScroll = document.body.scrollWidth; 
	yScroll = document.body.scrollHeight; 
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 
	xScroll = document.body.offsetWidth; 
	yScroll = document.body.offsetHeight; 
	} 
	
	var windowWidth, windowHeight; 
	if (self.innerHeight) { // all except Explorer 
	windowWidth = self.innerWidth; 
	windowHeight = self.innerHeight; 
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode 
	windowWidth = document.documentElement.clientWidth; 
	windowHeight = document.documentElement.clientHeight; 
	} else if (document.body) { // other Explorers 
	windowWidth = document.body.clientWidth; 
	windowHeight = document.body.clientHeight; 
	} 
	
	// for small pages with total height less then height of the viewport 
	if(yScroll < windowHeight){ 
	pageHeight = windowHeight; 
	} else { 
	pageHeight = yScroll; 
	} 
	
	// for small pages with total width less then width of the viewport 
	if(xScroll < windowWidth){ 
	pageWidth = windowWidth; 
	} else { 
	pageWidth = xScroll; 
	} 
	
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
} 
function showDiv(bigid,samllid){
	if(navigator.appName=="Microsoft Internet Explorer"){
		if(document.body.scrollWidth >document.body.clientWidth|| document.body.scrollHeight>document.body.clientHeight ){
			var page=PageSize();
			document.getElementById(bigid).style.height = page[3]+"px";
			document.getElementById(bigid).style.width = page[2]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
			document.getElementById(samllid).style.display = "block";
			
		}else{
			var page=PageSize();
			document.getElementById(bigid).style.height = page[1]+"px";
			document.getElementById(bigid).style.width = page[0]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
			document.getElementById(samllid).style.display = "block";
		}
	}else{
		if(document.body.offsetWidth >document.body.clientWidth|| document.body.offsetHeight>document.body.clientHeight ){
			var page=PageSize();
			document.getElementById(bigid).style.opacity="0.50";
			document.getElementById(bigid).style.height = page[3]+"px";
			document.getElementById(bigid).style.width = page[2]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
			document.getElementById(samllid).style.display = "block";
			
		}else{
			var page=PageSize();
			document.getElementById(bigid).style.opacity="0.50";
			document.getElementById(bigid).style.height = page[1]+"px";
			document.getElementById(bigid).style.width = page[0]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
			document.getElementById(samllid).style.display = "block";
		}
	}
}
function closeBigDiv(bigid){
	document.getElementById(bigid).style.display = "none";
}
function showBigDiv(bigid){
	if(navigator.appName=="Microsoft Internet Explorer"){
		if(document.body.scrollWidth >document.body.clientWidth|| document.body.scrollHeight>document.body.clientHeight ){
			var page=PageSize();
			document.getElementById(bigid).style.height = page[3]+"px";
			document.getElementById(bigid).style.width = page[2]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
		}else{
			var page=PageSize();
			document.getElementById(bigid).style.height = page[1]+"px";
			document.getElementById(bigid).style.width = page[0]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
		}
	}else{
		if(document.body.offsetWidth >document.body.clientWidth|| document.body.offsetHeight>document.body.clientHeight ){
			var page=PageSize();
			document.getElementById(bigid).style.opacity="0.50";
			document.getElementById(bigid).style.height = page[3]+"px";
			document.getElementById(bigid).style.width = page[2]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
		}else{
			var page=PageSize();
			document.getElementById(bigid).style.opacity="0.50";
			document.getElementById(bigid).style.height = page[1]+"px";
			document.getElementById(bigid).style.width = page[0]+"px";
			document.getElementById(bigid).style.top = 0;
			document.getElementById(bigid).style.left = 0;
			document.getElementById(bigid).style.display = "block";
		}
	}
}
function closeDiv(bigid,samllid){
	document.getElementById(bigid).style.display ="none";
	document.getElementById(samllid).style.display= "none";
}

///div居屏幕的中间
function centerSmallDiv(id){
	var div = document.getElementById(id);
	var page=PageSize();
	//滚动位置
	var st = document.documentElement.scrollTop;
	var sl = document.documentElement.scrollLeft;
	
	var ct = page[3] / 2 + st - div.offsetHeight /2 + document.body.scrollTop; //正中
	var cl = page[0] / 2 + sl - div.offsetWidth /2 + document.body.scrollLeft; //正中
	
	div.style.top = ct +"px";
    div.style.left = cl + "px";
    
    
}
