/* FILE ARCHIVED ON 9:10:37 Jan 17, 2009 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 1:39:09 May 1, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /** * JavaScript functions for CFC e-Giving system search form and search results page * * @category CFCe * @package e-Giving * @author Dave Stevenson * @copyright 2008 Dave Stevenson, Global Impact * @license https://webarchive.library.unt.edu/eot2008/20090117091037/http://opensource.org/licenses/gpl-license.php GNU Public License * @version SVN: $Id$ * @link https://webarchive.library.unt.edu/eot2008/20090117091037/http://trac.globalimpact.net/wiki/systems/eGiving * @see https://webarchive.library.unt.edu/eot2008/20090117091037/http://www.cfcnca.org/common.js */ /** * popup: keyword search tips */ function keywordSearchTips () { // if popup is already open, do nothing, otherwise open the popup and load the page window.tips && !window.tips.closed ? true : tips = popup('/?tips', 'tips,725,575,x,x,1,x,x'); // set window focus to popup window.tips.focus(); } /** * popup: more info on a default charity (e.g. Undesignated) * * @param object e = element triggering the event * @param int h = height of popup */ function infoPopup (e, h) { var c = e.id.replace('Get', ''); var h = h > 0 ? h : 150; // if popup is already open, just load the appropriate page, otherwise open the popup and load the page window.info && !window.info.closed ? window.info.location = '/?basket' : info = popup('/?info&i='+c, 'info,400,'+h+',x,x,x,x,x,100,100'); window.info.focus(); } /** * popup: view gift basket */ function viewBasket () { var reloadbasket = ''; // if popup is already open, just load the appropriate page, otherwise open the popup and load the page window.basket && !window.basket.closed ? window.basket.location = '/?basket=load' + reloadbasket : basket = popup('/?basket=load' + reloadbasket, 'basket,600,500,x,x,1,1,x,100,100'); // set window focus to popup window.basket.focus(); } /** * popup: more info on a charity * * @param string c = CFC code */ function getCharity (c) { // if popup is already open, just load the appropriate page, otherwise open the popup and load the page window.charity && !window.charity.closed ? window.charity.location = '/?get&c='+c : charity = popup('/?get&c='+c, 'charity,500,420,x,x,1,1,x,100,100'); // set window focus to popup window.charity.focus(); } /** * popup: add charity to basket * * @param string c = CFC code */ function addCharity (c) { var reloadbasket = ''; // if popup is already open, just load the appropriate page, otherwise open the popup and load the page window.basket && !window.basket.closed ? window.basket.location = '/?add&c=' + c + reloadbasket : basket = popup('/?add&c=' + c + reloadbasket, 'basket,600,500,x,x,1,1,x,100,100'); // set window focus to popup window.basket.focus(); } /** * remove charity from basket * * @param object e = remove button element */ function removeCharity (e) { var code = e.name.replace('Remove', ''); var name = e.value.replace('Remove ', ''); if (confirm('Are you sure you want to remove ' + name + ' from your gift basket?')) window.location = '/?remove&c=' + code; } /** * go to allocations page */ function allocate () { var reloadbasket = ''; // if popup is already open, just load the appropriate page, otherwise open the popup and load the page window.location = '/?allocate' + reloadbasket; } /** * add charity to favorites * * @param string c = CFC code */ function addFavorite (c) { window.location = '/?faves&add=' + c; } /** * remove charity from favorites * * @param string c = CFC code */ function removeFavorite (c) { if (confirm('Are you sure you want to remove charity #' + c + ' from your favorites?')) window.location = '/?faves&remove=' + c; } /** * handler function for when user clicks a charity website link in search results * * @param string u = URL of website (including http://) * * @returns mixed = window object on user confirmation, boolean false otherwise */ function offsiteLinkAlert (u) { var t = "You are now exiting the official site for the Combined Federal Campaign of the National Capital Area.\n\nThe link you have clicked on will take you to the website for another organization.\n\nYour internet experience at that site will no longer function under the assurances made under this site's Privacy Statement. We encourage you to learn about the charities and return here to finalize your CFC giving decision.\n\nSome charity sites also encourage you to make direct donations via credit cards. Should you choose to do so, you are doing so at your own risk. Such gifts are not part of the CFC campaign. Under Federal regulations, CFCNCA does not accept credit card transactions. Furthermore, such gifts will not count toward your Department, Agency or Commands CFC totals. The charities also will not receive any share of the undesignated funds from CFCNCA for gifts you make directly on their web site.\n\nIf you wish to proceed to this charity's website, click OK, otherwise click Cancel.\n\n"; return confirm(t) ? popup(u, 'CFC') : false; }