function openImageLibrary(pstrFieldName) { if (navigator.appName == 'Microsoft Internet Explorer') { imageselector = window.open("/cms/cms_uploadfile.jsp?FileType=PRODUCTIMAGE&Popup=Y&UploadIdInSelect=Y&FieldName="+pstrFieldName,"ImageLibrary", "directories=no, location=no, scrollbars=yes, menubar=no, resizable=no, status=yes, toolbar=no, height=500, width=540, top=50, left=75"); imageselector.opener = self; } else { imageselector = window.open("/cms/cms_uploadfile.jsp?FileType=PRODUCTIMAGE&Popup=Y&UploadIdInSelect=Y&FieldName="+pstrFieldName,"ImageLibrary","resizable,scrollbars=yes,height=500, width=540"); imageselector.opener = self; } } function openDocumentLibrary(pstrFieldName) { if (navigator.appName == 'Microsoft Internet Explorer') { imageselector = window.open("/cms/cms_uploadfile.jsp?FileType=IF&Popup=Y&UploadIdInSelect=Y&FieldName="+pstrFieldName,"ImageLibrary", "directories=no, location=no, scrollbars=yes, menubar=no, resizable=no, status=yes, toolbar=no, height=500, width=540, top=50, left=75"); imageselector.opener = self; } else { imageselector = window.open("/cms/cms_uploadfile.jsp?FileType=IF&Popup=Y&UploadIdInSelect=Y&FieldName="+pstrFieldName,"ImageLibrary","resizable,scrollbars=yes,height=500, width=540"); imageselector.opener = self; } } function setURL(pstrURL, pstrUploadId, pstrFieldName){ document.frmProduct.elements[pstrFieldName].value = pstrUploadId; hideItem(pstrFieldName + "_VIEWLINK"); setItem(pstrFieldName + "_MSG", "Requires save to take effect.  "); } function editRTEContent(pstrFieldName) { if (navigator.appName == 'Microsoft Internet Explorer') { mwinEditor = window.open("/cms/cms_pop_pleasewait.htm","ContentEditor", "directories=no, location=no, scrollbars=no, menubar=no, resizable=no, status=yes, toolbar=no, height=680, width=800,top=50,left=75"); } else { mwinEditor = window.open('/cms/cms_pop_pleasewait.htm','ContentEditor','scrollbars,height=680,width=800'); } mwinEditor.name = 'ContentEditor'; document.frmRTEEdit.Content.value = document.frmProduct.elements[pstrFieldName].value; document.frmRTEEdit.FieldName.value = pstrFieldName; document.frmRTEEdit.LinkName.value = "Insert content into Product Content"; document.frmRTEEdit.submit(); } function setFieldValue(pstrFieldName, pstrValue){ document.frmProduct.elements[pstrFieldName].value = pstrValue; } function showHideDescField(){ try{ if(document.frmProduct.UseCatDesc.checked){ hideItem('DescriptionArea'); document.frmProduct.CategoryDesc.value = document.frmProduct.Description.value; } else showItem('DescriptionArea'); }catch(e){ //wont work if not in edit mode, that's ok, just catch it do nothing } } function showItem(pstrId){ document.getElementById(pstrId).style.display = ''; } function hideItem(pstrId){ document.getElementById(pstrId).style.display = 'none'; } function productSelector(pintIndex, pstrMode){ var mwinLinkSelector; var newURL = "/cms/cms_pop_productselector.jsp?Mode="+pstrMode+"&Index=" + pintIndex; if (navigator.appName == 'Microsoft Internet Explorer') { mwinLinkSelector = window.open(newURL,"popuppage", "directories=no, location=no, menubar=no, scrollbars=yes, resizable=no, status=yes, toolbar=no, height=370, width=500, top=150, left=150"); } else { mwinLinkSelector = window.open(newURL,'popuppage','resizable=no,scrollbars,height=370,width=500'); } mwinLinkSelector.focus(); } function clearImageField(pstrFieldName){ document.frmProduct.elements[pstrFieldName].value = ""; //cleared if(pstrFieldName=="Image"){ document.getElementById(pstrFieldName + "File").style.display = "none"; document.getElementById(pstrFieldName + "Table").style.display = ""; document.getElementById(pstrFieldName + "_NoImageText").innerHTML = "No Image

Requires save to take effect."; } } function clearFieldValue(pstrFieldName){ document.frmProduct.elements[pstrFieldName].value = ""; document.getElementById(pstrFieldName + "_VIEWLINK").style.display="none"; setItem(pstrFieldName + "_MSG", "Requires save to take effect.  "); } function addProdToCat(){ if(document.frmProduct.NewItemCode.value!=""){ document.frmProduct.CtlAction.value = "METHOD.PRODUCT.ADDCATTOPROD"; document.frmProduct.submit(); } } function removeCategoryFromProd(pintIndex){ document.frmProduct.CtlAction.value = "METHOD.PRODUCT.REMOVECATFROMPROD"; document.frmProduct.Index.value = pintIndex; document.frmProduct.submit(); } function editCategory(pstrCode){ document.frmProductEdit.CtlAction.value = "METHOD.PRODUCT.CATEGORY.VIEW.INSITU"; document.frmProductEdit.Code.value = pstrCode; if (navigator.appName == 'Microsoft Internet Explorer') { mwinEditor = window.open("/cms/cms_pop_pleasewait.htm","ProductEditor", "directories=no, location=no, scrollbars=no, menubar=no, resizable=no, status=yes, toolbar=no, height=680, width=800,top=50,left=75"); } else { mwinEditor = window.open('/cms/cms_pop_pleasewait.htm','ProductEditor','scrollbars,height=685,width=800'); } mwinEditor.name = "ProductEditor"; document.frmProductEdit.submit(); } function editProduct(pstrCode){ document.frmProductEdit.CtlAction.value = "METHOD.PRODUCT.VIEWUPDATE"; document.frmProductEdit.Code.value = pstrCode; if (navigator.appName == 'Microsoft Internet Explorer') { mwinEditor = window.open("/cms/cms_pop_pleasewait.htm","ProductEditor", "directories=no, location=no, scrollbars=yes, menubar=no, resizable=no, status=yes, toolbar=no, height=680, width=800,top=50,left=75"); } else { mwinEditor = window.open('/cms/cms_pop_pleasewait.htm','ProductEditor','scrollbars,height=685,width=800'); } mwinEditor.name = 'ProductEditor'; document.frmProductEdit.submit(); }