var oSlider = {
	compare : '/images/compare.gif',
	seeit  : '/images/seeit.gif',
	joint : '---pi-',
	items : [
		{
			title: 'Keurig Special Edition B60 Coffee Maker',
			price: 120,
			pid: 28836755,
			img: 'http://di1.shopping.com/images1/pi/37/08/75/28836755-100x100-0-0_Keurig+Keurig+Special+Edition+B60+Brewer+Coffee+Ma.jpg?p=CrTsok7Fy9&a=2&c=1&l=3069176&t=08%2F13%2F09%2004%3A36%3A24%20AM&r=1',
			button: this.compare
		},
		{
			title: 'Garmin nuvi 260W Car GPS Receiver',
			price: 100,
			pid: 51371484,
			img: 'http://di1.shopping.com/images/pi/d7/c8/c6/81956891-100x100-0-0.jpg?p=w2.c1f15e4f271286648f71&a=2&c=1&l=8056299&t=090813052228&r=1',
			button: this.compare
		},
		{
			title: 'Sony Playstation 3 (80 GB) Black Console',
			price: 338,
			pid: 77542481,
			img: 'http://di1.shopping.com/images/pi/b8/f9/57/77542481-100x100-0-0.jpg?p=w2.f785ec3c9fcbf4faef40&a=2&c=1&l=8056299&t=090813063115&r=1',
			button: this.compare
		},
		{
			title: 'Blue Grass Perfume Gift Set by Elizabeth ...',
			price: 13,
			pid: 32478336,
			img: 'http://di1.shopping.com/images/pi/f5/15/65/32478336-100x100-0-0.jpg?p=w1.11f1d33302b0aec94d06&a=2&c=1&l=8056299&t=090813052505&r=1',
			button: this.compare
		},
		{
			title: 'Hoover S3765-040 WindTunnel Bagless Canister Vacuum',
			price: 210,
			pid: 20941741,
			img: 'http://di1.shopping.com/images/pi/fe/3a/f9/20941741-100x100-0-0.jpg?p=w2.adc23ddb181d71302c24&a=2&c=1&l=8056299&t=090814024424&r=1',
			button: this.compare
		},
		{
			title: 'Nikon D60 Digital Camera with 18-55mm lens',
			price: 547,			
			pid: 56321218,
			img: 'http://di1.shopping.com/images/pi/bb/94/9d/56321218-100x100-0-0.jpg?p=w2.58ce6f414ae64f2cd447&a=2&c=1&l=8056299&t=090814024749&r=1',
			button: this.compare
		},
		{
			title: 'Whynter SNO Arctica ARC-10D Stainless Steel ...',
			price: 300,
			pid: 37406793,
			img: 'http://di1.shopping.com/images/pi/78/5e/55/37406793-100x100-0-0.jpg?p=w1.cbcd2987ecded72dccd4&a=2&c=1&l=8056299&t=090813052618&r=1',
			button: this.compare
		},
		{
			title: "Adult 50's Hop with Poodle Skirt Costume",
			price: 34,
			pid: 35530569,
			img: 'http://di1.shopping.com/images/pi/22/9f/93/35530569-100x100-0-0.jpg?p=w1.9b6b58774f52bf4d9f0a&a=2&c=1&l=8056299&t=090814025246&r=1',
			button: this.compare
		},
		{
			title: 'Microsoft Office Professional 2007 Full Version ...',
			price: 155,
			pid: 38952419,
			img: 'http://di1.shopping.com/images/pi/5f/40/f3/38952419-100x100-0-0.jpg?p=w2.e67f06f5c6f6cffc3103&a=2&c=1&l=8056299&t=090814025357&r=1',
			button: this.compare
		},
		{
			title: 'Casio Sea-Pathfinder SPF40-1V Wrist Watch for Men',
			price: 117,
			pid: 22011588,
			img: 'http://di1.shopping.com/images/pi/50/a7/15/22011588-100x100-0-0.jpg?p=w1.a10ca7d38e1cc968a534&a=2&c=1&l=8056299&t=090814025547&r=1',
			button: this.compare
		},
		{
			title: 'CTA Digital WI-BBB Nintendo Wii Fit ...',
			price: 14,
			pid: 68161098,
			img: 'http://di1.shopping.com/images/pi/16/31/b8/68161098-100x100-0-0.jpg?p=w2.054d47dd755ab08b1580&a=2&c=1&l=8056299&t=090814025758&r=1',
			button: this.compare
		},
		{
			title: 'Top Spin 3 for Xbox 360',
			price: 16,
			pid: 51053003,
			img: 'http://di1.shopping.com/images/pi/6d/c3/f9/51053003-100x100-0-0.jpg?p=w1.71f11d9af39713d38338&a=2&c=1&l=8056299&t=090814025836&r=1',
			button: this.compare
		},
		{
			title: 'Motorola H700 Bluetooth Headset',
			price: 8,
			pid: 28588693,
			img: 'http://di1.shopping.com/images/pi/58/8d/a0/28588693-100x100-0-0.jpg?p=w1.b216ddc673bd4f911094&a=2&c=1&l=8056299&t=090814025924&r=1',
			button: this.compare
		},
		{
			title: 'Nintendo DS Lite Cobalt Blue Console',
			price: 109,
			pid: 58374119,
			img: 'http://di1.shopping.com/images/pi/61/d4/17/58374119-100x100-0-0.jpg?p=w1.987317fa0f8ef0464902&a=2&c=1&l=8056299&t=090814030001&r=1',
			button: this.compare
		},
		{
			title: 'Victorian Doll House',
			price: 139,
			pid: 35425901,
			img: 'http://di1.shopping.com/images/pi/b2/e6/4f/35425901-100x100-0-0.jpg?p=w1.d6ffb874f32915722c14&a=2&c=1&l=8056299&t=090814030119&r=1',
			button: this.compare
		},
		{
			title: 'Canon VIXIA HG10 (40 GB) Hard Drive Camcorder',
			price: 400,
			pid: 44765184,
			img: 'http://di1.shopping.com/images/pi/db/e0/b6/44765184-100x100-0-0.jpg?p=w1.15a8bafc2ca09a352489&a=2&c=1&l=8056299&t=090814030232&r=1',
			button: this.compare
		}
	],
	el : [],
	add: function (s) {
		this.el.push(s);
	},
	slide : function (o, direction) {
		var div = document.getElementById(o);
		var positon = document.getElementById('position');
		var start, end, total;
		
		start = 0;
		total = this.items.length / 4;

		if (direction == 'left') {
			positon.value--;
			if (positon.value == 0) {
				start = (total - 1) * 4;
				positon.value = total;
			} else {
				start = (positon.value - 1) * 4;				
			}
		}
		if (direction == 'right') {
			if (positon.value >= total) {
				start = 0;
				positon.value = 1;
			} else {
				start = (positon.value) * 4;
				positon.value++;
			}
		}
		
		this.add('<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BABABA" >' +
					'<tr><td class="pre_com"><a href="###" onclick="oSlider.slide(\'' + o + '\', \'left\');"><img src="/images/pre_com.gif" class="pre"/></a></td>');

		end = start + 4;
		for (start;start<end;start++) {

			this.add(
			'<td onMouseOver="this.style.backgroundColor=\'#f6f6f6\'" onMouseOut="this.style.backgroundColor=\'\'">' +
				'<a href="/'+escape(this.items[start].title)+this.joint+this.items[start].pid+'.html" target="_blank"><img src="'+this.items[start].img+'" alt="'+this.items[start].title+'" /></a><br />' +
				'<div class="p_title"><a href="/'+escape(this.items[start].title)+this.joint+this.items[start].pid+'.html" target="_blank" title="'+this.items[start].title+'">'+this.items[start].title.substring(0, 55)+'</a></div>' +
				'From: <span class="price">$'+ this.items[start].price.toFixed(2) +'</span>' +
				'<div class="p_compare"><a href="/'+escape(this.items[start].title)+this.joint+this.items[start].pid+'.html" title="compare" class="compare" target="_blank">' +
				'</a></div></td>'
			);
		}

		this.add('<td class="pre_com"><a href="###" onclick="oSlider.slide(\'' + o + '\', \'right\')"><img src="/images/next_com.gif" class="next"/></a></td></tr> </table>');
		div.innerHTML = ''
		div.innerHTML = this.toString();
		this.el = [];
	},
	toString: function () {
		return this.el.join('');
	}
}
