// JavaScript Document


// Used for Gallery Image-popups on the site
/* Example on usage:
 * Format:  <a href='javascript:popupFlash("EWCD Flash Image URL",height,width,"Pagetitle");'>LinkText</a>
 * Example: <a href='javascript: popupImage("_CSEMBED...",135,130,"3M")'>LinkText</a>
 */
var popupwin = null;

function popupImage(ImageURL,fileWidth,fileHeight,popupTitle) {
	// Width & Height of your Flash Document
	var sx = fileWidth;
	var sy = fileHeight;
	// Position the window in the Middle of the Screen
	var winl = (screen.width-sx)/2;
	var wint = (screen.height-sy)/2;
	// The following two lines prevents an IE error.
	popupwin=window.open("","NewWindow","top="+wint+",left="+winl+",width=200,height=200");
	popupwin.window.close();
	
	var image_insert="<a href='javascript:self.close()'><img src='"+ImageURL+"' height='"+fileHeight+"' width='"+fileWidth+"' border='0'></a>";
	popupwin=window.open("","NewWindow","toolbar=no,location=no,scrollbars=no,directories=no,status=no,menubar=no,top="+wint+",left="+winl+",width="+sx+",height="+sy+"");
	popupwin.document.write("<HTML><HEAD><TITLE>"+popupTitle+"</TITLE><style type='text/css'> HTML, BODY { overflow: hidden; margin:0;padding:0;color:#fff } </style></HEAD><Bo"+"dy>"+image_insert+"</Bo"+"dy></HTML>");
	popupwin.window.focus();
}
