//********************************************************************** // BEGIN MODAL DIALOG CODE (can also be loaded as external .js file) //***********************************************************************/ // Global for brower version branching. var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) // One object tracks the current modal dialog opened from this window. var dialogWin = new Object() // Generate a modal dialog. // Parameters: // url -- URL of the page/frameset to be loaded into dialog // width -- pixel width of the dialog window // height -- pixel height of the dialog window // returnFunc -- reference to the function (on this page) // that is to act on the data returned from the dialog // args -- [optional] any data you need to pass to the dialog //function openDGDialog(url, width, height, returnFunc, args) { //var agt=navigator.userAgent.toLowerCase() var agt=navigator.appName //alert(agt) var pos = '' var pos2 = '' function popup(url, width, height, returnFunc, pos) { if( (name_end = url.lastIndexOf("?") ) != -1) { start_name = 0 name = url.substring(start_name, name_end) } if(!returnFunc) returnFunc = 'yes' if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) { dialogWin.returnFunc = returnFunc dialogWin.returnedValue = "" dialogWin.url = url dialogWin.width = width dialogWin.height = height dialogWin.name = name if (Nav4) { alert('nav4') // The best we can do is center in screen. dialogWin.left = (screen.width - dialogWin.width) / 2 dialogWin.top = (screen.height - dialogWin.height) / 2 var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",resizable=yes, scrollbars=" + returnFunc + ", width=" + dialogWin.width + ",height=" + dialogWin.height } else { //alert('not nav4') /* alert('nav4') alert(' window.screenX: '+ window.screenX+' window.screenX: '+ window.screenX) alert(' window.outerWidth: '+ window.outerWidth+' window.outerHeight: '+ window.outerHeight) alert(' dialogWin.width: '+ dialogWin.width+' dialogWin.height: '+ dialogWin.height) */ dialogWin.left = window.screenX + 30 dialogWin.top = window.screenY + 30 var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",resizable=yes, scrollbars=" + returnFunc + ",width=" + dialogWin.width + ",height=" + dialogWin.height } /* alert('pos: '+pos+' | pos2: '+pos2) */ if(agt == 'Netscape') dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr) else dialogWin.win=window.open(dialogWin.url, 'window', attr) dialogWin.win.focus() } else { dialogWin.win.focus() } return dialogWin.win } // Event handler to inhibit Navigator form element // and IE link activity when dialog window is active. function deadend() { if (dialogWin.win && !dialogWin.win.closed) { dialogWin.win.focus() return false } } // Since links in IE4 cannot be disabled, preserve // IE link onclick event handlers while they're "disabled." // Restore when re-enabling the main window. var IELinkClicks // Disable form elements and links in all frames for IE. function disableForms() { IELinkClicks = new Array() for (var h = 0; h < frames.length; h++) { for (var i = 0; i < frames[h].document.forms.length; i++) { for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) { frames[h].document.forms[i].elements[j].disabled = true } } IELinkClicks[h] = new Array() for (i = 0; i < frames[h].document.links.length; i++) { IELinkClicks[h][i] = frames[h].document.links[i].onclick frames[h].document.links[i].onclick = deadend } frames[h].window.onfocus = checkModal frames[h].document.onclick = checkModal } } // Restore IE form elements and links to normal behavior. function enableForms() { for (var h = 0; h < frames.length; h++) { for (var i = 0; i < frames[h].document.forms.length; i++) { for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) { frames[h].document.forms[i].elements[j].disabled = false } } for (i = 0; i < frames[h].document.links.length; i++) { frames[h].document.links[i].onclick = IELinkClicks[h][i] } } } // Grab all Navigator events that might get through to form // elements while dialog is open. For IE, disable form elements. function blockEvents() { if (Nav4) { window.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) window.onclick = deadend } else { disableForms() } window.onfocus = checkModal } // As dialog closes, restore the main window's original // event mechanisms. function unblockEvents() { if (Nav4) { window.releaseEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) window.onclick = null window.onfocus = null } else { enableForms() } } // Invoked by onFocus event handler of EVERY frame, // return focus to dialog window if it's open. function checkModal() { setTimeout("finishChecking()", 50) return true } function finishChecking() { if (dialogWin.win && !dialogWin.win.closed) { dialogWin.win.focus() } } //************************** // END MODAL DIALOG CODE //**************************/ function img_popup(file, path) { window.open( path + "popup.html?"+file, "", "resizable=1,height=200,width=200"); } function get_big_img(el, type, path) { //alert(el.src) loc = el.src; special_start = loc.lastIndexOf("/") + 1 special_end = loc.length file_thumb = loc.substring(special_start, special_end) //alert(file_thumb) file_part_start = 0 file_part_end = file_thumb.lastIndexOf("_") //file_part_end = file_thumb.lastIndexOf(".") file_type_start = file_thumb.lastIndexOf(".") file_part = file_thumb.substring(file_part_start, file_part_end) file_type = file_thumb.substring(file_type_start+1, file_thumb.length) file = file_part + '.' + file_type //popup('content/'+type+'/' + file_part + '_'+type+'.' + file_type) //alert('images/content/' + file) //img_popup('images/content/' + file, path) img_popup('dobb_cms/images/content/' + file_thumb, path) } -->