<?php

$w = 400;//提示框宽度
$h = 60;//提示框高度
$title = "

Messenger 

";//提示框标题HTML代码，请用\"来表示"

$msg = "

<img src='images/default/loading.gif' /> ระบบกำลังโหลดหน้าเวปเพจ,กรุณารอสักครู่....

"; // Tips box HTML code, use \ "to express"

$msg = str_replace("\r",'',$msg);
$msg = str_replace("\n",'',$msg);
$msg = addslashes($msg);
$title = str_replace("\r",'',$title);
$title = str_replace("\n",'',$title);
$title = addslashes($title);
?>

document.write('<div id="_pl_loading" onmouseover="this.style.display=\'none\'"></div>');
_pl_div = document.getElementById('_pl_loading');
_pl_div.style.position = 'fixed';
_pl_div.style.width = '<?=$w ?>px';
_pl_div.style.height = '<?=$h ?>px';

_pl_clientWidth = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
_pl_clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

_pl_div.style.left = ((_pl_clientWidth - <?=$w ?>) / 2) + 'px';
_pl_div.style.top = ((_pl_clientHeight - <?=$h ?>) / 2) + 'px';

_pl_div.className = 'box';
_pl_div.innerHTML = '<h4><?=$title ?></h4><?=$msg ?>';

document.body.appendChild(_pl_div)

_pl_alpha('_pl_loading', 70);

function _pl_onload() {
	document.getElementById('_pl_loading').style.display='none';
}

if (document.attachEvent) window.attachEvent('onload',_pl_onload);
else window.addEventListener('load',_pl_onload,false);

function _pl_alpha(obj,al) {
	if(typeof obj != 'object') obj = document.getElementById(obj);
	if(!obj) return;
	var alpha=al/100;
	obj.style.filter = "alpha(opacity:"+al+")";
	obj.style.KHTMLOpacity = alpha;
	obj.style.MozOpacity = alpha;
	obj.style.opacity = alpha;
}