﻿
var splashWrapper, splashContent;
var splashAnimationFinished = function(sender, args) { };
function showSplashAnimation(sender, args) {
    var obj = splashWrapper;
    var obj2 = splashContent;
    obj.style.height = "0px";
    obj.style.overflow = "hidden";
    Sys.UI.DomElement.toggleCssClass(obj2, 'StartHidden');
    $common.setElementOpacity(obj2, 0);
    var size = Sys.UI.DomElement.getBounds(obj2);
    $create(
        Pacem.UI.Tween,
        { 'isCssProperty':true, 'property': 'height', 'easingFunc': Pacem.UI.Easing.Sine.easeOut, 'unit': Pacem.UI.Unit.pixels, 'start': 0, 'finish': size.height, 'duration': .5, 'delay': .1 },
        { 'motionFinished': showSplashAnimation2 }, null, obj);
}
function showSplashAnimation2(sender, args) {
    var obj2 = splashContent;
    $create(
        Pacem.UI.Tween,
        { 'property': 'dummy', 'easingFunc': Pacem.UI.Easing.Sine.easeOut, 'start': 0, 'finish': 1, 'duration': .5 },
        { 'motionChanged': obj2_motionChanged, 'motionFinished': obj2_motionFinished }, null, obj2);
}
function obj2_motionChanged(sender, args) {
    $common.setElementOpacity(sender.get_object(), args.get_currentPosition());
}
function obj2_motionFinished(sender, args) {
    if (sender.get_object().style.filter && sender.get_object().style.removeAttribute)
        sender.get_object().style.removeAttribute('filter');
    splashAnimationFinished(sender, args);
}