
function changeSize()
{
	var w , h 

	w = screen.Width*.99
	h = screen.Height*.88

	window.resizeTo( w,h );
	window.moveTo(screen.width/2-(w/2),screen.height/2-(h/2));

}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,menubar=yes,toolbar=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function SynchTextBoxes(MasterTextBoxName, CopyTextBoxName)
{
	CopyTextBoxName.value = MasterTextBoxName.value;
}

function SynchCombos(MasterCombo, CopyCombo)
{
	var masterComboSelectedIndex = MasterCombo.selectedIndex;
	CopyCombo.selectedIndex = masterComboSelectedIndex;
}

function loadParentNClose(strParentURL) {
	var parWin  = self.opener;
	
	if (typeof(parWin) == "object" && !parWin.closed) {
		if (strParentURL != null)
			parWin.location.href = strParentURL;
		parWin.focus();
	}
	self.close();
	return;
}

function loadFirstParentNClose(strParentURL) {
//loads the first parent window.
	var tempParWin;
	var parWin;
	
	parWin = self.opener;
	
	do {
		tempParWin = parWin.opener;
		if (tempParWin==null) 
		{
		//alert ("tempparwin is null");
		break;
		}
		if (!(typeof(tempParWin) == "object") || tempParWin.closed) 
		{
		//alert("either tempparwin is not an object or tempparwin is closed");
		break;
		}
		parWin = tempParWin;
	}
	while (1>0);
	
	if (typeof(parWin) == "object" && !parWin.closed) 
	{
		if (strParentURL != null && strParentURL.length > 0)
		{
			parWin.location.href = strParentURL;
		}
		else
			//just refresh the window with the current url.
			if (parWin.document.Login)
			{
				//refresh the parent window only if still not logged-in.
				parWin.location.href = parWin.location.href;
			}
	}
	self.close();
	return;
}

function SelectComboItem(formname,strComboName,Value)
{
	var ComboName = String(strComboName)
	var lc = 0;
	var frmcnt;
	frmcnt = document.forms.length
	if (document.forms[formname].elements[ComboName])
	{
		var max = document.forms[formname].elements[ComboName].length;
		if (max > 0)
		{
			for (lc=0;lc<max;lc++)
			{
				if (document.forms[formname].elements[ComboName][lc].value == Value)
					{
						document.forms[formname].elements[ComboName][lc].selected = true;
						//break;
					}	
			}
		}
	}
}

function SelectListItems(formname,strListName,arrValues)
{
	var ListName = String(strListName)
	var lc = 0;
	var lc1 = 0;
	var arrLength = arrValues.length;
	//alert("array length" + arrLength);
	var frmcnt;
	frmcnt = document.forms.length
	if (document.forms[formname].elements[ListName])
	{
		var max = document.forms[formname].elements[ListName].length;
		//alert("list length" + max);
		if (max > 0)
		{
			for (lc=0;lc<max;lc++)
			{
				//go through all the elments in the array and see if the current list item is eaual to any of the items in the array.
				for (lc1=0;lc1<arrLength;lc1++)
				{
					//alert("going through array value:" + arrValues[lc1]);
					if (document.forms[formname].elements[ListName][lc].value == arrValues[lc1])
						{
							document.forms[formname].elements[ListName][lc].selected = true;
							//break;
						}	
				}
			}
		}
	}
}
function SelectRadioButton(formname,strRadioName,Value)
{
	var RadioName = String(strRadioName)
	var lc = 0;
	var frmcnt;
	frmcnt = document.forms.length
	if (document.forms[formname].elements[RadioName])
	{
		var max = document.forms[formname].elements[RadioName].length;
		if (max > 0)
		{
			for (lc=0;lc<max;lc++)
			{
				if (document.forms[formname].elements[RadioName][lc].value == Value)
					{
						document.forms[formname].elements[RadioName][lc].checked = true;
						//break;
					}	
			}
		}
	}

}

function SelectCheckBoxes(formname,strCheckBoxName,arrValues)
{
	var ChkBoxName = String(strCheckBoxName)
	var lc = 0;
	var lc1 = 0;
	var arrLength = arrValues.length;
	//alert("array length" + arrLength);
	var frmcnt;
	frmcnt = document.forms.length
	if (document.forms[formname].elements[ChkBoxName])
	{
		var max = document.forms[formname].elements[ChkBoxName].length;
		//alert("Chk box length" + max);
		if (max > 0)
		{
			for (lc=0;lc<max;lc++)
			{
				//go through all the elments in the array and see if the current chk box value is eaual to any of the items in the array.
				//if so - check the checkbox. if not leave it alone.
				for (lc1=0;lc1<arrLength;lc1++)
				{
					//alert("going through array value:" + arrValues[lc1]);
					if (document.forms[formname].elements[ChkBoxName][lc].value == arrValues[lc1])
						{
							document.forms[formname].elements[ChkBoxName][lc].checked = true;
							//break;
						}	
				}
			}
		}
	}
}


// This function opens a child window that would be placed in the middle of the
// current parent window.
// This function opens a new window.
function openChildWindow(strURL, iWinHeight, iWinWidth, strWinName, strShowScrollBars) {
	
	var iScreenWidth = screen.width;
	var iScreenHeight = screen.height;
	var iWinLeft = parseInt((iScreenWidth - iWinWidth)/2, 10);
	var iWinTop = parseInt((iScreenHeight - iWinHeight)/2, 10);
	var bShowScrollBars

	bShowScrollBars = "no";

	if (typeof(strShowScrollBars) != "undefined" && strShowScrollBars.toLowerCase() == 'yes') {
		bShowScrollBars = strShowScrollBars.toLowerCase();
	}

	if (strWinName == null) {
		strWinName = "childWin"
	}
	var childWin = window.open(strURL, strWinName, "screenX=" + iWinLeft + ",screenY=" + iWinTop + ",top=" + iWinTop + ",left=" + iWinLeft + ",height=" + iWinHeight + ",width=" + iWinWidth + ",location=no,menubar=no,resizable=yes,status=yes,scrollbars=" + bShowScrollBars + ",titlebar=yes,toolbar=no")
	if ( childWin != null ) {
		if ( childWin.opener == null ) {
	 		childWin.opener = self;
		}
	}
	// ATD-06272002: This is commented because, it was causing error when window opened in http opens a childwindow with https, also the window.open call should take care of what the window.move is trying to do.
	//childWin.moveTo(iWinLeft, iWinTop);

	childWin.focus();
	return(childWin);
}

// This function opens a child window that would be placed in the middle of the
// current parent window.
// This function opens a new window.
// Only difference from previous function is that the new window is created as the child
// of the current window's opener (if it exists).
function openChildWindowFromParent(strURL, iWinHeight, iWinWidth, strWinName, strShowScrollBars) {
	
	var iScreenWidth = screen.width;
	var iScreenHeight = screen.height;
	var iWinLeft = parseInt((iScreenWidth - iWinWidth)/2, 10);
	var iWinTop = parseInt((iScreenHeight - iWinHeight)/2, 10);
	var bShowScrollBars

	bShowScrollBars = "no";

	if (typeof(strShowScrollBars) != "undefined" && strShowScrollBars.toLowerCase() == 'yes') {
		bShowScrollBars = strShowScrollBars.toLowerCase();
	}

	if (strWinName == null) {
		strWinName = "childWin"
	}

	var childWin;
	if (window.opener != null && window.opener.closed == false )
		childWin = window.opener.open(strURL, strWinName, "screenX=" + iWinLeft + ",screenY=" + iWinTop + ",top=" + iWinTop + ",left=" + iWinLeft + ",height=" + iWinHeight + ",width=" + iWinWidth + ",location=no,menubar=no,resizable=yes,status=yes,scrollbars=" + bShowScrollBars + ",titlebar=yes,toolbar=no")
	else
		childWin = window.open(strURL, strWinName, "screenX=" + iWinLeft + ",screenY=" + iWinTop + ",top=" + iWinTop + ",left=" + iWinLeft + ",height=" + iWinHeight + ",width=" + iWinWidth + ",location=no,menubar=no,resizable=yes,status=yes,scrollbars=" + bShowScrollBars + ",titlebar=yes,toolbar=no")


	if ( childWin != null ) {
		if ( childWin.opener == null ) {
	 		childWin.opener = self;
		}
	}
	// ATD-06272002: This is commented because, it was causing error when window opened in http opens a childwindow with https, also the window.open call should take care of what the window.move is trying to do.
	//childWin.moveTo(iWinLeft, iWinTop);

	childWin.focus();
	return(childWin);
}

// This function loads the parent window with the specified URL and 
// closes the current child window.
function loadParentNClose(strParentURL) {
	var parWin  = self.opener;
	
	if (typeof(parWin) == "object" && !parWin.closed) {
		if (strParentURL != null)
			parWin.location.href = strParentURL;
		parWin.focus();
	}
	self.close();
	return;
}

//this function refreshes the parent window of a child window without closing the child window.
function refreshParent()
{
	//alert("Hello");
	var parWin  = self.opener;
	var strParentURL = parWin.location.href;
	//alert(strParentURL);
	if (typeof(parWin) == "object" && !parWin.closed) {
		if (strParentURL != null)
			parWin.location.href = parWin.location.href;
	}
	return;
}

function round(number,X) {
// rounds number to X decimal places, defaults to 2
X = (!X ? 2 : X);
return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

function Comma(number) 
{
	number = '' + number;
	if (number.length > 3) 
	{
		var mod = number.length % 3;
		var output = (mod > 0 ? (number.substring(0,mod)) : '');
		for (i=0 ; i < Math.floor(number.length / 3); i++)
		{
		if ((mod == 0) && (i == 0)) output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
		else output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
		}
		return (output);
	}
	else return number;
}

// This function validates that a provided email string is of the format: x@y.z
function validateEmail(strEmail) {
	
	var re, arrEmail
	re = /..*\@..*\...*/;
	arrEmail = re.exec(strEmail);
	if (arrEmail == null)
		return false;
	else
		return true;
} 


// This function checks to see if a specified parameter passed,
// is a number or not
function isNumber(strValue)
{
	
	var iLoop, strNum, curChar
	
	strNum = "0123456789"
	
	for(iLoop = 0; iLoop < strValue.length; iLoop++)
	{
		curChar = strValue.substring(iLoop, iLoop + 1)
		if (strNum.indexOf(curChar) == -1)
		{
			return(false);
		}
	}
	
	return(true)
}


// This function checks to see if a specified parameter passed,
// is a formatted number or not
function isFormattedNumber(strValue)
{
	
	var iLoop, strNum, curChar
	
	strNum = "0123456789,"
	
	for(iLoop = 0; iLoop < strValue.length; iLoop++)
	{
		curChar = strValue.substring(iLoop, iLoop + 1)
		if (strNum.indexOf(curChar) == -1)
		{
			return(false);
		}
	}
	
	return(true)
}

// This function formats a given number by adding commas in the appropriate place.
function FormatNum(iNumber) {
	var iIndex, iMaxIndex, iFormattedNumber, iModLength
		
	iFormattedNumber = ""
	if (iNumber != "") {
		iNumber = iNumber.replace(/,/g, "")
		iModLength = iNumber.length % 3
		if (iModLength != 0) { 
			iFormattedNumber = iNumber.substr(0, iModLength) + ","
			iNumber = iNumber.substr(iModLength);
		}
		iMaxIndex = iNumber.length / 3;
		for (iIndex = 0; iIndex < iMaxIndex; iIndex++) {
			iFormattedNumber = iFormattedNumber + iNumber.substr(0, 3) + ","
			iNumber = iNumber.substr(3);
		}
		iFormattedNumber = iFormattedNumber.substr(0, iFormattedNumber.length - 1)
	}
	return(iFormattedNumber);
}	

// This function removes the formatting(commas) in a number, if it exists
function UnformatNum(iNumber) {
	
	var iUnformattedNumber
	
	iUnformattedNumber = ""
	if (iNumber != ""){
		iUnformattedNumber = iNumber.replace(/,/g, "")
	}
	return(iUnformattedNumber);
}

// This function checks to see if the parameter passed is a valid dollar amount
// with up to decimal places.
function isValidDollarAmount(strDollarsNCents) {
	
	var re, arrDollar;
	
	re = /^\d*(\.\d{1,2})?$/;

	if (re.test(strDollarsNCents))
		return true;
	else
		return false;
}

// This function checks to see if a zipcode passed is valid, based on the country.
function isValidZipcode(strZipcode, strCountry) {

	var re;
	var returnFlag = false;
	switch(strCountry) {
		case "US":
			re = /^\d{5}(-\d{4})?$/;
			break;
		case "CA":
			re = /^[a-z][\d][a-z][\s]?[\d][a-z][\d]$/i;
			break;
		default:
	}
	
	if (re.test(strZipcode))
		returnFlag = true;
		
	return(returnFlag);
}

//+----------------------------------------------------------------------------
//
//  Function:       MaskPhone
//
//  Description:    Takes the innerText or value of the tag (depending on the
//                  type of tag), and formats it as a 7 or 10 digit phone number.
//
//  Arguments:      sValue - innerText or value of the tag
//
//  Returns:        "" (empty string) if sValue is an empty string
//                  sNewValue - parsed and formatted phone number
//
//-----------------------------------------------------------------------------

function MaskPhone(sValue)
{
    var sNewValue = sValue;
    var iLength = 7;
    
    
    //  Parse out applicable characters by calling ParseChar()
    var zChar = new Array(' ', '(', ')', '-', '.');
    sNewValue = ParseChar(sNewValue, zChar);
 
    //  Determine if this is a 7 or 10 digit phone number
    if (sNewValue.length == 7);
    else if (sNewValue.length == 10) iLength = 10;
    else if (sNewValue.length == 0) return "";
    else if (sNewValue.length < 7)
    {
        while (sNewValue.length < 7) sNewValue += "0";
        sNewValue = "";
        
    }
    else if (sNewValue.length < 10)
    {
        sNewValue = sNewValue.substring(0,7);
        sNewValue = "";
    }
    else if (sNewValue.length > 10)
    {
        iLength = 10;
        
        if (sNewValue.charAt(0) == "1" && sNewValue.length == 11)
        {
            sNewValue = sNewValue.substring(1,11);
        }
        
        else sNewValue = sNewValue.substring(0,10);
        sNewValue = "";
    }
    
    if (sNewValue != "") {
    	//  Call FormatPhone() to apply formatting
		sNewValue = FormatPhone(sNewValue,iLength);
	};
    
    return sNewValue;
}


//+----------------------------------------------------------------------------
//
//  Function:       FormatPhone
//
//  Description:    Adds the proper formatting for a phone number (either 7 or
//                  10 digits) to a string of numbers passed in.
//
//  Arguments:      sPhone - a 7 or 10 digit string of numbers
//                  iLength - the desired phone number length
//
//  Returns:        sNewPhone - the formatted phone number
//
//-----------------------------------------------------------------------------

function FormatPhone(sPhone, iLength)
{
    var sNewPhone = "";

    if (iLength == 7)
    {
        sNewPhone = sPhone.substring(0,3) + "-" + sPhone.substring(3,7);
    }
    if (iLength == 10)
    {
        sNewPhone = "(" + sPhone.substring(0,3) + ") " + sPhone.substring(3,6)
            + "-" + sPhone.substring(6,10);
    }

    return sNewPhone;
}

//+----------------------------------------------------------------------------
//
//  Function:       ParseChar
//
//  Description:    This function takes a string and parses out certain
//                  characters.  The characters to be parsed out are passed in
//                  as a string or as a array.
//
//  Arguments:      sStr - The string intended to be parsed
//                  sChar - A string or array of characters to be parsed out
//                      of sStr
//
//  Returns:        sNewStr - The rebuilt (parsed) string
//
//-----------------------------------------------------------------------------

function ParseChar(sStr, sChar)
{
    //  If sChar is a string, create an array to hold it
    if (sChar.length == null) 
    {
        zChar = new Array(sChar);
    }
    else zChar = sChar;
    
    //  Iterate through the array, removing each character from the string
    for (i=0; i <= zChar.length; i++)
    {
        sNewStr = "";
    
        var iStart = 0;
        var iEnd = sStr.indexOf(sChar[i]);
    
        while (iEnd != -1)
        {
            sNewStr += sStr.substring(iStart, iEnd);
            iStart = iEnd + 1;
            iEnd = sStr.indexOf(sChar[i], iStart);
        }
        sNewStr += sStr.substring(sStr.lastIndexOf(sChar[i]) + 1, sStr.length);
        
        sStr = sNewStr;
    }
    
    return sNewStr;
}

// this function validates a given Date string (in 'yyyy/mm/dd' or 'mm/dd/yyyy' format) and returns true or false
function validateDate(sDate, sDateFormat)
{

	var oDate, oNewDate, re, arrDate, arrMonthDays, iDay, iMonth, iYear;
	var iDayIndex, iMonthIndex, iYearIndex;
	
	if (sDateFormat == null)
		sDateFormat = "yyyymmdd";
		
	switch(sDateFormat.toLowerCase()) {
		case "yyyymmdd":
			re = /(\d\d\d\d)\/(\d\d{0,1})\/(\d\d{0,1})/;
			iYearIndex = 1;
			iMonthIndex = 2;
			iDayIndex = 3;
			break;
		case "mmddyyyy":
			re = /(\d\d{0,1})\/(\d\d{0,1})\/(\d\d\d\d)/;
			iYearIndex = 3;
			iMonthIndex = 1;
			iDayIndex = 2;
			break;
		
	}
	
	arrDate = re.exec(sDate);
	if (arrDate == null)
	{
		return false;
	}
				
	iDay =  parseInt(arrDate[iDayIndex], 10);
	iMonth =  parseInt(arrDate[iMonthIndex], 10);
	iYear =  parseInt(arrDate[iYearIndex], 10);
	arrMonthDays = new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
				
	if ((iMonth <= 0 || iMonth > 12) ||
		(iDay <= 0 || iDay > arrMonthDays[iMonth - 1]) ||
		(iYear <= 0))
	{
		return false;
	}
				
	// check for leap years
	if (iMonth == 2 && iDay == 29)
	{
		if ((iYear % 4 != 0) ||
			((iYear % 100 == 0) && (iYear % 400 != 0)))
			return false;
						
	}
	return true;
}  


// this function reformats the supplied 'strDate' parameter (in yyyy/mm/dd) to 
// a format specified in the 'strtDateFormat' parameter.
function fixDate(strDate, strFromDateFormat, strToDateFormat)
{
	var arrDate, strDateYear, strDateMonth, strDateDay, dtCurrent, strCurrentYearPrefix;
	var iYearIndex, iMonthIndex, iDayIndex;
	
	switch(strFromDateFormat) {
		case "yyyymmdd":
			iYearIndex = 0;
			iMonthIndex = 1;
			iDayIndex = 2;
			break;
		case "mmddyyyy":
			iYearIndex = 2;
			iMonthIndex = 0;
			iDayIndex = 1;
			break;
	}
			
	arrDate = strDate.split("/");
	strDateYear = arrDate[iYearIndex];
	strDateMonth = arrDate[iMonthIndex];
	strDateDay = arrDate[iDayIndex];
	
	if (strDateMonth.length == 1)
		strDateMonth = "0" + strDateMonth;
	if (strDateDay.length == 1)
		strDateDay = "0" + strDateDay;
	if (strDateYear.length == 2) {
		dtCurrent = new Date();
		strCurrentYearPrefix = substr(dtCurrent.getFullYear(), 0, 2);
   		strDateYear = strCurrentYearPrefix + strDateYear
	}
	
	switch(strToDateFormat.toLowerCase()) {
		case "yyyymmdd":
			return(strDateYear + "/" + strDateMonth + "/" + strDateDay);
			break;
		case "mmddyyyy":
			return(strDateMonth + "/" + strDateDay + "/" + strDateYear);
			break;
	}
	
}


// this function compares the  'strDate1' and  'strDate2' parameters, using the
// 'strOperator' value.
function isDateSetValid(strDate1, strDate2, strOperator, strDateFormat)
{
	var arrDate1, arrDate2, objDate1, objDate2, nDate1, nDate2, bResult
	var iYearIndex, iMonthIndex, iDayIndex

	bResult = false

	arrDate1 = strDate1.split("/");
	arrDate2 = strDate2.split("/");

	switch(strDateFormat) {
		case "mmddyyyy":
			iYearIndex = 2;
			iMonthIndex = 0;
			iDayIndex = 1;
			break;
		case "yyyymmdd":
			iYearIndex = 0;
			iMonthIndex = 1;
			iDayIndex = 2;
			break;
	}


	objDate1 = new Date(arrDate1[iYearIndex], arrDate1[iMonthIndex], arrDate1[iDayIndex]);
	objDate2 = new Date(arrDate2[iYearIndex], arrDate2[iMonthIndex], arrDate2[iDayIndex]);
	nDate1 = parseInt(Date.parse(objDate1), 10);
	nDate2 = parseInt(Date.parse(objDate2), 10);

	bResult = eval("nDate1 " + strOperator + " nDate2");

	return bResult;
}

//This Function accepts a flash file and launches that flash file in a new window.
function ShowFlashWin(strFlashFile){
	var childWin;
	var strFlashFilePath;
	
	if (strFlashFile.length > 0){
		strFlashFilePath = "content/flashfiles/howcarsworkMovie.asp?flashfile=" + strFlashFile;
	}
	else {
		alert("Unable to load the movie. Please try again.");
		return;
	}
	childWin = openChildWindow(strFlashFilePath, 450, 600);
}


function adjustImgSize(maxwidth) {
	if(document.logo)
	{
	  if(document.logo.width >= maxwidth){
	  	document.logo.width = maxwidth;
	  }
	}
}


function popUp(URL) {
	var name = 'terms';
	var features = 'resizable, width=620, height=410';
	window.open(URL, name, features);
	return false;
}


//Returns the very first window opener.
function findTopParentWindow(varWindow)
{

	if (varWindow == null || varWindow.closed)
	{
		return null;
	}
	else
	{
		if (varWindow.opener == null)
		{
			return varWindow;
		}
		else
		{
			return findTopParentWindow(varWindow.opener);
		}
	}
}

function help_onmousemove(objdiv, objthis, sText)
{
	var divwidth, divheight;
	var oRect, i;
	var aCombos = document.body.all.tags("SELECT");
	if (objdiv.style.visibility == "hidden")
	{
		objdiv.noWrap = true;
		objdiv.innerHTML = sText;
		objdiv.style.visibility = "visible";
		if (objdiv.offsetWidth > 225)
		{
			objdiv.style.width = 225;
			objdiv.noWrap = false;
		}
	}

	objthis.style.zIndex = 1;
	objdiv.style.zIndex = 2;
	divheight = objdiv.offsetHeight;
	divwidth = objdiv.offsetWidth;

	if (document.body.clientWidth < (divwidth + window.event.x + 16))
	{
		objdiv.style.left = window.event.x - divwidth + window.document.body.scrollLeft - 10;
		if (document.body.clientHeight < (divheight + window.event.y))
		{
			objdiv.style.top = document.body.clientHeight - divheight + window.document.body.scrollTop;
		} else {
			objdiv.style.top = window.event.y + window.document.body.scrollTop;
		}
	} else { 
		objdiv.style.left = window.event.x + window.document.body.scrollLeft + 16;
		if (document.body.clientHeight < (divheight + window.event.y))
		{
			objdiv.style.top = document.body.clientHeight - divheight + window.document.body.scrollTop;
		} else {
			objdiv.style.top = window.event.y + window.document.body.scrollTop;
		}
	}

	for(i = 0; i < aCombos.length;i++)
	{
		oRect = aCombos[i].getClientRects();
		if (((objdiv.style.posTop) <= (oRect[0].bottom + window.document.body.scrollTop)) && ((objdiv.style.posTop + objdiv.clientHeight) >= (oRect[0].top + window.document.body.scrollTop)) && (((objdiv.style.posLeft) <= (oRect[0].right + window.document.body.scrollLeft))))// && ((objdiv.style.posLeft + objdiv.clientWidth) >= (oRect[0].left + window.document.body.scrollLeft))))
		{
			aCombos[i].style.visibility = "hidden";
		}
	}
}

function help_onmouseout(objdiv, objthis)
{
	var i;
	var aCombos = document.body.all.tags("SELECT");
	for(i = 0; i < aCombos.length; i++)
	{
		aCombos[i].style.visibility = "visible";
	}
	objdiv.innerHTML = "";
	objdiv.style.top = 0;
	objdiv.style.left = 0;
	objdiv.style.width = 0;
	objdiv.style.visibility = "hidden";
}

function GetCurrentText(fldName)
//returns the current test selection in the HTML element.
//For list & drop downs, returns the currently selected item's text sperated by commas.
//For checkboxes, radio buttons returns the innerText of the check box or radio selected.
//NOTE: FOR THIS TO WORK THE text for the check box or radio MUST be surounded by 
// span tags with the id attribute being the fldName + value of the radio/check box.
//For Text boxes, text areas, returns the current text.

//For buttons returns the value as well.
{
	var strRtnValue;
	var oFld;
	var oTempFld;
	var count;
	var intSelectedIndex;
	var i;
	var strTempSpanName;
	var chrSeparator;
	
	chrSeparator = "|"
	
	strRtnValue = new String("");
	oFld = FindObj(fldName);
	
	//alert('length=' + oFld.length);
	
	if (oFld.tagName != undefined) 
		{
		//alert("control");
		oTempFld = oFld;
		}
	else 
		{
		oTempFld = oFld[0]
		//alert("array");
		}
		
	switch (oTempFld.type)
    {
		case "select-one":
			intSelectedIndex = oFld.selectedIndex;
			strRtnValue = oFld.options[intSelectedIndex].text;
			return strRtnValue;
			break;
		case "select-multiple":
			count = oFld.length;
			for (i=0;i<count;i++){
				if (oFld.options[i].checked) 
				{
					if (strRtnValue.length==0)
					{strRtnValue = oFld.options[i].text;}
					else
					{strRtnValue = strRtnValue + chrSeparator + oFld.options[i].text;}
				}
			}	
			return strRtnValue;
			break;
		case "radio":
			count = oFld.length;
			for (i = 0; i < count; i++) {
				if (oFld[i].checked)
				{
					strTempSpanName = fldName + oFld[i].value;
					if (strRtnValue.length==0)
					{strRtnValue = FindObj(strTempSpanName).innerText;}
					else
					{strRtnValue = strRtnValue + chrSeparator + FindObj(strTempSpanName).innerText;}
				}
			}
			return strRtnValue;
			break;
		case "checkbox":
			count = oFld.length;
			for (i = 0; i < count; i++) {
				if (oFld[i].checked)
				{
					strTempSpanName = fldName + oFld[i].value;
					if (strRtnValue.length==0)
					{strRtnValue = FindObj(strTempSpanName).innerText;}
					else
					{strRtnValue = strRtnValue + chrSeparator + FindObj(strTempSpanName).innerText;}
				}
			}
			return strRtnValue;
			break;
		default:
			return oFld.value;
	}
}
//Launches centered window
//Called from OpStatsView and ITBudgetView
function launchCenter(url, name, height, width) {
  var str = "menubar=no,scrollbars=yes,height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  return window.open(url, name, str);
}


