// JavaScript Document



var bannerImg = new Array();
  // Enter the names of the images below
  bannerImg[0]="http://www.stolenchair.org/_images/_content/works/RepPoster.jpg";
  bannerImg[1]="http://www.stolenchair.org/_images/_content/works/RepPosterupslide.jpg";
 

var newBanner = 0;
var totalBan = bannerImg.length;

function cycleBan() {
  newBanner++;
  if (newBanner == totalBan) {
    newBanner = 0;
  }
  document.banner.src=bannerImg[newBanner];
  // set the time below for length of image display
  // i.e., "4*1000" is 4 seconds
  setTimeout("cycleBan()", 4*1000);
}
window.onload=cycleBan;




	var productionslides=new Array();
productionslides = [
 "_images/_content/ProductionSlides/ProductionSlideKinderspiel.jpg",
 "_images/_content/ProductionSlides/ProductionSlideKillMe.jpg",
 "_images/_content/ProductionSlides/ProductionSlideManWhoLaugs.jpg",
 "_images/_content/ProductionSlides/ProductionSlideCommedia.jpg",
 "_images/_content/ProductionSlides/ProductionSlideStageKiss.jpg"
];

var productionurls=new Array();
productionurls = [
		"http://www.stolenchair.org/OldWebsite/kinderspiel/",
		"http://www.stolenchair.org/OldWebsite/killme/",
		"http://www.stolenchair.org/OldWebsite/manwholaughs/",
		"http://www.stolenchair.org/OldWebsite/commedia/",
		"http://www.stolenchair.org/OldWebsite/stagekiss/"
		];



var stillsslides=new Array();
stillsslides = [
 "_images/_content/StillsSlides/photoslidetest.jpg",
 "_images/_content/StillsSlides/photoslidetest2.jpg",
 "_images/_content/StillsSlides/photoslidetest3.jpg",
 "_images/_content/StillsSlides/photoslidetest4.jpg",
 "_images/_content/StillsSlides/photoslideMax.jpg",
 "_images/_content/StillsSlides/photoslidePhyllida.jpg",
 "_images/_content/StillsSlides/photoslideTuzia.jpg",
 "_images/_content/StillsSlides/photoslideNeptune.jpg",
 "_images/_content/StillsSlides/photoslideJones.jpg",
 "_images/_content/StillsSlides/photoslideIntertitle.jpg",
 "_images/_content/StillsSlides/photoslideIntertitle2.jpg",
 "_images/_content/StillsSlides/photoslideTassi.jpg"
 
];

var stillsurls=new Array();
stillsurls = [
		"http://www.stolenchair.org/OldWebsite/killme/",
		"http://www.stolenchair.org/OldWebsite/kinderspiel/",
		"http://www.stolenchair.org/OldWebsite/killme/",
		"http://www.stolenchair.org/OldWebsite/theaccidentalpatriot/",
		"http://www.stolenchair.org/OldWebsite/kinderspiel/",
		"http://www.stolenchair.org/OldWebsite/stagekiss/",
		"http://www.stolenchair.org/OldWebsite/commedia/",
		"http://www.stolenchair.org/OldWebsite/stagekiss/",
		"http://www.stolenchair.org/OldWebsite/killme/",
		"http://www.stolenchair.org/OldWebsite/manwholaughs/",
		"http://www.stolenchair.org/OldWebsite/manwholaughs/",
		"http://www.stolenchair.org/OldWebsite/commedia/"
		];



clickMenu = function(menu,element,cname,doMore,doStills,doProduction,doTabbed) {
	
	
	
if(doMore){	var getEls = document.getElementById(menu).getElementsByTagName(element);

	for (var i=0; i<getEls.length; i++) {
			getEls[i].onclick=function() {
			if ((this.className.indexOf(cname))!=-1)
			{
			if ((this.className.indexOf('click'))!=-1) {
				this.className=this.className.replace("click", "");
				}
				else {
				this.className+=" click";
				}
			}
		}
	}
}
	
if(doStills)	{var choice;
choice = Math.floor(Math.random()*stillsslides.length);
document.place.src=stillsslides[choice];
document.getElementById('links').href=stillsurls[choice];
}

if(doProduction){
var choiceB;
choiceB = Math.floor(Math.random()*productionslides.length);
document.placeB.src=productionslides[choiceB];
document.getElementById('linksB').href=productionurls[choiceB];	
}


if(doTabbed) {
	var e, i = 0;
	while (e = document.getElementById('gallery').getElementsByTagName ('DIV') [i++]) {
		if (e.className == 'on' || e.className == 'off') {
		e.onclick = function () {
			var getEls = document.getElementsByTagName('DIV');
				for (var z=0; z<getEls.length; z++) {
				getEls[z].className=getEls[z].className.replace('show', 'hide');
				getEls[z].className=getEls[z].className.replace('on', 'off');
				}
			this.className = 'on';
			var max = this.getAttribute('title');
			document.getElementById(max).className = "show";
			}
		}
	}
}
}

$j(document).ready(function() {
	$j(".personname").click(function(){
		var daddy = this.parentNode.id;
		var baby = $j("#" + daddy + "-pop");
		var babyVis = $j(baby).css("display");
		if(babyVis == "none"){
			$j(".personinfo").css({ display:"none" });
			$j(baby).css({ display:"block" });
			$j("#who-copy").addClass("faded");
		} else {
			$j(baby).css({ display:"none" });
			$j("#who-copy").removeClass("faded");
		}
	});
	$j(".personname-text").click(function(){
		var daddy = this.parentNode.id;
		var baby = $j("#" + daddy + "-pop");
		var babyVis = $j(baby).css("display");
		if(babyVis == "none"){
			$j(".personinfo").css({ display:"none" });
			$j(baby).css({ display:"block" });
			$j("#who-copy").addClass("faded");
		} else {
			$j(baby).css({ display:"none" });
			$j("#who-copy").removeClass("faded");
		}
	});
	$j(".person-image").click(function(){
		var daddy = this.parentNode.id;
		var baby = $j("#" + daddy + "-pop");
		var babyVis = $j(baby).css("display");
		if(babyVis == "none"){
			$j(".personinfo").css({ display:"none" });
			$j(baby).css({ display:"block" });
			$j("#who-copy").addClass("faded");
		} else {
			$j(baby).css({ display:"none" });
			$j("#who-copy").removeClass("faded");
		}
	});
	$j(".person").mouseover(function(){
		var imgdaddy = this.id;
		$j("#" + imgdaddy + "-image").css({backgroundPosition:"0 -130px"});
	})
	$j(".person").mouseout(function(){
		var imgdaddy = this.id;
		$j("#" + imgdaddy + "-image").css({backgroundPosition:"0 0"});
	})
	$j(".personinfo").click(function(){
		this.style.display = "none";
		$j("#who-copy").removeClass("faded");
	});
	$j("#cs-nav a").click(function(){
      var changeTo = this.id;
      $j(".slide").removeClass("current");
      $j("#" + changeTo + "-body").addClass("current");
      $j("#cs-nav a").removeClass("active");
      $j("#" + changeTo).addClass("active");
      return false;
    })
    
});
