﻿var current = 0;
var i = 0;

function Up()
{
  var rows = $("div.photos > div").size();
  if (current > 0)
  {
    $("div.photos div:nth-child(" + current + ")").slideDown("normal");
    current = current - 1;
  }
}

function Down()
{
  var rows = $("div.photos > div").size();
  if (current < (rows - 1))
  {
    current = current + 1;
    if (current < 1) { current = 1; }
    $("div.photos div:nth-child(" + current + ")").slideUp("normal");
  }
}

function ScrollUp()
{
    var rows = $("div.scroll > div").size();
    if (current > 0)
    {
        $("div.scroll div:nth-child(" + current + ")").slideDown("normal");
        current = current - 1;
    }
}

function ScrollDown()
{
    var rows = $("div.scroll > div").size();
    if (current < (rows - 1))
    {
        current = current + 1;
        if (current < 1) { current = 1; }
        $("div.scroll div:nth-child(" + current + ")").slideUp("normal");
    }
}

function ScrollMultipleUp()
{
    var rows = $("div.scroll > div").size();
    if (current > 0)
    {
        $("div.scroll div:nth-child(" + current + ")").slideDown("200");
        current = current - 1;
    }
}

function ScrollMultipleDown()
{
    var rows = $("div.scroll > div").size();
    if (current < (rows - 1))
    {
        current = current + 1;
        if (current < 1) { current = 1; }
        $("div.scroll div:nth-child(" + current + ")").slideUp("normal");
    }
}

function videoEndEvent()
{
    current = 1;
    var movieContainer = document.getElementById('flashPlayer');
    movieContainer.style.display = "none";
    $("div.scrollPlayer img:nth-child(" + current + ")").show("normal");
    setTimeout("HideImage()", 4500);
}
function HideImage()
{
    if (current <= 5)
    {
        $("div.scrollPlayer img:nth-child(" + current + ")").fade("normal");
        setTimeout("ShowImage()", 500);
    }
}
function ShowImage()
{
    current = current + 1;
    if (current <= 5)
    {
        $("div.scrollPlayer img:nth-child(" + current + ")").show("normal");
        setTimeout("HideImage()", 4500);
    }
}

//Used for dynamic menu content
function helpHover()
{
    var linkElement = document.getElementById("helpLink");
    linkElement.style.backgroundImage = "none";
}
function helpOut()
{
    var linkElement = document.getElementById("helpLink");
    linkElement.style.backgroundImage = "url(http://www.imta.com/img/help.jpg)";
}
function Hover(elementName)
{
    var linkElement = document.getElementById(elementName);
    linkElement.style.backgroundImage = "none";
}
function Out(elementName, imageName)
{
    var linkElement = document.getElementById(elementName);
    var imagePath = "http://www.imta.com/img/" + imageName;
    linkElement.style.backgroundImage = "url(" + imagePath + ")";
}

