<!-- Begin

// CODE FOR THE GALLERY SLIDESHOW



var rotate_delay 	= "3000" 	// SLIDE DELAY (in milliseconds (5000 = 5 secs)
var stopbutton		= "Stop"	// TEXT FOR AUTOPLAY STOP
var playbutton		= "Go"		// TEXT FOR AUTOPLAY START
var right_click_on	= "yes"		// RIGHT CLICK PROTECTION ON



// DEFAULT FADE SETTINGS BELOW ARE 200 THEN 100

var fadespeed		= "200"		// SPEED OF THE FADE USE 50 TO 800 (low amount for slow)
var fadeadjust		= "100"		// BLANK TIME BETWEEN IMAGES (low amount for fast)



// THIS OPTION IS BEST LEFT SET TO 0

var fadeamount		= "0"		// OPACITY AMOUNT TO FADE (0=total fade 100=no fade)








// COPYRIGHT 2009 © Allwebco Design Corporation
// Unauthorized use or sale of this script is strictly prohibited by law

// YOU DO NOT NEED TO EDIT BELOW THIS LINE



// START SLIDESHOW AND IMAGE CHANGE CODE

document.write('<style type="text/css">');
document.write('.slideimage { filter:alpha(opacity=0);-moz-opacity:.0;opacity:.0; }');
document.write('</style>');


var fadeinpause		= ((50000/fadespeed)+(fadeadjust/1));

function fadeimageup() {
opacity('MainImage', 0, 100, 500);
}

current = 0;
function next() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("nextA()",fadeinpause);
}

function nextA() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
   }
else first();
}

function IMG1() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 0;document.images.show.src = document.slideform.slide[0].value;document.slideform.slide.selectedIndex = 0;",fadeinpause);
   }

function IMG2() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 1;document.images.show.src = document.slideform.slide[1].value;document.slideform.slide.selectedIndex = 1;",fadeinpause);
}

function IMG3() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 2;document.images.show.src = document.slideform.slide[2].value;document.slideform.slide.selectedIndex = 2;",fadeinpause);
}

function IMG4() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 3;document.images.show.src = document.slideform.slide[3].value;document.slideform.slide.selectedIndex = 3;",fadeinpause);
}

function IMG5() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 4;document.images.show.src = document.slideform.slide[4].value;document.slideform.slide.selectedIndex = 4;",fadeinpause);
}

function IMG6() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 5;document.images.show.src = document.slideform.slide[5].value;document.slideform.slide.selectedIndex = 5;",fadeinpause);
}

function IMG7() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 6;document.images.show.src = document.slideform.slide[6].value;document.slideform.slide.selectedIndex = 6;",fadeinpause);
}

function IMG8() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 7;document.images.show.src = document.slideform.slide[7].value;document.slideform.slide.selectedIndex = 7;",fadeinpause);
}

function IMG9() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 8;document.images.show.src = document.slideform.slide[8].value;document.slideform.slide.selectedIndex = 8;",fadeinpause);
}

function IMG10() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 9;document.images.show.src = document.slideform.slide[9].value;document.slideform.slide.selectedIndex = 9;",fadeinpause);
}

function IMG11() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 10;document.images.show.src = document.slideform.slide[10].value;document.slideform.slide.selectedIndex = 10;",fadeinpause);
}

function IMG12() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 11;document.images.show.src = document.slideform.slide[11].value;document.slideform.slide.selectedIndex = 11;",fadeinpause);
}

function IMG13() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 12;document.images.show.src = document.slideform.slide[12].value;document.slideform.slide.selectedIndex = 12;",fadeinpause);
}

function IMG14() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 13;document.images.show.src = document.slideform.slide[13].value;document.slideform.slide.selectedIndex = 13;",fadeinpause);
}

function IMG15() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 4;document.images.show.src = document.slideform.slide[14].value;document.slideform.slide.selectedIndex = 4;",fadeinpause);
}

function IMG16() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("current = 5;document.images.show.src = document.slideform.slide[15].value;document.slideform.slide.selectedIndex = 5;",fadeinpause);
}

function previous() {
opacity('MainImage', 100, fadeamount, 500);
setTimeout("previousA()",fadeinpause);
}

function previousA() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
   }
else last();
}

function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}

function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}

function ap(text) {
document.slideform.slidebutton.value = (text == "Stop") ? "AutoPlay" : "Stop";

if (document.slideform.slidebutton.value == "AutoPlay") {
opacity('MainImage', 0, 100, 500);
autostop();
}

if (document.slideform.slidebutton.value == "Stop") {
window.setTimeout("rotate()", 10);
}

}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}

function rotate() {
if (document.slideform.slidebutton.value == "Stop") {
opacity('MainImage', 100, fadeamount, 500);
pausetofade=setTimeout("rotateA()",fadeinpause);
  }
}

function rotateA() {
if (document.slideform.slidebutton.value == "Stop") {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
rotatetime=window.setTimeout("rotate()", rotate_delay);
  }
}

function autostop() {
pausetofade=clearTimeout(pausetofade);
rotatetime=window.clearTimeout(rotatetime);
pausecomp(200);
}

function pausecomp(millis) 
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); } 
while(curDate-date < millis);
} 







// FADE IMAGE SCRIPT

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / fadespeed); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 






//  End -->