/***********************************************
* Fade-in image 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
***********************************************/

//SET THE RANDOM SEED AND FUNCTIONS
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
	rnd.seed = (rnd.seed*9301+49297) % 233280;
	return rnd.seed/(233280.0);
}
function rand(number) {
	return Math.ceil(rnd()*number);
}

var ie4 = document.all;
var dom = document.getElementById;

var slideContainerLg = "homepic-lg";
var homeSlidesLg = true;
var slideshow_width_Lg = "370px"; //SET IMAGE WIDTH
var slideshow_height_Lg = "370px"; //SET IMAGE HEIGHT
var slideshow_pause_Lg = 6000; //SET PAUSE BETWEEN SLIDE (3000=3 seconds)

var fadeimagesLg=new Array()
//SET 1) IMAGE PATHS, 2) optional link, 3), optional link target:
//fadeimagesLg[0]=["images/homepic1.jpg", "", ""] //plain image syntax
//fadeimagesLg[1]=["photo2.jpg", "http://www.google.com", ""] //image with link syntax
//fadeimagesLg[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
//NOTE: SLIDE #0 IS THE DEFAULT IMAGE AND DOES NOT SHOW UP IN THE ROTATION
fadeimagesLg[0]=["/images/blank.gif", "/index.cfm", "_top"]
var rndSlideSetLg = rand(3); //Put in the number of slideshow sets available
switch (rndSlideSetLg) {
	//Add a seperate case for every slideshow; make sure the nubmer matches the number in line 31
	case 1 :
		fadeimagesLg[1]=["/images/homepic_lg_1a.jpg", "/index.cfm", "_top"];
		fadeimagesLg[2]=["/images/homepic_lg_1b.jpg", "/index.cfm", "_top"];
		fadeimagesLg[3]=["/images/homepic_lg_1c.jpg", "/index.cfm", "_top"];
		break;
	case 2 :
		fadeimagesLg[1]=["/images/homepic_lg_2a.jpg", "/index.cfm", "_top"];
		fadeimagesLg[2]=["/images/homepic_lg_2b.jpg", "/index.cfm", "_top"];
		fadeimagesLg[3]=["/images/homepic_lg_2c.jpg", "/index.cfm", "_top"];
		break;
	case 3 :
		fadeimagesLg[1]=["/images/homepic_lg_3a.jpg", "/index.cfm", "_top"];
		fadeimagesLg[2]=["/images/homepic_lg_3b.jpg", "/index.cfm", "_top"];
		fadeimagesLg[3]=["/images/homepic_lg_3c.jpg", "/index.cfm", "_top"];
		break;	
}

////////////////////////////////////////////////
// NO need to edit beyond here
////////////////////////////////////////////////

var preloadedimagesLg=new Array()
for (p=0;p<fadeimagesLg.length;p++){
preloadedimagesLg[p]=new Image()
preloadedimagesLg[p].src=fadeimagesLg[p][0]
}

var curposLg=10
var degreeLg=10
var curcanvas="canvas0Lg"
var curimageindexLg = rand(fadeimagesLg.length-1)
var nextimageindexLg= (curimageindexLg == fadeimagesLg.length-1) ? 1 : curimageindexLg+1;
var previmageindexLg = (curimageindexLg == 1) ? fadeimagesLg.length-1 : 1;

if ((ie4||dom) && document.getElementById(slideContainerLg)) {
	var containerLg = document.getElementById(slideContainerLg);
	containerLg.innerHTML = '<div style="position:relative;width:'+slideshow_width_Lg+';height:'+slideshow_height_Lg+';overflow:hidden"><img name="defaultslide" src="'+fadeimagesLg[0][0]+'"><div  id="canvas0Lg" style="position:absolute;width:'+slideshow_width_Lg+';height:'+slideshow_height_Lg+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas1Lg" style="position:absolute;width:'+slideshow_width_Lg+';height:'+slideshow_height_Lg+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10;visibility: hidden"></div></div>';
	//document.write('<div style="position:relative;width:'+slideshow_width_Lg+';height:'+slideshow_height_Lg+';overflow:hidden"><div  id="canvas0Lg" style="position:absolute;width:'+slideshow_width_Lg+';height:'+slideshow_height_Lg+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas1Lg" style="position:absolute;width:'+slideshow_width_Lg+';height:'+slideshow_height_Lg+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10;visibility: hidden"></div></div>')
} else {
	containerLg.innerHTML = '<img name="defaultslide" src="'+fadeimagesLg[1][0]+'">';
}

function fadepicLg(){
if (curposLg<100){
curposLg+=2
if (tempobjLg.filters)
tempobjLg.filters.alpha.opacity=curposLg
else if (tempobjLg.style.MozOpacity)
tempobjLg.style.MozOpacity=curposLg/101
}
else{
clearInterval(dropslideLg)
nextcanvas=(curcanvas=="canvas0Lg")? "canvas0Lg" : "canvas1Lg"
tempobjLg=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobjLg.innerHTML=insertimageLg(nextimageindexLg)
nextimageindexLg=(nextimageindexLg<fadeimagesLg.length-1)? nextimageindexLg+1 : 1
var tempobj2Lg=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj2Lg.style.visibility="hidden"
setTimeout("rotateimageLg()",slideshow_pause_Lg)
}
}

function insertimageLg(i){
var tempcontainerLg=fadeimagesLg[i][1]!=""? '<a href="'+fadeimagesLg[i][1]+'" target="'+fadeimagesLg[i][2]+'">' : ""
tempcontainerLg+='<img src="'+fadeimagesLg[i][0]+'" border="0">'
tempcontainerLg=fadeimagesLg[i][1]!=""? tempcontainerLg+'</a>' : tempcontainerLg
return tempcontainerLg
}

function rotateimageLg(){
if (ie4||dom){
resetitLg(curcanvas)
var crossobj=tempobjLg=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
tempobjLg.style.visibility="visible"
var temp='setInterval("fadepicLg()",25)'
dropslideLg=eval(temp)
curcanvas=(curcanvas=="canvas0Lg")? "canvas1Lg" : "canvas0Lg"
}
else
document.images.defaultslide.src=fadeimagesLg[curimageindexLg][0]
curimageindexLg=(curimageindexLg<fadeimagesLg.length-1)? curimageindexLg+1 : 1
}

function resetitLg(what){
curposLg=10
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
if (crossobj.filters)
crossobj.filters.alpha.opacity=curposLg
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=curposLg/101
}

function startitLg(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML=insertimageLg(curimageindexLg)
rotateimageLg()
}

/*
// MOVED ONLOAD TO SIFR.JS
if (ie4||dom)
window.onload=startitLg
else
slideStart = setInterval("rotateimageLg()",slideshow_pause_Lg)
*/