{
	//remember...curpic represents the 2nd pic, not the first
	var curpic=1;
	var maxsponsor=16;
	var thepath="/images/sponsors/";
	//var r_speed=5;	
	//r_speed: fading increment / decrement
	var r_speed=10;	
	//r_pause: duration of each "clip"
	var r_pause=5000;	
	
	var picCollection= new Array(maxsponsor);
	picCollection[0]="nlgov.jpg";
	picCollection[1]="steele.jpg";
	picCollection[2]="orange.jpg";
	picCollection[3]="nunatsiavut.jpg";
	picCollection[4]="bmo.jpg";
	picCollection[5]="exit.jpg";
	picCollection[6]="exxon.jpg";
	picCollection[7]="lfl.jpg";
	picCollection[8]="vocm.jpg";
	picCollection[9]="telegram.jpg";
	picCollection[10]="westernstar.jpg";
	picCollection[11]="transcontinental.jpg";
	picCollection[12]="innu.jpg";
	picCollection[13]="nlc.jpg";
	picCollection[14]="smiling.jpg";
	picCollection[15]="clearwater.jpg";
	
	var destination= new Array(maxsponsor);
	destination[0]="builder";
	destination[1]="builder";
	destination[2]="believer";
	destination[3]="believer";
	destination[4]="champion";
	destination[5]="champion";
	destination[6]="champion";
	destination[7]="champion";
	destination[8]="champion";
	destination[9]="champion";
	destination[10]="champion";	
	destination[11]="champion";	
	destination[12]="champion";	
	destination[13]="champion";	
	destination[14]="champion";	
	destination[15]="champion";	
	
	function gotosponsor()
	{
		var temp;
		
		temp="index.asp";
		if((curpic-1)<0)
		{
			temp="/donors/index.asp#"+destination[maxsponsor-1];
		}else{
			temp="/donors/index.asp#"+destination[curpic-1];
		}
		document.location.href=temp;	
		
	}
		
	function initrotate()
	{	
		//decrease r_pause for initial display (previously 1200)
		r_pause=r_pause-0;
		////r_pause=r_pause;
		//setTimeout('rotate(2)',400);
		rotate(2);
		//curpic=curpic+1;
	
		//reset r_pause (previously 1200)
		r_pause=r_pause+0;
	}
	
	function rotate(p_show)
	{
		var r_show;
		var r_hide;
		var r_obj;
		var newpic;
		
		//show / hide pics
		if(p_show==1)
		{
			r_hide="2";
			r_show="1";
		}else{
			r_hide="1";
			r_show="2";
		}
		
		setTimeout('rfade("sponsor'+r_hide+'",100,'+((-1)*r_speed)+');',r_pause);
		setTimeout('rfade("sponsor'+r_show+'",0,'+r_speed+');',r_pause);
			
		//start cycle again
		setTimeout('rotate("'+r_hide+'");',r_pause);
		//alert(r_hide+p_show);
	}
	
	function rfade(p_obj,p_alpha,p_speed)
	{
		//this will cause the object to fade / appear.  p_alpha is the current opacity, the speed is the interval amount.  negative amount will cause it to fade, pos. will cause it to appear.
		//0 is nothing, 100 is full
	
		var robj;
		var r_speed=p_speed;
		var r_alpha=p_alpha+p_speed;
		
		//just in case
		if(r_alpha>=100)
		{
			r_alpha=100;
		}else if(r_alpha<=0){
			r_alpha=0;
		}
		
		robj=document.getElementById(p_obj);
		
		//safari / mozilla
		robj.style.opacity=(r_alpha/100);
		//IE
		robj.style.filter = 'alpha(opacity=' + r_alpha + ')';
			
		if(((r_alpha<=(100-r_speed)) && (r_speed>0)) || ((r_alpha>=(0-r_speed)) && (r_speed<0)))
		{
			setTimeout('rfade("'+robj.id+'",('+r_alpha+'),'+r_speed+');',100);	
		}else{
			if(r_speed>0)
			{
				robj.style.zIndex=10;
			}else if(r_speed<0){
				robj.style.zIndex=1;
				//change pic src
				/*
				if(curpic>0 && curpic<maxpic){
					curpic=curpic+1;		
				}else{
					curpic=1;
				}
				robj.src="images/sshow/sshow"+curpic+".jpg";*/
				changepic(p_obj);
			}
		}
	}
	
	function changepic(p_id)
	{
		//var thepath;
		//thepath=document.forms.thevalue.thepath.value;
		
		//var flashObjStr = "<embed id='clip"+p_id+"' src="+thepath+"assets/img_flash/"+picCollection[curpic-1]+" quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='550' height='75' wmode='opaque'></embed>";
		newpic=document.getElementById(p_id);
		
		
		//alert(curpic);
		// rotate pics
		if((curpic>=0) && (curpic<(maxsponsor-1))){
			curpic=curpic+1;		
		}else{
			curpic=0;
		}
		
		
		//alert(curpic);
		newpic.style.zIndex=1;
		//safari / mozilla
		newpic.style.opacity=(0);
		//IE
		newpic.style.filter = 'alpha(opacity=0)';
			
			
		newpic.src=thepath+picCollection[curpic];
		//newpic.innerHTML = flashObjStr;	
		//alert(newpic.innerHTML);
	}

}