//alert("scripts loaded");

function MaxOrMin(fieldName) {
field = eval("document.mainform." + fieldName);
if (field.value == "true") field.value = "false";
else field.value="true";
document.mainform.last_expanded.value = fieldName;
document.mainform.submit();
}

function expandOnly(fieldName) {
field = eval("document.mainform." + fieldName);
if (field.value == "false")
{
field.value = "true";
document.mainform.last_expanded.value = fieldName;
document.mainform.submit();
}
}

function submitForm(fieldName) {
document.mainform.last_expanded.value = fieldName;
document.mainform.submit();
}



function spinUp(maximum, increment, form, fieldName) {

field = eval("document." + form + "." + fieldName);
fieldValue = parseFloat(field.value);
test = (fieldValue * 100)  + (increment*100);

if(test/100 <= maximum) {
test = test/100;
testString = test.toString();


// if there is a decimal point, then split up string
if(testString.indexOf('.')!= -1) {

testStringPairs = testString.split('.');
firstValue = testStringPairs[0];
secondValue = testStringPairs[1];




if(secondValue.length > 1) {
secondValue = secondValue.substring(0,1);

secondValue ++;
}

field.value= firstValue + "." + secondValue;
}

if(testString.indexOf('.')== -1) {
field.value = testString;
}

}
}

function spinDown(minimum, increment, form, fieldName) {

field = eval("document." + form + "." + fieldName);
fieldValue = parseFloat(field.value);
test = (fieldValue * 100)  - (increment*100);

if(test/100 >= minimum) {
test = test/100;
testString = test.toString();


// if there is a decimal point, then split up string
if(testString.indexOf('.')!= -1) {

testStringPairs = testString.split('.');
firstValue = testStringPairs[0];
secondValue = testStringPairs[1];



if(secondValue.length > 1) {
secondValue = secondValue.substring(0,1);
secondValue ++
}

field.value= firstValue + "." + secondValue;
}

if(testString.indexOf('.')== -1) {
field.value = testString;
}

}
}




bVersion = parseFloat(navigator.appVersion); 	// get non-rounded version number (eg. "3.01")
	bName = navigator.appName;						// name, (eg. "Netscape")
	bUserAgent = navigator.userAgent;				// user agent, as reported to web server
	bPlatform = "";									// will store platform

	// local object that we'll treat as an array. we don't use the Array class
	// because array objects aren't available in javascript 1.0 and we want max compatibility
	var platformFinder = new Object();

	// store all the platform strings we want to match against in the array
	platformFinder[0] = navigator.appVersion.indexOf("Windows NT 5.0");		// this is win2000
	platformFinder[1] = navigator.appVersion.indexOf("WinNT");
	platformFinder[2] = navigator.appVersion.indexOf("Windows NT");			// this is winNT4 w/ie5
	platformFinder[3] = navigator.appVersion.indexOf("Mac");
	platformFinder[4] = navigator.appVersion.indexOf("95");
	platformFinder[5] = navigator.appVersion.indexOf("Win16");
	platformFinder[6] = navigator.appVersion.indexOf("98");
	platformFinder.length = 7;		// manually set the array length to stay js1.0 compliant

	// store human readable platform names in another array (these match platformFinder)
	platformName = new Object();
	platformName[0] = "Windows 2000 (aka NT 5)";
	platformName[1] = "Windows NT";
	platformName[2] = "Windows NT";
	platformName[3] = "Macintosh";
	platformName[4] = "Windows 95";
	platformName[5] = "Windows 3.1";
	platformName[6] = "Windows 98";


	// check if the users' platform matches any of the platforms we're looking for. if yes,
	// set "bPlatform" to the corresponding human-readable name.
	var i = 0;
	while (i < platformFinder.length) {
		if (platformFinder[i] != -1) {
			bPlatform = platformName[i];
			break;
		}
		i++;
	}



if(bName=="Microsoft Internet Explorer" && bPlatform=="Macintosh") {
	thisPlatform = "ieMac";
}
else {
	thisPlatform = "notIEMac";
}


function goToExpanded(newLocation) {

if(thisPlatform!="ieMac") {
javascript:document.location.hash=newLocation;
}
}



