<!--
	/*
		DHTML_main.js include file.
		Written			: 20011107 by James Austin.
		Last Updated	: 20021227 - Changed the method of relative values, and the method of passing the parameters to the function
						  20011212 - doElementEffects() now accepts relative values for parameters
		Current Version	: 3.1
		
		Purpose:
		This code forms the core of client-side DHTML routines.  The first part performs a capability
		test on the browser, and sets the syntax for performing DHTML commands.  If the browser isn't 
		DHTML capable, this is recorded here also.

		The "doElementEffects()" function is the heart of the system.  This perfoms the changes to given 
		elements properties.

		Dependants:
		None
	*/


	// find out what the capabilities of the browser are.
	var strLeft;
	var strRight;
	var blnDHTMLOk = true;
	
	if (document.getElementById) {
		strLeft = 'document.getElementById("';
		strRight = '").style.';
	}
	else if (document.all) {
		strLeft = 'document.all("';
		strRight = '").style.';
	}
	else if (document.layers) {
		strLeft = 'document.layers["';
		strRight = '"].';
	}
	else {
		/*
			browser doesn't support DHTML.  Note: we could've tested strLeft and strRight being
			equal to "".  However, from a readability point of view, blnDHTMLOk makes more sense!
		*/
		blnDHTMLOk = false;
	}
	// --- end of browser capability test ---


	function doElementEffects(strList) {
		/*
			Changes the style properties of given elements.  Accepts single/multiple values

			PARAMETERS:
			strList, (string) = string containing either single values for element,property,value or semicolon separated blocks of values.

			NOTE: The values can be absolute and/or relative.  Relative values should be indicated by 
			prefixing the value with a "+" or a "-" sign.  e.g. to add 300px to the left property of
			an element, you would pass the value as "+300".  To remove 300, pass "-300".
		*/
		if (blnDHTMLOk && typeof strList == 'string' && strList != '' && strList != null) {

			// create the arrays to hold the semi-colon separated blocks, (if applicable)
			var arrElementBlocks = strList.split(";");
			var arrElementSet;
			var intTempVal;

			for (var i in arrElementBlocks) {

				// Split the single blocks of "name,property,value" into an array
				arrElementSet = arrElementBlocks[i].split(",");

				if (arrElementSet.length == 3) {	// we must have an array containing 3 elements
				
					if (arrElementSet[1] == "visibility" && document.layers) {
						/*
							NS4 has different values for the "visibility" property to the DOM1 syntax used by other browsers.
							This code converts the DOM1 syntax values if we're running on NS4.
						*/
						if (arrElementSet[2] == "visible") {
							arrElementSet[2] = "show";
						}
						else if (arrElementSet[2] == "hidden") {
							arrElementSet[2] = "hide";
						}
					}

					// Check if the value is relative
					if (arrElementSet[2].charAt(0) == "+" || arrElementSet[2].charAt(0) == "-") {
						
						// Convert the new value into an integer
						arrElementSet[2] = parseInt(arrElementSet[2]);
						
						// Convert the existing value into an integer
						intTempVal = parseInt(eval(strLeft + arrElementSet[0] + strRight + arrElementSet[1]));
						if (isNaN(intTempVal)) {	// Just in case the string won't convert to an int
							intTempVal = 0;
						}
						// add the two results together
						arrElementSet[2] += intTempVal;
					}

					eval(strLeft + arrElementSet[0] + strRight + arrElementSet[1] + " = '" + arrElementSet[2] + "'");
				}
			}
		}
	}
	
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}	
	
//-->