var macromediaWindow;
var outsideWindow;

    function OpenWindow ( url, width, height, options, name )
    {      
	   if (url.indexOf("http://www.macromedia.com") > -1){
	    //alert ("Adobe script: detected macromedia URL");
        if (window.opener != null && !(window.opener.closed)) 
        {
			// alert ("Adobe script: window.opener is NOT null and window.opener is still open");
            window.opener.location = url;
            window.opener.focus();
        
        } else if (typeof(macromediaWindow) != "undefined" && macromediaWindow != null && !(macromediaWindow.closed)) {
			// alert ("Adobe script: macromediaWindow is NOT null and macromediaWindow.closed is false");
            macromediaWindow.location = url;
			macromediaWindow.focus();
        
        } else {
		    // alert ("Adobe script: macromediaWindow is null and window.opener is null");
            if (!width) width = 714;
            if (!height) height = 536;
            if (!options) options = "scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes";
			if (!name) name = "MacromediaWindow";
            macromediaWindow = window.open( url, name, "width="+width+",height="+height+","+options );
            macromediaWindow.focus();
        }
	 } else {
	 // alert ("Adobe script: NOT detected macromedia URL");
	 		if (!width) width = 714;
            if (!height) height = 536;
            if (!options) options = "scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes";
			if (!name) name = "OutsideWindow";
            outsideWindow = window.open( url, name, "width="+width+",height="+height+","+options );
            outsideWindow.focus();
	 }
		
    }
