function divshow(html)
{
mask('show');
$('djC').className = 'alert4';
$('djC').style.display='block';
$('djC').innerHTML = html;

middle($('djC'));

}

function mask(show) {
    $('mask').style.height = document.documentElement.scrollHeight + 'px';
    if (show == 'show') {
        $('mask').style.display = 'block';
    } else {
        $('mask').style.display = 'none';
    }
}

 function hide() {
    $('djC').style.display='none';
    $('djC').innerHTML = "";
    mask('none');
}

function middle(obj){//居中
    var win = getWinSize();
    with (obj) {
        style.position = "absolute";
        style.left = (win.width - offsetWidth)/2+'px';
        style.top = (win.height - offsetHeight)/2 + document.documentElement.scrollTop+'px';
    }
}

function getWinSize(obj) {//取屏幕大小
	var windowWidth, windowHeight;
	if(obj) {
        target = obj.document;
    } else {
        target = document;
    }
	if (self.innerHeight) {
		if(obj) {
            target = obj.self;
        } else	 {
            target = self;
        }
		windowWidth = target.innerWidth;
		windowHeight = target.innerHeight;
	} else if (target.documentElement && target.documentElement.clientHeight) {
		windowWidth = target.documentElement.clientWidth;
		windowHeight = target.documentElement.clientHeight;
	} else if (target.body) {
		windowWidth = target.body.clientWidth;
		windowHeight = target.body.clientHeight;
	}
	return {width:parseInt(windowWidth),height:parseInt(windowHeight)};
}
function $(id) {
    return document.getElementById(id);
}

function getCookie(cookieName) 
{
	var cookieValue = '';
	var posName = document.cookie.indexOf(escape(cookieName) + '=');
	if (posName != -1) {
		var posValue = posName + (escape(cookieName) + '=').length;
		var endPos = document.cookie.indexOf(';', posValue);
		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
		else cookieValue = unescape(document.cookie.substring(posValue));
	}
	return (cookieValue);
}

function readCookie(name) {
	var cookieValue = ""; 
	var search = name + "=";
	if (document.cookie.length > 0) { 
		offset = document.cookie.indexOf(search); 
		if (offset != -1) { 
			offset += search.length; 
			end = document.cookie.indexOf(";", offset); 
			if (end == -1) {
				end = document.cookie.length;
			}
			cookieValue = document.cookie.substring(offset, end);
		}
	}
	return cookieValue; 
}

function writeCookie(name, value, hours, domain, path) {
	var expire = ""; 
	if(hours != null) { 
		expire = new Date((new Date()).getTime() + hours * 3600000); 
		expire = "; expires=" + expire.toGMTString(); 
		if (domain) domain = "; domain=" + domain;
		if (path) path = "; path=" + path;
	}
	document.cookie = name + "=" + encodeURIComponent(value) + expire + domain + path; 
}
var djC = document.createElement("div");
djC.id = 'djC';
djC.style.display = 'none';
document.getElementsByTagName('body')[0].appendChild(djC);

var mymask = document.createElement("div");
mymask.id = 'mask';
mymask.style.display = 'none';
document.getElementsByTagName('body')[0].appendChild(mymask);