﻿var _prm = Sys.WebForms.PageRequestManager.getInstance();
var _elPostBackItem = null;

Sys.Application.add_init(OnApplicationInitHandler);

function OnApplicationInitHandler(sender, args) {
    RegisterEventHandlers();
    toggleTagsOnMouseoverImage();
}
/// Registers handlers for events of multiple elements and for the pageLoaded Event.
function RegisterEventHandlers() {  
    // Add PageRequestManager event handlers.
    _prm.add_pageLoaded(OnPageLoadedHandler);
}
/// Raised after all content on the page is refreshed, as a result of either a synchronous or an asynchronous postback.
function OnPageLoadedHandler(sender, args) {
    // ~~ Scroll to top.
    setTimeout("$('html, body').animate({ scrollTop: 0 }, 'slow')", 100);
    toggleTagsOnMouseoverImage();
 }


function toggleTagsOnMouseoverImage() {
    var config = {
        sensitivity: 3,  
        interval: 200,  
        over: makeTall, 
        timeout: 300,  
        out: makeShort
    };
    $(".itemRight").find("span").hoverIntent(config);
}
function makeTall() {
    $(this).css("backgroundImage", "url('../_images/bg80.png')");
    $(this).animate({
        width: 290
    }, {
        duration: 200
    });
}
function makeShort() {
    $(this).animate({
        width: 25
    }, {
        duration: 200, complete: function() { $(this).css("backgroundImage", "none"); }
    });
}
