/* CONTAINS THE FOLLOWING: function notifyBadBrowser() function browser_Manuf() { function doc_GetQSArg(strArgName){ function doc_GetCookie(strCookieName){ function doc_SetCookie(strCookieName, strCookieValue) { function window_OpenDialog(winOpener, strURL, strName, varArguments, strFeatures) { function PopAssetCreate(strQueryString) { function PopAssetCreateICBData(strQueryString) { function PopAssetSell(strQueryString) { function PopExecutor(strQueryString) { //function PopNeedCreate(strQueryString) { //function PopNeedSuggestions(strQueryString) { function PopNeedRetrieve(strQueryString) { function PopNeedBrowser(strQueryString) { function PopNeedCatRUD(strQueryString) { function PopNeedCatCreateSetSubCats(strQueryString) function PopNeedCatOrderPlanCRUD(strQueryString) { function PopNeedShop(strQueryString) { function PopSiteSearchPop(strQueryString) { function PopProductRUD(strQueryString) { function PopAssetRUD(strQueryString) { function PopNeedRUD(strQueryString) { function PopAssetRepurpose(strQueryString) { function PopProductSearch(strQueryString) { function PopNeedList(strQueryString) { function PopSimpleCalculator(strQueryString) { function PopUseRateCalculator(strQueryString) { function PopRemainingLifetimeCalculator(strQueryString) { function PopFeedbackForm() { function PopCustNotesEditor() { function PopTextAreaExpander( function PopLoginSendPassword() //function PopSiteWin(strArgList) { SEE NeedShop.asp function PopQuestion(strQueryString) { function PopRptTopCatExpenseDetail(strQueryString) { function PopRptVendorPerfDetail(strQueryString) { function PopNeedActionsMenu(strQueryString) { function PopAssetActionsMenu(strQueryString) { function PopTimeIntervalSelector(strQueryString) { function select_AddOption(lst, strOptVal, strOptTextHexEncoded, bSameWindow) { function select_GetVal(lst) { function select_SelectVal(lst, val) { function select_GetText(lst) { function form_GetStarOfSelectedCheckBoxControlValues(ctlChk) { function PopEntityCreateAndUpdate(strQueryString, strWinName, strWinProps) { (SEE ALSO SPECIAL CASES BELOW): function PopECUForCustLocation(strQueryString) { function PopECUForCustPerson(strQueryString) { function PopECUForCustPurpose(strQueryString) { function PopECUForOrderHeader(strQueryString) { function PopECUForVendor(strQueryString) { function PopECUForVendorStore(strQueryString) { function PopHelpSearch(strKeywords) { function PopHelpTopicGloss(strBookmark) { function PopHelpTopicLarge(strHelpFileNameAndBookmark) { function PopHelpTopicUI() { //NOT intented to be called directly, use one of the above procs: function PopHelpTopic(strHelpTopicSubPath, strWinSizeCode) { function popup_GetFeatures(strPopupLocation, intIdealWidth, intIdealHeight) { function MM_controlSound(x, _sndObj, sndFile) { //v3.0 function InvMgmtInfo_CopyFromSourceFormToDestForm(frmSrc, winDest, frmDest) { function InvMgmtInfo_CopyFromLstExtAttrsStarToFormControls( function FlexRound(sngNum, intNumDigits) { function GetFlexNumDigitsAfterDecimal( // ***BUT***, this is not used anywhere yet (see FlexRound above). function advertiser_LinkClicked( ... ) function advertiser_OpenWin( ... ) function cmd_Disable(cmd) function cmd_IsEnabled(cmd) function SubAppMode_Switch(strSubAppMode) { function SubAppMode_Get() { function site_Display( .... ) function site_Display_ForProvider( function PopLiveHelpChatWindow() function PopFinder(strPageMode) { //CURRENTLY NOT USED function PopAgent(strQueryString) { function PopAgtCust(strQueryString) { function PopCustAgent(strQueryString) { function PopIMSNeedAdd(strQueryString) { function PopIMSAssetAdd(strQueryString) { function PopIMSAgtOffer(strQueryString) { function imgPic_onerror() { function PopPicView(strQueryString) { function PopPicsView(strQueryString) { function PopPicsChange(strQueryString) { function lstQtyLifetimeDisplayTimePeriodCode_onChange(ctlThis) { */ var g_lngMSECS_PER_DAY = 24 * 60 * 60 * 1000; var winDDC = null; /* UNUSED; COPIED IN FROM Adv123 FOR REFERENCE: function notifyBadBrowser() { var badB = "" if (navigator.appName.substring(0,8) == "Netscape") { if (navigator.appVersion.substring(0,1) < 4) badB = "Netscape Navigator " + navigator.appVersion } else if (navigator.appName.substring(0,9) == "Microsoft") { if (navigator.appVersion.substring(0,1) < 4) badB = "Microsoft Internet Explorer " + navigator.appVersion } else badB = navigator.appName + " " + navigator.appVersion if (badB != "") getBrowser = open("badBrowser.asp?browser="+badB, "getBrowser", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=300") return true } */ function browser_Manuf() { //01-01-17 RMcQ //Returns the manufacturer of the current hosting browser; very simple //See also the navigator.appVersion property. if (navigator.appName.substring(0,9) == "Microsoft") return "Microsoft" else return "Netscape" } function doc_GetQSArg(strArgName) { //01-11-03 RMcQ adapted from doc_GetCookie //NOTE that "document" is assumed avail externally var strQS = document.location.search; // alert("document.location.search=" + strQS); //replace the starting "?" with a "&" to normalize the first arg //and simplify the logic below: var strQS = strQS.replace("?", "&") // alert("strQS=" + strQS); //if the arg doesn't exist, return an empty string: if (strQS.indexOf("&"+strArgName+"=") == -1) { return ""; } //otherwise, move to the start of the argument name: strQS = strQS.substring(strQS.indexOf("&"+strArgName+"=")+1); //if the remaining substring has another "&"...: if (strQS.indexOf("&") != -1) { //then truncate all that follows: strQS = strQS.substring(0,strQS.indexOf("&")); } //truncate the "strArgName=" from the front of the string: strQS = strQS.substring(strQS.indexOf("=")+1); // alert(strArgName + "=" + strQS); return unescape(strQS); } function doc_GetCookie(strCookieName) { //1999-11-13 RMcQ adapted from help system //NOTE that "document" is assumed avail externally //03-04-05 RMcQ FIXED by adding "if (strCookieValue.indexOf(";") > -1)" below; apparently help system was incorrect. var strCookieValue = document.cookie; if (strCookieValue.indexOf(strCookieName) == -1) return ""; strCookieValue = strCookieValue.substring(strCookieValue.indexOf(strCookieName)); if (strCookieValue.indexOf(";") > -1) strCookieValue = strCookieValue.substring(0,strCookieValue.indexOf(";")); return unescape(strCookieValue.substring(strCookieValue.indexOf("=")+1)); } function doc_SetCookie(strCookieName, strCookieValue) { //1999-11-13 RMcQ adapted from help system //NOTE that "document" is assumed avail externally // alert('strCookieName=' + strCookieName); // alert('strCookieValue=' + strCookieValue); document.cookie = strCookieName + "=" + escape(strCookieValue) + ";" } function window_OpenDialog(winOpener, strURL, strWinName, strWinProps, varWinArgs) { //01-12-07 RMcQ //NOTE: Could use to simulate modality in NetScape, //but that method has problems (e.g., see www.webreference.com/js/tips/000613.html; "Modal Windows in Netscape" by Yehuda Shiran, Ph.D. (Doc Javascript)). if (false) { //(document.all) { winOpener.showModalDialog(strURL, varWinArgs, strWinProps) } else { // var win = winOpener.open(strURL, strWinName, strWinProps); // win.focus(); //02-02-16 RMcQ REPLACED WITH THIS FROM TVG: var win; win = window.open("", strWinName, strWinProps); win.focus(); win.location = strURL; } } function PopAssetCreate(strQueryString) { //01-07-20 RMcQ //See the AssetCreate.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the AssetCreate page after the "?". if (SubAppMode_Get().toUpperCase() == "IMS") { return PopIMSAssetAdd(strQueryString); } else { window_OpenDialog( window, window.location.pathname + "/../../Common/AssetCreate.asp?hidModMode=Modal&" + strQueryString, "AssetCreate", popup_GetFeatures("L6", 780, 540), ""); return false; } } function PopAssetCreateICBData(strQueryString) { //03-02-10 RMcQ //See the page header for a description of the input arguments. //The strQueryString arg is passed directly to the page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/AssetCreateICBData.asp?hidModMode=Modal&" + strQueryString, "AssetCreateICBData", popup_GetFeatures("L6", 700, 460), ""); return false; } function PopAssetSell(strQueryString) { //02-06-07 RMcQ //See the AssetSell.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". //NOTE that the hidModMode param is not used here, but kept for possible future expansion. window_OpenDialog( window, window.location.pathname + "/../../Common/AssetSell.asp?hidModMode=Modal&" + strQueryString, "AssetSell", popup_GetFeatures("M", 550, 550), ""); return false; } function PopExecutor(strQueryString) { //01-11-24 RMcQ //See the page header for a description of the input arguments. //The strQueryString arg is passed directly to the page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/Executor.asp?" + strQueryString, "Executor", "height=10,width=10,left=10,top=10,menubar=no,toolbar=no,location=no,scrollbars=no,status=no,resizable=yes", ""); return false; } function PopNeedRetrieve(strQueryString) { //02-01-07 RMcQ //See the NeedRetrieve.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the NeedRetrieve page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/NeedRetrieve.asp?hidModMode=Modal&" + strQueryString, "NeedRetrieve", popup_GetFeatures("M", 730, 800), ""); return false; } function PopNeedBrowser(strQueryString) { //1999-11-18 RMcQ //See the NeedBrowser.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the NeedBrowser page after the "?". //NOTE: Querystring should contain the desired starting PID: //To start at root, use "PopNeedBrowser('PID=1')" window_OpenDialog( window, window.location.pathname + "/../../Common/NeedBrowser.asp?hidModMode=Modal&" + strQueryString, "NeedBrowser", popup_GetFeatures("L8", 650, 650), ""); return false; } function PopNeedCatRUD(strQueryString) { //1999-07-09 RMcQ, rev 01-09-28 RMcQ //See the NeedCatRUD.asp (Read, Update, and Delete) page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/NeedCatRUD.asp?" + strQueryString, "NeedCatRUD", popup_GetFeatures("L1", 650, 505), ""); return false; } function PopNeedCatCreateSetSubCats(strQueryString) { //01-11-13 RMcQ //See the .asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/NeedCatCreateSetSubCats.asp?hidModMode=Modal&" + strQueryString, "NeedCatCreateSetSubCats", popup_GetFeatures("L8", 600, 800), ""); return false; } function PopNeedCatOrderPlanCRUD(strQueryString) { //01-11-07 RMcQ //See the NeedCatOrderPlanCRUD.asp (Create, Read, Update, and Delete) //page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/NeedCatOrderPlanCRUD.asp?hidModMode=Modal&" + strQueryString, "NeedCatOrderPlanCRUD", popup_GetFeatures("L1", 700, 360), ""); return false; } function PopNeedShop(strQueryString) { //02-06-07 RMcQ //See the NeedShop.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". //NOTE that the hidModMode param is not used here, but kept for possible future expansion. //NOTE that PopFinder(...) ALSO names its window "NeedShop": window_OpenDialog( window, window.location.pathname + "/../../Common/NeedShop.asp?" + strQueryString, "NeedShop", "menubar=yes,titlebar=yes,toolbar=no,scrollbars=yes,resizable=yes,status=yes," + "top=" + (window.screen.height - 580)/4 + "," + "left=" + (window.screen.width - 800)/2 + "," + "height=580," + "width=800;", ""); // popup_GetFeatures("M", 800, 580), return false; } function PopSiteSearchPop(strQueryString) { //02-06-07 RMcQ //See the SiteSearchPop.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". //NOTE that the hidModMode param is not used here, but kept for possible future expansion. window_OpenDialog( window, window.location.pathname + "/../../Common/SiteSearchPop.asp?hidModMode=Modal&" + strQueryString, "SiteSearchPop", popup_GetFeatures("M", 500, 210), ""); return false; } function PopProductRUD(strQueryString) { //1999-07-09 RMcQ, rev 01-09-28 RMcQ //See the ProductRUD.asp (Read, Update, and Delete) page header for a description of the input arguments. window_OpenDialog( window, window.location.pathname + "/../../Common/ProductRUD.asp?" + strQueryString, "ProductRUD", popup_GetFeatures("L4", 650, 505), ""); return false; } function PopAssetRUD(strQueryString) { //1999-07-09 RMcQ //See the AssetRUD.asp (Read, Update, and Delete) page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". if (SubAppMode_Get().toUpperCase() != "IMS") { window_OpenDialog( window, window.location.pathname + "/../../Common/AssetRUD.asp?" + strQueryString, "AssetRUD", popup_GetFeatures("L3", 700, 530), ""); } else { window_OpenDialog( window, window.location.pathname + "/../../IMS/AssetAdd.asp?FM=RUD&" + strQueryString, "AssetRUD", popup_GetFeatures("L3", 600, 700), ""); } return false; } function PopNeedRUD(strQueryString) { //1999-07-09 RMcQ //See the NeedRUD.asp (Read, Update, and Delete) page header for a description of the input arguments. //The strQueryString arg is passed directly to the popping page after the "?". if (SubAppMode_Get().toUpperCase() != "IMS") { window_OpenDialog( window, window.location.pathname + "/../../Common/NeedRUD.asp?" + strQueryString, "NeedRUD", popup_GetFeatures("L2", 750, 550), ""); } else { window_OpenDialog( window, window.location.pathname + "/../../IMS/NeedAdd.asp?FM=RUD&" + strQueryString, "NeedRUD", popup_GetFeatures("L2", 600, 700), ""); } return false; } function PopAssetRepurpose(strQueryString) { //01-04-12 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/AssetRepurpose.asp?" + strQueryString, "AssetRepurpose", popup_GetFeatures("L1", 650, 650), ""); return false; } function PopProductSearch(strQueryString) { //01-09-12 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/ProductSearch.asp?hidModMode=Modal&" + strQueryString, "ProductSearch", popup_GetFeatures("L5", 950, 650), ""); return false; } function PopNeedList(strQueryString) { //03-03-20 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/NeedList.asp?hidModMode=Modal&" + strQueryString, "NeedList", popup_GetFeatures("L5", 950, 650), ""); return false; } function PopSimpleCalculator(strQueryString) { //01-10-01 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/SimpleCalculator.asp?" + strQueryString, "SimpleCalculator", popup_GetFeatures("L1", 450, 250), ""); return false; } function PopUseRateCalculator(strQueryString) { //01-04-13 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/UseRateCalculator.asp?" + strQueryString, "UseRateCalculator", popup_GetFeatures("L2", 500, 650), ""); return false; } function PopRemainingLifetimeCalculator(strQueryString) { //01-11-04 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/RemainingLifetimeCalculator.asp?" + strQueryString, "RemainingLifetimeCalculator", popup_GetFeatures("L2", 540, 330), ""); return false; } function PopFeedbackForm() { //01-10-10 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/FeedbackForm.asp?hidModMode=Modal", "FeedbackForm", popup_GetFeatures("L8", 600, 700), ""); return false; } function PopCustNotesEditor(strNotesFieldName, strSourceControlID) { //01-10-29 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/CustNotesEditor.asp" + "?NFN=" + strNotesFieldName + "&SCN=" + strSourceControlID, "CustNotesEditor", popup_GetFeatures("L8", 700, 420), ""); return false; } function PopTextAreaExpander(strFieldName, strFieldCaption, strMaxTextLength) { //03-02-12 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/TextAreaExpander.asp" + "?FN=" + strFieldName + "&FC=" + escape(strFieldCaption) + "&MTL=" + strMaxTextLength, "TextAreaExpander", popup_GetFeatures("L8", 700, 420), ""); return false; } function PopLoginSendPassword(strQueryString) { //01-11-18 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Base/LoginSendPassword.asp?" + strQueryString, "LoginSendPassword", popup_GetFeatures("M", 400, 300), ""); return false; } function PopQuestion(strQueryString) { //02-02-19 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/Question.asp?" + strQueryString, "Question", popup_GetFeatures("M", 550, 210), ""); return false; } function PopRptTopCatExpenseDetail(strQueryString) { //02-02-26 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/RptTopCatExpenseDetail.asp?hidModMode=Modal&" + strQueryString, "RptTopCatExpenseDetail", popup_GetFeatures("M", 700, 500), ""); return false; } function PopRptVendorPerfDetail(strQueryString) { //02-02-26 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/RptVendorPerfDetail.asp?hidModMode=Modal&" + strQueryString, "RptVendorPerfDetail", popup_GetFeatures("M", 700, 700), ""); return false; } function PopNeedActionsMenu(strQueryString) { //03-03-05 RMcQ //See the page header for a description of the input arguments. //The strQueryString arg is passed directly to the page after the "?". var intHeight = 380; var intWidth = 160; window_OpenDialog( window, window.location.pathname + "/../../Common/NeedActionsMenu.asp?" + strQueryString, "NeedActionsMenu", "titlebar=no,toolbar=no,scrollbars=no,resizable=no,status=no," + "top=" + (window.screen.height - intHeight)/4 + "," + "left=" + (window.screen.width - intWidth)/2 + "," + "height=" + intHeight + "," + "width=" + intWidth + ";", ""); return false; } function PopAssetActionsMenu(strQueryString) { //03-03-08 RMcQ //See the page header for a description of the input arguments. //The strQueryString arg is passed directly to the page after the "?". var intHeight = 330; var intWidth = 180; window_OpenDialog( window, window.location.pathname + "/../../Common/AssetActionsMenu.asp?" + strQueryString, "AssetActionsMenu", "titlebar=no,toolbar=no,scrollbars=no,resizable=no,status=no," + "top=" + (window.screen.height - intHeight)/4 + "," + "left=" + (window.screen.width - intWidth)/2 + "," + "height=" + intHeight + "," + "width=" + intWidth + ";", ""); return false; } function PopTimeIntervalSelector(strQueryString) { //03-03-20 RMcQ //See the page header for a description of the input arguments. //The strQueryString arg is passed directly to the page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/TimeIntervalSelector.asp?" + strQueryString, "TimeIntervalSelector", popup_GetFeatures("M", 400, 300), ""); return false; } function select_AddOption(lst, strOptVal, strOptTextHexEncoded, bSameWindow) { //1999-12-07 RMcQ, rev 01-01-17 RMcQ //Adds a new option with value strOptVal and name strOptName //to the HTML SELECT control lst and selects that option. //Uses one method for Netscape browsers and another for Microsoft browsers //NOTE: Using current browser detection logic, this will FAIL for IE versions less than 4.0. //strOptTextHexEncoded must be hex-encoded //(using either escape() on the client-side or URLEncode on the server-side) //and will be decoded here (using unescape): if (browser_Manuf() == "Microsoft") { //var optNew = window.opener.document.createElement("OPTION"); //REPLACED WITH THIS (use of "window.opener.document.") not general purpose enough: var OptNew; if (bSameWindow == true) { optNew = window.document.createElement("OPTION"); } else { optNew = window.opener.document.createElement("OPTION"); } //TRIED THIS FOR ABOVE; DOESN'T WORK: //var optNew = lst.form.parentElement.parentElement.createElement("OPTION"); optNew.value = strOptVal; optNew.text = unescape(strOptTextHexEncoded); lst.add(optNew); lst.selectedIndex = lst.options.length - 1; } else { var optNew = new Option(unescape(strOptTextHexEncoded), strOptVal, true, true); lst.options[lst.options.length]=optNew; //Alternative: lst.options[1]=optNew; } } function select_GetVal(lst) { //01-08-23 RMcQ //implemented to improve readability of code. //To retrieve the currently selected value of a SELECT control, //NetScape requires the syntax herein (for IE it's just "... = lst.value") //IMPROVE?: Returns "" if no item selected; is there a better way to handle this error? //Added 02-01-05 to handle a hidden control proxying for a select control: if (lst.type == "hidden") { return lst.value; } //Not yet used: // if (lst.type == "text") { // alert("Text type."); // return lst.value; // } if (lst.selectedIndex > -1) { var strVal = lst.options[lst.selectedIndex].value } else { strVal = "" } return strVal; } function select_SelectVal(lst, val) { //01-08-23 RMcQ //implemented to improve readability of code. //To set the currently selected value of a SELECT control, //NetScape requires the syntax herein (for IE it's just "lst.value = ...") //Added 02-01-05 to handle a hidden control proxying for a select control: if (lst.type == "hidden") { lst.value = val; return; } for (var i=0; i < lst.length; i++) { if (lst.options[i].value == val) { lst.selectedIndex = i; break; } } } function select_GetText(lst) { //02-03-24 RMcQ; 03-05-23 RMcQ test for "text" added //implemented to improve readability of code. //To retrieve the currently selected text of a SELECT control, //NetScape requires the syntax herein (for IE it's just "... = lst.text") //IMPROVE?: Returns "" if no item selected; is there a better way to handle this error? if (lst.type == "hidden") { //this "if" never used? return lst.text; } if (lst.type == "text") { return lst.value; } if (lst.selectedIndex > -1) { var strVal = lst.options[lst.selectedIndex].text } else { strVal = "" } return strVal; } function form_GetStarOfSelectedCheckBoxControlValues(ctlChk) { //00-12-13 RMcQ //Collects (in a |-delimited star, with leading a trailing delimiters) //and returns the values of all HTML checkbox controls //in an array ctlChk on a form. var str = ''; for (var i = 0; i < ctlChk.length; i++) { if (ctlChk[i].checked) { str = str + '|' + ctlChk[i].value; } } //if at least one element exists, add a trailing delimiter, too: if (str.length > 0) str = str + "|"; return str; } function PopEntityCreateAndUpdate(strQueryString, strWinName, strWinProps) { //01-09-14 RMcQ //NOTE that EntityCreateAndUpdate is called directly (w/o using this proc) from several locs in ABServerLib. //NOTE also that this one requires the window name (strWinName) and window properties string (strWinProps) as an input arg. window_OpenDialog( window, window.location.pathname + "/../../Common/EntityCreateAndUpdate.asp?" + strQueryString, strWinName, strWinProps, "") return false; } function PopECUForCustLocation(strQueryString) { //01-12-04 RMcQ PopEntityCreateAndUpdate( "ET=CL&" + strQueryString, "winECUForCustLocation", popup_GetFeatures("M", 460, 260)); return false; } function PopECUForCustPerson(strQueryString) { //01-12-04 RMcQ PopEntityCreateAndUpdate( "ET=CP&" + strQueryString, "winECUForCustPerson", popup_GetFeatures("M", 460, 260)); return false; } function PopECUForCustPurpose(strQueryString) { //01-12-04 RMcQ //NOTE that ET=CPRP is UNDEFINED in EntityCreateAndUpdate.asp PopEntityCreateAndUpdate( "ET=CR&" + strQueryString, "winECUForCustPurpose", popup_GetFeatures("M", 460, 260)); return false; } function PopECUForOrderHeader(strQueryString) { //01-12-04 RMcQ PopEntityCreateAndUpdate( "ET=OH&" + strQueryString, "winECUForOrderHeader", popup_GetFeatures('R4', 430, 300)); return false; } /* UNUSED: function PopECUForVendor(strQueryString) { //01-12-04 RMcQ //NOTE that ET=V is UNDEFINED in EntityCreateAndUpdate.asp PopEntityCreateAndUpdate( "ET=V&" + strQueryString, "winECUForVendorStore", g_strSMALLWINPROPS2); return false; } */ function PopECUForVendorStore(strQueryString) { //01-12-04 RMcQ PopEntityCreateAndUpdate( "ET=VS&" + strQueryString, "winECUForVendorStore", popup_GetFeatures("R4", 450, 460)); return false; } function PopECUForBuyerSite(strQueryString) { //01-12-11 RMcQ PopEntityCreateAndUpdate( "ET=BS&" + strQueryString, "winECUForBuyerSite", popup_GetFeatures("R4", 450, 390)); return false; } function PopHelpSearch(strKeywords) { //03-04-25 RMcQ if (strKeywords == "") { strKeywords = prompt("Please enter search keyword(s):", "") } if (strKeywords != null) { //the user didn't cancel out PopHelpTopic("Search/HelpSearch.asp?txtKeywords=" + escape(strKeywords), "l"); } return false; } function PopHelpTopicGloss(strBookmark) { PopHelpTopic("Glossary/HelpGlossary.asp#" + strBookmark, "l"); return false; } function PopHelpTopicLarge(strHelpFileNameAndBookmark) { PopHelpTopic(strHelpFileNameAndBookmark, "l"); return false; } function PopHelpTopicUI() { //01-08-15 RMcQ var strBookmark = document.location.pathname; // alert('document.location.pathname=' + document.location.pathname); // alert('strBookmark.lastIndexOf(/)=' + strBookmark.lastIndexOf("/")); // alert('strBookmark.length=' + strBookmark.length); // alert('strBookmark.indexOf(Resources)=' + strBookmark.indexOf("/Resources/")); // alert('strBookmark.indexOf(More)=' + strBookmark.indexOf("/More/")); //exclude locations without help topics: if (strBookmark.indexOf("/Resources/") >= 0 ) return false; if (strBookmark.indexOf("/More/") >= 0 ) return false; strBookmark = strBookmark.substring( strBookmark.lastIndexOf("/") + 1, (strBookmark.length - 4)) // alert('strBookmark=' + strBookmark); //03-09-27 Added for IMS pages: if (document.location.pathname.indexOf("/IMS/") >= 0 ) strBookmark = "IMS" + strBookmark; // PopHelpTopic("HelpUI.asp#" + strBookmark, "l"); //02-02-14 REPLACED WITH THIS: PopHelpTopic("Pages/HelpPage_" + strBookmark + ".asp", "l"); //03-02-25 Added override(s) for specific page(s): if (strBookmark.indexOf("NeedRetrieve") > -1 ) { if (document.location.href.indexOf("hidFunc=GN") > -1 ) PopHelpTopic("Pages/HelpPage_NeedRetrieve_GetNeedMode.asp", "l"); else PopHelpTopic("Pages/HelpPage_NeedRetrieve_AddNeedMode.asp", "l"); } return false; } //NOT INTENDED TO BE CALLED DIRECTLY; USE <...>Gloss, <...>Large, or <...>UI ABOVE: function PopHelpTopic(strHelpTopicSubPath, strWinSizeCode) { //01-08-15 RMcQ //strHelpTopicSubPath includes the sub-folder (if any), help file name, and bookmark (if any) //under the "../Help/" folder. var strWinName; var strWinProps; //CURRENTLY NOT USED: if (strWinSizeCode == 's') { strWinName = "HelpWinSmall"; strWinProps = popup_GetFeatures("R1", 250, 250) } //CURRENTLY NOT USED: else if (strWinSizeCode == 'm') { strWinName = "HelpWinMed"; strWinProps = popup_GetFeatures("R2", 500, 250) + ",toolbar=yes" } //CURRENTLY USED FOR _ALL_ TOPICS OTHER THAN GLOSSARY: else if (strWinSizeCode == 'l') { strWinName = "HelpWinLarge"; strWinProps = popup_GetFeatures("R3", 500, 700) + ",toolbar=yes" } else { alert('System error: Unknown help window size code of ' + strWinSizeCode + '.'); return false; } // var winHelp = window.open( // "../Help/" + strHelpTopicSubPath, // strWinName, // strWinProps); // winHelp.focus(); //02-02-18 RMcQ REPLACED WITH THIS SAFER METHOD: var winHelp; winHelp = window.open("", strWinName, strWinProps); winHelp.focus(); if (SubAppMode_Get().toUpperCase() == "IMS") { winHelp.location = "../IMSHelp/" + strHelpTopicSubPath; } else { winHelp.location = "../Help/" + strHelpTopicSubPath; } return false; } function popup_GetFeatures(strPopupLocation, intIdealWidth, intIdealHeight) { //01-10-11 RMcQ //Gets the "sFeatures" argument of the window.open method for a popup. //WARNING: Right-aligned windows will not truncate intIdealWidth, //so intIdealWidth for right-aligned windows must be limited to a size //that will not cause the popup to display outside of the screen area. var intTop; var intLeft; var intHeight; var intWidth; var intPIX_FROM_BOTTOM = 60 //can't explain why it's 60, but this is best var intPIX_FROM_RIGHT = 10 switch (strPopupLocation) { case 'L1' : intTop=160; intLeft= 20; break; case 'L2' : intTop=140; intLeft= 40; break; case 'L3' : intTop=120; intLeft= 60; break; case 'L4' : intTop=100; intLeft= 80; break; case 'L5' : intTop= 80; intLeft=100; break; case 'L6' : intTop= 60; intLeft=120; break; case 'L7' : intTop= 40; intLeft=140; break; case 'L8' : intTop= 20; intLeft=160; break; case 'M' : //all values for 'M' can be calc'ed right here: intHeight = Math.min(intIdealHeight, window.screen.height); intWidth = Math.min(intIdealWidth, window.screen.width); intTop = (window.screen.height - intHeight) * 1 / 4 intLeft = (window.screen.width - intWidth ) / 2 break; case 'R1' : intTop= 80; intLeft=window.screen.width-intIdealWidth- 20; break; case 'R2' : intTop= 60; intLeft=window.screen.width-intIdealWidth- 40; break; case 'R3' : intTop= 40; intLeft=window.screen.width-intIdealWidth- 60; break; case 'R4' : intTop= 20; intLeft=window.screen.width-intIdealWidth- 80; break; } //note that cases L1-L8 have the same result as do cases R1-R4: //(actually all cases are the same here): switch (strPopupLocation) { case 'L1' : case 'L2' : case 'L3' : case 'L4' : case 'L5' : case 'L6' : case 'L7' : case 'L8' : intHeight=Math.min(intIdealHeight, window.screen.height-intTop-intPIX_FROM_BOTTOM); break; case 'R1' : case 'R2' : case 'R3' : case 'R4' : intHeight=Math.min(intIdealHeight, window.screen.height-intTop-intPIX_FROM_BOTTOM); break; } //note that cases L1-L8 have the same result as do cases R1-R4: switch (strPopupLocation) { case 'L1' : case 'L2' : case 'L3' : case 'L4' : case 'L5' : case 'L6' : case 'L7' : case 'L8' : intWidth=Math.min(intIdealWidth, window.screen.width-intLeft-intPIX_FROM_RIGHT); break; case 'R1' : case 'R2' : case 'R3' : case 'R4' : intWidth=intIdealWidth; break; } var strDisplayParams = "scrollbars=yes,resizable=yes,status=yes," + "top=" + intTop + ",left=" + intLeft + ",height=" + intHeight + ",width=" + intWidth; // alert(strDisplayParams); return strDisplayParams; } function InvMgmtInfo_CopyFromSourceFormToDestForm(frmSrc, winDest, frmDest) { //02-01-05 RMcQ //IMPROVE: //Use this in all areas where it can be applied (there are several more). //Move this to a more appropriate location (file) //Fix the reference to winDest? Or is this okay? //Upload init vals for the Inv Mgmt Info from the parent (calling) page. if (frmDest.lstMgmtTypeCode.type != "hidden") { winDest.pnlInvMgmtInputs_ConfigureControlVisibility(select_GetVal(frmSrc.lstMgmtTypeCode)) } select_SelectVal(frmDest.lstMgmtTypeCode, select_GetVal(frmSrc.lstMgmtTypeCode)) frmDest.txtReorderPtDaysMin.value = frmSrc.txtReorderPtDaysMin.value frmDest.txtReorderPtDaysAvg.value = frmSrc.txtReorderPtDaysAvg.value frmDest.txtReorderPtDaysMax.value = frmSrc.txtReorderPtDaysMax.value // frmDest.txtEOQtyAvg.value = frmSrc.txtEOQtyAvg.value frmDest.txtNumUsesAvg.value = frmSrc.txtNumUsesAvg.value frmDest.txtQtyUseRateDisplayUnitQty.value = frmSrc.txtQtyUseRateDisplayUnitQty.value select_SelectVal(frmDest.lstQtyUseRateDisplayUnitCode, select_GetVal(frmSrc.lstQtyUseRateDisplayUnitCode)) frmDest.txtQtyUseRateDisplayTimePeriodQty.value = frmSrc.txtQtyUseRateDisplayTimePeriodQty.value select_SelectVal(frmDest.lstQtyUseRateDisplayTimePeriodCode, select_GetVal(frmSrc.lstQtyUseRateDisplayTimePeriodCode)) frmDest.txtQtyLifetimeDisplayTimePeriodQty.value = frmSrc.txtQtyLifetimeDisplayTimePeriodQty.value select_SelectVal(frmDest.lstQtyLifetimeDisplayTimePeriodCode, select_GetVal(frmSrc.lstQtyLifetimeDisplayTimePeriodCode)) } function InvMgmtInfo_CopyFromLstExtAttrsStarToFormControls( strInvAttrsStar, frm, bCopyLocPersPurp) { //02-02-08 RMcQ //Parses the standard inv mgmt data star "strInvAttrsStar" //and copies the values into standard inv mgmt controls on frm //NOT USED YET. //first get the elements of the value string var arrValVals = strInvAttrsStar.split("~") //next use them to populate the inv mgmt fields: select_SelectVal(frm.lstMgmtTypeCode, arrValVals[5]); frm.txtReorderPtDaysMin.value = arrValVals[6]; frm.txtReorderPtDaysAvg.value = arrValVals[7]; frm.txtReorderPtDaysMax.value = arrValVals[8]; frm.txtNumUsesAvg.value = arrValVals[9]; frm.txtQtyUseRateDisplayUnitQty.value = arrValVals[10]; //alert('arrValVals[11]=' + arrValVals[11]); select_SelectVal(frm.lstQtyUseRateDisplayUnitCode, arrValVals[11]); frm.txtQtyUseRateDisplayTimePeriodQty.value = arrValVals[12]; select_SelectVal(frm.lstQtyUseRateDisplayTimePeriodCode, arrValVals[13]); frm.txtQtyLifetimeDisplayTimePeriodQty.value = arrValVals[14]; select_SelectVal(frm.lstQtyLifetimeDisplayTimePeriodCode,arrValVals[15]); pnlInvMgmtInputs_ConfigureControlVisibility(select_GetVal(frm.lstMgmtTypeCode)); if (bCopyLocPersPurp == true) { select_SelectVal(frm.lstCustLocID, arrValVals[16]); select_SelectVal(frm.lstCustPersID, arrValVals[17]); select_SelectVal(frm.lstCustPurpID, arrValVals[18]); } } function MM_controlSound(x, _sndObj, sndFile) { //v3.0 //01-10-20 RMcQ TAKEN VERBATIM FROM FROM PAVEL; CURRENTLY NOT USED: var i, method = "", sndObj = eval(_sndObj); if (sndObj != null) { if (navigator.appName == 'Netscape') method = "play"; else { if (window.MM_WMP == null) { window.MM_WMP = false; for(i in sndObj) if (i == "ActiveMovie") { window.MM_WMP = true; break; } } if (window.MM_WMP) method = "play"; else if (sndObj.FileName) method = "run"; } } if (method) eval(_sndObj+"."+method+"()"); else window.location = sndFile; } function FlexRound(sngNum, intNumDigits) { //02-01-29 RMcQ //NOTE that the FlexRound intNumDigits is one less than the GetFlexNumDigitsAfterDecimal var sngResult = Math.round( (sngNum * Math.pow(10, intNumDigits) ) ) / Math.pow(10, intNumDigits); return sngResult; } function GetFlexNumDigitsAfterDecimal( // BUT, this is not used anywhere yet (see FlexRound above). varNumber, intNumDigits) { //02-02-10 RMcQ //Returns a "number of digits after decimal" dependent on the //TOTAL precision required for the number: //(NumDigitsAfterDecimal = intNumDigits - NumDigitsBEFOREDecimal) in most cases. //NOTE the COMPANION server-side PROC IN ABServerLib.vbp. if (intNumDigits == -1) intNumDigits = 3 var intDigitsAfterDecimal var varAbsOfNumber = Math.abs(varNumber) if (parseInt(varNumber) == varNumber) { intDigitsAfterDecimal = 0 } else { if (varAbsOfNumber >= 1000) intDigitsAfterDecimal = Math.max(intNumDigits - 4, 1); else if (varAbsOfNumber >= 100) intDigitsAfterDecimal = Math.max(intNumDigits - 3, 1); else if (varAbsOfNumber >= 10) intDigitsAfterDecimal = Math.max(intNumDigits - 2, 1); else if (varAbsOfNumber >= 1) intDigitsAfterDecimal = Math.max(intNumDigits - 1, 1); else if (varAbsOfNumber >= 0.1) intDigitsAfterDecimal = Math.max(intNumDigits - 0, 1); else if (varAbsOfNumber >= 0.01) intDigitsAfterDecimal = Math.max(intNumDigits + 1, 1); else if (varAbsOfNumber >= 0.001) intDigitsAfterDecimal = Math.max(intNumDigits + 2, 1); else if (varAbsOfNumber >= 0.0001) intDigitsAfterDecimal = Math.max(intNumDigits + 3, 1); else if (varAbsOfNumber == 0) intDigitsAfterDecimal = 0; else intDigitsAfterDecimal = Math.max(intNumDigits + 4, 1); } // alert('varNumber=' + varNumber); // alert('intDigitsAfterDecimal=' + intDigitsAfterDecimal); return intDigitsAfterDecimal; } function PopNeedUseRateAnalysis(strQueryString) { //02-02-19 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/NeedUseRateAnalysis.asp?" + strQueryString, "NeedUseRateAnalysis", popup_GetFeatures("M", 800, 700), ""); return false; } function advertiser_LinkClicked( strAdvTypeCode, lAdvID, strEscapedURL, strAdvWinName, strDisplayPageTypeCode, lNeedID, lAssetID) { //02-06-10 RMcQ //03-04-11 RMcQ TO BE REMOVED AND REPLACED WITH site_Display WHEN ASSET SELLER IS UPGRADED. /* Displays a linked advertiser's site in a window of their own, with these considerations: (1) If the advertiser supports pre-search, provide the user with that option (by popping the SiteSearchPop window first), (2) Open in the advertiser's own window, RE-USING their window if it's already open. strAdvTypeCode= The type of the advertiser, either "VS" (vendor store), "BS" (buyer site), or "OT" (other type) lAdvID= The advertiser's ID (either a VendorStore.ID, BuyerSite.ID, or [other advertiser].ID strEscapedURL= the Vendor's escaped (URL-encoded) URL (escape() it before passing it in) strAdvWinName= The advertiser's window name DisplayPageTypeCode= (Null (= display home page) OR 'search' = display search page) lNeedID=If search capability is avail FIXXX/FINISH: strSearchBoxModeCode=The type of search box provided, either a SELECT control or a text box. */ //PREP THE strAdvWinName HERE: if (strAdvWinName == '') { if (strAdvTypeCode == 'VS') { strAdvWinName = 'winShop_' + lAdvID } else { strAdvWinName = 'winSell_' + lAdvID } } //PREP THE strEscapedURL HERE: //Step 1: If there's no protocol, pre-pend the protocol: strEscapedURL = ( (strEscapedURL.indexOf(escape("://")) == -1) ? "http://" : "" ) + strEscapedURL //SKIP STRIP // //Step 2: Append a notice that we referred this vendor (NOT REALLY REQUIRED, BUT...) // strEscapedURL = strEscapedURL + ( (strEscapedURL.indexOf("?") == -1) ? "?" : "&" ) + "RefBy=MakeLifeEasy" // alert('Entered advertiser_LinkClicked with values strAdvTypeCode=' + strAdvTypeCode + ' lAdvID=' + lAdvID + ' strEscapedURL=' + strEscapedURL + ' strAdvWinName=' + strAdvWinName + ' strDisplayPageTypeCode=' + strDisplayPageTypeCode + ' lNeedID=' + lNeedID); switch (strDisplayPageTypeCode) { case '': if (strEscapedURL == escape('http://')) { //SKIP STRIP // alert("strEscapedURL=" + strEscapedURL); //SKIP STRIP // alert("escape('http://')=" + escape('http://')); //SKIP STRIP if (confirm('No URL is provided. Would you like to enter it now?')) { alert('After entering the URL, refresh this page to load the new URL, then click on the seller\'s name again.'); PopECUForVendorStore('EM=U&ID=' + lAdvID); } } else { advertiser_OpenWin( strAdvTypeCode, lAdvID, unescape(strEscapedURL), strAdvWinName, "", ""); } break; case 'search': PopSiteSearchPop( 'NID=' + lNeedID + '&AID=' + lAdvID + '&ATC=' + strAdvTypeCode + '&AWN=' + strAdvWinName + '&URL=' + strEscapedURL + '&AssetID=' + lAssetID); break; } return false; } function advertiser_OpenWin( strAdvTypeCode, lAdvID, strEscapedURL, strAdvWinName, bDoSearch, strSearchString) { //02-06-09 RMcQ //03-04-11 RMcQ TO BE REMOVED AND REPLACED WITH site_Display WHEN ASSET SELLER IS UPGRADED. // alert('Entered advertiser_OpenWin with values strAdvTypeCode=' + strAdvTypeCode + ' lAdvID=' + lAdvID + ' strEscapedURL=' + strEscapedURL + ' strAdvWinName=' + strAdvWinName + ' bDoSearch=' + bDoSearch + ' strSearchString=' + strSearchString); var strQueryString = "?ATC=" + strAdvTypeCode + "&AID=" + lAdvID + "&DS=" + ( (bDoSearch) ? "T" : "F") + "&SS=" + escape(strSearchString) //The 180 here (two places) approxes the width of the left sidebar; //The 60 here (in two places) approx'es. the typical height avail. var strShopWinFeatures = "top=20,left=180," + "height=" + (window.screen.height - 60) + "," + "width=" + (window.screen.width - 180) + "," + "menubar=yes,toolbar=yes,location=yes,directories=yes,scrollbars=yes,status=yes,resizable=yes" /* 'VB VERSION: 'Now, since this vendor's window has been opened, append their ID to the cookie: var str If InStr(req.Cookies("strSessAdvIDStar"), "~" & lngAdvID & "~") = 0 Then 'The ID is not in the star, so add it: If req.Cookies("strSessAdvIDStar") = "" Then 'The cookie is completely empty, so pre-pend the leading/starting "~": resp.Cookies("strSessAdvIDStar") = "~" & lngAdvID & "~" Else 'Just add the lngAdvID to the end of the cookie: resp.Cookies("strSessAdvIDStar") = req.Cookies("strSessAdvIDStar") & lngAdvID & "~" End If End If 'Keep this list around at least a little while longer (say 1 day) in case the session expires: resp.Cookies("strSessAdvIDStar").Expires = Now + 1 REPLACED WITH THIS CLIENT-SIDE VERSION: */ var strSessAdvIDStarName = "strSess" + strAdvTypeCode + "AdvIDStar" // ( (strAdvTypeCode == 'VS') ? "strSessVSAdvIDStar" : "strSessBSAdvIDStar" ) var strSessAdvIDStar = doc_GetCookie(strSessAdvIDStarName); var strAdvID = lAdvID.toString(); //alert("strSessAdvIDStar=" + strSessAdvIDStar); if (strSessAdvIDStar.indexOf("~" + strAdvID + "~") == -1) { //The ID is not in the star, so add it: if (strSessAdvIDStar.length == 0) { //alert('length == 0'); //The cookie is completely empty, so pre-pend the leading/starting "~": doc_SetCookie(strSessAdvIDStarName, "~" + strAdvID + "~") } else { //alert('length != 0'); //Just add the lngAdvID to the end of the cookie: doc_SetCookie(strSessAdvIDStarName, strSessAdvIDStar + strAdvID + "~") } } //NOTE that expiration need not be set for these cookies; //they will remain available until the browser is closed. if (bDoSearch) { //there is a search string, so open the intermediate window: window_OpenDialog( window, window.location.pathname + "/../../Common/SiteWin.asp" + strQueryString, strAdvWinName, strShopWinFeatures, ''); } else { //there is no search string, so open to the home page: window_OpenDialog( window, unescape(strEscapedURL), strAdvWinName, strShopWinFeatures, ''); } } function cmd_Disable(cmd, strDisabledCaption) { //02-08-30 RMcQ //"Disables" a command button (type=input or submit or ...) //In NetScape, to truly disable the button, //also use with the cmd_IsEnabled fun to restrict processing. if (strDisabledCaption == "") strDisabledCaption = "Working..." cmd.value = strDisabledCaption; // alert(cmd.value); if (document.all) cmd.disabled = true } function cmd_IsEnabled(cmd, strDisabledCaption, strWaitMsg) { //02-02-19 RMcQ //MUST be used in conjunction with cmd_Disable if (strDisabledCaption == "") strDisabledCaption = "Working..." if (strWaitMsg == "") strWaitMsg = "Your request is being processed. Please wait."; if (cmd.value != strDisabledCaption) { return true; } else { alert(strWaitMsg) return false; } } function SubAppMode_Switch(strSubAppMode) { //03-03-04 RMcQ //NOTE/WARNING: KEEP THIS CONSISTENT WITH SERVER-SIDE SubAppMode_Set FUNCTION //THIS ONE is similar to that one, but it also reloads the window. //FIX*/*DELETE*: THIS FUNC IS NOW PERFORMED WITH A SERVER CALL SINCE THIS ONE DOES NOT MANAGE THE COOKIES WELL: var strCookieVal switch (strSubAppMode) { case "HomeInv": strCookieVal = "HomeInv"; break; case "ShopList": strCookieVal = "ShopList"; break; case "IMS": strCookieVal = "IMS"; break; case "Full": strCookieVal = ""; break; default: strCookieVal = ""; break; } //Prepare a past and future expiration date for the cookie: var dt = new Date(); var strDateSevenDaysPast = new Date(Date.parse(dt) - (7 * g_lngMSECS_PER_DAY)).toLocaleString(); var strDateSevenDaysFuture = new Date(Date.parse(dt) + (7 * g_lngMSECS_PER_DAY)).toLocaleString(); // //Delete the current cookie: // document.cookie = "strSubAppMode=; expires=" + strDateSevenDaysPast + ";"; // document.cookie = "strSubAppMode=; expires=Thu, 01-Jan-70 00:00:01 GMT"; //Update the cookie: // document.cookie = "strSubAppMode=" + strCookieVal + "; expires=" + strDateSevenDaysFuture + ";"; //03-03-28 RMcQ Replaced with this; remove the future expiration date: document.cookie = "strSubAppMode=" + strCookieVal + ";"; window.location.reload(); } function SubAppMode_Get(strSubAppMode) { //03-09-12 RMcQ //NOTE/WARNING: KEEP THIS CONSISTENT WITH SERVER-SIDE SubAppMode_Get FUNCTION var strSubAppMode = doc_GetCookie("strSubAppMode"); return strSubAppMode; } function site_Display( strAdvTypeCode, lAdvID, strEscapedURL, strFrameNum, strAdvWinName, strDisplayPageTypeCode, bDoSearch, strSearchString) { //03-04-10 RMcQ /* Displays an "advertiser's" (a seller's or buyer's) site in either (a) a frame of the parent window, or (b) a window of its own (RE-USING their window if it's already open), with these considerations: (0) If we are an affiliate of the "advertiser", pass our affiliate ID to them (1) If the "advertiser" supports pre-search, provide the user with that option (by popping the SiteSearchPop window first), Input args: - strAdvTypeCode= The type of the advertiser, either "VS" (vendor store), "BS" (buyer site), or "OT" (other type) - lAdvID= The advertiser's ID (either a VendorStore.ID, BuyerSite.ID, or [other advertiser].ID - strEscapedURL= the Vendor's escaped (URL-encoded) URL (escape() it before passing it in) - strFrameNum=the number of the frame in which to display the site. If empty (""), then the site is displayed in a separate window named with strAdvWinName (below). - strAdvWinName= The advertiser's window name - DisplayPageTypeCode= (Null (= display home page) OR 'search' = display search page) - bDoSearch=w/n to perform a "fast search". IF (1) bDoSearch=true AND (2) the site HAS fast-search capability (DisplayPageTypeCode='search') AND (3) strSearchString is provided, THEN do the search; OTHERWISE just display the home page (defined by strEscapedURL). - strSearchString=the string to search for on the site, if "fast search" is available. */ // alert('Entered site_Display with values strAdvTypeCode=' + strAdvTypeCode + ' lAdvID=' + lAdvID + ' strEscapedURL=' + strEscapedURL + ' strFrameNum=' + strFrameNum + ' strAdvWinName=' + strAdvWinName + ' strDisplayPageTypeCode=' + strDisplayPageTypeCode + ' strSearchString=' + strSearchString); //PREP THE strAdvWinName HERE: if (strAdvWinName == '') { if (strAdvTypeCode == 'VS') { strAdvWinName = 'winShop_' + lAdvID } else { strAdvWinName = 'winSell_' + lAdvID } } //PREP THE strEscapedURL HERE: //Step 1: If there's no protocol, pre-pend the protocol: strEscapedURL = ( (strEscapedURL.indexOf(escape("://")) == -1) ? "http://" : "" ) + strEscapedURL //SKIP STRIP // //Step 2: Append a notice that we referred this vendor (NOT REALLY REQUIRED, BUT...) // strEscapedURL = strEscapedURL + ( (strEscapedURL.indexOf("?") == -1) ? "?" : "&" ) + "RefBy=MakeLifeEasy" //Clean up search string (allows "-No search-" to be passed in): strSearchString = ( (strSearchString == "-No search-") ? "" : strSearchString) //A little convoluted; This must be saved for strQueryStringAddl //before potentially modifying bDoSearch (directly following): var bSearchRequested = bDoSearch //"Refine" bDoSearch; assure that all needed data is provided in order to do a search bDoSearch = ( (bDoSearch) && (strDisplayPageTypeCode=='search') && (strSearchString != "") ) var strQueryString = "?ATC=" + strAdvTypeCode + "&AID=" + lAdvID + "&DS=" + ( (bDoSearch) ? "T" : "F") + "&SS=" + escape(strSearchString) //this one provides addl params for the header frame: var strQueryStringAddl = "&URL=" + strEscapedURL + "&FN=" + strFrameNum + "&SREQ=" + ( (bSearchRequested) ? "T" : "F") + "&DPTC=" + strDisplayPageTypeCode + "&AWN=" + strAdvWinName //The 180 here (two places) approxes the width of the left sidebar; //The 60 here (in two places) approx'es. the typical height avail. var strShopWinFeatures = "top=20,left=180," + "height=" + (window.screen.height - 60) + "," + "width=" + (window.screen.width - 180) + "," + "menubar=yes,toolbar=yes,location=yes,directories=yes,scrollbars=yes,status=yes,resizable=yes" //Now, since this vendor's window will be opened, append their ID to the cookie of previously opened adv IDs: var strSessAdvIDStarName = "strSess" + strAdvTypeCode + "AdvIDStar" // ( (strAdvTypeCode == 'VS') ? "strSessVSAdvIDStar" : "strSessBSAdvIDStar" ) var strSessAdvIDStar = doc_GetCookie(strSessAdvIDStarName); var strAdvID = lAdvID.toString(); //alert("strSessAdvIDStar=" + strSessAdvIDStar); if (strSessAdvIDStar.indexOf("~" + strAdvID + "~") == -1) { //The ID is not in the star, so add it: if (strSessAdvIDStar.length == 0) { //alert('length == 0'); //The cookie is completely empty, so pre-pend the leading/starting "~": doc_SetCookie(strSessAdvIDStarName, "~" + strAdvID + "~") } else { //alert('length != 0'); //Just add the lngAdvID to the end of the cookie: doc_SetCookie(strSessAdvIDStarName, strSessAdvIDStar + strAdvID + "~") } } //NOTE that expiration need not be set for these cookies; //they will remain available until the browser is closed. if (!bDoSearch) { if (strEscapedURL == escape('http://')) { //SKIP STRIP // alert("strEscapedURL=" + strEscapedURL); //SKIP STRIP // alert("escape('http://')=" + escape('http://')); //SKIP STRIP if (confirm('No URL is provided. Would you like to enter it now?')) { alert('After entering the URL, refresh this page to load the new URL, then click on the seller\'s name again.'); PopECUForVendorStore('EM=U&ID=' + lAdvID); } } else { //there is NO search string, so open to the home page: if (strFrameNum != "") { window.top.frames('header0' + strFrameNum).location.href = window.location.pathname + "/../../Common/NeedShopResults_Header.asp" + strQueryString + strQueryStringAddl; window.top.frames('detail0' + strFrameNum).location.href = unescape(strEscapedURL) } else { window_OpenDialog( window, unescape(strEscapedURL), strAdvWinName, strShopWinFeatures, ''); } } } else { // bDoSearch == true //there IS a search string, so open the intermediate window: if (strFrameNum != "") { window.top.frames('header0' + strFrameNum).location.href = window.location.pathname + "/../../Common/NeedShopResults_Header.asp" + strQueryString + strQueryStringAddl; window.top.frames('detail0' + strFrameNum).location.href = window.location.pathname + "/../../Common/SiteWin.asp" + strQueryString; } else { window_OpenDialog( window, window.location.pathname + "/../../Common/SiteWin.asp" + strQueryString, strAdvWinName, strShopWinFeatures, ''); } } return false; } function site_Display_ForProvider( strFrameNum, strWinName, strProvCode, lngNeedID, strSearchString, strZipCode) { //03-05-15 RMcQ /* Displays a "provider's" (an info. provider; e.g. a coupon provider, a recipe provider) site in either (a) a frame of the parent window, or (b) a window of its own (RE-USING their window if it's already open), Input args: - strFrameNum =the number of the frame in which to display the site. If empty (""), then the site is displayed in a separate window named with strWinName (below). - strWinName = The advertiser's window name - strProvCode = The provider code (often the "domain prefix"; e.g. "MakeLifeEasy" for makelifeeasy.com - lngNeedID = The ID of the Need in question - strSearchString = the string to search for on the site, if "fast search" is available. - strZipCode = */ // alert( // 'Entered site_Display_Provider with values' + // ' strFrameNum=' + strFrameNum + // ' strWinName=' + strWinName + // ' strProvCode=' + strProvCode + // ' lngNeedID=' + lngNeedID + // ' strSearchString=' + strSearchString + // ' strZipCode=' + strZipCode); //PREP THE strWinName HERE: if (strWinName == '') strWinName = 'winProv_' + strProvCode //Clean up search string (allows "-No search-" to be passed in): strSearchString = ( (strSearchString == "-No search-") ? "" : strSearchString) var strQueryString = "?PC=" + strProvCode + "&NID=" + lngNeedID + "&SS=" + escape(strSearchString) + "&ZC=" + strZipCode //this one provides addl params for the header frame: var strQueryStringAddl = "&FN=" + strFrameNum + "&AWN=" + strWinName //The 180 here (two places) approxes the width of the left sidebar; //The 60 here (in two places) approx'es. the typical height avail. var strProvWinFeatures = "top=20,left=180," + "height=" + (window.screen.height - 60) + "," + "width=" + (window.screen.width - 180) + "," + "menubar=yes,toolbar=yes,location=yes,directories=yes,scrollbars=yes,status=yes,resizable=yes" if (strFrameNum != "") { window.top.frames('header0' + strFrameNum).location.href = window.location.pathname + "/../../Common/NeedShopResults_Header.asp" + strQueryString + strQueryStringAddl; window.top.frames('detail0' + strFrameNum).location.href = window.location.pathname + "/../../Common/SiteWin_Provider.asp" + strQueryString; } else { window_OpenDialog( window, window.location.pathname + "/../../Common/SiteWin_Provider.asp" + strQueryString, strWinName, strProvWinFeatures, ''); } return false; } function PopLiveHelpChatWindow() { //03-05-02 RMcQ alert("We're sorry! Live help is currently not available."); // window.open( // 'http://server.iad.liveperson.net/hc/19081936/?cmd=file&file=visitorWantsToChat&site=19081936&referrer='+document.location, // 'chat19081936', // 'width=472,height=320'); return false; } /* CURRENTLY NOT USED: function PopFinder(strPageMode) { //03-05-24 RMcQ //NOTE that this one is somewhat nonstandard; it does not use the strQueryString arg ... //NOTE that the window name is "NeedShop", same as for PopNeedShop(...). var strPageName = ( (strPageMode == "C") ? "Rpt_CoupFinder.asp" : "Rpt_RecFinder.asp" ); window_OpenDialog( window, window.location.pathname + "/../../Resources/" + strPageName, "NeedShop", "menubar=yes,titlebar=yes,toolbar=no,scrollbars=yes,resizable=yes,status=yes," + "top=" + (window.screen.height - 580)/4 + "," + "left=" + (window.screen.width - 800)/2 + "," + "height=580," + "width=800;", ""); return false; } */ function PopAgent(strQueryString) { //03-08-06 RMcQ //See the Agent.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the Agent page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/Agent.asp?hidModMode=Modal&" + strQueryString, "Agent", popup_GetFeatures("M", 730, 800), ""); return false; } function PopAgtCust(strQueryString) { //03-08-04 RMcQ //See the AgtCust.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the AgtCust page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/AgtCust.asp?hidModMode=Modal&" + strQueryString, "AgtCust", popup_GetFeatures("M", 730, 800), ""); return false; } function PopCustAgent(strQueryString) { //03-08-05 RMcQ //See the CustAgent.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the CustAgent page after the "?". window_OpenDialog( window, window.location.pathname + "/../../Common/CustAgent.asp?hidModMode=Modal&" + strQueryString, "CustAgent", popup_GetFeatures("M", 730, 800), ""); return false; } function PopIMSNeedAdd(strQueryString) { //03-08-07 RMcQ //See the IMS/NeedAdd.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the IMS/NeedAdd page after the "?". window_OpenDialog( window, window.location.pathname + "/../../IMS/NeedAdd.asp?hidModMode=Modal&" + strQueryString, "IMSNeedAdd", popup_GetFeatures("M", 500, 500), ""); return false; } function PopIMSAssetAdd(strQueryString) { //03-08-07 RMcQ //See the IMS/AssetAdd.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the IMS/AssetAdd page after the "?". window_OpenDialog( window, window.location.pathname + "/../../IMS/AssetAdd.asp?hidModMode=Modal&" + strQueryString, "IMSAssetAdd", popup_GetFeatures("M", 750, 480), ""); return false; } function PopIMSAgtOffer(strQueryString) { //03-10-23 RMcQ //See the IMS/AgtOffer.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the IMS/AgtOffer page after the "?". window_OpenDialog( window, window.location.pathname + "/../../IMS/AgtOffer.asp?hidModMode=Modal&" + strQueryString, "IMSAgtOffer", popup_GetFeatures("M", 700, 700), ""); return false; } function PopIMSCustOffer(strQueryString) { //03-10-23 RMcQ //See the IMS/AgtOffer.asp page header for a description of the input arguments. //The strQueryString arg is passed directly to the IMS/AgtOffer page after the "?". window_OpenDialog( window, window.location.pathname + "/../../IMS/CustOffer.asp?hidModMode=Modal&" + strQueryString, "IMSCustOffer", popup_GetFeatures("M", 700, 700), ""); return false; } function imgPic_onerror(ctlImg) { //03-11-05 RMcQ //Implements a "pecking order" for picture file types. //To be assigned to the "onerror" attribute of an img that uses an object picture //The application will first try to set the img src to a jpg file. //If that fails, the error event will fire and call this proc to //replace the "jpg" file name suffix with "gif", and try that (see below). If that fails, it will //replace the "gif" file name suffix with "png", and try that (see below). //If none of those work, the action stops. //alert('onerror event fired for ' + this.name + ' with src=' + ctlImg.src) var intLen = ctlImg.src.length; if (intLen > 3) { var intSrcNamePrefix = ctlImg.src.substr(0, intLen-3) var intSrcNameSuffix = ctlImg.src.substr(intLen-3, intLen-1) switch(intSrcNameSuffix) { case 'jpg': ctlImg.src = intSrcNamePrefix + "gif" ; break; case 'gif': ctlImg.src = intSrcNamePrefix + "png" ; break; } } return false; } function PopPicView(strQueryString) { //03-11-05 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/PicView.asp?" + strQueryString, "PicView", popup_GetFeatures("M", 800, 800), ""); return false; } function PopPicsView(strQueryString) { //03-11-05 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/PicsView.asp?hidModMode=Modal&" + strQueryString, "PicsView", popup_GetFeatures("M", 700, 700), ""); return false; } function PopPicsChange(strQueryString) { //03-11-05 RMcQ window_OpenDialog( window, window.location.pathname + "/../../Common/PicsChange.asp?hidModMode=Modal&" + strQueryString, "PicsChange", popup_GetFeatures("M", 740, 600), ""); return false; } function lstQtyLifetimeDisplayTimePeriodCode_onChange(ctlThis) { //03-11-13 moved here since called from four places: var frm = document.form1; if (select_GetVal(ctlThis) == 'expires') { //03-11-13 Removed this the from message below (Netscape can't handle dashes): //"<#=BrwsVal("~. Use slashes (12/31/02), not dashes (12-32-02)")#>" var strReply = prompt( 'Please enter a date (e.g. 12/31/05), and it will be converted to days:', ''); if (strReply != null) { //at least the user didn't cancel out // if (isNaN(Date.parse(strReply))) { //02-05-03 RMcQ Replaced with this improved date validation as requested by 020415 - aw02: if (!val_IsDateTime(strReply)) { alert('Please enter a valid date.'); } else { //NOTE that GetNow() is not used: var GetNow = new Date(); //today // alert('GetNow=' + GetNow); // //IMPROVE: Adjust for dtStart HERE to fix bug in 020401 - aw02: //BUT, the OrderDate (AcqDate) is needed here, and that's a mess: // var dtStart = //alert('val_AdjustForY2K(strReply)=' + val_AdjustForY2K(strReply)); var dtExpire = new Date(val_AdjustForY2K(strReply)); var lngDays = parseInt((dtExpire - GetNow) / g_lngMSECS_PER_DAY) if (lngDays > 0) frm.txtQtyLifetimeDisplayTimePeriodQty.value = lngDays else alert('Please enter a valid future date.'); } } //REGARDLESS of success or failure, //set the lstQtyLifetimeDisplayTimePeriodCode back to 'day(s)' select_SelectVal(ctlThis, 'day(s)') } }