/* Exodus Library - North Coast Management, S.A. 
   Base Functions loaded with every page
   Copyright (c) Exodus Enterprise Systems, LLP
   unless otherwise specified herein.
*/

// Global Misc
ES_Domain = 'casa-claridad.com';

// Empty initialization and termination functions
function initPage() {}
function exitPage() {}

// Display Copyscape warning
function warncopyscape() {
    document.write('<A HREF="http://www.copyscape.com/"><IMG SRC="http://banners.copyscape.com/images/cs-wh-234x16.gif" ALT="Page copy protected against web site content infringement by Copyscape" TITLE="Do not copy content from the page. Plagiarism will be detected by Copyscape." WIDTH="234" HEIGHT="16" BORDER="0"></A>');
}
// Disable the right click button
function disableRClick(e)
 {
    var message = "Copyright © 2005-Present\nAll Rights Reserved, Inversiones Playa Grande, S.A.\n\nCopyscape Protected";

    if (!document.rightClickDisabled)
    // initialize
    {
        if (document.layers)
        {
            document.captureEvents(Event.MOUSEDOWN);
            document.onmousedown = disableRClick;
        }
        else document.oncontextmenu = disableRClick;
        return document.rightClickDisabled = true;
    }
    if (document.layers || (document.getElementById && !document.all))
    {
        if (e.which == 2 || e.which == 3)
        {
            alert(message);
            return false;
        }
    }
    else
    {
        alert(message);
        return false;
    }
}
// disableRClick();
function hasPopupBlocker() {
    /*  Function:      hasPopUpBlocker
        Creation Date: April 5, 2004
        Programmer:    Edmond Woychowsky
        Purpose:       The purpose of this function is to attempt to open
                       a popup window to determine if a popup blocker is
                       enabled.
        Update Date:            Programmer:         Description:
	*/
    var objChild;
    // Window
    var reWork = new RegExp('object', 'gi');
    // Regular expression
    try {
        objChild = window.open('', 'child', 'width=50,height=50,status=no,resizable=yes');

        objChild.close();
    }
    catch(e) {}
    if (!reWork.test(String(objChild)))
    return true;
    // alert('Warning: A pop-up blocker is enabled for this site!');
    else
    return false;
    // alert('No pop-up blocker or pop-up blocker is disabled!');
}

// Get the arguments from either the active or passed location URL.  Return as an array
function getURLArgs(theURL) {
    var theArgs = new Object();
    // Create a new object to hold the args
    var argv = getURLArgs.arguments;
    // Get the function arguments
    if (argv.length == 0) {
        query = location.search.substring(1);
        // Assume we are parsing the active location string
    } else {
        var queryLoc = theURL.indexOf('?');
        // Or check to see if we have been passed one to parse
        if (queryLoc == -1) return;
        query = theURL.substr(queryLoc + 1);
    }
    var arguments = query.split("&")
    // Split into array arguments at the & symbol
    for (var i = 0; i < arguments.length; i++) {
        var argLoc = arguments[i].indexOf('=');
        // Look for name=value pair
        if (argLoc == -1) continue;
        // Nothing found, go to next one
        var argName = arguments[i].substring(0, argLoc);
        // Extract the name
        var argValue = arguments[i].substring(argLoc + 1);
        // Extract the value
        theArgs[argName] = unescape(argValue);
        // Store in object as full string
    }
    return theArgs;
}

// IE bookmark
function bookmarkUs() {
    if (document.all) {
        window.external.AddFavorite('http://www.northcoastmanagement.com', 'Dominican Republic Villa Rentals');
    }
}
// Reasonable attempt to get the basics about this session
function WhoIsIt() {
    var pform = navigator.platform.toLowerCase();
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
    this.ie = (agent.indexOf("msie") != -1);
    this.op3 = (agent.indexOf("opera") != -1);
    this.pc = (agent.indexOf("win") != -1);
    this.mac = (agent.indexOf("mac") != -1);
    // Mac detect
    this.client = ((navigator.userAgent.indexOf('AOL') != -1) || (navigator.userAgent.indexOf('CS 2000') != -1)) ? 1: 0;
    this.moz = (this.ns && (agent.indexOf("netscape/") == -1));
    if (this.moz) this.ns = 0;
    this.HIDDEN = (this.ns) ? 'hide': 'hidden';
    this.VISIBLE = (this.ns) ? 'show': 'visible';
}
var ES_BROWSERINFO = WhoIsIt();

function emailURLTag() {
    var _tagURL = escape(document.location.href);
    var _tagTitle = escape(document.title)
    return _tagTitle + '(' + _tagURL + ')';
}

/* 
	Copyright (c) Macromedia 
	Copied here for convenience and everything seems to use them
*/

// Restore an image that was previously swapped.
function MM_swapImgRestore() {
    //v3.0
    var i,
    x,
    a = document.MM_sr;
    for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}

// Preload images for this page.
function MM_preloadImages() {
    //v3.0
    var d = document;
    if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i,
        j = d.MM_p.length,
        a = MM_preloadImages.arguments;
        for (i = 0; i < a.length; i++)
        if (a[i].indexOf("#") != 0) {
            d.MM_p[j] = new Image;
            d.MM_p[j++].src = a[i];
        }
    }
}

// Locate an object in the document.
function MM_findObj(n, d) {
    //v4.01
    var p,
    i,
    x;
    if (!d) d = document;
    if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document;
        n = n.substring(0, p);
    }
    if (! (x = d[n]) && d.all) x = d.all[n];
    for (i = 0; ! x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; ! x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n);
    return x;
}

// Swap an image
function MM_swapImage() {
    //v3.0
    var i,
    j = 0,
    x,
    a = MM_swapImage.arguments;
    document.MM_sr = new Array;
    for (i = 0; i < (a.length - 2); i += 3)
    if ((x = MM_findObj(a[i])) != null) {
        document.MM_sr[j++] = x;
        if (!x.oSrc) x.oSrc = x.src;
        x.src = a[i + 2];
    }
}

// Write a message to the status area.
function MM_displayStatusMsg(msgStr) {
    //v1.0
    status = msgStr;
    document.MM_returnValue = true;
}

function MM_goToURL() {
    //v3.0
    var i,
    args = MM_goToURL.arguments;
    document.MM_returnValue = false;
    for (i = 0; i < (args.length - 1); i += 2) eval(args[i] + ".location='" + args[i + 1] + "'");
}

function MM_reloadPage(init) {
    //reloads the window if Nav4 resized
    if (init == true) with(navigator) {
        if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
            document.MM_pgW = innerWidth;
            document.MM_pgH = innerHeight;
            onresize = MM_reloadPage;
        }
    }
    else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() {
    //v6.0
    var i,
    p,
    v,
    obj,
    args = MM_showHideLayers.arguments;
    for (i = 0; i < (args.length - 2); i += 3) if ((obj = MM_findObj(args[i])) != null) {
        v = args[i + 2];
        if (obj.style) {
            obj = obj.style;
            v = (v == 'show') ? 'visible': (v == 'hide') ? 'hidden': v;
        }
        obj.visibility = v;
    }
}

function ES_showHideLayers() {
    //v1.0 - Lots of assumptions here!
    if (!document.layers) return;
    var i,
    args = ES_showHideLayers.arguments;
    for (i = 0; i < (args.length - 2); i += 3) {
        v = (args[i + 2] == 'show') ? 'visible': 'hidden';
        document.layers.args[i].style.visibility = v;
    }
}

// Copyright (c) aardwulf.com (encode64 and decode64)
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"abcdefghijklmnopqrstuvwxyz" +
"0123456789+/" + "=";

function encode64(input) {
    var output = "";
    var chr1,
    chr2,
    chr3 = "";
    var enc1,
    enc2,
    enc3,
    enc4 = "";
    var i = 0;

    do {
        chr1 = input.charCodeAt(i++);
        chr2 = input.charCodeAt(i++);
        chr3 = input.charCodeAt(i++);

        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        enc4 = chr3 & 63;

        if (isNaN(chr2)) {
            enc3 = enc4 = 64;
        } else if (isNaN(chr3)) {
            enc4 = 64;
        }

        output = output +
        keyStr.charAt(enc1) +
        keyStr.charAt(enc2) +
        keyStr.charAt(enc3) +
        keyStr.charAt(enc4);
        chr1 = chr2 = chr3 = "";
        enc1 = enc2 = enc3 = enc4 = "";
    }
    while (i < input.length);

    return output;
}

function decode64(input) {
    var output = "";
    var chr1,
    chr2,
    chr3 = "";
    var enc1,
    enc2,
    enc3,
    enc4 = "";
    var i = 0;

    // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
    var base64test = /[^A-Za-z0-9\+\/\=]/g;
    if (base64test.exec(input)) {
        alert("There were invalid base64 characters in the input text.\n" +
        "Valid base64 characters are A-Z, a-z, 0-9, '+', '/', and '='\n" +
        "Expect errors in decoding.");
    }
    input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

    do {
        enc1 = keyStr.indexOf(input.charAt(i++));
        enc2 = keyStr.indexOf(input.charAt(i++));
        enc3 = keyStr.indexOf(input.charAt(i++));
        enc4 = keyStr.indexOf(input.charAt(i++));

        chr1 = (enc1 << 2) | (enc2 >> 4);
        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
        chr3 = ((enc3 & 3) << 6) | enc4;

        output = output + String.fromCharCode(chr1);

        if (enc3 != 64) {
            output = output + String.fromCharCode(chr2);
        }
        if (enc4 != 64) {
            output = output + String.fromCharCode(chr3);
        }

        chr1 = chr2 = chr3 = "";
        enc1 = enc2 = enc3 = enc4 = "";

    }
    while (i < input.length);

    return output;
}

function setRecipient(aVal) {
    if ((s = MM_findObj('recipient')) != null) {
        s.value = aVal + '@' + ES_Domain;
    }
}

function ES_showHideBlocks() {
    //v6.0
    var i,
    p,
    v,
    obj,
    args = ES_showHideBlocks.arguments;
    for (i = 0; i < (args.length - 1); i += 2)
    if ((obj = MM_findObj(args[i])) != null) {
        v = args[i + 1];
        if (obj.style) {
            obj = obj.style;
            v = (v == 'show') ? 'block': (v == 'hide') ? 'none': v;
        }
        obj.display = v;
    }
    return true;
}

// Loads images in the 'background'
function EA_lazypreloadImages() {
    //v1.0
    var x,
    args = EA_lazypreloadImages.arguments
    var d = document;
    if (args.length > 0) {
        if (!d.EA_lazyFiles) {
            d.EA_lazyFiles = new Array();
            d.EA_lazyImgs = new Array();
            d.EA_lazyStart = new Date();
        }
        for (x = 0; x < args.length + 1; x++) {
            d.EA_lazyFiles.push(args[x]);
        }
    }
    if (!d.EA_preloader) {
        d.EA_preloader = setInterval("EA_lazypreloadImages()", 250);
    }
    var i = new Image();
    i.src = d.EA_lazyFiles.pop();
    d.EA_lazyImgs.push(i);
    if (d.EA_lazyFiles.length == 0) {
        clearInterval(d.EA_preloader);
        d.EA_lazyFiles = new Array();
        //		alert('Done in ' + (new Date()- d.EA_lazyStart)/1000 + " secs");
    }
}

// Create a default popup window using the defined URL and optionally resize it to a single image.
// Params: 0 = URL, 1 = Width, 2 = Height
function simplePopUp() {
    var w,
    h,
    s,
    x,
    y,
    iw,
    ih,
    args = simplePopUp.arguments;
    w = (args[1] > 0) ? args[1] : (screen.availWidth / 2);
    h = (args[2] > 0) ? args[2] : (screen.availHeight / 2);
    x = (screen.availWidth) ? ((screen.availWidth / 2) - (w / 2)) : 0;
    y = (screen.availHeight) ? ((screen.availHeight / 2) - (h / 2)) : 0;
    window.open(args[0], 'NCMPopup', 'width=' + w + ',height=' + h + ',toolbar=no,scrollbars=yes,resizable=yes,left=' + x + ',screenX=' + x + ',top=' + y + ',screenY=' + y);
}

// Fading Layer Window
var EA_fadeTimer;
var t;
var EA_fadeObj;

function EA_initFader() {
    if ((EA_fadeObj = MM_findObj('fader')) != null) {
        var divWidth = 170;
        var l = (document.body.innerwidth) ? document.body.innerwidth / 2: document.body.offsetWidth / 2;
        EA_fadeObj.style.left = (l - divWidth) + "px";
        EA_showFader(true);
        EA_timerFader();
    }
}

function EA_showFader(a) {
    (a) ? EA_fadeObj.className = 'show': EA_fadeObj.className = '';
}

function EA_timerFader() {
    EA_fadeTimer = setInterval("EA_Fader()", 20);
}

function EA_Fader() {
    var c = Math.abs(0);
    if (c == 0 || c == 100) clearInterval(EA_fadeTimer);
    c = (c == 100) ? 99.9999: c;
    EA_fadeObj.style.filter = "alpha(opacity:" + c + ")";
    EA_fadeObj.style.KHTMLOpacity = c / 100;
    EA_fadeObj.style.MozOpacity = c / 100;
    EA_fadeObj.style.opacity = c / 100;
    if (c == 0) EA_showFader(false);
}

// Simple check to see if this browser accepts cookies or not
function EA_CookieAccept() {
    _acc = new Cookie("_accept_");
    _acc.set("value=/scay");
    _acc.get();
    if (_acc.value == "scay")
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

// Ensure something only occurs one time
var EA_oncepersession = 0;
var EA_onetimeonly = 0;
var EA_OTAlertMsg = "";

function EA_OTgetCookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
        if (offset != -1) {
            // if cookie exists
            offset += search.length
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset);
            // set index of end of cookie value
            if (end == -1)
            end = document.cookie.length;
            returnvalue = unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}

function EA_OTcheckAlert() {
    if (EA_OTgetCookie('EA_onceper') == '') {
        EA_OTLoadAlert();
        document.cookie = "EA_onceper=yes";
        EA_oncepersession = 1;
        EA_onetimeonly = 1;
    }
}

function EA_OTLoadAlert() {
    if ((EA_OTAlertMsg != "") && EA_CookieAccept()) alert(EA_OTAlertMsg)
}

// Pad the string on the left
function padleft(val, ch, num) {
    var re = RegExp(".{" + num + "}$");
    var pad = "";

    do {
        pad += ch;
    }
    while (pad.length < num)

    return re.exec(pad + val);
}

// Pad the string on the right
function padright(val, ch, num) {
    var re = RegExp("^.{" + num + "}");
    var pad = "";

    do {
        pad += ch;
    }
    while (pad.length < num)

    return re.exec(val + pad);
}

function ltrim(str) {
    return str.replace(/^\s+/, '');
}

function rtrim(str) {
    return str.replace(/\s+$/, '');
}

function alltrim(str) {
    return str.replace(/^\s+|\s+$/g, '');
}

// Parse the URL elements from the string of data
function parseURL(theURL) {
    var e = /^((http|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+\.[^#?\s]+)(#[\w\-]+)?$/;

    if (theURL.match(e)) {
        return {
            url: RegExp['$&'],
            protocol: RegExp.$1,
            host: RegExp.$2,
            path: RegExp.$3,
            file: RegExp.$5,
            hash: RegExp.$6
        };
    }
    else {
        return {
            url: "",
            protocol: "",
            host: "",
            path: "",
            file: "",
            hash: ""
        };
    }
}

// Locate all elements with a specified class name
// Format: getElementsByClassName(document, 'TD', 'required')
function getElementsByClassName(oElm, strTagName, strClassName) {
    var arrElements = (strTagName == "*" && document.all) ? document.all: oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for (var i = 0; i < arrElements.length; i++) {
        oElement = arrElements[i];
        if (oRegExp.test(oElement.className)) {
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function num2Currency(num) {
    num = num.toString().replace(/\$|\,/g, '');
    if (isNaN(num)) num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num * 100 + 0.50000000001);
    cents = num % 100;
    num = Math.floor(num / 100).toString();
    if (cents < 10) cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) num = num.substring(0, num.length - (4 * i + 3)) + ',' +
    num.substring(num.length - (4 * i + 3));
    return (((sign) ? '': '-') + '$' + num + '.' + cents);
}


/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Nate Baldwin :: http://www.mindpalette.com */

/* Breadcrumb Links Script
   NOTE: Be sure to check Web site for updates */

// ============================================================
/* The variable below determines what the home page, or the root directory,
of your site is named. The default is "Home". To use the address of your
site (www.yoursite.com), leave the value blank (nothing between the double quotes). */

var homePage = "Home";

/* The variable below controls the character(s) that the script places between
the link levels. The default is set to be the > (greater than) HTML entity
with a space on either side. Change this to whatever you want, but if the
character has an HTML entity, be sure to use that. */

var sepChars = " > ";

/* In most cases, the value below should just be a / sign. Or, you can use the
fully qualified http://www.yoursite.com address if you'd rather. Basically,
it just tells the script what all the link addresses will start with. */

var linkHome = "/";

/* Leave the value below set to 'true' if you want the script to not list your
index page name (index.html) at the end of the links path. The values 'true' or
'false' should be used without quotes. */

var hideIndex = true;

/* Leave the value below set to 'true' if you want the script to convert any
underscores in directory or names to spaces. For instance, it would convert
"golive_actions" to "golive actions". The values 'true' or 'false' should be
used without quotes. */

var UToSpace = true;

/* Leave the value below set to 'true' if you want the script to convert any dashes
in directory or page names to spaces. For instance, it would convert "golive-actions"
to "golive actions". The values 'true' or 'false' should be used without quotes. */

var DToSpace = true;

/* The variable below allows you to change the capitalization of the directory and
pages names in your menu. The value should be a number between 0 and 3, without
quotation marks. Options are as follows: 0 = no change; 1 = initial caps;
2 = all upper case; 3 = all lower case */

var changeCaps = 1;

/* If set to true, the variable below will not display the file's extension for
any file names displayed in the menu. Otherwise, set to false to show extensions.
The values 'true' or 'false' should be used without quotes. */

var hideExt = true;

//-------------------------------------------------------------------------
// SCRIPT FUNCTIONS  (shouldn't need to edit code below)...
//-------------------------------------------------------------------------
// build breadcrumb links...
function MPJSBackLinks() {
    var linkHTML = '';
    var thisURL = window.location + '';
    var urlPair = thisURL.split('//');
    if (urlPair.length > 1) thisURL = urlPair[1];
    var dirArray = thisURL.split('/');
    var linkArray = dirArray.slice(1);
    var linkDir = '/';
    var currentPage = '';
    if (linkHome != '' && linkHome != '/') {
        var thisTest = linkHome.split('//');
        if (thisTest.length > 1) linkHome = thisTest[1];
        startArray = linkHome.split('/');
        var backCount = 0;
        for (var n = 0; n < startArray.length; n++) {
            if (startArray[n] == '..') backCount++;
            else break;
        }
        if (backCount > 0) {
            var part1 = dirArray.slice(0, (dirArray.length - backCount - 1));
            var part2 = startArray.slice(backCount);
            startArray = part1.concat(part2);
        } else {
            var newStart = new Array(dirArray[0]);
            for (var n = 1; n < startArray.length; n++) {
                var thisTest = (typeof dirArray[n] != "undefined") ? dirArray[n] : false;
                if (thisTest && thisTest == startArray[n]) newStart[n] = startArray[n];
                else break;
            }
            startArray = newStart;
        }
        if (startArray.length > 1) {
            var lastOne = startArray[startArray.length - 1];
            if (lastOne != '') {
                var thisTest = lastOne.split('.');
                if (thisTest.length > 1) startArray[startArray.length - 1] = '';
                else startArray[startArray.length] = '';
            }
            if (homePage == '') homePage = startArray[startArray.length - 2];
            linkArray = dirArray.slice(startArray.length - 1);
            if (startArray[0] != '') startArray[0] = "http://" + startArray[0];
            linkDir = startArray.join('/');
        } else linkArray = dirArray.slice(1);
    } else {
        linkArray = dirArray.slice(1);
        if (homePage == '') homePage = dirArray[0];
    }
    var backTrack = 1;
    if (linkArray[linkArray.length - 1] != '') {
        var lastOne = linkArray[linkArray.length - 1];
        var testName = lastOne.split('.');
        if (testName[0] == 'index' || testName[0] == 'default') {
            backTrack = 2;
            currentPage = linkArray[linkArray.length - 2];
        } else if (hideExt) currentPage = testName[0]
        else currentPage = lastOne;
    } else {
        backTrack = 2;
        currentPage = linkArray[linkArray.length - 2];
    }
    var html = '';
    if (linkArray.length >= backTrack) {
        linkArray = linkArray.slice(0, linkArray.length - backTrack);
        var links = new Array();
        if (homePage != '') {
            homePage = MPBCParseText(homePage, UToSpace, DToSpace, changeCaps);
            links[links.length] = '<a href="' + linkDir + '">' + homePage + '</a>';
        }
        var baseDir = linkDir;
        for (var n = 0; n < linkArray.length; n++) {
            baseDir += linkArray[n] + '/';
            var thisText = MPBCParseText(linkArray[n], UToSpace, DToSpace, changeCaps);
            links[links.length] = '<a href="' + baseDir + '">' + thisText + '</a>';
        }
        if (currentPage != '') links[links.length] = MPBCParseText(currentPage, UToSpace, DToSpace, changeCaps);
        html = '<div class="mp_backlinks">' + links.join(sepChars) + '<\/div>';
    }
    return html;
}

// parse string through text filters
function MPBCParseText(thisText, UToSpace, DToSpace, changeCaps) {
    if (typeof thisText != "undefined" && thisText) {
        if (DToSpace) thisText = MPBCReplaceChar('-', ' ', thisText);
        if (UToSpace) thisText = MPBCReplaceChar('_', ' ', thisText);
        if (changeCaps) thisText = MPBCFixCaps(thisText, changeCaps);
    } else thisText = '';
    return thisText;
}

// find and replace single character in string...
function MPBCReplaceChar(oldChar, newChar, thisString) {
    var newString = '';
    for (var n = 0; n < thisString.length; n++) {
        newString += (thisString.charAt(n) == oldChar) ? newChar: thisString.charAt(n);
    }
    return newString;
}

// determine changes in capitalization...
function MPBCFixCaps(thisString, changeCaps) {
    if (changeCaps == 1) thisString = MPBCUCWords(thisString);
    else if (changeCaps == 2) thisString = thisString.toUpperCase();
    else if (changeCaps == 3) thisString = thisString.toLowerCase();
    return thisString;
}

// capitalize the first letter of every word...
function MPBCUCWords(thisString) {
    var thisArray = thisString.split(' ');
    var newString = '';
    for (var n = 0; n < thisArray.length; n++) {
        var firstChar = thisArray[n].charAt(0).toUpperCase();
        var theRest = thisArray[n].substring(1, thisArray[n].length);
        newString += firstChar + theRest + ' ';
    }
    return newString.substring(0, newString.length - 1);
}
