var bEnteredSubNav = false;
function getNavigation(sPage) { //Reset subnav sensor.
bEnteredSubNav = false;
sPage = sPage.toLowerCase();  //Normalize for conditional.
var aLinkTitles = new Array();  //Array objects to store dynamic navigation items.
var aLinkHrefs = new Array();
setNavigation(sPage);  //Roll over for top nav.
switch (sPage) {   //Conditional based on what tab is selected.
case "home":
aLinkTitles[0] = "Pricing Info";
aLinkHrefs[0] =  "http://www.printingforless.com/pricinginfo.html";
aLinkTitles[1] = "Printing Knowledge Center";
aLinkHrefs[1] =  "http://www.printingforless.com/Printing-Help.html";
aLinkTitles[2] = "FAQ";
aLinkHrefs[2] =  "http://www.printingforless.com/Printing-FAQ.html";
aLinkTitles[3] = "Get Free Samples";
aLinkHrefs[3] =  "http://www.printingforless.com/samplesrequest.html";
aLinkTitles[4] = "About Us";
aLinkHrefs[4] =  "http://www.printingforless.com/about.html";
aLinkTitles[5] = "myPFL";
aLinkHrefs[5] =  "http://mypfl.com";
break;
case "general":
aLinkTitles[0] = "Pricing Info";
aLinkHrefs[0] =  "http://www.printingforless.com/pricinginfo.html";
aLinkTitles[1] = "Printing Knowledge Center";
aLinkHrefs[1] =  "http://www.printingforless.com/Printing-Help.html";
aLinkTitles[2] = "FAQ";
aLinkHrefs[2] =  "http://www.printingforless.com/Printing-FAQ.html";
aLinkTitles[3] = "Get Free Samples";
aLinkHrefs[3] =  "http://www.printingforless.com/samplesrequest.html";
aLinkTitles[4] = "About Us";
aLinkHrefs[4] =  "http://www.printingforless.com/about.html";
break;
case "brochures":
aLinkTitles[0] = "Introduction";
aLinkHrefs[0] =  "http://www.printingforless.com/Brochure-Printing.html";
aLinkTitles[1] = "8-&frac12; x 11";
aLinkHrefs[1] =  "https://www.printingforless.com/brochureseightR.html";
aLinkTitles[2] = "8-&frac12; x 14";
aLinkHrefs[2] =  "https://www.printingforless.com/brochuresfourteenR.html";
aLinkTitles[3] = "11 x 17";
aLinkHrefs[3] =  "https://www.printingforless.com/brochureselevenR.html";
aLinkTitles[4] = "11 x 25-&frac12;";
aLinkHrefs[4] =  "https://www.printingforless.com/brochurestwentyfiveR.html";
aLinkTitles[5] = "Posters";
aLinkHrefs[5] = "https://www.printingforless.com/brochuresposters.html";
aLinkTitles[6] = "Brochure Holders";
aLinkHrefs[6] = "https://www.printingforless.com/Brochure-Rack-Card-Holders.html";
aLinkTitles[7] = "Samples";
aLinkHrefs[7] = "http://www.printingforless.com/Brochure-Printing.html#samples";
break;
case "cards":
aLinkTitles[0] = "Bookmarks";
aLinkHrefs[0] = "https://www.printingforless.com/cardsbookmarks.html";
aLinkTitles[1] = "Business Cards";
aLinkHrefs[1] = "https://www.printingforless.com/cardsbusinesscards.html";
aLinkTitles[2] = "Club Cards";
aLinkHrefs[2] = "http://www.printingforless.com/Club-Cards-Printing.html";
aLinkTitles[3] = "Door Hangers";
aLinkHrefs[3] = "https://www.printingforless.com/cardsdoorhangers.html";
aLinkTitles[4] = "Greeting Cards";
aLinkHrefs[4] = "https://www.printingforless.com/cardsgreetingcards.html";
aLinkTitles[5] = "Plastic Cards";
aLinkHrefs[5] =  "https://www.printingforless.com/Custom-Plastic-Card-Printing.html";
aLinkTitles[6] = "Postcards";
aLinkHrefs[6] =  "https://www.printingforless.com/cardspostcards.html";
aLinkTitles[7] = "Rack Cards";
aLinkHrefs[7] =  "https://www.printingforless.com/cardsrackcards.html";
break;
case "newsletters":
aLinkTitles[0] = "Introduction";
aLinkHrefs[0] =  "http://www.printingforless.com/Newsletter-Printing.html";
aLinkTitles[1] = "8-&frac12; x 11";
aLinkHrefs[1] =  "https://www.printingforless.com/newsletterseight.html";
aLinkTitles[2] = "11 x 17";
aLinkHrefs[2] =  "https://www.printingforless.com/newsletterseleven.html";
aLinkTitles[3] = "11 x 25-&frac12;";
aLinkHrefs[3] =  "https://www.printingforless.com/newsletterstwentyfive.html";
aLinkTitles[4] = "Samples";
aLinkHrefs[4] =  "http://www.printingforless.com/Newsletter-Printing.html#samples";
break;
case "stationery":
aLinkTitles[0] = "Introduction";
aLinkHrefs[0] =  "http://www.printingforless.com/Stationery-Printing.html";
aLinkTitles[1] = "Letterhead/Envelopes";
aLinkHrefs[1] =  "https://www.printingforless.com/stationeryletterhead.html";
aLinkTitles[2] = "Letterhead";
aLinkHrefs[2] =  "https://www.printingforless.com/stationeryletterheadonly.html";
aLinkTitles[3] = "#10 Envelopes";
aLinkHrefs[3] =  "https://www.printingforless.com/stationeryenvelopesonly.html";
aLinkTitles[4] = "Large Envelopes";
aLinkHrefs[4] =  "https://www.printingforless.com/stationerylrgenvelopes.html";
aLinkTitles[5] = "Samples";
aLinkHrefs[5] =  "http://www.printingforless.com/Stationery-Printing.html#samples";
break;
case "catalogs":
aLinkTitles[0] = "Introduction";
aLinkHrefs[0] =  "Catalog-Booklet-Printing.html"; 
aLinkTitles[1] = "5-&frac12; x 8-&frac12; Catalogs";
aLinkHrefs[1] =  "https://www.printingforless.com/catalogsfive.html";  
aLinkTitles[2] = "8-&frac12; x 11 Catalogs";
aLinkHrefs[2] =  "https://www.printingforless.com/catalogseight.html"; 
aLinkTitles[3] = "Calendars";
aLinkHrefs[3] =  "https://www.printingforless.com/calendars.html";
aLinkTitles[4] = "Coil Bound Booklets";
aLinkHrefs[4] =  "http://www.printingforless.com/Booklet-Manual-Printing.html";
aLinkTitles[5] = "Samples";
aLinkHrefs[5] =  "http://www.printingforless.com/Catalog-Booklet-Printing.html#samples";
break;
case "folders":
aLinkTitles[0] = "Introduction";
aLinkHrefs[0] =  "http://www.printingforless.com/Folders-Printing.html";
aLinkTitles[1] = "9 x 12 Presentation Folders";
aLinkHrefs[1] =  "https://www.printingforless.com/presentationfolders.html";
aLinkTitles[2] = "File Folders";
aLinkHrefs[2] =  "https://www.printingforless.com/filefolders.html";
aLinkTitles[3] = "Samples";
aLinkHrefs[3] =  "http://www.printingforless.com/Folders-Printing.html#samples";
break;
case "custom":
aLinkTitles[0] = "Carbonless Forms";
aLinkHrefs[0] =  "https://www.printingforless.com/Carbonless-NCR-Printing.html";
aLinkTitles[1] = "Hang Tags";
aLinkHrefs[1] =  "http://www.printingforless.com/Hang-Tags-Printing.html";
aLinkTitles[2] = "Large Format";
aLinkHrefs[2] =  "http://www.printingforless.com/Large-Format-Printing.html";
aLinkTitles[3] = "Notepads";
aLinkHrefs[3] =  "https://www.printingforless.com/Notepad-Printing.html";
aLinkTitles[4] = "Post-it&reg;";
aLinkHrefs[4] =  "https://www.printingforless.com/Post-It-Notes-Printing.html";
aLinkTitles[5] = "Statement Stuffers";
aLinkHrefs[5] =  "https://www.printingforless.com/statementstuffers.html";
aLinkTitles[6] = "Table Tents";
aLinkHrefs[6] =  "http://www.printingforless.com/Table-Tent-Printing.html";
aLinkTitles[7] = "Other stuff";
aLinkHrefs[7] =  "http://www.printingforless.com/Custom-Printing-Prices.html";
break;
case "help":
aLinkTitles[0] = "Pricing Info";
aLinkHrefs[0] =  "http://www.printingforless.com/pricinginfo.html";
aLinkTitles[1] = "Printing Knowledge Center";
aLinkHrefs[1] =  "http://www.printingforless.com/Printing-Help.html";
aLinkTitles[2] = "FAQ";
aLinkHrefs[2] =  "http://www.printingforless.com/Printing-FAQ.html";
aLinkTitles[3] = "Get Free Samples";
aLinkHrefs[3] =  "http://www.printingforless.com/samplesrequest.html";
aLinkTitles[4] = "About Us";
aLinkHrefs[4] =  "http://www.printingforless.com/about.html";
aLinkTitles[5] = "myPFL";
aLinkHrefs[5] =  "http://mypfl.com";
break;
default:break;}
	  
//Clear navigation area.
oNavDiv = document.getElementById("navigationContent")
oNavDiv.innerHTML = "<img src=\"images/TopNavSep.gif\" width=\"8\" height=\"24\" align=\"absmiddle\" style=\"margin-right:5px;\" />";
for (var i = 0; i <= (aLinkTitles.length - 1); i++) {
oNavDiv.innerHTML += "<a href=\"" + aLinkHrefs[i] + "\" class=\"subnav\">" + aLinkTitles[i] + "</a>";
//Insert divider unless last element in array.
if (i != aLinkTitles.length) {
oNavDiv.innerHTML += "<img src=\"images/TopNavSep.gif\" width=\"8\" height=\"24\" hspace=\"5\" align=\"absmiddle\" />";}}}
function setNavigation(sPage) { //Roll over top nav.
document.getElementById("imgTopNavBar").src = document.getElementById("imgTopNav" + sPage).src;}
function writePreloader() {
document.write("<div style=\"visibility:hidden; position:absolute; width:1px; height:1px; overflow:hidden;\">");
document.write("<img id=\"imgTopNavhome\" src=\"images/topnavMtnsHomeCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavbrochures\" src=\"images/topnavMtnsBrochuresCO.gif\" width=\"775\" height=\"2\" alt=\"\" />");
document.write("<img id=\"imgTopNavcards\" src=\"images/topnavMtnsCardsCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavnewsletters\" src=\"images/topnavMtnsNewslettersCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavstationery\" src=\"images/topnavMtnsStationeryCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavcatalogs\" src=\"images/topnavMtnsCatalogsCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavfolders\" src=\"images/topnavMtnsFoldersCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavcustom\" src=\"images/topnavMtnsCustomCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavhelp\" src=\"images/topnavMtnsHelpCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("<img id=\"imgTopNavgeneral\" src=\"images/topnavMtnsGeneralCO.gif\" width=\"775\" height=\"22\" alt=\"\" />");
document.write("</div>");}
var currentdate = 0
var core = 0
function StringArray (n) {
this.length = n;
for (var i =1; i <= n; i++) {
 this[i] = ' ' }}
image = new StringArray(7)
image[0] = 'images/FP/LauraP5.jpg'
image[1] = 'images/FP/Lori.jpg'
image[2] = 'images/FP/BrianM.jpg'
image[3] = 'images/FP/Terra.jpg'
image[4] = 'images/FP/KatieO.jpg'
image[5] = 'images/FP/JessP.jpg'
image[6] = 'images/FP/RyanF.jpg'
var ran = 60/image.length
function ranimage() {
currentdate = new Date()
core = currentdate.getSeconds()
core = Math.floor(core/ran)
return(image[core]) }
function showImage(){
document.write("<img src='" +ranimage()+ "' ALT='Actual employee, not a stock photo' WIDTH='78' HEIGHT='94' HSPACE='2' BORDER='1'>");}

var source = GetQueryStringValue('ts');
if (source) {
    buildTrafficSource(source);
}
buildWebsiteOptimizer(15);

function GetQueryStringValue(key) {
    var querystring = window.location.search.substring(1);
    var querystringArray = querystring.split("&");
    var current;
    for (var i = 0, loopCnt = querystringArray.length; i < loopCnt; i++) {
        current = querystringArray[i].split("=");
        if (current.length == 2 && current[0] == key) {
            return current[1];
        }
    }
    return '';
}

var fullUrl = window.location.pathname;
var pageUrl = fullUrl.substring(fullUrl.lastIndexOf('/') + 1);
var SourcePage = pageUrl.substring(0, pageUrl.indexOf('.html'));
var source = SourcePage + ' Page'; buildTrafficSource(source);

function buildTrafficSource(source) {
    if (!(findCookie("trafficsource"))) {
        var expires = 730;
        var formatdate = getFormatDate();
        var expr = new Date();
        var path = '/';
        var expr = new Date(expr.getTime() + (expires * 86400000));
        var data = "source|" + source + "&createdate|" + formatdate;
        var cookie = "trafficsource=" + escape(data) + ((expires) ? ";expires=" + expr.toGMTString() : "") + ((path) ? ";path=" + path : ""); ;
        document.cookie = cookie;
    }
}

function buildWebsiteOptimizer(id) {
    if (!(findCookie("websiteOptimizer"))) {
        var expires = 730;
        var formatdate = getFormatDate();
        var expr = new Date();
        var path = '/';
        var expr = new Date(expr.getTime() + (expires * 86400000));
        var data = "id|" + id + "&createdate|" + formatdate;
        var cookie = "websiteOptimizer=" + escape(data) + ((expires) ? ";expires=" + expr.toGMTString() : "") + ((path) ? ";path=" + path : "");
        document.cookie = cookie;
    }
}

function findCookie(name) {
    if (document.cookie == '') {
        return false;
    } else {
        var firstChar, lastChar;
        var theBigCookie = document.cookie;
        firstChar = theBigCookie.indexOf(name);
        if (firstChar != -1) {
            firstChar += name.length + 1;
            lastChar = theBigCookie.indexOf(';', firstChar);
            if (lastChar == -1) lastChar = theBigCookie.length;
            return true;
        } else {
            return false;
        }
    }
}

function getFormatDate() {
    var today = new Date();
    var timezoneoffset = today.getTimezoneOffset();
    if ((navigator.appVersion.indexOf('MSIE 3') != -1)) timezoneoffset = timezoneoffset * (-1);
    today.setTime(today.getTime() + timezoneoffset * 60 * 1000);
    today.setTime(today.getTime() - 8 * 60 * 60 * 1000);
    var month = today.getMonth() + 1;
    var date = today.getDate();
    var year = today.getYear();
    if (year < 1900) year += 1900;
    var hour = today.getHours();
    if (hour < 10) hour = "0" + hour;
    var minute = today.getMinutes();
    if (minute < 10) minute = "0" + minute;
    var second = today.getSeconds();
    if (second < 10) second = "0" + second;
    var formatdate = month + "/" + date + "/" + year + " " + hour + ":" + minute + ":" + second;
    return formatdate;
}

