nSlideSpeed = 100;
$(document).ready(function () {
	/*$('.level1').hover(
		function () {
			$(this).find('li.level2:last a').css('border', '0px');
			$(this).find('ul.level2').slideDown(nSlideSpeed);
		},
		function () {
			//$(this).find('ul.level2').slideUp(nSlideSpeed);
		}
	);
	$('li.level2').hover(
		function () {
			offset = $(this).find('a').position();
			//lightFuse();
			$(this).find('li.level3:last a').css('border', '0px');
			$(this).children('ul.level3').css('top', offset.top).show(nSlideSpeed);
		},
		function () {}
	);
	
	$('ul.level2').hover(
		function () {
			//lightFuse();	
		},
		function () {
			$(this).hide(nSlideSpeed);
		}
	);
	
	$('ul.level3').hover(
		function () {
			//lightFuse();
		},
		function () {
			$(this).hide(nSlideSpeed);
		}
	)*/
	$('#slider ul').each(function () { $('li a:last').css('border', '0px'); })
	
	
	$('.image_main img').click(function () {
		window.open($(this).attr('src'));
	});
});
/*nFuse = 5;
function lightFuse()
{
	nFuse = 5;
	hideMenuDelay();
}
function hideMenuDelay()
{
	setTimeout(hideAll(), 1000);
}
function hideAll()
{
	if(nFuse > 0)
	{
		nFuse--;
		hideMenuDelay();
	}
	else
		$('ul.level2').hide();
}*/

/*function swatch(sImage)
{
	$('.image_main img').attr('src', 'uploads/images/products/' + sImage);
}*/
sGlobalFabric = ''
sGlobalFinish = '';
function swatch(sName, sAttribute, sValue, sType)
{
	switch(sAttribute)
	{
		case 'fabric': sGlobalFabric = sValue; break;
		case 'finish': sGlobalFinish = sValue; break;
	}
	$('.image_main img').attr('src', 'uploads/images/products/' + sName + '_' + sGlobalFabric + '_' + sGlobalFinish + '.' + sType);
}

function sendToAFriend(sSubject)
{
	document.location = 'mailto:?subject='+sSubject;
}
