function show_wnd(http) {
    var win_height = window.screen.height - 200;
    var win_width = window.screen.width - 100;
    var PosTop = 50;
    var PosLeft = 40;

    window.open(http, '', 'scrollbars=1, menubar=no,location=no,directories=no,status=yes,resizable=yes,top=' + PosTop + ',left=' + PosLeft + ',width=' + win_width + ',height=' + win_height);
}

function mycarousel_itemLoadCallback(carousel, state)
{
    //Check if the requested items already exist
    if(carousel.has(carousel.first, carousel.last)) {
        return;
    }
    //alert(carousel.first);
    jQuery.get(
        'script/gallery.php',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, xml)
{
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('image', xml).each(function(i){
        carousel.add(first + i, mycarousel_getItemHTML(jQuery(this)));
    });
	$('#mycarousel a').lightBox();
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(image)
{
	url     = image.attr("url");
	alt     = image.attr("alt");
	title   = image.attr("title");
	img = image.attr("img");
	img_big = image.attr("img_big");
	pr_id = image.attr("pr_id");
	return '<a href="Photo/Production/'+img_big+'" title="'+title+'" rel="lightbox[GALLERY]" url="include/ProdInfo.php?height=600&width=800&pr_id='+pr_id+'" ><img src="Photo/Production/'+img+'" width="75" height="75" id="pr_id='+pr_id+'" rel="'+pr_id+'" border="0" alt="'+alt+'"/></a>'
	
};

/*
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        itemLoadCallback: mycarousel_itemLoadCallback
    });
});
*/

