﻿//<!--This tutorial is provided in part by Server Intellect Web Hosting Solutions http://www.serverintellect.com-->
//<!--Visit http://www.JavaScriptatoms.com for more JavaScript Tutorials-->
/// <reference path="jquery-1.4.1.min.js" />

$("document").ready(function () {
    $("#mainanim > *").fadeOut();
    $(".anim1, .anim3, .anim5").fadeIn("fast", function () {
        $(this).fadeOut("fast");
        $(".anim2, .anim4, .anim6").fadeIn("fast", function () {
            $(".anim , .animm").fadeOut("fast");
            $("#mainanim").fadeOut("slow", function () {
                $("#main").fadeIn("fast");
            });
        })

    })


    $("#home").mouseenter(function () {
        $(".button").find(".spn").fadeOut(100).animate({ top: '-50' }, 1);
        $(this).removeClass("btnHomeback").removeClass("btnHome").addClass("btnHomeOver");
        $("#shadow").addClass("shadow");
        $("#home").find(".spn").animate({ top: '45' }, 80,
             function () {
                 $(this).fadeIn(100);

                 $(this).animate({ top: '55', opacity: '0.5' }, 20,
                function () {

                    $(this).animate({ top: '45', opacity: '1' }, 50)
                }
                )
             }
        )



    });

    $("#home").mouseleave(function () {
        $(this).removeClass("btnHomeOver").addClass("btnHomeback");

        $("#shadow").removeClass("shadow");
        $(this).find(".spn").fadeOut(100).animate({ top: '-50' }, 80);

    })

    //-----------------------------------------------------
    $("#about").mouseenter(function () {

        $(this).removeClass("btnAboutback").removeClass("btnAbout").addClass("btnAboutOver");
        $("#shadow1").addClass("shadow");
        $("#about").find(".spn").animate({ top: '45' }, 80,
             function () {
                 $(this).fadeIn(100);

                 $(this).animate({ top: '55', opacity: '0.5' }, 30,
                function () {

                    $(this).animate({ top: '45', opacity: '1' }, 50)
                }
                )
             }
        )



    });

    $("#about").mouseleave(function () {

        $(this).removeClass("btnAboutOver").addClass("btnAboutback");
        $("#shadow1").removeClass("shadow");
        $(this).find(".spn").fadeOut(100).animate({ top: '-50' }, 80);

    })
    //---------------------------------------------------------------
    $("#service").mouseenter(function () {

        $(this).removeClass("btnserviceback").removeClass("btnservice").addClass("btnserviceOver");
        $("#shadow2").addClass("shadow");
        $("#service").find(".spn").animate({ top: '45' }, 80,
             function () {
                 $(this).fadeIn(100);

                 $(this).animate({ top: '55', opacity: '0.5' }, 30,
                function () {

                    $(this).animate({ top: '45', opacity: '1' }, 50)
                }
                )
             }
        )



    });

    $("#service").mouseleave(function () {

        $(this).removeClass("btnserviceOver").addClass("btnserviceback");
        $("#shadow2").removeClass("shadow");
        $(this).find(".spn").fadeOut(100).animate({ top: '-50' }, 80);

    })
    //--------------------------------------------------------------------
    $("#sample").mouseenter(function () {

        $(this).removeClass("btnsampleback").removeClass("btnsample").addClass("btnsampleOver");
        $("#shadow3").addClass("shadow");
        $("#sample").find(".spn").animate({ top: '45' }, 80,
             function () {
                 $(this).fadeIn(100);

                 $(this).animate({ top: '55', opacity: '0.5' }, 30,
                function () {

                    $(this).animate({ top: '45', opacity: '1' }, 50)
                }
                )
             }
        )



    });

    $("#sample").mouseleave(function () {

        $(this).removeClass("btnsampleOver").addClass("btnsampleback");
        $("#shadow3").removeClass("shadow");
        $(this).find(".spn").fadeOut(100).animate({ top: '-50' }, 80);

    })
    //--------------------------------------------------------------------

    $("#customer").mouseenter(function () {

        $(this).removeClass("btncustomerback").removeClass("btncustomer").addClass("btncustomerOver");
        $("#shadow4").addClass("shadow");
        $("#customer").find(".spn").animate({ top: '45' }, 80,
             function () {
                 $(this).fadeIn(100);

                 $(this).animate({ top: '55', opacity: '0.5' }, 30,
                function () {

                    $(this).animate({ top: '45', opacity: '1' }, 50)
                }
                )
             }
        )



    });

    $("#customer").mouseleave(function () {

        $(this).removeClass("btncustomerOver").addClass("btncustomerback");
        $("#shadow4").removeClass("shadow");
        $(this).find(".spn").fadeOut(100).animate({ top: '-50' }, 80);

    })
    //--------------------------------------------------------------
    $("#contact").mouseenter(function () {

        $(this).removeClass("btncontactback").removeClass("btncontact").addClass("btncontactOver");
        $("#shadow5").addClass("shadow");
        $("#contact").find(".spn").animate({ top: '45' }, 80,
             function () {
                 $(this).fadeIn(100);

                 $(this).animate({ top: '55', opacity: '0.5' }, 30,
                function () {

                    $(this).animate({ top: '45', opacity: '1' }, 50)
                }
                )
             }
        )



    });

    $("#contact").mouseleave(function () {

        $(this).removeClass("btncontactOver").addClass("btncontactback");
        $("#shadow5").removeClass("shadow");
        $(this).find(".spn").fadeOut(100).animate({ top: '-50' }, 80);

    })
    //--------------------------------------------------------------
    $(".button").click(function () {
        var url = $(this).attr("rel");
        document.location = "page.html?p=" + url;
    });


});


