
/***********************************************
* Translucent Slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var trans_width='442px' //slideshow width
//var trans_height='300px' slideshow height
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
var degree=10 //animation speed. Greater is faster.
var flag = true;
var running = false;
//var slideshowcontent=new Array()
//Define slideshow contents: [image URL, OPTIONAL LINK, OPTIONAL LINK TARGET]
/*var path = "imgs/";
slideshowcontent[0]=[path+"S1.jpg", "http://www.cnn.com", "_new"]
slideshowcontent[1]=[path+"S2.jpg", "", ""]
slideshowcontent[2]=[path+"S3.jpg", "http://www.google.com", ""]
slideshowcontent[3]=[path+"S4.jpg", "", ""]
slideshowcontent[4]=[path+"S5.jpg", "", ""]
slideshowcontent[5]=[path+"S6.jpg", "", ""]*/


////NO need to edit beyond here/////////////

//var bgcolor='white'

function getslidehtml(theslide){
var slidehtml=""
slidehtml+='<img src="'+theslide+'" border="0">'
return slidehtml
}

function moveslide(){
	if (curpos<0){
		curpos=Math.min(curpos+degree,0)
		tempobj.style.left=curpos+"px"
	}else{
		clearInterval(dropslide)
		if (crossobj.filters)
			crossobj.filters.alpha.opacity=100
		else if (crossobj.style.MozOpacity)
			crossobj.style.MozOpacity=1
		
		nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
		tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
		tempobj.innerHTML=getslidehtml(slideshowcontent[curindex])
		nextindex=(nextindex<slideshowcontent.length-1)? nextindex+1 : 0
		if(!flag){
			running = false;
			return false;	
		}else{
			setTimeout("rotateslide()",pause)
			
		}
	}
}

function rotateslide(){
	// display image description
			document.getElementById("TDDescription").innerHTML = imageText[curindex];	
	if(!flag){
		running = false;
		return false;	
	}
	if (ie4||dom){
	resetit(curcanvas)
	crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
	crossobj.style.zIndex++
	if (crossobj.filters)
	document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20
	else if (crossobj.style.MozOpacity)
	document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2
	var temp='setInterval("moveslide()",50)'
	dropslide=eval(temp)
	curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
	}

curindex=(curindex<slideshowcontent.length-1)? curindex+1 : 0
}

function jumptoslide(which){
curindex=which
rotateslide()
}

function resetit(what){
curpos=parseInt(trans_width)*(-1)
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
crossobj.style.left=curpos+"px"
}

function startit(){
	flag=true;
	if(!running)
	{
	 running = true;
	 document.getElementById("btn_slide").value = "STOP";
	}else
	{
	flag=false;
	document.getElementById("btn_slide").value = "PLAY Slideshow";
	 return;
	}
	curindex=0;
	crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas);
	crossobj.innerHTML=getslidehtml(slideshowcontent[curindex])
	rotateslide()
}



