	/*
	- this script requires that a CSS class like the one below be assigned to whichever div contains the images
	- the images and divs should have their heights and widths declared, and the img tag should reside within a div
	- also note that this will only work in IE, Firefox, and Safari (no Opera, no IE5 for Mac)
	
	.transparent {
  opacity: 0;
  filter: alpha(opacity=0);
  background-color: #FF0000;
  color: #666666;
  font-family: georgia,serif;
  font-size: 11px;
	}
	*/
	
	
	divArray = new Array();	
	var clearID = null;
	
	function StartFadeIn() {
		
		//this function takes any number of div names and fades them in one by one (serially)
		//list the div IDs as arguments, all that you want faded in the order you want them faded in (at least one is required)
		//the last two fields are also required. the next-to-last one is the fade multiplier (value 0-100)
		//the last field is the delay time in ms
		//StartFadeIn('div1','div2','2','200') means fade in the divs 2% every 200ms

		var num_args = arguments.length;
		var num_divs = num_args-2;

		//assign the div array
		for (m=0;m<num_divs;m++) {
		divArray[divArray.length] = arguments[m];
		}
		
		//doesn't assign the last two arguments
		count =0;
		var passInc = Number (arguments[num_args-2]);
		var passStep = Number (arguments[num_args-1]);
	
		var divID = divArray[0];
		curDiv = 1;
		totalDivs = num_divs;
		clearID = window.setInterval("FadeIn('"+divID+"','"+passInc+"','"+curDiv+"','"+totalDivs+"','"+passStep+"')",passStep);
	}


	function FadeIn(divID,passInc,curDiv,totalDivs,passStep) {	

	/* here's how it breaks down:
	divID = the text name of the div, which will be used to change its property
	passInc =  percentage increase per cycle (specified with 0 - 100)
	currDiv = the current div (starting from 1)
	totalDivs = all the divs
	passStep = the amount of time to pass to setInterval each time
	*/
	
		var o_level = document.getElementById(divID);
		var index = Number (curDiv);
		var ie = (document.all) ? 1 : 0;

		if (ie) {	
			
			cur_reg_opacity = Number(o_level.filters.alpha.opacity);
			increment_val = Number (passInc);
			new_opacity = cur_reg_opacity + increment_val;
			o_level.filters.alpha.opacity=new_opacity;
			if (new_opacity < 100) {
				o_level.style.opacity=new_opacity;
			} else {
				o_level.style.className="opaque";
				clearInterval(clearID);
				clearID = null;
				
				var newDivName = divArray[index];
				index++;

				if (index <= totalDivs ) {
					clearID = window.setInterval("FadeIn('"+newDivName+"','"+passInc+"','"+index+"','"+totalDivs+"','"+passStep+"')",passStep);
				}
			}
			
		} else {

			cur_opacity = Number(o_level.style.opacity);
			increment_val = Number (passInc) * 0.01;
			new_opacity = cur_opacity + increment_val;

			if (new_opacity < 1) {
				o_level.style.opacity=new_opacity;
			} else {
				clearInterval(clearID);
				clearID = null;
				
				var newDivName = divArray[index];
				index++;

				if (index <= totalDivs ) {
					clearID = window.setInterval("FadeIn('"+newDivName+"','"+passInc+"','"+index+"','"+totalDivs+"','"+passStep+"')",passStep);
				}
			}
		}
	}
