// VARS USED IN THIS SCRIPT var exclude=1; var agt=navigator.userAgent.toLowerCase(); var win=0;var mac=0;var lin=1; if(agt.indexOf('win')!=-1){win=1;lin=0;} if(agt.indexOf('mac')!=-1){mac=1;lin=0;} var lnx=0;if(lin){lnx=1;} var ice=0; var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var dcm; var op5=0;var op6=0;var op7=0; var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0; var __ohw_dragging = false var __ohw_cur_mouse_left = 0; var __ohw_cur_mouse_top = 0; var __ohw_start_mouse_left = 0; var __ohw_start_mouse_top = 0; var __ohw_start_elem_left = 0; var __ohw_start_elem_top = 0; var __ohw_cur_dragElement = null; var __ohw_computing = false; // END VARS // START BROWSER DETECTION BEFORE ANYTHING ELSE HAS A CHANCE TO START // browser detection (modified for ohw) // script from javascripts.com if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){ var thisKDE=agt; var splitKDE=thisKDE.split("konqueror/"); var aKDE=splitKDE[1].split("; "); var KDEn=parseFloat(aKDE[0]); if(KDEn>=2.2){ kde=1; ns6=1; exclude=0; } } else if(agt.indexOf('webtv')!=-1){exclude=1;} else if(typeof window.opera!="undefined"){ exclude=0; if(agt.indexOf("opera/5")!=-1||agt.indexOf("opera 5")!=-1){op5=1;} if(agt.indexOf("opera/6")!=-1||agt.indexOf("opera 6")!=-1){op6=1;} if(agt.indexOf("opera/7")!=-1||agt.indexOf("opera 7")!=-1){op7=1;} } else if(typeof document.all!="undefined"&&!kde){ exclude=0; ie=1; if(typeof document.getElementById!="undefined"){ ie5=1; if(agt.indexOf("msie 6")!=-1){ ie6=1; dcm=document.compatMode; if(dcm!="BackCompat"){com=1;} } } else{ie4=1;} } else if(typeof document.getElementById!="undefined"){ exclude=0; if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){ns6=1;} else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;} else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;} if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")) {mz7=0;ns6=1;saf=1;} } else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){ exclude=0; ns4=1; if(typeof navigator.mimeTypes['*']=="undefined"){ exclude=1; ns4=0; } } if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;} if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;} // END BROWSER DETECTION function vt_alinkOnLoad() { if (opener != null) { opener.name = "__ohw_main_window"; } // signal any ppr event handlers that the page has loaded //document.body.__ohw_done_loading = "true"; } function vt_topicsOnLoad(forceNonDynamic) { // signal any ppr event handlers that the page has loaded //document.body.__ohw_done_loading = "true"; if (_vt_supportsDynamicContent() && !forceNonDynamic) { _vt_setupWindows(); _vt_setupMouseListeners(); // Make the view topic title the topic documents title //if (parent && document.title) //{ // parent.document.title = document.title; // } } } function vt_launchAlink(loc) { if (_vt_supportsDynamicContent()) { _vt_launchContent(loc + "&vtDynamic=true"); return; } _vt_launchWindow(loc, 'height=100,width=300,location=no,resizable=yes,status=no,toolbar=no,scrollbars=yes'); return; } function vt_launchPopup(loc) { if (_vt_supportsDynamicContent()) { _vt_launchContent(loc); return; } _vt_launchWindow(loc, 'height=100,width=300,location=no,resizable=yes,status=no,toolbar=no,scrollbars=yes'); return; } function _vt_launchWindow(loc, params) { window.open(loc, null, params); } function _vt_launchContent(loc) { // Get the content layer //var conWin = _vt_getWindow("_ohw_cnt"); // Set minumum bounds //conWin.style.width = 225; //conWin.style.height = 100; //conWin.style.overflow = "auto"; //OHWPageLoader.load(loc, conWin); // Fixup our table due to NS 4.7 bug var ohwTable = _vt_getWindow("_ohw_table"); ohwTable.border = 1; var ifrm = _vt_getContentFrame(); ifrm.location.replace("about:blank"); ifrm.location.replace(loc); vt_openPresentationWindow(); return true; } function vt_openPresentationWindow() { //OHWPageLoader.elem.innerHTML = // OHWPageLoader.dynFrame.document.documentElement.innerHTML; var ohwDiv = _vt_getWindow("_ohw_prs"); //alert("TOP: " + __ohw_cur_mouse_top); //ohwDiv.style.left = __ohw_cur_mouse_left ; //ohwDiv.style.top = __ohw_cur_mouse_top; // TEMP until we can come up with something better /*if (ohwDiv.document) { var addX = 0; var addY = 0; if (window.frames._ohw_content) { addX = window.frames._ohw_content.document.body.scrollLeft; addY = window.frames._ohw_content.document.body.scrollTop; } else { addX = document.body.scrollLeft; addY = document.body.scrollTop; } ohwDiv.style.left = addX + 50; ohwDiv.style.top = addY + 200; } else { var addX = 0; var addY = 0; if (window.frames._ohw_content) { addX = window.frames._ohw_content.window.pageXOffset; addY = window.frames._ohw_content.window.pageYOffset; } else { addX = window.pageXOffset; addY = window.pageYOffset; } ohwDiv.style.left = addX + 50; ohwDiv.style.top = addY + 200; }*/ ohwDiv.style.top = __ohw_cur_mouse_top + 10; ohwDiv.style.left = __ohw_cur_mouse_left + 10; ohwDiv.style.visibility = "visible"; } function vt_closePresentationWindow(e) { // Make sure we dont close it right after opening the link!! var curElem = null; var hasNativeEvent = true; if (!e) { e = event; curElem = event.srcElement; hasNativeEvent = false; } else { curElem = e.target; } while (curElem.tagName != "HTML") { if (curElem.tagName == "A") return; curElem = hasNativeEvent ? curElem.parentNode : curElem.parentElement; } if (__vt_windowOpen == true) { __vt_windowOpen = false; return; } var conWin = _vt_getWindow("_ohw_prs"); if (conWin) { conWin.style.visibility = "hidden"; } /*var ifrm = _vt_getContentFrame(); if (ifrm) { //ifrm.style.width = 0; }*/ __vt_windowOpen = false; return; } function _vt_getWindow(windowStr) { var conWin = null; // IE/NS/MOZ get element out of frameset conWin = document.getElementById(windowStr); // IE get element in frameset if (!conWin) { if (window.frames._ohw_content) conWin = window.frames._ohw_content.document.getElementById(windowStr); } // NW/MOZ get element in frameset if (!conWin) { if (window.frames._ohw_content) { conWin = window.frames._ohw_content.document.getElementById(windowStr); } } return conWin; } function _vt_getTopicFrame() { var doc = null; if (window.frames._ohw_content) { doc = window.frames._ohw_content; } if (!doc) { doc = document; } return doc; } function _vt_getContentFrame() { // Get the iframe var ohwFrame = null; if (window.frames._ohw_content) ohwFrame = window.frames._ohw_content.frames._ohw_render_frame; else ohwFrame = window.frames._ohw_render_frame; return ohwFrame; } var OHWPageLoader = new Object(); OHWPageLoader.load = function(url, elem) { with (OHWPageLoader) { if (!this.dynFrame) { this.dynFrame =_vt_getContentFrame(); } this.elem = elem; this.dynFrame.src = "about:blank"; this.dynFrame.location.replace(url) setTimeout("_ohw_waitForContent()", 100); } } function _ohw_waitForContent() { if (OHWPageLoader.dynFrame.document.body && OHWPageLoader.dynFrame.document.body.__ohw_done_loading == "true") { OHWPageLoader.dynFrame.document.body.__ohw_done_loading = "false"; vt_openPresentationWindow(); return; } setTimeout("_ohw_waitForContent()", 100); } function vt_genericClick(e) { if (ns6) __vt_windowOpen = true; return false; } var __vt_windowOpen = false; document.onclick = vt_closePresentationWindow; // Scripts for dragging the windows function _vt_startDrag(e) { var curElem = null; var hasNativeEvent = true; if (!e) { e = event; curElem = event.srcElement; hasNativeEvent = false; } else { curElem = e.target; } while (curElem.tagName != "HTML" && curElem.className != "__ohw_draggable" && curElem.className != "__ohw_not_draggable") { curElem = hasNativeEvent ? curElem.parentNode : curElem.parentElement; } if (curElem.className == "__ohw_draggable") { __ohw_dragging = true __ohw_cur_dragElement = curElem; __ohw_start_mouse_left = e.clientX; __ohw_start_mouse_top = e.clientY; __ohw_start_elem_left = parseInt(curElem.style.left + 0) __ohw_start_elem_top = parseInt(curElem.style.top + 0) return false; } } function _vt_dragWindow(e) { var hasNativeEvent = true; if (!e) { e = window.event; hasNativeEvent = false; } if (!hasNativeEvent) { var addX = 0; var addY = 0; if (window.frames._ohw_content) { addX = window.frames._ohw_content.document.body.scrollLeft; addY = window.frames._ohw_content.document.body.scrollTop; } else { addX = document.body.scrollLeft; addY = document.body.scrollTop; } __ohw_cur_mouse_left = e.clientX + addX; __ohw_cur_mouse_top = e.clientY + addY; } else { var addX = 0; var addY = 0; if (window.frames._ohw_content) { addX = window.frames._ohw_content.window.pageXOffset; addY = window.frames._ohw_content.window.pageYOffset; } else { addX = window.pageXOffset; addY = window.pageYOffset; } __ohw_cur_mouse_left = e.clientX + addX; __ohw_cur_mouse_top = e.clientY + addY; } if (__ohw_dragging) { __ohw_cur_dragElement.style.left = __ohw_start_elem_left + e.clientX - __ohw_start_mouse_left; __ohw_cur_dragElement.style.top = __ohw_start_elem_top + e.clientY - __ohw_start_mouse_top; return false } /*else { var ohwDiv = _vt_getWindow("_ohw_prs"); if (ohwDiv.style.visibility != "visible") { //ohwDiv.style.left = __ohw_cur_mouse_left ; //ohwDiv.style.top = __ohw_cur_mouse_top; } return false; }*/ } function _vt_stopDrag(e) { __ohw_dragging = false; } function _vt_setupMouseListeners() { if (window.frames._ohw_content) { window.frames._ohw_content.document.onmousemove = _vt_dragWindow; window.frames._ohw_content.document.onmousedown = _vt_startDrag; window.frames._ohw_content.document.onmouseup = _vt_stopDrag; } else { document.onmousemove = _vt_dragWindow; document.onmousedown = _vt_startDrag; document.onmouseup = _vt_stopDrag; } } function _vt_supportsDynamicContent() { return ie5 || ie6 || ns6 || saf || op7; } function _vt_setupWindows() { /*var majDiv = document.createElement("div"); majDiv.onclick="vt_genericClick(event)"; majDiv.id = "_ohw_prs"; majDiv.className = "__ohw_draggable"; //majDiv.style.visibility = "hidden"; majDiv.style.position = "absolute"; var table = document.createElement("table"); table.borderColor="black"; table.border="1"; table.cellspacing="0"; table.bgColor="white"; var upperTr = document.createElement("tr"); var titleTd = document.createElement("td"); titleTd.bgColor = "lightBlue"; var titleDiv = document.createElement("div"); titleDiv.style.cursor = "move"; titleDiv.innerHTML = "OHW"; titleTd.appendChild(titleDiv); upperTr.appendChild(titleTd); table.appendChild(upperTr); var lowerTr = document.createElement("tr"); var contentTd = document.createElement("td"); var iframe = document.createElement("iframe"); iframe.name = "_ohw_render_frame"; iframe.id = "_ohw_render_frame"; iframe.frameBorder = "0"; iframe.height = 75; iframe.width = 300; contentTd.appendChild(iframe); lowerTr.appendChild(contentTd); table.appendChild(lowerTr); majDiv.appendChild(table); alert(majDiv.outerHTML); var elem = document.createElement("div"); elem.innerHTML = "
OHW |
" +
// Bug in mozilla, can't do this or it will load forever
//"" +
" |