// div popup
function prdLyrView(lid,n,total) {
    var ht = document.body.scrollHeight; // if DTD is xhtml, document.documentElement.clientHeight;
    var target = document.getElementById(lid+n);

    if (total != 0)    {
        for (var i=1; i<=total; i++) {
            document.getElementById(lid+i).style.display = (i==n ? 'block':'none');
        }
    } else {
        target.style.display = 'none';
    }
}
function preViewS(lid,n,total) {
	var wt = document.body.clientWidth; // if DTD is xhtml, document.documentElement.clientWidth;
	var ht = document.body.scrollHeight; // if DTD is xhtml, document.documentElement.clientHeight;
	var target = document.getElementById(lid+n);

	for (var i=1; i<=total; i++) {
		document.getElementById(lid+i).style.display = (i==n ? 'block':'none');
	}
	target.style.left = wt/2 - target.offsetWidth/2 + "px";
	target.style.top = ht/2 - target.scrollHeight/2 + "px";
}
// lid : layer Id,     n : target div,    total : total count
function preViewin(lid,n,total) {
	var wt = document.body.clientWidth; // if DTD is xhtml, document.documentElement.clientWidth;
	var ht = document.body.scrollHeight; // if DTD is xhtml, document.documentElement.clientHeight;
	var target = document.getElementById(lid+n);

	for (var i=1; i<=total; i++) {
		document.getElementById(lid+i).style.display = (i==n ? 'block':'none');
	}
	target.style.left = wt/2 - target.offsetWidth/2 + "px";
	target.style.top = ht/2 - target.scrollHeight/2 + "px";
}
