function act()
{
	LOAD.crLoading(200,100,'Đang tải dữ liệu');
}

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//

function getPageSize()
{
	
	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;
}


//********************/
// loaddingImg
//
var LOAD = new Object();
var loadObj=null;
var loadingImg = new Image();
	loadingImg.src ='images/lightbox-ico-loading.gif';//loading.gif

LOAD.crLoading = function(w, h , strTitle)
{
	
	var bodyObj = document.getElementsByTagName("body")[0];	
	var box = null;
	
	if(bodyObj.firstChild.id == 'boxLoading')
	{	
		box = bodyObj.firstChild;
		box.style.display='block';
		box.lastChild.style.width = w+"px";
	}else {
		box = document.createElement("div");	
		box.setAttribute("id","boxLoading");
		bodyObj.insertBefore(box,bodyObj.firstChild);
		box.innerHTML="<div id=boxFilter></div><div id=boxBlock class='box_black' style='width:"+w+"px'></div>";
	}
	
	this.box = box;
	
	box.lastChild.innerHTML = this.boxBorder(strTitle);							
	box.lastChild.childNodes[1].firstChild.innerHTML = "<div style='margin: 0 2px 0 2px;text-align:center'><br><img src='"+loadingImg.src+"'><br><br></div>";
	
	var pageSize = getPageSize();	
	box.style.height 	=  box.firstChild.style.height=pageSize[1]+"px";
	box.firstChild.style.width = "100%";
	
	box.lastChild.style.top  = parseInt((pageSize[3]-h)/2) + "px" ;	
	box.lastChild.style.left = parseInt((pageSize[2]- w)/2) + "px";	
	
	
}

var imgSlideClose = new Image();
imgSlideClose.src = 'black_style/3.gif';
LOAD.boxBorder = function(str){
	var htm ="<div class=boxT ><div><table cellspacing=0 cellpadding=0 width=100% border=0><tr><td class='title' onmousedown=\"dragStart(event,'boxBlock')\" OnMouseUp=\"dragStop(event)\">"+str+"</td><td width=74><img src='"+imgSlideClose.src+"' title='Close' OnClick=\"LOAD.reLoading()\" style='cursor:pointer'></td></tr></table></div></div>"
			 +"<div class=boxM><div id=boxM></div></div><div class=boxB><div><div onmousedown=\"dragStart(event,'boxBlock')\" OnMouseUp=\"dragStop(event)\"></div></div></div>";
	return htm;
}

LOAD.reLoading = function()
{
	var flv = document.getElementsByTagName("embed");
	if(flv)
	{
		for (i = 0; i< flv.length; i++)
		{
			flv[i].style.visibility ='visible';
		}
	}
	this.slide();
}


var maxFilter = 60;
var timeFilter = 0;
var speed = 10;
LOAD.slide = function()
{
	maxFilter -= 20;
	if(maxFilter > 0){
		timeFilter = window.setTimeout("LOAD.slide()",speed);
		this.box.firstChild.style.filter = "alpha(opacity="+maxFilter+")";
		this.box.firstChild.style.opacity = maxFilter / 100;		
	}
	else {
		window.clearTimeout(timeFilter);
		this.box.style.display='none';
		this.box.firstChild.style.filter = "alpha(opacity=60)";
		this.box.firstChild.style.opacity = 0.6;
		maxFilter = 60;
		timeFilter = 0;
	}
}

function getObject(str){
       if(typeof str == "Object" || typeof str == "object" ) return str;
       else return document.getElementById(str);
}