// JavaScript Document

////////////////////////////////////////////////////Arrays////////////////////////////////////////
//<object style=\"height: 344px; width: 425px\"><param name=\"movie\" value=\"http://www.youtube.com/v/wHH2Yr9uZwM\"><param name=\"allowFullScreen\" value=\"true\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"wmode\" value=\"transparent\"><embed src=\"http://www.youtube.com/v/wHH2Yr9uZwM\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowScriptAccess=\"always\" width=\"425\" height=\"344\"></object>
/////////////
var images_list=new Array("images/ProductImages/SAS-banner.jpg","images/ProductImages/Grabbler.jpg","images/ProductImages/HarperCollins.jpg","images/ProductImages/yuntaa.jpg","images/ProductImages/PssLive.jpg","images/ProductImages/eurosys.jpg");

var title_list=new Array("SAS Survival Guide - on iPhone!","Need we say more?","A 21st Century makeover for a 175 year old company","Yuntaa is much more than just online storage. ","Paperless asset management and inspections.","50,000 products and counting!");

var desc_list=new Array("The million-copy bestseller <b>SAS Survival Guide by John 'Lofty' Wiseman</b> released in an enhanced e-book format on the iPhone in collaboration with Harper Collins. Read more on <a href=\"http://www.sassurvivalguide.com\" target=\"_blank\">www.sassurvivalguide.com</a><p> <a href=\"applicationdevelopment.aspx\" target=\"_parent\">Click here</a> to read how we build iPhone Apps</p>","Grabbler is among the top 50 games on Facebook with over 10 million minutes of game play since launch. <a href=\"http://apps.facebook.com/grabbler/\" target=\"_blank\">Click here</a> to play.<p> <a href=\"socialapplications.aspx\" target=\"_parent\">Click here</a> to read how we build social applications</p>","Visit <a href=\"http://www.collinslanguage.com/\" target=\"_blank\">www.collinslanguage.com</a> to see how we positively impacted the traffic on the website.<p><a href=\"portaldevelopment.aspx\" target=\"_parent\">Click here</a> to read how we can do the same for you.</p>","Visit <a href=\"http://www.yuntaa.com/\" target=\"_blank\">www.yuntaa.com</a> to find out.<p><a href=\"outsourcing.aspx\" target=\"_parent\">Click here </a> to read how end-to-end outsourcing can benefit your organization.</p>","Visit <a href=\"http://www.pssltd.co.uk/\" target=\"_blank\">www.pssltd.co.uk</a> to learn more.<p> <a href=\"dotnetsolutions.aspx\" target=\"_parent\">Click here</a> to read how our Microsoft Solutions can give your products the edge.</p>","End-to-end Microsoft Navision integrated webshop launched for Eurosys, Belgium's leading Megastore and retail chain. Checkout our NaviWeb <a href=\"http://naviweb.eurosys.be/\" target=\"_blank\">here</a>.<p> <a href=\"ecommerce.aspx\" target=\"_parent\">Click here</a> to know how we can help with your ecommerce requirements.</p>");
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

var Num = 0;
var fade = false;
var PrevRadio;
var numAd
var myTimer = null;
var finalSlide = false;

function startSlider(Num){
		document.getElementById('itemImage').innerHTML = '<img src="'+images_list[Num]+'" alt=""/>';
		document.getElementById('itemHeading').innerHTML = title_list[Num];
		document.getElementById('desc').innerHTML = desc_list[Num];
		document.getElementById('r'+Num+'').style.backgroundPosition="0px -25px";
		PrevRadio = document.getElementById('r'+Num+'')
		myTimer = setTimeout("slider(Num)", 8000);
		
}

/*function startTime(numAd){
	myTimer = setTimeout("slider(numAd)", 3000);
}*/

function slider(Num){
	if(numAd > images_list.length-2 && Num==4){
		numAd = 0
		finalSlide = true;
		changeContents(numAd);
	}else{
		numAd = Num+1
		finalSlide = false;
		changeContents(numAd);
	}
	myTimer = setTimeout("slider(numAd)", 8000);
}

function doThis(Num){
	clearTimeout(myTimer);
	slider(Num-1);
}

function changeContents(numAd){
	if(document.getElementById('allCont').style.left == "0px"){	
		if(PrevRadio != null || PrevRadio == ""){
				PrevRadio.style.backgroundPosition="0px -1px";
			}
		
		document.getElementById('r'+numAd+'').style.backgroundPosition="0px -25px";
		PrevRadio = document.getElementById('r'+numAd+'')
		
		
		opacityTween = new OpacityTween(document.getElementById('bannerImageHeading'),Tween.strongEaseOut, 100, 0, .5); 
		opacityTween.start()
		opacityTween = new OpacityTween(document.getElementById('bannerImageContent'),Tween.strongEaseOut, 100, 0, .5); 
		opacityTween.start()
	//	t1 = new Tween(document.getElementById('bannerItemImage').style,'left',Tween.strongEaseOut,0,-50,1,'px');
		//t1.start();
		t1 = new Tween(document.getElementById('allCont').style,'left',Tween.strongEaseOut,0,10,1,'px');
		t1.start();
		opacityTween = new OpacityTween(document.getElementById('bannerItemImage'),Tween.strongEaseOut, 100, 0, 1); 
		opacityTween.start()
		opacityTween.onMotionFinished = function(){
			document.getElementById('itemImage').innerHTML = '<img src="'+images_list[numAd]+'" alt=""/>';
			opacityTween = new OpacityTween(document.getElementById('bannerItemImage'),Tween.strongEaseOut, 0, 100, 1); 
			opacityTween.start()
			opacityTween = new OpacityTween(document.getElementById('bannerImageHeading'),Tween.strongEaseOut, 0, 100, 1); 
			opacityTween.start()
			opacityTween = new OpacityTween(document.getElementById('bannerImageContent'),Tween.strongEaseOut, 0, 100, 1); 
			opacityTween.start()
			//t1 = new Tween(document.getElementById('bannerItemImage').style,'left',Tween.strongEaseOut,-50,0,1,'px');
			//t1.start();
			t1 = new Tween(document.getElementById('allCont').style,'left',Tween.strongEaseOut,10,0,1,'px');
			t1.start();
			document.getElementById('itemHeading').innerHTML = title_list[numAd];
			document.getElementById('desc').innerHTML = desc_list[numAd];
		};
	}
}