        //SLIDES  - array
        var Slides=new Array();
        var Counter=0, NOS=5;
        var t;
        var SS_isPushed=0;
        var GalleryName='People'; idCatalog=100;
        var myWidth = 0, myHeight = 0;

        if( typeof( window.innerWidth ) == 'number' ) {
          //Non-IE
          myWidth = window.innerWidth;
          myHeight = window.innerHeight;
        } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
          //IE 6+ in 'standards compliant mode'
          myWidth = document.documentElement.clientWidth;
          myHeight = document.documentElement.clientHeight;
        } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
          //IE 4 compatible
          myWidth = document.body.clientWidth;
          myHeight = document.body.clientHeight;
        }

//--------------------------------
// centering a DIV off another DIV
        function center_div(id_div,offset_X,offset_Y) {

          if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
          }

          _left=(myWidth-$(id_div).width())/2+offset_X;
          _top=(myHeight-$(id_div).height())/2+20;

          if (_left<0)
              {left=0;}
          if (_top<0)
              {_top=5;}
          else {_top=20}
        $(id_div).css('left',_left);
        $(id_div).css('top',_top);
        }

//--------------------------------
        function center_div_off_parent(id_div,par_div,offset_X,offset_Y)
        {
          $(id_div).css('left',($(par_div).width()-$(id_div).width())/2+offset_X);
          $(id_div).css('top',($(par_div).height()-$(id_div).height())/2+offset_Y);
          return false;
        }



//--------------------------------
//menu result managment
        function MenuResult(ItemName,ItemNumber)
        {
    // change gallery
          if (isFinite(ItemNumber))
          {
            idCatalog=Number(ItemNumber);
            GalleryName=ItemName;
            Counter=0;
            $.get("slides.php", {IdCatalog:idCatalog}, function(data){parseMyXML(data);}, "xml" );
            }
    // goto page
          else
          {
          document.location=ItemNumber;
          };

          return false;
        }
//******************************

//<![CDATA[
        $(document).ready(function()
          {

// Dialogs
    		$('#dialog').dialog({
    			autoOpen: false,
    			width: 600,
                maxHeight: 600,
                modal: true,
                resizable: false,
                zIndex: 200 ,
                position: ['center','top'],
                dialogClass: 'alert',
    			buttons: {
    				"close": function() {
    					$(this).dialog("close");
    				}
    			}
    		});

            $("#tabs").tabs();

            // BUTTONS
            $('.fg-button').hover(
                function(){ $(this).removeClass('ui-state-default').addClass('ui-state-focus');  $(this).trigger('click') },
                function(){ $(this).removeClass('ui-state-focus').addClass('ui-state-default'); }
            );

            $('.service_picture').hover(
                function() {$(this).stop().animate({ opacity: 0.75 }, 'fast', 'easeOutElastic');},
                function() {$(this).stop().animate({ opacity: 1.0}, 'fast','easeInElastic');}
            );

            $('#bottom_links img').hover(
                function() {$(this).stop().animate({ width: '78px' }, 10 );},
                function() {$(this).stop().animate({ width: '80px'}, 10 );}
            );

            $('#extra_links img').hover(
                function() {$(this).stop().animate({ width: '78px' }, 10 );},
                function() {$(this).stop().animate({ width: '80px'}, 10 );}
            );

            $('.menu_icon').hover(
                function() {$(this).stop().animate({ width: '28px', height: '28px' }, 10 );},
                function() {$(this).stop().animate({ width: '30px', height: '30px'}, 10);}
            );

            // MENUS

            // or from an external source
            $.get('ServicesMenuContent.html', function(data1){ // grab content from another page
                $('#flyout').menu({ content: data1, flyOut: true});
            });

            $.get('ProjectsMenuContent.html', function(data2){ // grab content from another page
                $('#flyout1').menu({ content: data2, flyOut: true});
            });

            $.get('PlansMenuContent.html', function(data3){ // grab content from another page
                $('#flyout3').menu({ content: data3, flyOut: true});
            });

            $.get('RequestMenuContent.html', function(data4){ // grab content from another page
                $('#flyout4').menu({ content: data4, flyOut: true});
            });

            $(window).resize(function ()
            {
                center_div($('#mainbox'),0,0);
            }
            );

            center_div($('#mainbox'),0,0);
            $('#mainbox').css('visibility','visible');
        } );
//]]>


