// JavaScript Document
prevlink=0;
var scpp = new Array();
var scpc = new Array();
var scpd = new Array();

function gotoURL(linkage) {
	document.location.href=linkage;
}

function show_description(fname) {
	document.getElementById('ccont').innerHTML = '<iframe width="477px" height="322px" frameborder="0" scrolling="auto" src="descriptions/'+fname+'.html"></iframe>';
}

function show_episodes(fname) {
	document.getElementById('ccont').innerHTML = '<iframe width="427px" height="322px" frameborder="0" scrolling="auto" src="episodes/'+fname+'.html"></iframe>';
}

function show_activity(id, special) {

	if (document.getElementById('ep'+prevlink+'_act')) document.getElementById('ep'+prevlink+'_act').style.display = 'none';
	document.getElementById('ep'+id+'_act').style.display = ''; 
	prevlink = id;

}

function hide_activity(id, special) {
	document.getElementById('ep'+id+'_act').style.display = 'none'; 

}

function hop(num) {
	clearInterval(scpp[num]);

	if (!scpd[num]) {
		//scpd[num] = new Array(img.width, img.height);
	} else {
		//img.width = scpd[num][0];
		//img.height = scpd[num][1];
	}
	scpp[num] = setInterval(function() { hopping_out(num); }, 10);
	scpc[num]=0;
}

function hopping_out(num) {
	//img.height+=1;
	img = document.getElementById('img'+num);

	img.style.paddingBottom = scpc[num]+'px';
	//img.width+=1;
	scpc[num]+=2;

	if (scpc[num]>5) {
		clearInterval(scpp[num]);
		scpp[num] = setInterval(function() { hopping_in(num); }, 10);
	}
}

function hopping_in(num) {
	//img.height-=1;
	//img.width-=1;
	img = document.getElementById('img'+num)

	img.style.paddingBottom = scpc[num]+'px';
	scpc[num]-=2;
	if (scpc[num]<0) {
		img.width = scpd[num][0];
		img.height = scpd[num][1];
		clearInterval(scpp[num]);
	}
}