﻿        $(window).load(function () {
            image_resize("imageSize190x180", 190, 180);
            image_resize("imageSize130x130", 130, 130);

            $("#publicidadCarosuel").simplyScroll({ autoMode: 'loop' });
        });

        $(document).ready(function() {
            /*
            $.blockUI({ 
			    theme:     true, // true to enable jQuery UI support 
			    draggable: true, // draggable option is only supported when jquery UI script is included 
			    title: 'Cargando componetes', // only used when theme == true 
			    //message: $("#divShowPleaseWait")
			    message:  "<h3><img src='../Images/load.gif' /> Iniciando modulo...</h3>"
		    });
            */
            LazyLoad.loadOnce([
            "../Includes/jqAjax.js",
            "../Includes/galleryview/jquery.easing.js",
            "../Includes/galleryview/jquery.timers.js",
            "../Includes/galleryview/jquery.galleryview.js",
            "../Includes/UI/jquery.ui.widget.js",
            "../Includes/UI/jquery.ui.button.js",
            "../Includes/UI/jquery.ui.button.js",
            "../Includes/UI/jquery.ui.widget.js",
            "../Includes/UI/jquery.ui.mouse.js",
            "../Includes/UI/jquery.ui.draggable.js",
            "../Includes/UI/jquery.ui.resizable.js",
            "../Includes/UI/jquery.ui.dialog.js",            
            "../Includes/functions.js",
            "../Includes/dropDown.js"
            ], readyToGo);        
        });
        function readyToGo()
        {
            try
            {
                /*
                $("button").mouseover(function() {
                    $(this).addClass("ui-state-hover");
                    $(this).css('cursor', 'pointer');
                });
        		 
                $("button").mouseout(function() {
                    $(this).removeClass("ui-state-hover");
                });
                

                pageLoad();
		        $.unblockUI();	
                */

                $('body').css("background-image", "url(../Info/Fondos/01.jpg)");
                $('body').css("background-repeat", "no-repeat");
                $('body').css("background-position", "top");
                $('body').css("background-color", "#F1F3F2");
                $('body').css("background-attachment", "fixed");

                $('#imgMenuPrincipal').attr("src", "../Images/Web/Menu/Boton-01-On.png");
                /*
                $('#myGallery').galleryView({
                    
                });*/

                /*
                $('#myGallery').galleryView({
                    filmstrip_position: 'right',
                    transition_interval: 15000,
                    show_captions: true,
                    show_overlays: true,
                    frame_width: 110,
                    frame_height: 80,
                    overlay_opacity:0.7,
                    panel_width: 520
                });
                */
            }catch(ex){alert(ex)}
        }

        function image_resize(sClass, iMaxWidth, iMaxHeight) {
            $("." + sClass).each(function () {
                $(this).removeAttr("width");
                /* Max width for the image */
                var maxWidth = iMaxWidth;
                /* Max hieght for the image */
                var maxHeight = iMaxHeight;
                /*Used for aspect ratio*/
                var ratio = 0;
                /*Current image width*/
                var width = $(this).width();
                /*Current image height */
                var height = $(this).height();
                

                /*Check if the current width is larger than the max*/
                if (width > maxWidth) {
                    /*get ratio for scaling image*/
                    ratio = (maxWidth / width);
                    /* Set New hieght and width of Image*/
                    $(this).attr({
                        width: maxWidth,
                        height: (height * ratio),
                        alt: "laestacionfm.com.ar"
                    });
                    /* Reset height to match scaled image */
                    height = (height * ratio);
                    /* Reset width to match scaled image */
                    width = (width * ratio);
                    /*Check if current height is larger than max*/
                    if (height > maxHeight) {
                        /*get ratio for scaling image*/
                        ratio = (maxHeight / height);
                        /*Set new height and width*/
                        $(this).attr({
                            height: maxHeight,
                            width: (width * ratio),
                            alt: "quepasasalta.com.ar"
                        });

                    }
                }

                $(this).css("display", "");
            });
        }

        /*
        Here is End Image Resize Code
        */
