var a_filetype = new Object(); a_filetype['default'] = Array('/gedit/images/filetype/ext_default.gif', 'document'); a_filetype['doc'] = Array('/gedit/images/filetype/ext_doc.gif', 'word document'); a_filetype['gif'] = Array('/gedit/images/filetype/ext_gif.gif', 'gif afbeelding'); a_filetype['htm'] = Array('/gedit/images/filetype/ext_htm.gif', 'html document'); a_filetype['jpg'] = Array('/gedit/images/filetype/ext_jpg.gif', 'jpeg afbeelding'); a_filetype['pdf'] = Array('/gedit/images/filetype/ext_pdf.gif', 'pdf document'); a_filetype['ppt'] = Array('/gedit/images/filetype/ext_ppt.gif', 'powerpoint presentatie'); a_filetype['pps'] = Array('/gedit/images/filetype/ext_ppt.gif', 'powerpoint presentatie'); a_filetype['txt'] = Array('/gedit/images/filetype/ext_txt.gif', 'tekst document'); a_filetype['xls'] = Array('/gedit/images/filetype/ext_xls.gif', 'excel spreadsheet'); function get_filetype_key(s_filename) { var s_retval = ''; var pattern = /^.*\.(\w+)/i; if(pattern.test(s_filename)) s_retval = RegExp.$1 s_retval = s_retval.toLowerCase(); if(!a_filetype[s_retval]) s_retval = 'default'; return s_retval; } function externalLinks() { if (document.getElementsByTagName) { an = document.getElementsByTagName("a"); for (i=0; i 0 && obj.href) { s_key = get_filetype_key(obj.href); s_title = obj.title; if(s_title == '') s_title = obj.firstChild.nodeValue; obj.title = a_filetype[s_key][1] + ": " + s_title; obj.target= '_blank'; //if (obj.getElementsByTagName("img").length == 0 && obj.className.indexOf('nomark') == -1) if (obj.className.indexOf('nomark') == -1) { mark = document.createElement("img"); mark.src = a_filetype[s_key][0]; mark.alt = a_filetype[s_key][1]; mark.width = "16"; mark.height = "16"; mark.className = "external_doc"; if(obj.parentNode) obj.parentNode.insertBefore(mark, obj); // obj.appendChild(mark); } } } } } function isImage(s_value) { var pattern = /\.(jpg|jpeg|png|gif|bmp)$/i; return pattern.test(s_value); } function popup(s_href, title, iWidth, iHeight, iMaxWidth, iMaxHeight) { if (iMaxWidth == "") iMaxWidth = 800; if (iMaxHeight == "") iMaxHeight = 600; sScroll = 'yes'; if(isImage(s_href)) { s_href = "/php/popup.php?img="+s_href+"&title="+escape(title); sScroll = 'no'; } iHeight = iHeight + 0; iWidth = iWidth + 0; if (iHeight > iMaxHeight) { iHeight = iMaxHeight; sScroll = 'yes'; } if (iWidth > iMaxWidth) { iWidth = iMaxWidth; sScroll = 'yes'; } var s_options = "toolbar=no,"+ "resizable=yes,"+ "status=no,"+ "menubar=no,"+ "location=no,"+ "directories=no,"+ "height="+ iHeight +","+ "width="+ iWidth +","+ "scrollbars="+ sScroll; controlWindow = window.open(s_href, "new", s_options); }