﻿function changeDisplay(map){
	for(i in map){
		var display=map[i];
		$(i).css("display",display);
	}
}

function readyHelpAction(){
	
	helpGeneralAction();
	
	helpTimeAction();
	
}

function helpGeneralAction(){
	$("#showHelpGeneral").click(function(){
		var map={'#helpLayer_1':'block','select':'none'};
		changeDisplay(map);
		
		document.getElementById("Captivate1").Play();
	});
	
	$("#showHelpGeneral").mouseover(function(){
		$(this).toggleClass("hover");
	}).mouseout(function(){
		$(this).toggleClass("hover");
	});
	
	$("#playHelp").click(function(){
		document.getElementById("Captivate1").Play();
	});
	
	$("#closeHelpGeneral").click(function(){
		var map={'#helpLayer_1':'none','select':'block'};
		changeDisplay(map);
		
		document.getElementById("Captivate1").Rewind();
	});
}

function helpTimeAction(){

	$("#showHelpTime").click(function(){
		var map={'#timeHelpLayer':'block','select':'none'};
		changeDisplay(map);
		
		document.getElementById("timeCaptivate").Play();
	});
	
	$("#showHelpTime").mouseover(function(){
		$(this).toggleClass("hover");
	}).mouseout(function(){
		$(this).toggleClass("hover");
	});
	
	$("#timePlayHelp").click(function(){
		document.getElementById("timeCaptivate").Play();
	});
	
	$("#closeHelpTime").click(function(){
		var map={'#timeHelpLayer':'none','select':'block'};
		changeDisplay(map);
		
		document.getElementById("timeCaptivate").Rewind();
	});
}
