// start info
if(typeof jsReport != 'undefined'){
	jsVersion = new Array(
	/*Name			=*/ 'Easy Styles',
	/*Version 		=*/ '1.1',
	/*Date 			=*/ 20030127,
	/*Author		=*/ 'Maurice van Creij',
	/*ProjectCode	=*/ 'l1_easystyles',
	/*Summary		=*/ 'Easily define and manipulate styles and classes without the hassle of browser specific code',
	/*Dependencies	=*/ new Array('easystyles.js','browsercheck.js'),
	/*Browsers		=*/ new Array('NS','MO','IE','OP'),
	/*Changes		=*/ new Array(
						'1.1: new functions "setClassNameTerm()" and "getClassNameTerm()" to change classnames which are formatted with valiables and values. (ie. class=0 and state=1 in "class0state1")',
						'1.0: Split off code style-specific branch from "easylayers.js"'
					  	),
	/*Usage			=*/ new Array(
						'<script language="javascript" src="easystyles.js"></script>',
						'<script language="javascript">',
						'<!--',
						'	setClassName(strId,strClass,fltFade)',
						'//-->',
						'</script>'
					  	)
	)
}else{
// end info


	// configuration/constants
		var booFaderEnabled = ie && v6 && !mc;
		var fltFadeDef = 0.0;

	
	// primary functions - functionality
		// quick style changes
			function setColour(strId,objColour,fltFade){
				if(dom){
					// apply the new properties only if there's a change to the old properties
					if(document.getElementById(strId).style.color!=objColour){
						// initiate the fader-filter
						setFade(strId,false,fltFade);
						// the new properties
						document.getElementById(strId).style.color=objColour;
						// activate the fader-filter
						setFade(strId,true,fltFade);
					}
				}else if(ie && !dom){
					// the real object
					objId = eval(strId);
					// the new properties
					objId.style.color = objColour;
				}else if(ns){
					// I wish
				}
			}
			
			function setBackgroundColour(strId,objColour,fltFade){
				if(dom){
					if(document.getElementById(strId).style.backgroundColor!=objColour){
						setFade(strId,false,fltFade);
						document.getElementById(strId).style.backgroundColor=objColour;
						setFade(strId,true,fltFade);
					}
				}else if(ie && !dom){
					objId = eval(strId);
					objId.style.backgroundColor = objColour;
				}else if(ns){
					// I wish
				}
			}
			
			function setDisplay(strId,objState,fltFade){
				if(objState){
					if(ie){styleSetting="inline"}else{styleSetting=""}
				}else{
					styleSetting="none"
				}
				
				if(dom){
					if(document.getElementById(strId).style.display!=styleSetting){
						setFade(strId,false,fltFade);
						document.getElementById(strId).style.display = styleSetting;
						setFade(strId,true,fltFade);
					}
				}else if(ie && !dom){
					objId = eval(strId);
					objId.style.display = styleSetting;
				}else if(ns){
					// I wish
				}
			}
	
			function setVisibility(strId,objState,fltFade){
				if(objState){styleSetting="visible"}else{styleSetting="hidden"}
				if(dom){
					if(document.getElementById(strId).style.visibility!=styleSetting){
						setFade(strId,false,fltFade);
						document.getElementById(strId).style.visibility = styleSetting;
						setFade(strId,true,fltFade);
					}
				}else if(ie && !dom){
					objId = eval(strId);
					objId.style.visibility = styleSetting;
				}else if(ns){
					if(objState){styleSetting="show"}else{styleSetting="hide"}
					objId = eval('document.'+strId);
					objId.visibility = styleSetting;
				}
			}

		// manipulate classnames
			// change the class-name assigned to an Id
			function setClassName(strId,strClass,fltFade){
				if(dom){
					// apply the new properties only if there's a change to the old properties
					if(document.getElementById(strId).className!=strClass){
						// initiate the fader-filter
						setFade(strId,false,fltFade);
						// the new properties
						document.getElementById(strId).className=strClass;
						// activate the fader-filter
						setFade(strId,true,fltFade);
					}
				}else if(ie && !dom){
					// the real object
					objId = eval(strId);
					// the new properties
					objId.className = strClass;
				}else if(ns){
					// I wish
						//objId = eval('document.'+strId);
						//objId.className = strClass;
				}
			}
			
			// fetch the class-name
			function getClassName(strId){
				var strClass = '';
				if(dom){
					// the class name
					strClass = document.getElementById(strId).className;
				}else if(ie && !dom){
					// the real object
					objId = eval(strId);
					// the class name
					strClass = objId.className;
				}else if(ns){
					// I wish
						//objId = eval('document.'+strId);
						//strClass = objId.className;
				}
				return strClass;
			}
			
			// fetches the last (digit) character of a class-name
			function getClassSuffix(strId){
				// get the class
				strClass = getClassName(strId);
				// split the base name
				strClassName = strClass.substr(0,strClass.length-1);
				// split the state
				strClassState = strClass.substr(strClass.length-1,1) * 1;
				// return the split pieces
				return new Array(strClassName,strClassState);
			}
			
			// changes the last (digit) character of a class-name
			function setClassSuffix(strId,intStateOffset,booOffset,fltFade){
				// get the current state
				arrClass = getClassSuffix(strId);
				// check if it's an offset or an absolute value
				if(typeof booOffset == 'undefined') booOffset = false;
				if(!booOffset) arrClass[1] = 0;
				// add the state offset to the current one
				intClassState =  intStateOffset + arrClass[1];
				// apply the new class
				setClassName(strId,arrClass[0]+intClassState,fltFade);
			}
			
			// splits a classname up in variables with numeric values
			function getClassNameTerms(strId){
				var arrTerms = new Array();
				var intTermId = -1;
				var tglNewChar = 0;
				var tglPrevChar = 1;
				// get the class name of the object
				strClassName = getClassName(strId);
				// for all characters in the string
				for(var intA=0; intA<strClassName.length; intA++){
					// cut the current character from the string
					strChar = strClassName.substr(intA,1);
					// is it a letter or a digit
					tglNewChar = (strChar>="0"&&strChar<="9")?1:0;
					// was the last character not the same class
					if(tglPrevChar==1 && tglNewChar==0){
						// switch to a new array field
						intTermId += 1;
						arrTerms[intTermId] = new Array('','');
					}
					// add character to the current array field
					arrTerms[intTermId][tglNewChar] += strChar;
					// remember the last character class
					tglPrevChar = tglNewChar;
				}
				// pass back all values in an array
				return arrTerms;
			}
			
			// returns the value of a given "variable" contained in a classname (ie. class=0 and state=1 in "class0state1")
			function getClassNameTerm(strId,strTerm){
				var intValue = 0;
				// get all terms
				arrTerms = getClassNameTerms(strId);
				// get the requested term
				for(var intA=0; intA<arrTerms.length; intA++){
					if(strTerm==arrTerms[intA][0]) intValue = arrTerms[intA][1] * 1;
				}
				// pass back the value
				return intValue;
			}
			
			// sets the value of a given "variable" contained in a classname (ie. class=0 and state=1 in "class0state1")
			function setClassNameTerm(strId,strTerm,intValue,fltFade){
				var strNewClassName = '';
				// split off the requested term
				arrTerms = getClassNameTerms(strId);
				// construct a new classname
				for(var intA=0; intA<arrTerms.length; intA++){
					// term name
					strNewClassName += arrTerms[intA][0];
					// term value
					if(strTerm==arrTerms[intA][0]){
						// the new one
						strNewClassName += intValue;
					}else{
						// or the old one
						strNewClassName += arrTerms[intA][1];
					}
				}
				// change the class of the object
				setClassName(strId,strNewClassName,fltFade);
			}
		
		// image object changing
			// caches an image URL as an object
			function cacheImage(objImageName,objImageSource){
				eval(objImageName + "= new Image(0,0);");
				eval(objImageName + ".src = '" + objImageSource + "';");
			}
			
			// changes the (cached) background image
			function setBackgroundImage(strId,objImageName,fltFade){
				objImage = eval(objImageName);
				if(dom){
					if(document.getElementById(strId).style.backgroundImage!=objImage.src){
						setFade(strId,false,fltFade);
						document.getElementById(strId).style.backgroundImage= "url("+objImage.src+")";
						setFade(strId,true,fltFade);
					}
				}else if(ie && !dom){
					objId = eval(strId);
					objId.background = objImage.src;
				}else if(ns){
					// I wish
				}
			}
			
			// changed the (cached) image object
			function setForegroundImage(imgDocId,objImageName,layerName,fltFade) {
				objImage = eval(objImageName);
				if(ns && layerName!=-1){
					eval("document."+layerName+".document.images['"+imgDocId+"'].src = objImage.src");
				}else{
					if(document.images[imgDocId].src!=objImage.src){
						setFade(document.images[imgDocId],false,fltFade);
						document.images[imgDocId].src = objImage.src;
						setFade(document.images[imgDocId],true,fltFade);
					}
				}
			}
			
		
	// secondary functions - construction
		// set the innerHTML of an object
		function setContent(strId,objContent,fltFade){
			if(dom){
				if(document.getElementById(strId).innerHTML!=objContent){
					document.getElementById(strId).innerHTML = objContent;
				}
			}else if(ie && !dom){
				objId = eval(strId);
				objId.innerHTML=objContent;
			}else if(ns){
				objId = eval('document.'+strId);
				objId.document.open();
				objId.document.write(objContent);
				objId.document.close();
			}	
		}
		
		// change the dimensions of an object
		function setDimensions(strId,objWidth,objHeight){
			if(dom){
				if(document.getElementById(strId).style.width!=objWidth && objWidth!='')	document.getElementById(strId).style.width = objWidth;
				if(document.getElementById(strId).style.height!=objHeight && objHeight!='')	document.getElementById(strId).style.height = objHeight;
			}else if(ie && !dom){
				objId = eval(strId);
				if(objWidth!='')	objId.style.width = objWidth;
				if(objHeight!='')	objId.style.height = objHeight;
			}else if(ns){
				objId = eval('document.'+strId);
				if(objWidth!='')	objId.width = objHeight;
				if(objHeight!='')	objId.width = objWidth;
			}
		}
		
		// set the z-index (depth) of an object
		function setDepth(objId,objZpos){
			if(dom){
				if(document.getElementById(objId).style.zIndex!=objZpos){
					document.getElementById(objId).style.zIndex = objZpos;
				}
			}else if(ie && !dom){
				objId = eval(strId);
				objId.style.zIndex = objZpos;
			}else if(ns){
				objId = eval('document.'+strId);
				objId.zIndex = objZpos;
			}	
		}

		// set the position of a object (with optional screen-edge guard)
		function setPosition(strId,objXpos,objYpos,objZpos,objWidth,objHeight,booScrollLock,booOffScreenGuard){
			// incomplete arguments guard
				if(typeof objWidth == 'undefined'){
					objWidth = 0;
					objHeight = 0;
					booScrollLock = false;
					booOffScreenGuard = false;
				}
			// find page postition
			intXadjust = 0; intYadjust = 0;
			if(booScrollLock){
				if (ie){
					intXadjust = document.body.scrollLeft;
					intYadjust = document.body.scrollTop;
				}
				if (mo || ns){
					intXadjust = window.pageXOffset;
					intYadjust = window.pageYOffset;
				}
			}
			// adjust positions for screen-fitting
			intScreenXAdjust=0; intScreenYAdjust=0;
			if(booOffScreenGuard){
				// find page size
				if(ie){
					intPageWidth = document.body.offsetWidth;
					intPageHeight = document.body.offsetHeight;
				}
				if(ns||mo){
					intPageWidth = window.innerWidth;
					intPageHeight = window.innerHeight;
				}
				// find object size
				intObjWidth = objWidth;
				intObjHeight = objHeight;
				// adjust object position
				if(intObjWidth+objXpos>intPageWidth)	intScreenXAdjust=intPageWidth-intObjWidth-objXpos;
				if(intObjHeight+objYpos>intPageHeight)	intScreenYAdjust=intPageHeight-intObjHeight-objYpos;
			}
			// set new positions
			if(dom){
				if(document.getElementById(strId).style.left!=objXpos+intXadjust+intScreenXAdjust || document.getElementById(strId).style.top!=objYpos+intYadjust+intScreenYAdjust || document.getElementById(strId).style.zIndex!=objZpos){
					document.getElementById(strId).style.left = (objXpos+intXadjust+intScreenXAdjust);
					document.getElementById(strId).style.top = (objYpos+intYadjust+intScreenYAdjust);
					document.getElementById(strId).style.zIndex = objZpos;
				}
			}else if(ie && !dom){
				objId = eval(strId);
				objId.style.left = (objXpos+intXadjust+intScreenXAdjust);
				objId.style.top = (objYpos+intYadjust+intScreenYAdjust);
				objId.style.zIndex = objZpos;
			}else if(ns){
				objId = eval('document.'+strId);
				objId.left = (objXpos+intXadjust+intScreenXAdjust);
				objId.top = (objYpos+intYadjust+intScreenYAdjust);
				objId.zIndex = objZpos;
			}	
		}
		

	//ternary function - operation
		// replace the entire stylesheet
		function loadStylesheet(strId,strStylesheetUrl){
			if(dom){
				document.getElementById(strId).href = strStylesheetUrl;
			}
		}
		
		// initiate and/or triger window's fade
		var booFadeUnlock = true;
		function setFade(strId,booGo,fltFade){
		/*
			// default fade
			if(typeof fltFade == 'undefined') fltFade = fltFadeDef;
			// only initiate the fade if it's allowed and possible
			if(fltFade>0 && booFaderEnabled && booFadeUnlock){
				// the real object
				objId = eval(strId);
				if(booGo){
					// lock the fader
					booFadeUnlock = false;
					// activate the fader-filter
					objId.filters.blendTrans.Play();
				}else{
					// initiate the fader-filter
					objId.style.filter="blendTrans(duration="+fltFade+")";
					objId.filters.blendTrans.Apply();
					// unlock the fader
					setTimeout('booFadeUnlock=true;',fltFade);
				}
			}
		*/
		}


	// executed inline



}