<!--
function changeFragment(idx,max_images)
{
	var objImage = document.getElementById('fragment-'+idx);
	objImage.style.display = "block";
	
	for(i=0; i < max_images; i++)
	{
		if(i != idx){
			var objImage2 = document.getElementById('fragment-'+i);
			if(objImage2) objImage2.style.display = "none";	
		}
	}
}

function popUpWindow(URLStr,width,height)
{
	window.open(URLStr,  '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+',height='+height+'');
    return false;
}

function chksoldOut(tmp)
{
	if(tmp.value == 'soldout'){
		
		alert("This product sold out. Please choose other product.");
		tmp.value = '';
	}
}

function changeImagebox(idx,rows,step)
{
	var previous = idx-1;
	var next = idx+1;
	
	if(idx == rows){
		next = 1;
	}
	
	if(idx == 1){
		previous = rows;
	}
	
	if(previous <= 0){
		previous += 1;
	}
	
	if(next > rows){
		next = 1;
	}
	
	if(step == 1){	//previous
		var target = previous;
		if(idx == 1) return;
	}
	else{
		var target = next;
		if(idx == rows) return;
	}
	
	for(i=1; i <= rows; i++)
	{
		var obj = document.getElementById('imageBox'+i);
		if(i == target){
			if(obj.style.display != "block"){
				obj.style.display = "block";
			}
		}
		else{
			obj.style.display = "none";
		}
	}
	
}

//-->