// JavaScript Documen
/************************************************************************************
This is created by Puchu ...... RentACoder 
For more information please visit : http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=7234186
*************************************************************************************/


var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
var imageStyle = "";
var ns4=document.layers
var ie5ns6=document.getElementById||document.all

var slidingSpeed = 50; //Change This to control the speed....the more the value the slower the speed

function initialize(){
if (ie5ns6){
crossobj=document.getElementById? document.getElementById("flyin") : document.all.flyin;
//setInterval("updatemsg()",delay+1000)
}
else if (ns4){
document.sslide.document.sslide2.document.write(openingtag+message[0]+closingtag);
document.sslide.document.sslide2.document.close();
//setInterval("updatemsgns4()",delay)
}
}

function create()
{
	var imageDiv = "<div id=\"imageDiv\" style=\"width:" + imageWidth + "px;height:" + imageHeight + "px;float:left;\"></div>";
		
	var scrollDiv = '<div id="flyin" style="position:relative;top:-60px;text-align:right;width:'+textWidth+'px;height:'+imageHeight+'px;float:left;"></div>';

	
	var mainDiv = "<div id=\"mainDiv\" style=\"width:100%;\">" + imageDiv + scrollDiv + "</div><div class=\"clear\"></div>";
	document.write(mainDiv);
	crossobj=document.getElementById? document.getElementById("flyin") : document.all.flyin;
	changeMe(0);
}

var hoffset=-10;
function updatemsg(){
crossobj.style.left="2000px";
crossobj.style.fontStyle="italic";
//crossobj.innerHTML=message[inc]
crossobj.style.left=crossobj.offsetWidth*(1)+hoffset+"px";
start=setInterval("animatein()",slidingSpeed);
}

function animatein(){
if (parseInt(crossobj.style.left)>0)
crossobj.style.left=parseInt(crossobj.style.left)-20+"px";
else{
crossobj.style.left=0+"px";
crossobj.style.fontStyle="normal";
clearInterval(start);
}
}
//var counter = 100;
function fadeIn(id, counter)
{
	var fadeInfactor = fadeInTime*10 ;
	counter++;
	if(counter < 100)
	{
		var mainDIv = document.getElementById("mainDiv");
		if((browser == "Microsoft Internet Explorer") )
		{
			if( (version>=4))
			{
				imageStyle = '-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + counter + ')"; filter: alpha(opacity=' + counter + ');';	
				mainDIv.style.width="100%";
				mainDIv.style.filter  = imageStyle;
			}
		}
		else
		{
			imageStyle = counter/100;
			mainDIv.style.width="100%";
			mainDIv.style.opacity = imageStyle;
		}
		
		setTimeout ("fadeIn(" + id + "," + counter + ")", fadeInfactor);
	}

}


function fadeOut(id, counter)
{
	/*var fadeOutfactor = fadeOutTime*10 ;
	counter--;
	if(counter > 0)
	{
		var mainDIv = document.getElementById("mainDiv");
		if((browser == "Microsoft Internet Explorer") )
		{
			if( (version>=4))
			{
				imageStyle = '-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + counter + ')"; filter: alpha(opacity=' + counter + ');';	
				mainDIv.style.width="100%";
				mainDIv.style.filter  = imageStyle;
			}
		}
		else
		{
			imageStyle = counter/100;
			mainDIv.style.width="100%";
			mainDIv.style.opacity = imageStyle;
		}
		
		setTimeout ("fadeOut(" + id + "," + counter + ")", fadeOutfactor);
	}
	else
	{
		changeMe(id);
		
		fadeIn(id, counter);
		updatemsg();
	}*/
	changeMe(id);
	updatemsg();
}

function changeMe(id)
{
	//alert(id)
	var image = document.getElementById("imageDiv");
	var text = document.getElementById("flyin");

	if(image != null && text!=null)
	{
		image.innerHTML = "<img src=\"" +  myTextList[id].image + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\">";
		text.innerHTML =  myTextList[id].text ;
	}
}

