var currentImgTest;
currentImgTest=100;

testNameArr = new Array(10);
testNameArr[189] = '<a class="promohead_link" href=\"\/staticid\/'+189+'\">Emotional IQ Test</a>';
testNameArr[809] = '<a class="promohead_link" href=\"\/staticid\/'+809+'\">What\'s your personality type?</a>';
testNameArr[760] = '<a class="promohead_link" href=\"\/staticid\/'+760+'\">Multi-dimensional IQ Test</a>';   
testNameArr[175] = '<a class="promohead_link" href=\"\/staticid\/'+175+'\">How assertive are you?</a>';   
testNameArr[967] = '<a class="promohead_link" href=\"\/staticid\/'+967+'\">Do you have leadership potential?</a>';   
testNameArr[785] = '<a class="promohead_link" href=\"\/staticid\/'+785+'\">Non-Verbal IQ Test</a>';   
testNameArr[743] = '<a class="promohead_link" href=\"\/staticid\/'+743+'\">Depression Test</a>';   
testNameArr[989] = '<a class="promohead_link" href=\"\/staticid\/'+989+'\">Career Style Test</a>';  
testNameArr[963] = '<a class="promohead_link" href=\"\/staticid\/'+963+'\">Are you a good communicator?</a>';   
testNameArr[654] = '<a class="promohead_link" href=\"\/staticid\/'+654+'\">Self-Esteem Test</a>'; 

testPromArr = new Array(10);
testPromArr[189] = "People with high emotional intelligence tend to be more successful than those with lower EIQ. Discover your EIQ with this test.";
testPromArr[809] = "The most accurate personality test available. Obtain an in-depth view of your personality and behaviors by taking this test.";
testPromArr[760] = "Want to find out how smart you are? Looking for a good IQ test? Try this test and find out where you stand! ";
testPromArr[175] = "Do you say 'yes' when you mean 'no'? Find out if you stand up for yourself as much as you should with the Assertiveness Test.";
testPromArr[967] = "Can you inspire others to action with your leadership skills? Find out if you've got what it takes with the Leadership Test.";
testPromArr[785] = "This test will measure your intellect and entertain you while minimizing cultural or educational biases.";
testPromArr[743] = "If your lows consistently outweigh your highs you may be depressed. Find out whether your slump needs attention with this test.";
testPromArr[989] = "This test is an ideal way to determine what drives and interests you and is ideal for those who need a little guidance in determining a career path.";
testPromArr[963] = "Do you have difficulty communicating your thoughts and feelings to others? Take this test to find out if your delivering your intended message.";
testPromArr[654] = "Self-esteem is essential for success and happiness. Find out if you should build your feelings of self-worth with this test.";

function fadeOut( elem, to, speed )
{
	for ( var i = 0; i < 100; i += 5 )
	{
		(function()
		{
			var opacity = i;
			setTimeout(function()
			{
				setOpacity( elem, 100 - opacity );
			}, ( i + 1 ) * speed );
		})();
	}
}

function setOpacity( elem, level ) {
	// If filters exist, then this is IE, so set the Alpha filter
	if ( elem.filters )
		elem.style.filter = 'alpha(opacity='+level+')';
//	elem.filters.alpha.opacity = level;
	// Otherwise use the W3C opacity property
	else
	elem.style.opacity = level / 100;
}

function resetOpacity( elem ) {
	if ( elem.filters )
		elem.style.filter = 'alpha(opacity=100)';
//	elem.filters.alpha.opacity = 100;
	else
	elem.style.opacity = 100;
}

sc={
	myCarousel:function()
	{
		sc.carousel=document.getElementById('carousel');
		if(!sc.carousel){return;}
		setTimeout("fadeOut(sc.carousel, 0, 10)", 9000 );
		sc.movePic();
		resetOpacity(sc.carousel);
		setTimeout("sc.myCarousel()", 10000 );
	},
	buildHtml:function(testId)
	{
		var myhtml;
		myhtml = '<div class="landimage'+testId+'"><div class="promobox_container"><div><img src="../images/promobox_top.png" style="width:252px;height:7px"></div><div class="promobox_mid"><div class="promobox_content"><span class="promohead_link">'+testNameArr[testId]+'</span></br><img src="images/spacer.png" alt="" width="1" height="18" border="0">'+testPromArr[testId]+'</br><a href="\/staticid\/'+testId+'"></a><a class="link_blue3" href="\/staticid\/'+testId+'" ><img src="images/spacer.png" alt="" width="1" height="15" border="0">Take this test now!</a></div><div><img height="5" width="1" border="0" alt="" src="images/spacer.png"/></div></div><div class="promobox_bot"></div></div></div><div style="float:right;margin-top:0px;margin-right:8px;"><img src="images/spacer.png" alt="" width="1" height="5" border="0"><a  href="#" onClick="sc.moveBack()"><img src="images/car_back_off.gif" alt="" border="0"></a><a href="#" onClick="sc.moveNext()"><img src="images/car_for_off.gif" alt=""></a></div>';
		return myhtml;
	},
	movePic:function()
	{
		if (currentImgTest%10==0){
			sc.carousel.innerHTML = sc.buildHtml(189);
		}
		if (currentImgTest%10==1){
			sc.carousel.innerHTML = sc.buildHtml(809);
		}
		if (currentImgTest%10==2){
			sc.carousel.innerHTML = sc.buildHtml(760);
		}
		if (currentImgTest%10==3){
			sc.carousel.innerHTML = sc.buildHtml(175);
		}
		if (currentImgTest%10==4){
			sc.carousel.innerHTML = sc.buildHtml(967);
		}
		if (currentImgTest%10==5){
			sc.carousel.innerHTML = sc.buildHtml(785);
		}
		if (currentImgTest%10==6){
			sc.carousel.innerHTML = sc.buildHtml(743);
		}
		if (currentImgTest%10==7){
			sc.carousel.innerHTML = sc.buildHtml(989);
		}
		if (currentImgTest%10==8){
			sc.carousel.innerHTML = sc.buildHtml(963);
		}
		if (currentImgTest%10==9){
			sc.carousel.innerHTML = sc.buildHtml(654);
		}
		currentImgTest++;
	},
	moveNext:function()
	{
		sc.movePic();
	},
	moveBack:function()
	{
		currentImgTest = currentImgTest - 2;
		sc.movePic();
	}
}
DOMhelp.addEvent(window,'load',sc.myCarousel,false);
