/* 
  Date 04/09/2009
  This line is to include Foresee survey on all pages. Please refer to 
   "/Main/various/foresee/foresee-serv-def.js" for the exclusion liost
*/
document.write("<script type='text/javascript' src='/main/various/foresee/foresee-trigger.js'></scr"+"ipt>");

function openAWindow( pageToLoad, winName, width, height, center){
/* Opens a new window on the users desktop.   Arguments:
    pageToLoad - The URL of a page to load in the browser window.
                 This can be a relative URL or fully qualified.
    winName - 	 Name of the new window.
    width - 	 The horizontal size of the new window.
    height - 	 The vertical size of the new window.
    center -     toggle centering on 4.0 browsers.
                  1=centered window 0=no centering
    Values in the "args" section below can all be toggled in the
    same fashion as the center toggle.  Just modify the appropriate
    value in the args section to be either 0 or 1.
    A call to this function might look like this:
    <a href="javascript:openAWindow('ice.html','ice',375,250,1)">Ice</a>
   Created by Glenn Davis of Project Cool, Inc. for general use.  If
   you use this routine please leave all comments in place so that
   others may benefit as well.*/				     xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;    }
    args = "width=" + width + ","     + "height=" + height + "," 
    + "location=0,"     + "menubar=0,"    + "resizable=1,"    + "scrollbars=1,"
    + "status=0,"     + "titlebar=0,"    + "toolbar=0,"    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only
    window.open( pageToLoad,winName,args );
}

function formatNumber(nStr,sPrefix){
	/*
	This function formats a number, inserting commas as needed.
	
	Parameters:
		nStr = The number to format.
		sPrefix = Character(s) to add at the beginning of the number.  This is usually a dollar sign.
	Returns:
		The formatted number as a string
	*/

	var sPrefix = sPrefix || '';
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;

	while (rgx.test(x1)){
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}

	return sPrefix + x1 + x2;
}

/* This script is Copyright (c) Paul McFedries and 
Logophilia Limited (http://www.mcfedries.com/).
Permission is granted to use this script as long as 
this Copyright notice remains in place.*/

function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals)
    var result2 = Math.round(result1)
    var result3 = result2 / Math.pow(10, decimals)
    return pad_with_zeros(result3, decimals)
}

function pad_with_zeros(rounded_value, decimal_places) {

    // Convert the number to a string
    var value_string = rounded_value.toString()
    
    // Locate the decimal point
    var decimal_location = value_string.indexOf(".")

    // Is there a decimal point?
    if (decimal_location == -1) {
        
        // If no, then all decimal places will be padded with 0s
        decimal_part_length = 0
        
        // If decimal_places is greater than zero, tack on a decimal point
        value_string += decimal_places > 0 ? "." : ""
    }
    else {

        // If yes, then only the extra decimal places will be padded with 0s
        decimal_part_length = value_string.length - decimal_location - 1
    }
    
    // Calculate the number of decimal places that need to be padded with 0s
    var pad_total = decimal_places - decimal_part_length
    
    if (pad_total > 0) {
        
        // Pad the string with 0s
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}




<!--
// findInPage Script - BEGIN

// Original:  Mike Hall (MHall75819@aol.com)
// Web Site:  http://members.aol.com/MHall75819

// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com

var NS4 = (document.layers);
var IE4 = (document.all);

var win = this;
var n   = 0;

function findInPage(str) {
	var txt, i, found;
	if (str == "")
		return false;
	
	if (NS4) {
		if (!win.find(str))
			while(win.find(str, false, true))
				n++;
		else
			n++;
		if (n == 0) alert(str + " was not found on this page.");
	}
	
	if (IE4) {
		txt = win.document.body.createTextRange();
		for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
			txt.moveStart("character", 1);
			txt.moveEnd("textedit");
		}
		if (found) {
			txt.moveStart("character", -1);
			txt.findText(str);
			txt.select();
			txt.scrollIntoView();
			n++;
		}
		else {
			if (n > 0) {
				n = 0;
				findInPage(str);
			}
			else
				alert(str + " was not found on this page.");
			}
	}
	
	return false;
}


// findInPage Script - END