ss = function()
{
	return {
		infoWind : function(pid)
		{
			window.open('/pvp.php?id='+pid,'info_window','menubar=0,location=0,status=0,resizable=1,width=780,height=700,scrollbars=1');
			return false;	
		},
		
		slideshowWind : function(path)
		{
			window.open(path,'slideshow_window','menubar=0,location=0,status=0,resizable=1,width=500,height=400,scrollbars=1');
			return false;
		},
			
		flashWind : function(path)
		{
			window.open(path,'flash_window','menubar=0,location=0,status=0,resizable=1,width=640,height=525,scrollbars=0');
			return false;	
		},
		
		slideshowWind2 : function(path)
		{
			window.open(path,'slideshow_window','menubar=0,location=0,status=0,resizable=1,width=490,height=310,scrollbars=1');
			return false;
		}
	};
}();
	
function Slideshow()
{
	var obj_id = 0;
		
	function startSlideshow(start_frame, end_frame, delay)
	{
		setTimeout(switchSlides(start_frame,start_frame,end_frame, delay), delay);
	}
							
	function switchSlides(frame, start_frame, end_frame, delay)
	{
		return (function()
		{
			Effect.Fade(obj_id+'_ss' + frame);
			if (frame == end_frame) 
				frame = start_frame;
			else
				frame++;
			setTimeout("Effect.Appear('"+obj_id+"_ss"+frame+"');", 5);
			setTimeout(switchSlides(frame, start_frame, end_frame, delay), delay);
		});
	}
	
	function hideInitialPictures(start_pic, end_pic)
	{
		for(var i=start_pic; i<=end_pic; i++)
			gebi(obj_id+'_ss'+i).style.display = "none";
	}
		
	return {
		init : function(obj_id_in, num_frames, delay_secs)
		{
			obj_id = obj_id_in;
			hideInitialPictures(2, num_frames);
			startSlideshow(1, num_frames, delay_secs*1000);
		}
	};
}

jQuery(document).ready(function($) {

	///
	/// Pricing
	$('.pieces').hide();
	
	$.preLoadImages('/images/arrow-open.png');
	
	$('.piece_types h5 a').click(function() {
		$(this).parent().toggleClass('hit');
		$(this).parents('.piece_types').children('.pieces').slideToggle();
		return false;
	});
});

