/*

Custom See It On Script for ConroyWilcox.com
Van Stokes
6.1.2010

- Goes to specific image detail when See it on text is clicked
- Works differently in thumb and big view

*/

$(document).ready( function (){ 

	$('.seeItOnLink').click(function(){
		
		var getSettings = $("#grayBoxSetting").attr("title");
		var splitSettings = getSettings.split(/-/g);
		var imageSize = splitSettings[1];
		var activeDetail = splitSettings[2];
		
		var altTag = $(this).attr('alt');
		var splitAlt = altTag.split(/_/g);
		var imageId = splitAlt[0];
		var galleryId = splitAlt[1];
		var detailId = '0002';
	
		if(imageSize == 'thumbs')
			{
				

				
				//var replacementHtmlItOn = '<a href="artistInfo/thumbs/' +  imageId + '_det_0002.jpg" id="largeImage" alt="" title=""><img src="artistInfo/thumbs/'+ imageId + '_det_0002.jpg" ></a>';
		
				var linkPath = 'pages.php?content=galleryBig.php&amp;navGallID=' + galleryId + '&amp;navGallIDquer=' + galleryId + '&amp;imageID=' + imageId + '&amp;view=big&amp;detailId=' + detailId ;		
				var imagePath = 'artistInfo/thumbs/' + imageId + '_det_' + detailId + '.jpg';
				var replacementHtmlItOn = '<a href="' + linkPath + '"><img src="' + imagePath + '"></a>';
				
		
	
			}
		
		if(imageSize == 'big')
			{
				var biggestImgUrl = 'artistInfo/biggest/' + imageId + '_det_' + detailId + '.jpg';
				var imagePath = 'artistInfo/big/' + imageId + '_det_' + detailId + '.jpg';
				var replacementHtmlItOn = '<a href="' + biggestImgUrl + '" id="largeImage" alt="" title=""  class="thumb"><img src="' + imagePath + '" ></a>';
				
				//alert('test');
			}
			
		var thumbId = "#thumb" + imageId;
		$(thumbId).html(replacementHtmlItOn);
		$('.thumb').lightBox();
		
	});

});
