var nn4 = (navigator.appName.indexOf("Netscape") > -1 && navigator.appVersion.indexOf("4") > -1) ? true:false var ie = (document.all) ? true:false var nn6 = (document.getElementById && !document.all) ? true:false function browser(id){ var layer = (nn4) ? document.layers[id] : (ie) ? document.all[id] : document.getElementById(id) return layer } function popUp(strURL, windowname, intHeight, intWidth, strScrollbar){ var strOptions = "toolbar=no"; strOptions += ",local=no"; strOptions += ",menubar=no"; strOptions += ",status=no"; strOptions += ",scrollbars=" + strScrollbar; strOptions += ",resizable=yes"; strOptions += ",height=" + intHeight; strOptions += ",width=" + intWidth; mywindow=window.open(strURL, windowname, strOptions); return mywindow; } function clickCategory(CatIDStr){ clickCategory2(CatIDStr,'/images/icon_minus.gif','/images/icon_plus.gif'); } function clickCategory2(CatIDStr,urlOpenImage,urlCloseImage){ var txtObj; var imgObj; if (browser("T_" + CatIDStr)==null){ if (parent.browser("T_" + CatIDStr) != null) { txtObj = parent.browser("T_" + CatIDStr); if (urlOpenImage != undefined) imgObj = parent.browser("I_" + CatIDStr); } else { return null; } } else { txtObj = browser("T_" + CatIDStr); if (urlOpenImage != undefined) imgObj = browser("I_" + CatIDStr); } if (txtObj.style.display == 'none'){ txtObj.style.display = ''; if (urlOpenImage != undefined) imgObj.src = urlOpenImage; } else { txtObj.style.display = 'none'; if (urlOpenImage != undefined) imgObj.src = urlCloseImage; } //window.event.cancelBubble=true; } function openCategory(CatIDStr){ var txtObj = browser("T_" + CatIDStr); var imgObj = browser("I_" + CatIDStr); txtObj.style.display = ''; imgObj.src = '/images/icon_minus.gif'; window.event.cancelBubble=true; } function layerToggle(CatIDStr){ var txtObj = browser(CatIDStr); if (txtObj.style.display == 'none'){ txtObj.style.display = ''; } else { txtObj.style.display = 'none'; } window.event.cancelBubble=true; } function layerOpen(CatIDStr){ var txtObj = browser(CatIDStr); txtObj.style.display = ''; window.event.cancelBubble=true; } function accept(str_question) { msg=str_question if (confirm(msg)) { return true; } else { return false; } } function clearMedia(strFormElementName,guidField){ var oLayer = browser("mediafield" + guidField); oLayer.innerHTML = ""; var formField = eval("document.forms[\'" + strFormElementName + "\'].elements[\'field" + guidField + "\']"); formField.value=""; } function getMedia(strFormElementName, guidField) { var strURL='/html/mediaarchive.asp?folder=E0F9642D-ED2C-4FE2-B6C0-D1261C1ADBEB&form=' + strFormElementName + '&field='+ guidField; var strOptions = "toolbar=no"; strOptions += ",local=no"; strOptions += ",menubar=no"; strOptions += ",status=yes"; strOptions += ",scrollbars=yes"; strOptions += ",resizable=yes"; strOptions += ",height=425"; strOptions += ",width=600"; mywindow=window.open(strURL, 'mediaarchive', strOptions); } function setMedia(strFormElementName,guidField,strContentType,strFileName) { var oLayer = browser("mediafield" + guidField); oLayer.innerHTML = "
"; if (strContentType=="image/gif" || strContentType=="image/jpg" || strContentType=="image/jpeg" || strContentType=="image/pjpeg" || strContentType=="image/x-png") { oLayer.innerHTML+="
\"View
" + strFileName + "
"; } else { oLayer.innerHTML+="
File selected: " + strFileName + "
"; } oLayer.style.display=''; } function selectMedia(strFormElementName,guidField,strMedia,strContentType,strFileName){ var formWindow = opener; var formField = eval("formWindow.document.forms[\'" + strFormElementName + "\'].elements[\'field" + guidField + "\']"); formField.value=strMedia; opener.setMedia(strFormElementName,guidField,strContentType,strFileName); opener.focus(); window.close(); } //returns window width(mode=1) or height (mode=anything else) function WindowSize(mode) { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } if (mode=='1') { return myWidth; } else { return myHeight; } } function htmleditor(strEditHtml,strFieldName){ html=strEditHtml; strUrl="/FCKeditor/ICPopUp.html?parentfield=" + strFieldName; editorWindow = window.open(strUrl, "FckEditor", Math.round(screen.height/1.5), Math.round(screen.width/1.5), 'auto') htmleditor.html=strEditHtml; } function htmleditorfullpage(strEditHtml,strFieldName){ html=strEditHtml; strUrl="/FCKeditor/ICPopUpFullPage.asp?parentfield=" + strFieldName; editorWindow = window.open(strUrl, "FckEditor", Math.round(screen.height/1.5), Math.round(screen.width/1.5), 'auto') htmleditor.html=strEditHtml; } //htmleditor.html=""; function getHtmlEditorText(){ return htmlEditorText; } function codeeditor(strEditText){ strUrl="/administration/codeeditor.asp"; return editor(strUrl,strEditText) } function editor(strEditorUrl,strEditText) { var editArgs=new Array(1); editArgs[0]=strEditText; //html = showModalDialog(strEditorUrl,editArgs,"status:no;dialogWidth:700px;dialogHeight:300px;dialogTop: 50px; dialogLeft: 50px;help:no"); //html = showModalDialog(strEditorUrl,editArgs,"status:no;dialogWidth:" + Math.round(WindowSize(1)-10) + "px;dialogHeight:" + Math.round(WindowSize(2)) + "px;dialogTop: 50px; dialogLeft: 50px;help:no"); if (ie==true) { html = showModalDialog(strEditorUrl,editArgs,"status:no;dialogWidth:" + Math.round(screen.width/1.5) + "px;dialogHeight:" + Math.round(screen.height/1.5) + "px;dialogTop: 50px; dialogLeft: 50px;help:no"); } else { myWindow = alert(myWindow.oFCKeditor.Value); } if (html!=null) { return html; } else { return strEditText; } }