var Product = {

	ajaxUrl: 'PHP/grabProducts.php?id=',



	showItemOptions: function(id)

	{

		var $ = jQuery;

		$('#fader')

			.remove()

			.prependTo($('body'))

			.width($(document).width())

			.height($(document).height())

			.css({

				position: 'absolute',

				left: '0px',

				top: '0px',

				backgroundColor: '#555',

				opacity: 0.5,

				zIndex: 9999

			})

			.show()

		;

		$('body').prepend(

			this.popup = $('<div></div>')

				.hide()

				.css({

					position: $.browser.msie ? 'absolute' : 'fixed',

					left: '30px',

					top: '30px',

					padding: '3px',

					border: '1px solid #03709f',

					backgroundColor: '#fdf7d9',

					//overflow: 'auto',

					zIndex: 10000

				})

				.load(this.ajaxUrl + id, {}, function(){

					var client = {

						width:	$(window).width(),

						height:	$(window).height()

					};

					$(this)

						.css({

							width: Math.min($(this).width(), client.width - 400),

							height: Math.min($(this).height(), client.height - 400)

						})

						.css({

							left: (client.width - $(this).width()) / 2 + 'px',

							top: (client.height - $(this).height()) / 2 + 'px'

						})

						.prepend(

							$('<div></div>')

								.text('X')

								.css({

									float: 'right',

									color: '#eb4771',

									fontWeight: 'bold',

									padding: '3px',

									cursor: 'pointer'

								})

								.click(function(){

									Product.popup.hide();

									$('#fader').hide();

								})

						)

						.show()

					;

				})

		);

		return false;

	}

};