﻿$(document).ready(function() {

    var currentWidth = 150;

    $.fn.supersized.options = {
        startwidth: 640,
        startheight: 480,
        vertical_center: 1,
        slides: [
					{ image: 'PicturePages/bgViewer.aspx?imgext=.jpg' }
				]
	};
    
    $('#supersized').supersized();


    $("#divMenuAbout")
    .mouseover(function() {
        $(this).animate({ "width": "365px" }, 300);
    })
    .mouseout(function() {
        $(this).animate({ "width": "180px" }, "normal");
    });
    $("#divMenuEvents")
    .mouseover(function() {
        $(this).animate({ "width": "365px" }, 300);
    })
    .mouseout(function() {
        $(this).animate({ "width": "240px" }, "normal");
    });
    $("#divMenuFilmoghraphy")
    .mouseover(function() {
        $(this).animate({ "width": "365px" }, 300);
    })
    .mouseout(function() {
        $(this).animate({ "width": "204px" }, "normal");
    });
    $("#divMenuGallery")
    .mouseover(function() {
        $(this).animate({ "width": "365px" }, 300);
    })
    .mouseout(function() {
        $(this).animate({ "width": "214px" }, "normal");
    });
    $("#divMenuContact")
    .mouseover(function() {
        $(this).animate({ "width": "365px" }, 300);
    })
    .mouseout(function() {
        $(this).animate({ "width": "200px" }, "normal");
    });
        
        
    $(".imgSpc")
        .live('mouseover', function() {
            $(this).animate({ "width": "100px" }, "fast");
        })
        .live('mouseout', function() {
            $(this).animate({ "width": "70px" }, "fast");
        });


    $(".imgGallerySpc")
        .live('mouseover', function() {
            $(this).animate({ "width": "150px" }, "fast");
        })
        .live('mouseout', function() {
            $(this).animate({ "width": "140px" }, "fast");
        });



    $("#divMenuAbout").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divAbout").animate({ "left": "0px" }, "slow");
    });
    $("#divAboutBackBtn").click(function() {
        $("#divAbout").animate({ "left": "-1000px" }, "normal");
    });


    $("#divMenuEvents").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divEvents").animate({ "left": "0px" }, "slow");
    });
    $("#divEventsBackBtn").click(function() {
        $("#divEvents").animate({ "left": "-1000px" }, "normal");
    });


    $(".editBtn").live('click', function() {/* با کلیک عادی پنجره خبر فقط یک بار حرکت می کند اما با لایو کلیک هر دفعه درست کار می کند */
        $(".divPages").delay(1200).animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divNewsDetails").animate({ "left": "1000px" }, "slow");
    });
    $("#divNewsDetailsBackBtn").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divEvents").animate({ "left": "0px" }, "slow");
    });

    $("#divMenuFilmoghraphy").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divFilmography").animate({ "left": "0px" }, "slow");
    });
    $("#divFilmographyBackBtn").click(function() {
        $("#divFilmography").animate({ "left": "-1000px" }, "normal");
    });

    $("#divMenuGallery").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divGallery").animate({ "left": "0px" }, "slow");
    });
    $("#divGalleryBackBtn").click(function() {
        $("#divGallery").animate({ "left": "-1000px" }, "normal");
    });

    $("#divMenuContact").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divContact").animate({ "left": "0px" }, "slow");
    });
    $("#divContactBackBtn").click(function() {
        $("#divContact").animate({ "left": "-1000px" }, "normal");
    });
    $("#divRegMessageBtn").click(function() {
        $(".divPages").animate({ "left": "-1000px" }, "normal"); /* تمام صفحات رو که کلاس .divPages دارند رو می بنده */
        $("#divSendMessage").animate({ "left": "0px" }, "slow");
    });
    $("#divSendMessageBackBtn").click(function() {
        $("#divSendMessage").animate({ "left": "-1000px" }, "normal");
        $("#divContact").animate({ "left": "0px" }, "slow");
    });
});




