/*
@version 1.0: mod_S5_slideshowadvance Javascript
Author: Shape 5 - Professional Template Community
Available for download at www.shape5.com
Copyright Shape 5 LLC
*/

/* Left and Right thumbnail scroller */
var sa_left1 = 0;
var sa_right1 = 0;
var sa_mainleftright = 0;

/*  Left functions */
function s5_goleft_sa() {
	if (sa_left1 == 0)
	{window.setTimeout('s5_thumbnailleft_sa()',5);
	} else {}}
function s5_thumbnailleft_sa() {
if (sa_left1 == 1){	sa_left1 = 0; 
} else {
	if (sa_mainleftright >= 3) {  } else {
	document.getElementById("s5_thumbnailsinside_sa").style.left = sa_mainleftright +'px';
	sa_mainleftright = sa_mainleftright + 5;
	s5_goleft_sa();
	}}}
function s5_goleftstop_sa() {
	sa_left1 = 1;
	window.setTimeout('resetleft()',10);}
function resetleft() {	sa_left1 = 0;}

/*  Right functions */
function s5_goright_sa() {
	if (sa_mainleftright <= -s5_javascriptleft) {  } else {if (sa_right1 == 0)
	{ window.setTimeout('s5_thumbnailright_sa()',5);} else {} }}
function s5_thumbnailright_sa() {
if (sa_right1 == 1)
{ sa_right1 = 0; } else { if (sa_mainleftright <= -s5_javascriptleft) {  } else {
	document.getElementById("s5_thumbnailsinside_sa").style.left = sa_mainleftright +'px';
	sa_mainleftright = sa_mainleftright - 5;
	s5_goright_sa();}}}
function s5_gorightstop_sa() {
	sa_right1 = 1;
	window.setTimeout('resetright()',10);}
function resetright() {	sa_right1 = 0;}
/* End Left and Right thumbnail scroller */

/* Change Slide */
var s5_thumbchangeon_sa = 0;
var s5_thumbchangeslide_sa = 0;

function sa_thumb1() {
sa_picture1();
s5_currentslide_sa = 2;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb2() {
sa_picture2();
s5_currentslide_sa = 3;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb3() {
sa_picture3();
s5_currentslide_sa = 4;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb4() {
sa_picture4();
s5_currentslide_sa = 5;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb5() {
sa_picture5();
s5_currentslide_sa = 6;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb6() {
sa_picture6();
s5_currentslide_sa = 7;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb7() {
sa_picture7();
s5_currentslide_sa = 8;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb8() {
sa_picture8();
s5_currentslide_sa = 9;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb9() {
sa_picture9();
s5_currentslide_sa = 10;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}
function sa_thumb10() {
sa_picture10();
s5_currentslide_sa = 1;
s5_thumbchangeon_sa = 1;
window.setTimeout('next_thumb_sa()',display_time);}

function next_thumb_sa() {
	s5_thumbchangeon_sa = 0;
	if (s5_currentslide_sa == 1) { sa_picture1();}	
	if (s5_currentslide_sa == 2) { sa_picture2();}
	if (s5_currentslide_sa == 3) { sa_picture3();}
	if (s5_currentslide_sa == 4) { sa_picture4();}
	if (s5_currentslide_sa == 5) { sa_picture5();}
	if (s5_currentslide_sa == 6) { sa_picture6();}
	if (s5_currentslide_sa == 7) { sa_picture7();}
	if (s5_currentslide_sa == 8) { sa_picture8();}
	if (s5_currentslide_sa == 9) { sa_picture9();}
	if (s5_currentslide_sa == 10) { sa_picture10();}}
/* End Change Slide */


/* Pause and Play functions */
var s5_currentslide_sa = 0;
var s5_pauseslidevar_sa = 0;
function s5_pauseslide_sa() {
	s5_pauseslidevar_sa = 1;}
function s5_playslide_sa() {
	s5_pauseslidevar_sa = 0;
	if (s5_currentslide_sa == 1) { sa_picture1();}	
	if (s5_currentslide_sa == 2) { sa_picture2();}
	if (s5_currentslide_sa == 3) { sa_picture3();}
	if (s5_currentslide_sa == 4) { sa_picture4();}
	if (s5_currentslide_sa == 5) { sa_picture5();}
	if (s5_currentslide_sa == 6) { sa_picture6();}
	if (s5_currentslide_sa == 7) { sa_picture7();}
	if (s5_currentslide_sa == 8) { sa_picture8();}
	if (s5_currentslide_sa == 9) { sa_picture9();}
	if (s5_currentslide_sa == 10) { sa_picture10();}}
/* End Pause and Play functions */


/* Button Opacity on hover */
function s5_onhoverin_sa() {
s5_onhover_savar = 0;
if (s5_onhover_savar == 0) {
document.getElementById("s5_divarrows_sa").style.opacity = 10;
document.getElementById("s5_divarrows_sa").style.filter = 'alpha(opacity=100)';
s5_onhover_savar = 1;}}
function s5_onhoverout_sa() {
if (s5_onhover_savar == 1) {
document.getElementById("s5_divarrows_sa").style.opacity = .5;
document.getElementById("s5_divarrows_sa").style.filter = 'alpha(opacity=50)';
s5_onhover_savar = 0;}}
function s5_onhoverinbut_sa() {
s5_onhover_savarr = 0;
if (s5_onhover_savarr == 0) {
document.getElementById("s5_playpausebuttons").style.opacity = 10;
document.getElementById("s5_playpausebuttons").style.filter = 'alpha(opacity=100)';
s5_onhover_savarr = 1;}}
function s5_onhoveroutbut_sa() {
if (s5_onhover_savarr == 1) {
document.getElementById("s5_playpausebuttons").style.opacity = .5;
document.getElementById("s5_playpausebuttons").style.filter = 'alpha(opacity=50)';
s5_onhover_savarr = 0;}}
/* End Button Opacity on hover */


/* Start Rotator */
function sa_picture1_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture1 != "") {
				sa_picture2('sa_picture2');
			 }  else { 	sa_picture1('sa_picture1');}}}}

function sa_picture2_next() {
if (s5_thumbchangeon_sa == 0) { 
	if (s5_pauseslidevar_sa == 1) { return false; }
	if (s5_pauseslidevar_sa == 0) { 
		if (sa_picture3 != "") { 
		sa_picture3('sa_picture3');
	 }  else {  sa_picture1('sa_picture1'); }}}}

function sa_picture3_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture4 != "") { 
				sa_picture4('sa_picture4');
			 }  else {  sa_picture1('sa_picture1'); }}}}
			 
function sa_picture4_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture5 != "") { 
				sa_picture5('sa_picture5');
			 }  else {  sa_picture1('sa_picture1'); }}}}
			 
function sa_picture5_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture6 != "") { 
				sa_picture6('sa_picture6');
			 }  else { sa_picture1('sa_picture1'); }}}}
			 
function sa_picture6_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture7 != "") { 
				sa_picture7('sa_picture7');
			 }  else { sa_picture1('sa_picture1');}}}}

function sa_picture7_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture8 != "") { 
				sa_picture8('sa_picture8');
			 }  else { sa_picture1('sa_picture1'); }}}}
			 
function sa_picture8_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture9 != "") { 
				sa_picture9('sa_picture9');
			 }  else { sa_picture1('sa_picture1'); }}}}
			 
function sa_picture9_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { 
			if (sa_picture10 != "") { 
				sa_picture10('sa_picture10');
			 }  else { sa_picture1('sa_picture1');}}}}
			 
function sa_picture10_next() {
	if (s5_thumbchangeon_sa == 0) { 
		if (s5_pauseslidevar_sa == 1) { return false; }
		if (s5_pauseslidevar_sa == 0) { sa_picture1('sa_picture1');}}}
/* End Rotator */


/* Hide and Show Descriptions */

		function sa_picture1_display() {
		s5_currentslide_sa = 1;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		
		document.getElementById("scrollholder").style.display = "block";
		document.getElementById("scrollholder").style.opacity = 0;
		document.getElementById("scrollholder").style.filter = 'alpha(opacity=0)';
		s5_opacityon_sa('scrollholder');
		}

		function sa_picture2_display() {
		s5_currentslide_sa = 2;
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder1").style.opacity = 0;
		document.getElementById("scrollholder1").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder1").style.display = "block";
		s5_opacityon_sa('scrollholder1');
		}
		
		function sa_picture3_display() {
		s5_currentslide_sa = 3;
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder2").style.opacity = 0;
		document.getElementById("scrollholder2").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder2").style.display = "block";
		s5_opacityon_sa('scrollholder2');
		}
		
		function sa_picture4_display() {
		s5_currentslide_sa = 4;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder3").style.opacity = 0;
		document.getElementById("scrollholder3").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder3").style.display = "block";
		s5_opacityon_sa('scrollholder3');
		}
		
			
		function sa_picture5_display() {
		s5_currentslide_sa = 5;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder4").style.opacity = 0;
		document.getElementById("scrollholder4").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder4").style.display = "block";
		s5_opacityon_sa('scrollholder4');
		}
		
		function sa_picture6_display() {
		s5_currentslide_sa = 6;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder5").style.opacity = 0;
		document.getElementById("scrollholder5").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder5").style.display = "block";
		s5_opacityon_sa('scrollholder5');
		}
		
		function sa_picture7_display() {
		s5_currentslide_sa = 7;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder6").style.opacity = 0;
		document.getElementById("scrollholder6").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder6").style.display = "block";
		s5_opacityon_sa('scrollholder6');
		}
		
		function sa_picture8_display() {
		s5_currentslide_sa = 8;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder7").style.opacity = 0;
		document.getElementById("scrollholder7").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder7").style.display = "block";
		s5_opacityon_sa('scrollholder7');
		}
		
		function sa_picture9_display() {
		s5_currentslide_sa = 9;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		if (s5_ifvisible_sa >= 9) {
		document.getElementById("scrollholder9").style.display = "none";}
		document.getElementById("scrollholder8").style.opacity = 0;
		document.getElementById("scrollholder8").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder8").style.display = "block";
		s5_opacityon_sa('scrollholder8');
		}
		
		function sa_picture10_display() {
		s5_currentslide_sa = 10;
		if (s5_ifvisible_sa >= 1) {
		document.getElementById("scrollholder1").style.display = "none";}
		if (s5_ifvisible_sa >= 2) {
		document.getElementById("scrollholder2").style.display = "none";}
		if (s5_ifvisible_sa >= 3) {
		document.getElementById("scrollholder3").style.display = "none";}
		if (s5_ifvisible_sa >= 4) {
		document.getElementById("scrollholder4").style.display = "none";}
		if (s5_ifvisible_sa >= 5) {
		document.getElementById("scrollholder5").style.display = "none";}
		if (s5_ifvisible_sa >= 6) {
		document.getElementById("scrollholder6").style.display = "none";}
		if (s5_ifvisible_sa >= 7) {
		document.getElementById("scrollholder7").style.display = "none";}
		if (s5_ifvisible_sa >= 8) {
		document.getElementById("scrollholder8").style.display = "none";}
		if (s5_ifvisible_sa >= 0) {
		document.getElementById("scrollholder").style.display = "none";}
		document.getElementById("scrollholder9").style.opacity = 0;
		document.getElementById("scrollholder9").style.filter = 'alpha(opacity=0)';
		document.getElementById("scrollholder9").style.display = "block";
		s5_opacityon_sa('scrollholder9');
		}

function s5_opacityon_sa(id) {
 //if an element is invisible, make it visible, else make it ivisible
 opacity(id, 0, 100, 800);
}

var is_ie/*@cc_on = {
  // quirksmode : (document.compatMode=="BackCompat"),
  version : parseFloat(navigator.appVersion.match(/MSIE (.+?);/)[1])
}@*/;

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	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 + ")";
}

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	//make image transparent
	changeOpac(0, imageid);
	//make new image
	document.getElementById(imageid).src = imagefile;
	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}}

function blendimage2(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = document.getElementById(s5_backgroundimage).style.backgroundImage;
	//make image transparent
	changeOpac(0, imageid);
	//make new image
	document.getElementById(divid).style.backgroundImage = imagefile;
	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100; }
	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}