
var catID = 1000;
function MovePic(offset)
{
	var imgObj = document.getElementById('imgPhoto');
	currID = parseInt(document.getElementById('currID').value);
	var index =  currID + offset;
	var oIndexJump = document.getElementById('IndexJump');
	oIndexJump.href = "index.html?catID=" + catID + "&PageID=" + parseInt(1+(index / (nRow * nCol)));
	if ( index < 0 )
	{
		index = 1;
	}
	else if (index > nTotal)
	{
		index = nTotal;
	}
	
	if (index > 0 && index <= nTotal)
	{
		imgObj.src = photoPath  + 'photos/photo' + index.toString() + '.jpg';
		document.getElementById('currID').value = index;
	/*	
		if (index > 2)
		{
			document.getElementById('imgP2').src = photoPath  + 'photos/thumb' + (index - 2).toString() + '.jpg';
			document.getElementById('imgP2').style.display = 'block';
		}	
		else
			document.getElementById('imgP2').style.display = 'none';
		
		if (index > 1)
		{
			document.getElementById('imgP1').src = photoPath  + 'photos/thumb' + (index - 1).toString() + '.jpg';
			document.getElementById('imgP1').style.display = 'block';
		}
		else
			document.getElementById('imgP1').style.display = 'none';
			
		document.getElementById('imgP0').src = photoPath  + 'photos/thumb' + (index    ).toString() + '.jpg';
		
		if (index <= nTotal - 1)
		{
			document.getElementById('imgN1').src = photoPath  + 'photos/thumb' + (index + 1).toString() + '.jpg';
			document.getElementById('imgN1').style.display = 'block';
		}
		else
			document.getElementById('imgN1').style.display = 'none';
		
		if (index <= nTotal - 2)
		{
			document.getElementById('imgN2').src = photoPath  + 'photos/thumb' + (index + 2).toString() + '.jpg';
			document.getElementById('imgN2').style.display = 'block';
		}
		else
			document.getElementById('imgN2').style.display = 'none';
*/
	if (index == 1 )
	{
		document.getElementById('divprev').innerHTML=""
	}
	else
	{
		if(document.getElementById('divprev') != null)
			document.getElementById('divprev').innerHTML="<a href=\"javascript:MovePic(-1)\" style=\"visible:false;TEXT-DECORATION:none\">&lt;&lt;Previous&nbsp;前一张</a>";
	}
	if (index == nTotal)
	{
		document.getElementById('divnext').innerHTML="";
	}
	else
	{
		if(document.getElementById('divnext') != null)
			document.getElementById('divnext').innerHTML="<a href=\"javascript:MovePic(1)\" style=\"TEXT-DECORATION:none\">后一张&nbsp;&nbsp;Next &gt;&gt;</a>";
	}
		document.getElementById('currID').value = index;
		
		document.getElementById('sCaption').innerHTML = sDesc[index];
		
	}
}

