

function getStyleSheetProperty(ruleName,propertyName)
{
	var index;
	var index1;
	value = null;

	if (document.styleSheets) {
		styleSheetIndex = 0;
		ruleIndex = 0;

		for(index = 0; index < document.styleSheets.length; index++) {
			if (document.styleSheets[index] != null) {
				if (document.styleSheets[index].cssRules == null) {
					for(index1 = 0; index1 < document.styleSheets[index].rules.length; index1++) {
						selectorText = document.styleSheets[index].rules[index1].selectorText; 
						if (selectorText.toLowerCase() == ruleName.toLowerCase()) {
						   value = eval('document.styleSheets[' + index + '].rules[' + index1 + '].style.' + propertyName);
						   break;
						}
					}
				} else {
					for(index1 = 0; document.styleSheets[index].cssRules[index1] != null; index1++) {
						selectorText = document.styleSheets[index].cssRules[index1].selectorText; 
						if (selectorText.toLowerCase() == ruleName.toLowerCase()) {
						   value = eval('document.styleSheets[' + index + '].cssRules[' + index1 + '].style.' + propertyName);
						   break;
						}
					}
				}
			}
		}
	}

	return value;
}

function setStyleProperty(objectName,propertyName,theValue)
{
   return eval(objectName + '.style.' + propertyName + '=\"' + theValue + '\"');
}

function getStyleProperty(objectName,propertyName)
{
	return eval(objectName + '.style.' + propertyName);
}

function getPropertyQuantity(propertyValue)
{
	var index;
	var index1;
	endIndex = -1;
	qtyString = null;
	
	for (index = 0; index < propertyValue.length; index++) {
		valueCharacter = propertyValue.charAt(index);
		if (!(valueCharacter == ' ' || valueCharacter == '.' || valueCharacter == '-' || 
		    (valueCharacter >= '0' && valueCharacter <= '9'))) {
			endIndex = index;
			break;
		}
	}
	
	if (endIndex >= 0) {
		qtyString = propertyValue.substring(0, endIndex);
		qtyString = qtyString.replace(' ', '');
	}
	
    return qtyString;
}

function getPropertyUnit(propertyValue)
{
	var index;
	var index1;
	startIndex = -1;
	unitString = null;
	
	for (index = 0; index < propertyValue.length; index++) {
		valueCharacter = propertyValue.charAt(index);
		
		if (!(valueCharacter == ' ' || valueCharacter == '.' || valueCharacter == '-' || 
		    (valueCharacter >= '0' && valueCharacter <= '9'))) {
			startIndex = index;
			break;
		}
	}
	
	if (startIndex >= 0) {
		unitString = propertyValue.substring(startIndex, propertyValue.length);
		unitString = unitString.replace(' ', '');
	}
	
    return unitString;
}
