function doLayerSwap(strLayerID){
	$('#productdetail .img').children().not('#prodimgnav').css('display','none');
	$('#'+strLayerID).css('display','block');
	$('#prodimgnav a').removeClass('selected');
	$('#'+strLayerID+'link').addClass('selected');

	drawCloseUpLink(strLayerID);
}

function initLayerNav(){
	var strLayerNav='';
	var intCount=0;
	var strSiteLoc=window.location.href;

	$('.imgcontainer').each(function(i){
		intCount=intCount+1
		if(intCount==1){
			strClass=' class="selected"';
		}else{
			strClass='';
		}
		strLayerNav+=' <a href="'+strSiteLoc+'" onclick="doLayerSwap(\'img'+intCount+'\');return false;"'+strClass+' id="img'+intCount+'link">'+intCount+'</a>';
	});

	if(intCount>1){
		$('#prodimgnav').html(strLayerNav);
	}else{
		$('#prodimgnav').html('');
	}
	drawCloseUpLink('img1');
}

function drawCloseUpLink(strLayerID){
	$('.buttons .zoom a').replaceWith('');

	var strHref=$('#'+strLayerID+' a.shadowbox').attr('href');
	var strTitle=$('#'+strLayerID+' a.shadowbox').attr('title');

	if(strTitle){
		strTitle=' title="'+strTitle+'"';
	}else{
		strTitle='';
	}

	if(strHref){
		$('.buttons .zoom').html('<a href="'+strHref+'" class="closeup shadowbox" rel="shadowbox[productimage]"'+strTitle+'><img src="/images/button-zoom.gif" alt="Zoom" /></a>');

		Shadowbox.setup('a.shadowbox', {
			
		});

	}
}




/*function doLayerSwap(strLayerID){
	$('#prodimg').children().css('display','none');
	$('#'+strLayerID).css('display','block');
	$('#prodimgnav a').removeClass('selected');
	$('#'+strLayerID+'link').addClass('selected');

	drawCloseUpLink(strLayerID);
}

function initLayerNav(){
	var strLayerNav='<span class="label">Image:</span>';
	var intCount=0;
	var strSiteLoc=window.location.href;

	$('.imgcontainer').each(function(i){
		intCount=intCount+1
		if(intCount==1){
			strClass=' class="selected"';
		}else{
			strClass='';
		}
		strLayerNav+=' <a href="'+strSiteLoc+'" onclick="doLayerSwap(\'img'+intCount+'\');return false;"'+strClass+' id="img'+intCount+'link">'+intCount+'</a>';
	});

	$('#prodimgnav').html('<span class="imglist">'+strLayerNav+'</span>');
	drawCloseUpLink('img1');
}

function drawCloseUpLink(strLayerID){
	$('.buttons .zoom a').replaceWith('');

	var strHref=$('#'+strLayerID+' a.thickbox').attr('href');
	var strTitle=$('#'+strLayerID+' a.thickbox').attr('title');

	if(strTitle){
		strTitle=' title="'+strTitle+'"';
	}else{
		strTitle='';
	}

	if(strHref){
		$('.buttons .zoom').html('<a href="'+strHref+'" class="closeup thickbox"'+strTitle+'><img src="/images/button-zoom.gif" alt="Zoom" /></a>');
		tb_init('a.closeup');
	}
}*/


