/*******************************************************************************
* Project: StuffSpace 2.0                                                      *
* File: stuff.js (Javascript File for stuffspace)                              *
* Author: Cody Garvin                                                          *
*                                                                              *
********************************************************************************
* Date: 06/27/08                                                               *
* Version: 0.1                                                                 *
* History:                                                                     *
*  06/27/08 - Initial script created.                                          *
*                                                                              *		
*******************************************************************************/
/* Scrolling Functions */

var scrollLeftTO;
var scrollRightTO


////////////////////////////////////////////////////////////////////////////////////////////////////

var main = new Array();
main[0] = "images/body/ad3.jpg||CleanBreak Multi-Purpose Disinfectant||CleanBreak Multi-Purpose Disinfectant is an industrial strength cleaner.<br /><br />It works on porous and non-porous surfaces.<br /><br />Not only does it disinfect but it acts as a detergent, mildewstat, deodorant and virucide!||#003d92";
main[1] = "images/body/ad2.jpg||CleanBreak Facility Disinfectant||CleanBreak Facility Disinfectant is designed for use on all surfaces in human use facilities.<br /><br />It is approved by the EPA for uses in hospitals, hotels, gyms, etc.<br /><br />Effective against MRSA!||#008ebf";
main[2] = "images/body/ad1.jpg||CleanBreak Multi-Purpose Disinfectant||CleanBreak Multi-Purpose Disinfectant is an industrial strength cleaner.<br /><br />It works on porous and non-porous surfaces.<br /><br />Not only does it disinfect but it acts as a detergent, mildewstat, deodorant and virucide!||#003d92";
	
var scrollMainTO;
function goScrollMain()
{
	scrollMainTO = setTimeout('doScrollMain()',500);
}

function stopScrollMain()
{
	if(scrollMainTO)
	{
		clearTimeout(scrollMainTO);
	}
}	
var pointerMain = 0;
var opacityMain = 0;
	
function doScrollMain()
{
	var EvString = '';
	var thisPointer = pointerMain;
	var mainOne = '';
	
	mainOne = 'id="mainOne" style="width: 892px; height: 178px; opacity:0; text-align: left; color: #ff9001; font-size: 16px; line-height: 24px; margin: auto; background: url('+main[pointerMain].toString().split('||')[0]+') no-repeat;"';    

	EvString = "<div "+mainOne+"></div>";
			
	pointerMain++;
	if(pointerMain > (main.length - 1))
	{
		pointerMain = 0;
	}
	
	document.getElementById('mainScroller').innerHTML = EvString;
	opacityMain = 0;
	appearMain();
	scrollMainTO = setTimeout("doScrollMain()",13000);
}	
	
function appearMain()
{
	if(document.all)
	{
		document.getElementById('mainOne').style.filter = 'alpha(opacity=' + opacityMain + ')';
	}
	else
	{
		document.getElementById('mainOne').style.opacity = opacityMain/100;
	}
	
	opacityMain = opacityMain + 10;
	if(opacityMain <= 100)
	{
		setTimeout("appearMain()",80);
	}
}	
