var wpf;
var currentSlide = 1;

function Slides(target) {
	wpf = document.getElementById("wpfobj");
}

function enterPause (sender, eventArgs)
{
	var o = wpf.FindName("pause_over");
	o.SetValue("Opacity", 1);
}
function leavePause (s,e)
{
	var o = wpf.FindName("pause_over");
	o.SetValue("Opacity", 0);
}
function downPause (sender, eventArgs)
{
	var o = wpf.FindName("pause_down");
	o.SetValue("Opacity", 1);
}
function upPause (sender, eventArgs)
{
	var o = wpf.FindName("pause_down");
	o.SetValue("Opacity", 0.01);
    
    if (currentSlide < 7) {
	    var s = wpf.FindName("story_slideNext"+currentSlide);
	    s.Begin();
	    currentSlide++;
	}
}
function enterBack (sender, eventArgs)
{
	var o = wpf.FindName("back_over");
	o.SetValue("Opacity", 1);
}
function leaveBack (sender, eventArgs)
{
	var o = wpf.FindName("back_over");
	o.SetValue("Opacity", 0);
}
function downBack (sender, eventArgs)
{
	var o = wpf.FindName("back_down");
	o.SetValue("Opacity", 1);
}
function upBack (sender, eventArgs)
{
	var o = wpf.FindName("back_down");
	o.SetValue("Opacity", 0.01);
	    
    if (currentSlide > 1) {
	    currentSlide--;
	    var s = wpf.FindName("story_slideNext"+currentSlide);
	    s.Stop();
	}
}

