jQuery(document).ready(
	function() {
		if($('#product_images_battery').length > 0) {
			$('#product_images_battery').d_imagechange({
				data:data,
				desc:false,
				playTime:36000000,
				bgHeight:25,
				width:351,
				height:256,
				animateStyle:'x'
			});
		}
		
		$('a[rel="fncbx"]').fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over'
		});
		
		$("#tabs").tabs();
		
		/*$('#marquee').marquee('pointer').mouseover(function () {
			$(this).trigger('stop');
		}).mouseout(function () {
			$(this).trigger('start');
			$(this).data('drag', false);
		}).mousemove(function (event) {
			if ($(this).data('drag') == true) {
				this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
			}
		}).mousedown(function (event) {
			$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
		}).mouseup(function () {
			$(this).data('drag', false);
		});*/
		
		jQuery('#marquee_dialog').click(
			function() {	
				$("#dialog-message").dialog({
					autoOpen: true,
					height: 600,
					width: 980,
					modal: true,
					buttons: {
						Ok: function() {
							$(this).dialog('close');
						}
					}
				});
			}
		);
		
		jQuery('#test_report').click(
			function() {	
				$("#test-report-dialog-message").dialog({
					autoOpen: true,
					height: 620,
					width: 650,
					modal: true,
					buttons: {
						Ok: function() {
							$(this).dialog('close');
						}
					}
				});
			}
		);
		
		jQuery('a[id="list-tips"]').click(
			function() {
				var parent = jQuery(this).parents('td:first');
				var box = parent.find('#box-tips');
				var clone = box.clone();
				
				/*clone.find('a[rel="fncbx"]').fancybox({
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'titlePosition' 	: 'over'
				});*/
				
				clone.dialog({
					autoOpen: true,
					width: 950,
					height:document.documentElement.clientHeight - 40,
					modal: true,
					buttons: {
						Close: function() {
							jQuery(this).dialog('close');
						}
					}
				});
			}
		);
		
		jQuery('a[id="list-power-cable"]').click(
			function() {
				var parent = jQuery(this).parents('td:first');
				var box = parent.find('#box-power-cables');
				var clone = box.clone();
				clone.dialog({
					autoOpen: true,
					width: 950,
					height:document.documentElement.clientHeight - 40,
					modal: true,
					buttons: {
						Close: function() {
							jQuery(this).dialog('close');
						}
					}
				});
			}
		);
		
		jQuery('a[id="list-adaptor"]').click(
			function() {
				var parent = jQuery(this).parents('td:first');
				var box = parent.find('#box-adaptor');
				var clone = box.clone();
				clone.dialog({
					autoOpen: true,
					width: 950,
					height:document.documentElement.clientHeight - 40,
					modal: true,
					buttons: {
						Close: function() {
							jQuery(this).dialog('close');
						}
					}
				});
			}
		);
		
		jQuery('a[id="list-bag"]').click(
			function() {
				var parent = jQuery(this).parents('td:first');
				var box = parent.find('#box-bags');
				var clone = box.clone();
				clone.dialog({
					autoOpen: true,
					width: 950,
					height:document.documentElement.clientHeight - 40,
					modal: true,
					buttons: {
						Close: function() {
							jQuery(this).dialog('close');
						}
					}
				});
			}
		);
	}
);
