// Functions used by news release listing pages

function popRemote(winurl,winname,winfeatures)
{
    if (winfeatures == null){

      var scrheight = 500;
      var scrwidth = 720;
      winfeatures = 'WIDTH=' + scrwidth + ',HEIGHT=' + scrheight + ',SCROLLBARS=1,RESIZABLE=1,DIRECTORIES=0,menubar=0,screenX=' + scrwidth/4 + ',screenY=' + scrheight/4 + ',LEFT=' + scrwidth/4 + ',TOP=' + scrheight/4 ;

    }

    var newwin = window.open(winurl,winname,winfeatures);
    newwin.focus();
}

/* Show a randomly chosen factoid in the Holiday Facts box */

function ShowFactoid() {
    var Q = HolidayFact.length;
    var whichHolidayFact = Math.round(Math.random()*(Q-1));
    while (whichHolidayFact == lastFact) {
        whichHolidayFact = Math.round(Math.random()*(Q-1));
    }
    lastFact = whichHolidayFact;
    var factSpace = document.getElementById('factoid');
    if (typeof(factSpace.textContent) != 'undefined') {
        // all well-behaved browsers
        factSpace.textContent = HolidayFact[whichHolidayFact];
    } else  if (typeof(factSpace.innerText) != 'undefined') {
        // IE 6 and below
        factSpace.innerText = HolidayFact[whichHolidayFact];
    } else {
        // no support for either, just write
        document.write(HolidayFact[whichHolidayFact]);
    }
    //setTimeout('ShowFactoid()',120000);
}

var lastFact=99;  // guarantee not showing same fact two times in a row
var HolidayFact=new Array();

HolidayFact[0] = "The U.S. Postal Service has been delivering holiday cheer for 232 years.";
HolidayFact[1] = "19 billion cards, letters and packages will be delivered between Thanksgiving and Christmas.";
HolidayFact[2] = "3.4 billion letters will be mailed over the holidays.";
HolidayFact[3] = "960 million pieces of mail will be processed on Dec. 15, the busiest mailing day of the year.";
HolidayFact[4] = "On average, the U.S. Postal Service processes 700 million pieces of mail daily.";
HolidayFact[5] = "On average, 826 million pieces of mail are processed daily during the holidays.";
HolidayFact[6] = "The Postal Service will process 20 million pounds of mail for overseas military installations, including war zones in Iraq and Afghanistan.";
HolidayFact[7] = "7,400 Post Offices will offer expanded hours this holiday season.";
HolidayFact[8] = "214,500 vehicles will be used to transport holiday mail.";
HolidayFact[9] = "The Postal Service printed 2.17 billion holiday stamps this year.";
HolidayFact[10] = "130 million customers will visit a Post Office during the holidays.";
HolidayFact[11] = "The Postal Service handles 46 percent of the world's card and letter mail volume - delivering more mail to more addresses in a larger geographical area than any other post in the world.";
HolidayFact[12] = "To move holiday mail, the Postal Service will increase air cargo lift of mail by almost 32 percent and put 214,500 delivery vehicles on roadways.";
HolidayFact[13] = "By Dec. 9, the National Operations Center will be staffed around the clock, seven days a week, to monitor and coordinate mail transportation nationwide.";


/* Show a randomly chosen Tip in the Holiday Tip box */

function ShowTip() {
    var T = HolidayTip.length;
    var whichHolidayTip = Math.round(Math.random()*(T-1));
    while (whichHolidayTip == lastTip) {
        whichHolidayTip = Math.round(Math.random()*(T-1));
    }
    lastTip = whichHolidayTip;
    var tipSpace = document.getElementById('tip');
    if (typeof(tipSpace.textContent) != 'undefined') {
        // all well-behaved browsers
        tipSpace.textContent = HolidayTip[whichHolidayTip];
    } else  if (typeof(tipSpace.innerText) != 'undefined') {
        // IE 6 and below
        tipSpace.innerText = HolidayTip[whichHolidayTip];
    } else {
        // no support for either, just write
        document.write(HolidayTip[whichHolidayTip]);
    }
    //setTimeout('ShowTip()',120000);
}

var lastTip=99;  // guarantee not showing same tip two times in a row
var HolidayTip=new Array();

HolidayTip[0] = "FREE package pickup. Don't fight Mother Nature. Stay inside where it's nice and warm and let the Postal Service do what it does best - pick up and deliver mail.";
HolidayTip[1] = "FREE eco-friendly boxes and envelopes. Send a very green holiday message across town and around the world when sending Priority Mail and Express Mail packages and envelopes. These supplies are 100-percent recyclable.";
HolidayTip[2] = "FREE shipping supplies. Tape, labels, international mailing products, even customs forms are available online at usps.com - at no charge.";
HolidayTip[3] = "FREE military Care Kits. The Postal Service has created a special mailing and shipping kit designed specifically for military families sending packages overseas. Each Care Kit contains two Priority Mail boxes, six Priority Mail Flat-Rate boxes, eight Priority Mail labels, one roll of Priority Mail tape and eight customs forms with envelopes. Call 1-800-610-8734 and ask for the Care Kit.";
HolidayTip[4] = "Greeting cards, postcards, gift cards from more than 20 national retailers, even year-end letters to family and friends can be created, packaged and mailed through usps.com/cardstore.";
HolidayTip[5] = "Santa isn't the only one working on Christmas. The Postal Service will deliver Express Mail in most major cities on Dec. 24 and Dec. 25.";
HolidayTip[6] = "Going away for the holidays? Don't worry. Premium Forwarding Service allows you to have all your mail sent to you at your temporary location. Most mail is forwarded once a week by Priority Mail. Usps.com/premiumforwarding";
HolidayTip[7] = "Log onto usps.com and step into a Post Office. Ship a package, arrange a free package pickup, purchase stamps, design and print holiday cards, print postage and shipping labels and order specialty philatelic gift products.";
