/// <reference path="jquery-1.3.1-vsdoc.js" />
/// <reference path="swfobject-vsdoc.js" />
/// <reference path="sifr-vsdoc.js" />


$(document).ready(function() {

    theImage = document.getElementById('source-image');

    //var $orwinheight = theImage.height;
    //var $orwinwidth = theImage.width;

    var $winheight = $(window).height();
    var $winwidth = $(window).width();

    theImage.width = $winwidth;
    theImage.height = $winheight;

    $(window).bind("resize", function() {

        $winheight = $(window).height();
        $winwidth = $(window).width();


        $("img.source-image").attr({
            width: $winwidth,
            height: $winheight
        });


    });




    // Set menu left height

    var center_height = $("#div_middle_center").height();
    var left_height = $("#div_middle_left").height();

    if (center_height != null && left_height != null && center_height > left_height) {
        var left_menu = document.getElementById('div_middle_left');
        left_menu.style.height = center_height + 'px';
    }

    else if (center_height != null && left_height != null && center_height < left_height) {
        var content = document.getElementById('div_middle_center');
        content.style.height = left_height + 'px';
    }


    $('.menu_level1_li').css({ backgroundPosition: '-150px 0px' });

    $('.menu_level1_li', this).hover(
        function() {

            //$(this).addClass('menu_level1_li_sel');

            //$(this).stop();

            $('.menu_level1_link', this).addClass('menu_level1_link_sel');

            //$('.menu_level1_li').animate({ backgroundPosition: '-150px 0px' }, 500, 'linear');
            $(this).stop().animate({ backgroundPosition: '0px 0px' }, 0);

            //$(this).css({ backgroundPosition: '0px 0px' });

            //$(this).show().css({ background:"url('../images/left_menu_lev1_sel.png') no-repeat"});




            },
            function() {


                //$(this).stop();
                //$(this).removeClass('menu_level1_li_sel');
                $(this).stop().animate({ backgroundPosition: '-150px 0px' }, 500);
                $('.menu_level1_link', this).removeClass('menu_level1_link_sel');
            }

            //$('.menu_level1_link', this).addClass('menu_level1_link_sel');

            //$(this).css({ backgroundPosition: '0px 0px' });
        

    );




    $('.menu_level2_li').css({ backgroundPosition: '-120px 0px' });


    $('.menu_level2_li', this).hover(
        function() {

            //$(this).addClass('menu_level1_li_sel');

            //$(this).stop();

            $('.menu_level2_link', this).addClass('menu_level2_link_sel');

            //$(this).stop().animate({ backgroundPosition: '-120px 0px' }, 500);

            //$('.menu_level1_li').animate({ backgroundPosition: '-150px 0px' }, 500, 'linear');
            $(this).stop().animate({ backgroundPosition: '0px 0px' }, 0);

            //$(this).addClass('is_animated');

            //$(this).css({ backgroundPosition: '0px 0px' });

            //$(this).show().css({ background:"url('../images/left_menu_lev1_sel.png') no-repeat"});

},


            function() {


                //$(this).stop();
                //$(this).removeClass('menu_level1_li_sel');
                $(this).stop().animate({ backgroundPosition: '-120px 0px' }, 500);
                $('.menu_level2_link', this).removeClass('menu_level2_link_sel');
            }

            //$('.menu_level1_link', this).addClass('menu_level1_link_sel');

            //$(this).css({ backgroundPosition: '0px 0px' });
        

    );




    $('.bottom_image_odd', this).hover(
        function() {
            $('.bottom_image_link', this).addClass('bottom_image_link_sel');
        },
        function() {
            $('.bottom_image_link', this).removeClass('bottom_image_link_sel');
        }
    );


    $('.bottom_image_even', this).hover(
        function() {
            $('.bottom_image_link', this).addClass('bottom_image_link_sel');
        },
        function() {
            $('.bottom_image_link', this).removeClass('bottom_image_link_sel');
        }
    );



    /*
    
    });
    */



    /*
    $("img.source-image").attr({
    width: $winwidth
    });
    */



});
