/**
* Common Item Routines
* @category Divinity
* @package Store.Invengtory
* @version SVN:$Id$
*/

///////////////////////////////////////////////////////////////////////////////

jQuery.extend(true, jQuery, {

	/** Common item-related functionality */
	"item": {

		/** Show the popup for an item */
		"popup": function(html, w, h, d) {

			// no ThickBox ?
			//
			if (typeof tb_show == 'undefined') {
				return;
				}

			// container exists ?
			//
			if (jQuery('#item_popup_html').length < 1) {
				jQuery('body').append(
					'<div id=\"item_popup_html\" style=\"display:none;\">' + html + '<\/div>'
					);
				} else {
				jQuery('#item_popup_html').html(html);
				}

			jQuery(document).ready(
				function() {
					setTimeout(function() {
						tb_show('', '#TB_inline?height=' + h + '&width=' + w + '&inlineId=item_popup_html', false);
						}, 100 + d * 1000);
					}
				);

			}
		}
	});

///////////////////////////////////////////////////////////////////////////////