﻿jQuery.noConflict();

function swapImage(id, img) {
    jQuery('#' + id).attr('src', img);
}

function enlargeImage() {
    var imgObj;
    if (jQuery('#promotionDetails').find('img').length > 0) {
        imgObj = jQuery('#promotionDetails').find('img')[0];
    } else {
        imgObj = jQuery('#thumbnailImage').find('img')[0];
    }
    var img = jQuery(imgObj).attr('src');
    openWindow(img, 400, 400);
}

function openWindow(url, x, y) {
    l = Math.round((screen.width - x) / 2);
    t = Math.round((screen.height - y) / 2);
    w = window.open(url, 'popup', 'scrollbars=yes,status=no,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',toolbar=no,resizable=yes');
    w.focus();
}

jQuery(document).ready(function ($) {
    // start the carousel
    $('#divCarousel').nivoSlider({ effect: 'fade', pauseTime: 3000 });
});
