function showImages( imageList, imagePath, zoomImagePath ) {
	var picsPerPage=12;
	var httpLocation = document.location.pathname + '?';		
	var pageCounter = document.location.search.substr(1, document.location.search.length);			
	if ( !pageCounter>0 ){ pageCounter=1; }
	
	var toPic	=pageCounter*picsPerPage;
	var fromPic	=(toPic-picsPerPage)+1;

	var i=(fromPic-1);
	totalCounter=i;	

	document.write('<table width="420"  border="0" align="center" cellpadding="0" cellspacing="1">');
	while( i<=imageList.length ) {
  		document.write('<tr align="center" valign="middle">');
  		for( j=1; j<=4 ; j++) {
			totalCounter++;
			document.write('<td width="25%" height="120" >' )
    		if( imageList[i] != null && imageList[i] !='' ) {
				//alert("totalCounter:"+totalCounter+",fromPic:"+fromPic+",toPic:"+toPic);
				if ( totalCounter>=fromPic && totalCounter<=toPic) {				
					document.write('<a href="zoom.html?' + zoomImagePath + imageList[i] + '" target="_self"><img src="' + imagePath + imageList[i] + '" border="0"></a><br>');
					document.write( '<span class="smallDescriptionText">' + imageList[i].substring(0,imageList[i].length-4) + '</span>' );			
				} 
			} 
			document.write('</td>');						
			i++;
  		}
 		document.write('</tr>');
		if ( totalCounter == toPic ) { break;}
	} 
	document.write('</table>');
	document.write('<br/>');

	displayPages(imageList.length, picsPerPage, httpLocation, pageCounter );
}


//------------------------------------------------------------------------------------------------------------------------------------
//FUNCTION TO DISPLAY PAGES AVAILABLE
//------------------------------------------------------------------------------------------------------------------------------------
//  INPUT PARAMETERS
//    - maxImages
//    - imagePerPage
//    - pagePath
//------------------------------------------------------------------------------------------------------------------------------------
function displayPages(maxImages, imagePerPage, pagePath, pageNumber ){
	var numOfPages = Math.ceil(maxImages/imagePerPage);
	document.write('<span class="smallDescriptionText">' );
	document.write('Page : ' );
	for ( page = 1; page <= numOfPages; page++ ){
		if ( pageNumber == page ){
			document.write( '<b>'+page+'</b>&nbsp;|&nbsp;' );
		}else{
			document.write( '<a href='+pagePath+page+'>'+page+'</a>&nbsp;|&nbsp;' );
		}
	}
	document.write('</span>' );
}

