function nc_change_img(nc_parent_link, small_img, large_img, img_width, img_height){
	var nc_product_img = document.getElementById('nc_product_img');
	var nc_link = nc_product_img.getElementsByTagName('A')[0];
	var nc_img = nc_product_img.getElementsByTagName('IMG')[0];	
	
	nc_link_node = nc_parent_link.parentNode.getElementsByTagName('A');
	for(var i=0; i<nc_link_node.length; i++) if(nc_link_node[i].className == 'nc_current') nc_link_node[i].className = '';
	nc_parent_link.className = 'nc_current';
	
	nc_img.src = small_img;	
	if(large_img){
		nc_link.href = large_img;
		nc_link.style.cursor = 'pointer';
		nc_link.onclick = function(){return nc_show_image(this, img_width, img_height);}
	}else{
		nc_link.removeAttribute('HREF');
		nc_link.style.cursor = 'context-menu';
		nc_link.onclick = function(){return false;}
	}
	
	return false;
}
function nc_show_image(nc_parent_link, img_width, img_height){
	if( (img_width+30)>screen.width || (img_height+30)>screen.height ){
		var scroll_on = 'yes';
		var window_width = Math.floor(screen.width-10);
		var window_height = Math.floor(screen.height-100);
		var x_pos = 0;
		var y_pos = 0;
	}else{
		var scroll_on = 'no';
		var window_width = Math.floor(img_width+20);
		var window_height = Math.floor(img_height+20);
		var x_pos = Math.floor(screen.width/2-img_width/2);
		var y_pos = Math.floor(screen.height/2-img_height/2-40);
	}
	var nc_img_title = nc_parent_link.getElementsByTagName('IMG')[0].getAttribute('alt');
	var nc_window_html = '<html><head><title>' + nc_img_title + '</title></head><body style=\"margin:0;padding:0; background-color: rgb(56,22,17); text-align:center\"><img src=\"' + nc_parent_link.getAttribute('href') + '\" alt=\"' + nc_img_title + '\" onclick=\"self.close(); return false;\"/></body></html>';
	nc_img_window = window.open('', '', 'height=' + window_height + ', width=' + window_width + ', location=no, scrollbars=' + scroll_on + ', status=no, menubar=no, toolbar=no, resizable=yes, top=' + y_pos + ', left=' + x_pos );
	nc_img_window.document.write(nc_window_html);
	nc_img_window.document.close();
	return false;
}

