﻿
/*
Code for front page animation
*/

var shown;
var originalwidth = 320;
var doublewidthstring = (originalwidth * 1.2) + "px";
var halfwidthstring = (originalwidth / 1.2) + "px";
var originalwidthstring = originalwidth + "px";


function hidemenus() {
    $("#whychooseusmenu").hide();
    $("#whatwedomenu").hide();
    $("#whowearemenu").hide();
    shown = false;
}


function resetmenus() {


    $("#whatwedo").stop().animate({ width: originalwidthstring }, 500);
    $("#whoweare").stop().animate({ width: originalwidthstring }, 500);
    $("#whychooseus").stop().animate({ width: originalwidthstring }, 500);


    hidemenus();
}


function whychooseusmouseover() {
    $("#whychooseus").stop().animate({ width: doublewidthstring }, 500, function () {
        if (!shown) {
            $("#whychooseusmenu").stop().show("blind");
            $("#whychooseusextratext").stop().show("blind");
            shown = true;
        }
    });
    $("#whatwedo").stop().animate({ width: halfwidthstring }, 500);
    $("#whoweare").stop().animate({ width: halfwidthstring }, 500);
}
function whatwedomouseover() {
    $("#whychooseus").stop().animate({ width: halfwidthstring }, 500);
    $("#whatwedo").stop().animate({ width: doublewidthstring }, 500, function () {
        if (!shown) {
            $("#whatwedomenu").stop().show("blind");
            $("#whatwedoextratext").stop().show("blind");
            shown = true;
        }
    });
    $("#whoweare").stop().animate({ width: halfwidthstring }, 500);
}

function whowearemouseover() {
    $("#whychooseus").stop().animate({ width: halfwidthstring }, 500);
    $("#whatwedo").stop().animate({ width: halfwidthstring }, 500);
    $("#whoweare").stop().animate({ width: doublewidthstring }, 500, function () {
        if (!shown) {
            $("#whowearemenu").stop().show("blind");
            $("#whoweareextratext").stop().show("blind");
            shown = true;
        }

    });
}

function whychooseusmouseovernoexpand() {

    if (!shown) {
        $("#whychooseusmenu").stop().show("blind");
        shown = true;
    }


}
function whatwedomouseovernoexpand() {

    if (!shown) {
        $("#whatwedomenu").stop().show("blind");
        shown = true;
    }

}

function setMenu(name) {
    var elemId = "#menu" + name;
    $(elemId).css("background-image", "url('../../Content/images/NavBackground_Selected.png')");
    $(elemId).css("background-position", "0px 0px");
    $(elemId).addClass("active");
}
