// ******************************************************************************************************
// Function to popup url or image in new window
// ******************************************************************************************************
function PopUpGeneric(URL, width, height)
	{
	// Popup window with links to image library. 
	var popleft=((document.body.clientWidth - 440) / 2)+window.screenLeft; 
	var poptop=(((document.body.clientHeight - 460) / 2))+window.screenTop-40;		
	window.open(URL,"_blank","resizable=1,scrollbars=auto,width=" + width + ",height=" + height + ",left="+popleft+",top="+poptop)
	}

// ******************************************************************************************************
// Function that displays wait message when submitting a form
// css-style: .waitMsg {visibility:hidden; color: red; }
// sample code: <span class="waitMsg" ID="id_waitmsg">Loading Data. Please Wait...<br><img id=pbar src="/assets/layout/loading.gif"></span>
// ******************************************************************************************************
function ShowWaitMsg()
{
if(id_waitmsg) id_waitmsg.style.visibility = 'visible';
setTimeout('document.images["pbar"].src = "/assets/layout/loading.gif"', 200);
}

// ******************************************************************************************************
// Function to open help i Editor area
// ******************************************************************************************************
function OpenHelp(){
window.open("/Editor/Editor_help/help.htm","Help","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=990,height=550");
			}


// **********************************
// toggleDiv : Show / Hide functions 
// **********************************
function toggleElement(id) {
 //var e = document.getElementById(id).style.display = '';
 var e = document.getElementById(id);

 if(e.style.display == 'none')
  e.style.display = '';
 else
  e.style.display = 'none';
 }

// Clear input field on focus
// usage: onFocus="doClear(this)"
// ************************************
 function doClear(theText) {
  //if (theText.value == theText.defaultValue) {
    theText.value = ""
  //}
 refreshImg('imgCaptcha')
 }

// function refreshImg
// ***************************
function refreshImg(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
