var gCTLoaded = true;

var ctImg = function(o){
	var i = new Image();
	i.alt=o.alt;
	i.src=o.src;
	i.id=o.id;
	i.title=o.title;
	if(o.align)i.align=o.align;
	if(o.border)i.border=o.border;
	if(o.height)i.height=o.height;
	if(o.hspace)i.hspace=o.hspace;
	if(o.ismap)i.ismap=o.ismap;
	if(o.longdesc)i.longdesc=o.longdesc;
	if(o.name)i.name=o.name;
	if(o.usemap)i.usemap=o.usemap;
	if(o.usemap)i.vspace=o.usemap;
	if(o.width)i.width=o.width;
	return i;
}

/* --------------- wait layer ------------------------------------------------- */
function showRunningClock()
{
	var ie5 = document.all && document.getElementById;
	var waitSymbol = document.createElement("div");
	var waitStyle = waitSymbol.style;
	//waitStyle.visibility = "hidden";
	waitStyle.position = "absolute";
	waitStyle.top = -1000;
	waitStyle.left = -1000;
	waitStyle.zIndex = "10001";
	document.body.appendChild(waitSymbol);
	waitSymbol.innerHTML = "<img src=\"../images/load_bar.gif\"/>";
	waitStyle.left = (((ie5 ? document.body.clientWidth  : window.innerWidth) - waitSymbol.offsetWidth) / 2)+"px";
	waitStyle.top = (((ie5 ? document.body.clientHeight : window.innerHeight) - waitSymbol.offsetHeight) / 2)+"px";
	waitStyle.visibility = "visible";
}



function showWaitIcon()
{	
	var innerWidth = document.body.scrollWidth;
	var innerHeight = document.body.scrollHeight;

	var unclickableDiv = document.createElement("div");
	unclickableDiv.setAttribute("id", "y_unclickablediv");
	unclickableDiv.innerHTML = "<div style='width:100%; height:100%; filter = alpha(opacity=1); opacity:1;'>&nbsp;</div>";
	document.body.appendChild(unclickableDiv);
	unclickableDiv.style.cssText = "width:" + innerWidth + "px; height:" + innerHeight + "px;background-color:#e1e1e1; position:absolute; top:0; left:0; zIndex:1000;filter = alpha(opacity=0.5);opacity:0.5;" ;
	window.setTimeout(showRunningClock, 200);
}

function showModalLayer(content)
{	
	var innerWidth = document.body.scrollWidth;
	var innerHeight = document.body.scrollHeight;

	var unclickableDiv = document.createElement("div");
	unclickableDiv.setAttribute("id", "y_unclickablediv");
	unclickableDiv.innerHTML = "<div style='width:100%; height:100%; filter = alpha(opacity=1); opacity:1;'>"+content+"</div>";
	document.body.appendChild(unclickableDiv);
	unclickableDiv.style.cssText = "width:" + innerWidth + "px; height:" + innerHeight + "px;background-color:#e1e1e1; position:absolute; top:0; left:0; zIndex:1000;filter = alpha(opacity=0.5);opacity:0.5;" ;
	
}