//  site specific JavaScript for the Nexcare EWCD site.

// Used for popups on the site
/* Example on usage:
 * <a href='javascript:popupFlash("_CSEMBED...",height,width,"Pagetitle");'>LinkText</a>
 */
var popupwin = null;

function popupFlash(fileURL,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 flash_insert="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0' width='"+sx+"' height='"+sy+"'><param name='movie' value='"+fileURL+"'><param name=quality value=high><embed src='"+fileURL+"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+sx+"' height='"+sy+"'></embed></object>";
	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>"+flash_insert+"</HTML>");
	popupwin.window.focus();
}

