
//var buttonactive='b1'; 
var curLogoImg='1'; 

if (document.images) {

	Logo= new Image (256,474);
	Logo.src= "images/blank.gif";

	Logoo= new Image (256,474);
	Logoo.src= "images/logoo.jpg";

	b0= new Image (32,32);
	b0.src= "images/blank.gif";

	for (i=1; i<=6; i++){
		eval('b'+i+'= new Image (32,32)');
		eval('b'+i+'.src= "images/b'+i+'.png"');
		eval('b'+i+'o= new Image (32,32)');
		eval('b'+i+'o.src= "images/b'+i+'o.png"');
	}

}

function MouseOver(imgid,imgaction){
	if (!document.images) return true;

	eval('var a = document.images.'+imgid+';');
	if (imgaction==1 && buttonactive != imgid){
		//if (a.filters){
		//	a.style.filter="blendTrans(duration=.1)";
		//	a.filters.blendTrans.Apply();
		//}
		eval('a.src='+imgid+'o.src');
		//if (a.filters){
		//	a.filters.blendTrans.Play();
		//}
	}
	if (imgaction==0 && buttonactive != imgid){
		if (a.filters){
			a.style.filter="blendTrans(duration=.5)";
			a.filters.blendTrans.Apply();
		}
		eval('a.src=b0.src');
		if (a.filters){
			a.filters.blendTrans.Play();
		}
	}
	return true;
}

currentRecipient = '';

function sendEmail(emailAddress){
	currentRecipient = emailAddress;
	if (emailAddress != ''){
		generalContactWindow=window.open('https://plus13.safe-order.net/scottdanahynaylon/contactemail.php','generalContactWindow','width=300,height=410,top=0,left=0,scrollbars=auto');
		generalContactWindow.document.close();
		 if (!generalContactWindow.opener){generalContactWindow.opener=self};
		generalContactWindow.focus();
	} else {
		alert('We are sorry. This location can not be contacted by email.');
	}
}




// Speed (milliseconds)
var LogoSpeed = 1000

// Crossfade Duration (seconds)
var LogoFadeDuration = 1

var LogoImg = new Array()
LogoImg[0] = 'images/logo/1.jpg'
LogoImg[1] = 'images/logo/2.jpg'
LogoImg[2] = 'images/logo/3.jpg'
LogoImg[3] = 'images/logo/4.jpg'
LogoImg[4] = 'images/logo/5.jpg'
LogoImg[5] = 'images/logo/6.jpg'
LogoImg[6] = 'images/logo/7.jpg'
LogoImg[7] = 'images/logo/8.jpg'
LogoImg[8] = 'images/logo/9.jpg'
LogoImg[9] = 'images/logo/10.jpg'
LogoImg[10] = 'images/logo/11.jpg'
LogoImg[11] = 'images/logo/12.jpg'
LogoImg[12] = 'images/logo/13.jpg'
LogoImg[13] = 'images/logo/14.jpg'
LogoImg[14] = 'images/logo/15.jpg'
LogoImg[15] = 'images/logo/16.jpg'
LogoImg[16] = 'images/logo/17.jpg'
LogoImg[17] = 'images/logo/18.jpg'
LogoImg[18] = 'images/logo/19.jpg'
LogoImg[19] = 'images/logo/20.jpg'

function preLoadSlideShow(ImgArrayName){
	eval(ImgArrayName+'Index = 0;');
	eval(ImgArrayName+'PreLoad = new Array();');
	eval('for (i = 0; i < '+ImgArrayName+'.length; i++){'+ImgArrayName+'PreLoad[i] = new Image(); '+ImgArrayName+'PreLoad[i].src = '+ImgArrayName+'[i];}');
}

preLoadSlideShow('LogoImg');



function nextSlideShow(SlideShowObj,FadeDuration,ImgArrayName){
	if (!document.images) return
	//http://brainerror.net/scripts/javascript/blendtrans/

	var a = document.getElementById(SlideShowObj);
	if (a.filters){
		a.style.filter="blendTrans(duration=FadeDuration)";
		a.filters.blendTrans.Apply();
	}
	eval('a.src = '+ImgArrayName+'PreLoad['+ImgArrayName+'Index].src;');
	if (a.filters){
		a.filters.blendTrans.Play()
	}
	eval(ImgArrayName+'Index = '+ImgArrayName+'Index + 1;');
	eval('if ('+ImgArrayName+'Index > ('+ImgArrayName+'.length-1)) '+ImgArrayName+'Index=0;');
}

function startSlideShow(SlideShowObj,FadeDuration,ImgArrayName,Speed){
	eval(SlideShowObj+'Interval = setInterval(\'nextSlideShow("'+SlideShowObj+'","'+FadeDuration+'","'+ImgArrayName+'")\',Speed);');
}

function activateButton(){
	if (document.images) {
		startSlideShow("Logo",LogoFadeDuration,"LogoImg",LogoSpeed);
		eval(buttonactive+'a= new Image (32,32)');
		eval(buttonactive+'a.src= "images/'+buttonactive+'a.png"');
		eval('document.images.'+buttonactive+'.src='+buttonactive+'a.src');
	}
	return true;
}
window.onload = activateButton;
