var OPL = { /* other product list */
	
	__rstrsub : function(str, str_from, str_to) {
		
		pos = str.lastIndexOf(str_from);
		if(pos == -1) return str;
		
		last_part = str.substring(pos);
		
		first_part = str.substring(0, pos);
		
		new_part = last_part.replace(str_from, str_to);
		
		return first_part + new_part;
	},
	
	do_picture_swap : function(id) { 
		
		big_elm = $('#full_product_graphic');
		sma_elm = $('#other_product_pictures #' + id);
		if(!(big_elm && sma_elm)) return;
		
		big_p = big_elm.css('background-image');
		sma_p = sma_elm.css('background-image');
		if((big_p == '') || sma_p == '') return;
		
		new_big_p = OPL.__rstrsub(sma_p, 'thumb', 'full');
		new_sma_p = OPL.__rstrsub(big_p, 'full', 'thumb');
		
		big_elm.css( { 'background-image': new_big_p } );
		sma_elm.css( { 'background-image': new_sma_p } );
	},
	
	init : function() { }
};

$(function() { OPL.init(); });

