<!--
// =================================================================================
// File Name:	WindowOpener.js   
	// ****    Copyright © 2000-2004 PromoNet Interactive, Inc.    ****
    // ****              http://www.ecommproject.com               ****
	// ****            All Rights Reserved World Wide.             ****
	// ****Permission is granted to use this code in your projects,**** 
	// ****     as long as this copyright notice is included.      ****
	// ****     If you change this script, please remove the       ****
	// ****     copyright;  This script is provided as-is	       ****
	// ****				with no warrantees or guarantees.	       ****
// Dependancies:	BrowserInfo.js
//================================================================================
// Modification History                                         
// Date			Modified By			Modification Desc                      
// ---------------------------------------------------------------------------------
// 16 Apr 2004	Andrea Williams		Ceated from other code
// 17 Aug 2004	Andrea Williams		Added RefreshMainWindow() and CloseSelf()
// ---------------------------------------------------------------------------------
// ==================================================================================

	
	function WindowOpen(oNewWindow, strURL, strName, intWidth, intHeight, blnShowStatusBar, blnShowMenuBar, 
		blnShowScrollBars, blnIsResizable, intTopPosition, intLeftPosition)
	{
		var strOptions = null;
		
		if (intWidth > 0){
			strOptions = 'width=' + intWidth + ',';
		}
		if (intHeight > 0){
			strOptions = strOptions + 'height=' + intHeight + ',';
		}
		if (intTopPosition != null){
			strOptions = strOptions + 'top=' + intTopPosition + ',';
		}
		if (intLeftPosition != null){
			strOptions = strOptions + 'left=' + intLeftPosition + ',';
		}
		if (blnShowStatusBar == true){
			strOptions = strOptions + 'status=yes' + ',';
		}else{
			strOptions = strOptions + 'status=no' + ',';
		}
		if (blnShowMenuBar == true){
			strOptions = strOptions + 'menubar=yes' + ',';
		}else{
			strOptions = strOptions + 'menubar=no' + ',';
		}
		if (blnShowScrollBars == true){
			strOptions = strOptions + 'scrollbars=yes' + ',';
		}else{
			strOptions = strOptions + 'scrollbars=no' + ',';
		}
		if (blnIsResizable == true){
			strOptions = strOptions + 'resizable=yes' + ',';
		}else{
			strOptions = strOptions + 'resizable=no' + ',';
		}
//		alert(strURL);
//		alert(strOptions);
		if (oNewWindow == null){
			oNewWindow = window.open(strURL, strName, strOptions);
		}else{
			if (!oNewWindow.closed)	{
				if (oNewWindow.location != strURL)	{
					oNewWindow.close();
				}
			}	
			oNewWindow = window.open(strURL, strName, strOptions, true);
		}
		if (!oNewWindow.closed)	{
			if (!is.ie4)	{
				oNewWindow.focus();
			}
		}
	}
	
	
	function RefreshMainWindow(strReferringURL) {
		// this will reload the parent window...
		if (!window.opener.closed) 
		{
			if (strReferringURL == null)
			{
				window.opener.location.reload();
			}
			else
			{
				window.opener.location = strReferringURL;
			}
			if (!is.ie4)	{
				window.opener.focus();
			}
		}
	}
	
	function CloseSelf() {
		self.close();
	}

//-->
