/*****************************************************
 * swapper for home baskets
 *****************************************************/
function swap1(content, button, buttonDist) {
	if (document.swap1Content) {
		if (document.swap1Content == content) return;
		if (document.getElementById(document.swap1Content)) {
			document.getElementById(document.swap1Content).style.display="none";
		}
		document.swap1Content = null;
	}

	if (document.swap1Button) {
		if (document.swap1Button == button) return;
		if (document.getElementById(document.swap1Button)) {
			document.getElementById(document.swap1Button).style.backgroundPosition="0px 0px";
		}
		document.swap1Button = null;
	}

	if (document.getElementById(content)) {
		document.getElementById(content).style.display="block";
		document.swap1Content=content;
		document.getElementById(button).style.backgroundPosition=(buttonDist);		
		document.swap1Button=button;
	}
}
function swap2(content, button, buttonDist) {
	
	if (document.swap2Content) {
		if (document.swap2Content == content) return;
		if (document.getElementById(document.swap2Content)) {
			document.getElementById(document.swap2Content).style.display="none";
		}
		document.swap2Content = null;
	}

	if (document.swap2Button) {
		if (document.swap2Button == button) return;
		if (document.getElementById(document.swap2Button)) {
			document.getElementById(document.swap2Button).style.backgroundPosition="0px 0px";
		}
		document.swap2Button = null;
	}

	if (document.getElementById(content)) {
		document.getElementById(content).style.display="block";
		document.swap2Content=content;
		document.getElementById(button).style.backgroundPosition=(buttonDist);		
		document.swap2Button=button;
	}
	clearInterval(document.kill);
}
function swap3(content, button, buttonDist) {
	if (document.swap3Content) {
		if (document.swap3Content == content) return;
		if (document.getElementById(document.swap3Content)) {
			document.getElementById(document.swap3Content).style.display="none";
		}
		document.swap3Content = null;
	}

	if (document.swap3Button) {
		if (document.swap3Button == button) return;
		if (document.getElementById(document.swap3Button)) {
			document.getElementById(document.swap3Button).style.backgroundPosition="0px 0px";
		}
		document.swap3Button = null;
	}

	if (document.getElementById(content)) {
		document.getElementById(content).style.display="block";
		document.swap3Content=content;
		document.getElementById(button).style.backgroundPosition=(buttonDist);		
		document.swap3Button=button;
	}
}
/*****************************************************
 * the hero diorama: this function came from Trish McDonough on wiki.script.aculo.us/scriptaculous/show/EffectsTreasureChest
 *****************************************************/
    function majDiorama() 
    {
       var eff = 'appear';
       var dur = 4;
       var inter = 7;
	   var counter = 1;
       
       //show first picture as page loads
        Effect.toggle('contentHero' + counter, eff, { duration: 0 });
					document.btn2.style.backgroundPosition='0px -87px';
       var count = counter + 1;
       var tohide = counter;

		   document.kill = setInterval(function() {
				   //fades out last picture - fades in next
					document.btn2.style.backgroundPosition='0px 0px';
				   Effect.toggle('contentHero' + tohide, eff, { duration: dur });
					document.btn2.style.backgroundPosition='0px -87px';
				   Effect.toggle('contentHero' + count, eff, { duration: dur });
				   tohide = count;
				   count = (count == 3) ? counter : count + 1;
		   },inter * 1000);
    }
    

//-->
