// ******************************************************************************************************
// 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 for poping-up images : Reference it like this in the html: 
// <a href="javascript:;" onClick="PopUpImg('jpg','/assets/layout/my_image.jpg','640','480','Image 1','0','0')">Click!</a> 
// ******************************************************************************************************
function PopUpImg(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
 screenh = window.screen.height;
 screenw = window.screen.width;
 posLeft = (screenw-imageWidth)/2;
 posTop = (screenh-imageHeight)/2;
 theWindow = window.open("","theWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
 theWindow.document.open();
 theWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
 theWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" onClick="javascript:window.self.close();" galleryimg="no">');
 theWindow.document.write('</body></html>');
 theWindow.document.close();
 theWindow.focus()
}

// ******************************************************************************************************
// 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/shop/layout/loading.gif"></span>
// ******************************************************************************************************
function ShowWaitMsg()
{
if(id_waitmsg) id_waitmsg.style.visibility = 'visible';
setTimeout('document.images["pbar"].src = "/assets/shop/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=770,height=550");
			}
