// -------------------------------------------------------------------- // window open/close replacement (Re:- IE* default to open in new TAB function window_open(url, title, props) { //return window.open(url, title, props); return popwindow(url, title, props); //return new popwindow(url, title, props); } var popwindows = []; var popwindows_baseurl = []; function popwindow(url, title, props) { // exists? var baseurl_arr = url.split("?"); var baseurl = baseurl_arr[0] if ( popwindows_baseurl[baseurl] != null ) { var winid = popwindows_baseurl[baseurl] // set new url popwindows[winid].iframe1.src = url; return popwindows[winid].iframe1.contentWindow; } var title_h = 18; var myprops = props.replace(/\,/g,"\;").replace(/\=/g,"\:"); var winid = popwindows.length; //popwin = document.createElement("
"); popwin = document.createElement(""); popwindows[winid] = popwin; popwindows_baseurl[baseurl] = winid; popwin.baseurl = baseurl; //popwin.id = "my_" + title; popwin.id = "popwin_" + winid; popwin.style.z_index = 1; //popwin.style.display = "none"; //popwin.style.filter = 'alpha(opacity=0)'; popwin.style.position = "absolute"; popwin.style.border = "4"; popwin.style.borderStyle = "outset"; var frame_h = parseInt(popwin.style.height.replace(/px/,"")); var frame_w = parseInt(popwin.style.width.replace(/px/,"")); popwin.style.height = (title_h + frame_h) + "px"; var outp = ""; outp += "
"; outp += ""; outp += ""; outp += ""; outp += ""; outp += "
"; outp += title; outp += ""; //outp += "        " //outp += "        " //outp += "        " //outp += "        " //outp += " X " + "'>Close" + ""; //outp += ""; outp += "
"; outp += "
"; var frame1name = "frame1"; //outp = "" //outp += ""); iframe1.id = frame1name; iframe1.name = frame1name; iframe1.style.height = frame_h + "px"; //iframe1.style.width = frame_w + "px"; iframe1.style.width = "100%"; //iframe1.src = url; iframe1.popwin = popwin; popwin.iframe1 = iframe1; popwin.appendChild(iframe1); document.body.appendChild(popwin); // methods popwin.close = function () { //alert("popwin.close()"); popwin.removeNode(true); popwindows[popwin.winid] = null; popwindows_baseurl[popwin.baseurl] = null; } iframe1.close = function () { //alert("frame1.close()"); iframe1.popwin.close(); } iframe1.attachEvent("onload", function() { //alert("frame1 loaded"); //alert("b iframe1.contentWindow.close = " + iframe1.contentWindow.close); //iframe1.contentWindow.nativeclose = iframe1.contentWindow.closel; iframe1.contentWindow.close = function () { //iframe1.contentWindow.nativeclose(); //alert("frame1.contentWindow.close()"); iframe1.close(); } //alert("a iframe1.contentWindow.close = " + iframe1.contentWindow.close); }); //iframe1.attachEvent("onbeforeunload", function() { // alert("frame1 before unload"); // iframe1.close(); // }); //this.close = this.popwin.close; //this.focus = this.popwin.focus; //this.blur = this.popwin.blur; //this.toggle = function () { this.popwin.style.visibility = this.popwin.style.visibility == 'visible' ? 'hidden' : 'visible'; } //alert("here 0 popwin.id = [" + popwin.id + "]" + " HTML = " + popwin.outerHTML); //alert("iframe1.contentWindow = " + iframe1.contentWindow); ////iframe1.contentWindow.opener = window; // load url iframe1.src = url; //var popwinel = document.getElementById(popwin.id); //alert("here 1 id=" + popwinel.id); //popwinel.frame1.setAttribute('src', url); //frame1.src = url; //alert("here 2"); //popwin.style.visibility = 'hidden'; //alert("here 3"); popwin.style.visibility = 'visible'; //return popwin; //return iframe1; return iframe1.contentWindow; } //function window_close(x) //{ // alert("window_close(" + x + ")"); // if ( typeof(x) == "object" ) // x.removeNode(true); // else // eval(x + ".removeNode(true)"); //}