﻿function getPageSize(){ //内容区实际高度
        var re = {};
        if (document.documentElement && document.documentElement.clientHeight)
        {
            var doc = document.documentElement;
            re.width = (doc.clientWidth>doc.scrollWidth)?doc.clientWidth-1:doc.scrollWidth;
            re.height = (doc.clientHeight>doc.scrollHeight)?doc.clientHeight:doc.scrollHeight;
        }
        else
        {
            var doc = document.body;
            re.width = (window.innerWidth>doc.scrollWidth)?window.innerWidth:doc.scrollWidth;
            re.height = (window.innerHeight>doc.scrollHeight)?window.innerHeight:doc.scrollHeight;
        }
        return re;
    }
    function Middle(){
	    var wh=getPageSize().height;
		document.getElementById("index").style.marginTop=(wh-500)/2+"px";
    } 
Middle()
