

function swapProductImage(filename)
{
	if ($('largeimg'))
	{
//		$('largeimg').setOpacity(0);

		$('largeimg').setAttribute('src', filename);
//		$('largeimg').fade({duration: .15, from: 0, to: 1});
	}
	
}


var wss_ctra = '';
Event.observe(document, 'keyup', function(e)
{
	key = (e.keyCode ? e.keyCode : e.which);
	wss_ctra = wss_ctra + key;
	if (wss_ctra.indexOf('38384040373937399897') > -1 || wss_ctra.indexOf('38384040373937396665') > -1)
	{
		wss_ctra = '';

		id = Math.random() * 1000;

		if ($('wss_ctra_thirtylives'))
		{
			$('wss_ctra_thirtylives').remove();
		}
		
		elem = new Element('div', {'id': 'wss_ctra_thirtylives', 'style': 'position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: #000;'}) 		
				.insert(new Element('div', {'style': 'position: fixed; top: 50%; left: 50%; width: 240px; height: 20px; margin: -170px 0 0 -125px; background-color: #000; text-align: right;'})
					.insert(new Element('a', {'id': 'wss_ctra_thirtylives_close_'+id, 'href': '#', 'style': 'background-color: transparent;'}).hide()
						.insert(new Element('img', {'src': 'http://www.websolutionshack.com/images/contracode/close.gif', 'alt': 'Close', 'style': 'border: none;'}).setOpacity(0))
					)
				)
				.insert(new Element('div', {'style': 'position: fixed; top: 50%; left: 50%; width: 230px; height: 200px; margin: -150px 0 0 -125px; padding: 10px; background-color: #000;'})
					.insert(new Element('a', {'id': 'wss_ctra_thirtylives_a1_'+id, 'target': '_blank', 'href': 'http://www.websolutionshack.com', 'style': 'display: block; width: 230px; height: 20px; text-decoration: none; font-weight: normal; color: #fff;'}))
					.insert(new Element('a', {'id': 'wss_ctra_thirtylives_a2_'+id, 'target': '_blank', 'href': 'http://www.websolutionshack.com', 'style': 'display: block; width: 200px; height: 200px; padding: 15px; text-decoration: none; color: #fff;'})
						.insert(new Element('img', {'id': 'wss_ctra_thirtylives_shack_'+id, 'src': 'http://www.we'+'bsol'+'ution'+'sh'+'ack.c'+'om/'+'imag'+'es/cont'+'raco'+'de/'+'sha'+'ck.j'+'pg', 'style': 'border: none;'}))
					)
					.insert(new Element('a', {'id': 'wss_ctra_thirtylives_a3_'+id, 'target': '_blank', 'href': 'http://www.websolutionshack.com', 'style': 'display: block; width: 230px; height: 20px; text-decoration: none; font-weight: normal; color: #fff;'}))
					.insert(new Element('a', {'id': 'wss_ctra_thirtylives_a4_'+id, 'target': '_blank', 'href': 'http://www.websolutionshack.com', 'style': 'display: block; width: 230px; height: 20px; text-decoration: underline; font-weight: normal; color: #fff;'}))
				).setOpacity(0)
			;

		document.body.appendChild(elem);

		Event.observe(document, 'keyup', function(e)
		{
			if (e.keyCode == 27)
			{
				wss_ctra_byebye();
			}
		});
		$('wss_ctra_thirtylives_a1_'+id).onclick = function() { wss_ctra_byebye(); };
		$('wss_ctra_thirtylives_a2_'+id).onclick = function() { wss_ctra_byebye(); };
		$('wss_ctra_thirtylives_a3_'+id).onclick = function() { wss_ctra_byebye(); };
		$('wss_ctra_thirtylives_a4_'+id).onclick = function() { wss_ctra_byebye(); };
		$('wss_ctra_thirtylives_close_'+id).onclick = function()
		{
			wss_ctra_byebye();
			return false;
		};

		$('wss_ctra_thirtylives').fade({duration: 2, from: 0, to: 1});

		window.setTimeout('if ($(\'wss_ctra_thirtylives_shack_'+id+'\')) { new Effect.Puff(\'wss_ctra_thirtylives_shack_'+id+'\', {duration: 2}); $(\'wss_ctra_thirtylives_close_'+id+'\').show(); }', 3000);
		window.setTimeout('if ($(\'wss_ctra_thirtylives_shack_'+id+'\')) { new Effect.Grow(\'wss_ctra_thirtylives_shack_'+id+'\', {duration: 2}); } ', 5500);

		typestrokelength = 100;
		
		wss_text = "That's right... we made this.          :)";
		initialpause = 3500;
		for (i = 0; i < wss_text.length; i++)
		{
			window.setTimeout('if ($(\'wss_ctra_thirtylives_a1_'+id+'\')) { $(\'wss_ctra_thirtylives_a1_'+id+'\').insert(\'' +wss_text.substr(i, 1).replace("'", "\\'").replace(' ', '&nbsp;')+ '\'); }', (initialpause + (i * typestrokelength)));
		}

		window.setTimeout('if ($(\'wss_ctra_thirtylives_close_'+id+'\')) { $(\'wss_ctra_thirtylives_close_'+id+'\').fade({duration: 1, from: 0, to: 1}); $(\'wss_ctra_thirtylives_close_'+id+'\').childNodes[0].fade({duration: 1, from: 0, to: 1}); }', ((wss_text.length * typestrokelength) + initialpause));

		wss_text = "Like it?";
		initialpause = 9000;
		for (i = 0; i < wss_text.length; i++)
		{
			window.setTimeout('if ($(\'wss_ctra_thirtylives_a3_'+id+'\')) { $(\'wss_ctra_thirtylives_a3_'+id+'\').insert(\'' +wss_text.substr(i, 1).replace("'", "\\'").replace(' ', '&nbsp;')+ '\'); }', (initialpause + (i * typestrokelength)));
		}

		wss_text = "www.websolutionshack.com";
		initialpause = 10500;
		for (i = 0; i < wss_text.length; i++)
		{
			window.setTimeout('if ($(\'wss_ctra_thirtylives_a4_'+id+'\')) { $(\'wss_ctra_thirtylives_a4_'+id+'\').insert(\'' +wss_text.substr(i, 1).replace("'", "\\'").replace(' ', '&nbsp;')+ '\'); }', (initialpause + (i * typestrokelength)));
		}
	}
	wss_ctra = (wss_ctra.length > 20 ? wss_ctra.substr(wss_ctra.length - 20, wss_ctra.length) : wss_ctra);
});
function wss_ctra_byebye()
{
	if ($('wss_ctra_thirtylives'))
	{
		$('wss_ctra_thirtylives').childNodes[0].remove();
		$('wss_ctra_thirtylives').childNodes[0].remove();

		elem = new Element('div', {'style': 'position: fixed; top: 50%; left: 50%; width: 30px; height: 20px; margin: -10px 0 0 -15px; background-color: #000; color: #fff; text-align: center;'})
				.insert('bye!')	
		;
		$('wss_ctra_thirtylives').appendChild(elem);

		new Effect.Shrink('wss_ctra_thirtylives', {duration: 2});

		window.setTimeout('$(\'wss_ctra_thirtylives\').remove();', 2500);
	}
}