//PLEASE WAIT MESSAGE
//CREATED BY: FREDDY SARMIENTO Y BORIS SUAREZ (ACTIVOS TEAM)
//MAATGKNOWLEDGE 2006
//FILES REQUIRED: WAIT.GIF, TD.PNG, PLEASEWAIT.CSS

function showWaitMessage(title_wait,imgpath){
   // shortcut reference to the document object
	if ( title_wait == undefined || title_wait == ''){ title_wait = "Espere un momento por favor";}
	d = document;
	// if the backgroundcont object already exists in the DOM, bail out.
	if(d.getElementById("backgroundcont")) return;
	// create the backgroundcont div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "backgroundcont";
	mObj.style.height = document.documentElement.scrollHeight + "px";
	mObj.style.background = "url(style/img/bgkloader.png)";
	pwait = mObj.appendChild(d.createElement("div"));
	pwait.id = "gowait";
	var nom = navigator.appName;
	if (nom == "Netscape") { if(d.all && !window.opera) pwait.style.top = document.documentElement.scrollTop + "px";};
	pwait.style.left = (d.documentElement.scrollWidth - pwait.offsetWidth)/2 + "px";
	pwait.innerHTML = '<table align=center><tr><td><br><span style="font: 14px/16px arial, helvetica, sans-serif; color: #999;">' + title_wait + '</span><br></td></tr><tr><td><br><center><img id="waitimg" name="waitimg" src="style/img/loader.gif" border=0><br></center></td></tr></table><br>';
}
// *** IE / NS normalization code
function hideWaitMessage() {
   //hijoUno = document.getElementByTagName("div").item(0);
   var bb = document.getElementById("backgroundcont");
	try {document.getElementsByTagName("body")[0].removeChild(bb);}catch (err){}; 
}


function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject


function moveObject(objectId, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
} // moveObject