﻿

$("document").ready(function() {
    InitWidget();
});



function InitWidget() {



    $('.PreviewHeaderImage').click(function() {

        a = $(this).closest("#previewLayout").find("#PreviewBody");
        b = $(this).find("#headerIcon");
        c = $(this).find(".miniImage");


        if (a.data("Open") == "yes") {
            a.animate({
                height: 2,
                "opacity": "toggle"
            }, 500);
            c.animate({ "opacity": "toggle",
                width: 55
            }, 500);
            a.data("Open", "no");
        }
        else {
            a.addClass("PreviewBodyImageopen");
            a.animate({
                height: 180
            }, 500);
            c.animate({ "opacity": "toggle",
                width: 0
            }, 500);
            a.data("Open", "yes");
        }
        $(this).toggleClass("PreviewHeaderImageSelected");
        b.toggleClass("previewHeaderIconUp");


    });
}

function popup(url) {
    newwindow = window.open(url, 'Motors', 'height=690,width=748');
    if (window.focus) { newwindow.focus() }
    return false;
}

