/*theNum is number of words
*/
var theNum = 1;
var theType = 1;

var blk = '#000';
var wht = '#fff';

var arr1=new Array("make","develop","build", "assemble", "construct", "produce", "whip up");
var arr2=new Array("pretty","useful","awesome", "powerful", "clever","neat", "fancy");
var arr3=new Array("things","websites","sights","tunes","ideas");
function chit(){
		$('text2').innerHTML = " "+arr1[Math.floor(Math.random()*7)]+" ";
		$('text3').innerHTML = " "+arr2[Math.floor(Math.random()*7)]+" ";	
		$('text4').innerHTML = " "+arr3[Math.floor(Math.random()*5)]+" ";	
}
function chngTxt() {
	if(theType==1){
		col1 = wht;
	  	col2 = blk;
	} else if(theType==2){
	  	col1 = blk;
	  	col2 = wht;			
	}
	
	new Fx.Styles('text'+theNum, {duration: 500, 
	transition: Fx.Transitions.linear,
			onComplete:function(){
				if(theType==2 && theNum==4){
					
						setTimeout('chit()',2000);
					  
	 			}
								  },  
															}).start({
																				  'color':[col1,col2]
	  });
	
	if(theNum==4){
			  clearInterval(tloop);
			  theNum=0;
			  
			  if(theType == 1){
				  theType = 2;
			  } else if(theType ==2){
					theType = 1;  
			  }
	}
	theNum++;
}


function chng(){
	
																			  
	tloop = setInterval("chngTxt()",500);
}

setInterval("chng()",5000);
var Rc = { 
	init: function(){
	/////////
	
	
	
	
	
	
	
	/*	
	var txts=new Array("text1","text2","text3");
	txts.each(function(item, index){
   		new Fx.Style(item, 'color', {duration:500}).start('#000', '#fff');
		
		//alert(index + " = " + item); //alerts "0 = apple" etc.
		}
	);
	
	
	$('but').addEvent('click', function(event) {
			event = new Event(event).stop();
			Rc.txtFx.start({
			    'background-color': ['#ffffff', '#000000']
			});

			//Rc.chgBck('home');
		});
	
	var txts=new Array("text1","text2","text3");
	
	txts.each(function(item, index){
   		
		
		//alert(index + " = " + item); //alerts "0 = apple" etc.
		}
	);
	
	this.txtFx = new Fx.Styles('target',{
			duration: 500, 
			transition: Fx.Transitions.linear
			}
	)
	
	$('scrollTop').addEvent('click', function(e){
		e = new Event(e);
		e.stop();
	});
Smooth scroll and button event
	new SmoothScroll({ duration: 1500 });
	
	*/
	/*	this.myEffects = new Fx.Styles('target',{
			duration: 500, 
			transition: Fx.Transitions.linear
			}
		);
	
	
	setTimeout("Rc.myEffects.start({'font-size': ['12px;', '24px;'],'color':['#000','#fff']})",3000);
	
	
	
	$('but').addEvent('click', function(event) {
			event = new Event(event).stop();
			Rc.myEffects.start({
			    'background-color': ['#ffffff', '#000000']
			});

			//Rc.chgBck('home');
		});
		
		
		
		$('but2').addEvent('click', function(event) {
			event = new Event(event).stop();
			Rc.myEffects.start({
			    'font-size': ['12px;', '24px;'],
				'color':['#000', '#fff']
			});

			//Rc.chgBck('home');
		});
		
		
		
	
	var curBGColor = '#fffffff';
	
	this.chgBck = function change_background_color(page){
			var newColor = '';
			var newSize = '';
			
				//Set Variables
				if(page == 'home'){
					newColor = '#507eb0';
				} 
				
				//Do color stuff
				$(document.body).effect('background-color',{
						wait:false,
						duration:1600,
						transition: Fx.Transitions.linear
				}).start(curBGColor,newColor);
				curBGColor = newColor;
	}
	
	
	
	
	/*Change links rollovers.
	this.linky = function change_links(lin,coll,stCol,endCol){
		lin.each(function(element) {
			var col = new Fx.Style(element, 'color').set(coll);
			var fx = new Fx.Styles(element, {duration:200, wait:false});

			element.addEvent('mouseenter', function(){
				fx.start({
					color: stCol
				});
			});

			element.addEvent('mouseleave', function(){
				fx.start({
				'color': endCol
			});
		});
	});
		
	}
	
	
	/*Change links rollovers.*/
	
	
		/*this.playbuts = function change_fwd_back_buttons(lin,coll,stCol,endCol){
		lin.each(function(element) {
			var col = new Fx.Style(element, 'color').set(coll);
			var fx = new Fx.Styles(element, {duration:200, wait:false});

			element.addEvent('mouseenter', function(){
				fx.start({
					color: stCol
				});
			});

			element.addEvent('mouseleave', function(){
				fx.start({
				'color': endCol
			});
		});
	});
		
	}
	var fwdbck = $$('.newsButtons');
	Rc.playbuts(fwdbck,'','','');

	var list = $$('.navbut a');
	Rc.linky(list,'#000','#ca3a44','#000');
	
	
	this.cp_fade = function  (elem){
		new Fx.Style(elem, 'background-color', {duration:3500, wait: true}).start('#d5a5ad', '#ffffff');
	}*/
	
	
	///////
	}
}
window.addEvent('domready', Rc.init.bind(Rc));
