var modProducts_itemLargeImg_load  = new Image();
var modProducts_itemLargeImg_prev  = 1;
var modProducts_itemGallBlock_last = 0;

function j_module_products_public_itemGallery_showMedium( cID, urlMed, bigTitle) {
	
	if (modProducts_itemLargeImg_prev == cID) {
		return true;
	}
	
	var obj = j_common_getElement ('modProduct_bigImage_Enlarge_loading');
	
	if (obj) {
		obj.style.visibility = 'visible';
	}
	
	modProducts_itemLargeImg_load.src = urlMed;
	modProducts_itemLargeImg_load.onload = j_module_products_public_itemGallery_showMedium_loaded;
	

	var obj = j_common_getElement ('modProduct_bigImage_Enlarge');
	
	if (obj) {
		obj.title = bigTitle;
	}
	
	modProducts_itemLargeImg_prev = cID;
}

function j_module_products_public_itemGallery_showMedium_loaded () {
	j_public_imageSlideEffect ( 'modProductItemMediumImage' , modProducts_itemLargeImg_load.src , 1 );
	var obj = j_common_getElement ('modProduct_bigImage_Enlarge_loading');
	if (obj) {
		obj.style.visibility = 'hidden';
	}	
}

function j_module_products_public_itemGallery_showLarge () {
	var obj = j_common_getElement('modProduct_bigImage_Enlarge_'+modProducts_itemLargeImg_prev);
	if (obj) {
		cengContent_lightbox_object.start(obj);
	}
}


function j_module_products_public_itemGallery_walkBlock(totBlock, cInc) {
	modProducts_itemGallBlock_last += cInc;
	if (modProducts_itemGallBlock_last<0) {
		modProducts_itemGallBlock_last = 0;
	} else if (modProducts_itemGallBlock_last>totBlock) {
		modProducts_itemGallBlock_last = totBlock;
	}
	
	codaEffects_scrollSection('modProducts_itemGall_block_'+modProducts_itemGallBlock_last, 'modProducts_itemGall_scroller', 'modProducts_itemGall_block_0');
}
