//** LeDuc Gallery BUILDER **//

function buildGallery(whichtype) {
if (whichtype==null) {thisgallery="gallery"} else {thisgallery=whichtype};
cycle=0;
td=0;
for (p=0;p<gc;p++) {
if (galleryCats[p][2]==thisgallery || galleryCats[p][2]=="both") {
document.write('<span class="header"><b>'+galleryCats[p][0]+'</b></span><hr><p>'+galleryCats[p][1]+'</p><table border="0" cellpadding="5" width="100%"><tr>');
	for (k=0;k<GalleryItems;k++){
	if (galleryData[k][2]==p) {
	if (cycle==3) {cycle=0} else {}
    td++;
document.write('<td valign=middle align=center width="33%"><table border="0" cellspacing="0" cellpadding="0" align=center>'+
'<tr>'+ 
'    <td width="4"><img src="../images/tl_corner1_thumb.jpg" width="4" height="5"></td>'+
'    <td background="../images/top_thumb.jpg"><img src="../images/tl_corner2_thumb.jpg" width="7" height="5"></td>'+
'    <td background="../images/top_thumb.jpg"><img src="../images/top_thumb.jpg" width="50" height="5"></td>'+
'    <td background="../images/top_thumb.jpg"><div align="right"><img src="../images/tr_corner2_thumb.jpg" width="6" height="5"></div></td>'+
'    <td width="5" align="right"><img src="../images/tr_corner1_thumb.jpg" width="5" height="5"></td>'+
'  </tr>'+
'  <tr> '+
'    <td width="4" valign="top" background="../images/left_thumb.jpg"><img src="../images/tl_corner3_thumb.jpg" width="4" height="5"></td>'+
'    <td colspan="3" rowspan="3" bgcolor="#FFFFFF"><div align="center"><a href="javascript:popIt(\''+k+'\');"><img src="../images/leduc_gallery/'+galleryData[k][4]+'" hspace="2" vspace="2" border="1"></a></div></td>'+
'    <td width="5" align="right" valign="top" background="../images/right_thumb.jpg"><img src="../images/tr_corner3_thumb.jpg" width="5" height="5"></td>'+
'  </tr>'+
'  <tr> '+
'    <td width="4" background="../images/left_thumb.jpg"><img src="../images/left_thumb.jpg" width="4" height="50"></td>'+
'    <td width="5" align="right" background="../images/right_thumb.jpg"><img src="../images/right_thumb.jpg" width="5" height="50"></td>'+
'  </tr>'+
'  <tr> '+
'    <td width="4" valign="bottom" background="../images/left_thumb.jpg"><img src="../images/bl_corner3_thumb.jpg" width="4" height="6"></td>'+
'    <td width="5" align="right" valign="bottom" background="../images/right_thumb.jpg"><img src="../images/br_corner3_thumb.jpg" width="5" height="6"></td>'+
'  </tr>'+
'  <tr> '+
'    <td width="4"><img src="../images/bl_corner1_thumb.jpg" width="4" height="5"></td>'+
'    <td background="../images/bottom_thumb.jpg"><img src="../images/bl_corner2_thumb.jpg" width="7" height="5"></td>'+
'    <td background="../images/bottom_thumb.jpg"><img src="../images/bottom_thumb.jpg" width="50" height="5"></td>'+
'    <td background="../images/bottom_thumb.jpg"><div align="right"><img src="../images/br_corner2_thumb.jpg" width="6" height="5"></div></td>'+
'    <td width="5" align="right"><img src="../images/br_corner1_thumb.jpg" width="5" height="5"></td>'+
'  </tr>'+
'</table><br><b>'+galleryData[k][3]+'</b></td>');
	
if (td==3) {document.write('</tr><tr>');td=0} else{};
	cycle++;} else {}
}
if (td==2) {document.write('<td width="33%">&nbsp;</td></tr>');td=0}
else if (td==1) {document.write('<td width="33%">&nbsp;</td><td width="33%">&nbsp;</td></tr>');td=0}
else {document.write('</tr>');td=0};
document.write('</table>');}}}


function popIt(whichone) {
if (whichone==null) {w=" "} else {w=whichone};
if (is.nav) {popGallery=window.open('blank.htm','popGallery','height=500,width=550,scrollbars=yes,status=no,toolbar=no,location=no,resizable=yes');}
else {popGallery=window.open('','popGallery','height=500,width=550,scrollbars=yes,status=no,toolbar=no,location=no,resizable=yes');}
popGallery.document.write('<html>'+
'<head>'+
'<title>LeDuc Gallery Detail: '+galleryData[w][3]+'</title>'+
'<style>td {font-family: Arial, Helvetica, sans-serif;font-size: 10pt;color: #000000;}.whitebody {font-family: Arial, Helvetica, sans-serif;font-size: 10pt;color: #FFFFFF;}</style>'+
'</head>'+
'<body background="../images/background.gif">'+
'<table border="0" align="center" cellpadding="0" cellspacing="0">'+
'  <tr> '+
' <td width="13"><img src="../images/tl_corner1_big.jpg" width="13" height="14"></td>'+
'<td width="19" background="../images/top_big.jpg"><img src="../images/tl_corner2_big.jpg" width="19" height="14"></td>'+
'<td background="../images/top_big.jpg"><img src="../images/top_big.jpg" width="100" height="14"></td>'+
'<td  background="../images/top_big.jpg" align="right"> '+ '<img src="../images/tr_corner2_big.jpg" width="18" height="14"></td>'+
'<td width="15"><img src="../images/tr_corner1_big.jpg" width="15" height="14"></td>'+
'  </tr>'+
'  <tr> '+
' <td width="13" valign="top" background="../images/left_big.jpg"><img src="../images/tl_corner3_big.jpg" width="13" height="17"></td>'+
'    <td colspan="3" rowspan="3" bgcolor="#FFFFFF"><div align="center"><img src="../images/leduc_gallery/'+galleryData[w][0]+'" hspace="2" vspace="2" border="2"></div></td>'+
' <td width="15" valign="top" background="../images/right_big.jpg"><img src="../images/tr_corner3_big.jpg" width="15" height="17"></td>'+
'  </tr>'+
'  <tr> '+
'<td width="13" height="267" background="../images/left_big.jpg"><img src="../images/left_big.jpg" width="13" height="100"></td>'+
'<td width="15" background="../images/right_big.jpg"><img src="../images/right_big.jpg" width="15" height="100"></td>'+
'  </tr>'+
'  <tr> '+
'<td width="13" height="18" valign="bottom" background="../images/left_big.jpg"><img src="../images/bl_corner3_big.jpg" width="13" height="18"></td>'+
' <td width="15" valign="bottom" background="../images/right_big.jpg"><img src="../images/br_corner3_big.jpg" width="15" height="18"></td>'+
'  </tr>'+
'  <tr> '+
'<td width="13"><img src="../images/bl_corner1_big.jpg" width="13" height="16"></td>'+
'<td width="19" background="../images/bottom_big.jpg"><img src="../images/bl_corner2_big.jpg" width="19" height="16"></td>'+
'<td background="../images/bottom_big.jpg"><img src="../images/bottom_big.jpg" width="100" height="16"></td>'+
'<td  background="../images/bottom_big.jpg" align="right"> '+ '<img src="../images/br_corner2_big.jpg" width="18" height="16"></td>'+
'<td width="15"><img src="../images/br_corner1_big.jpg" width="15" height="16"></td>'+
'  </tr>'+
'</table>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="5">'+
'  <tr>'+
'    <td><div align="center">'+galleryData[w][1]+'</div></td>'+
'  </tr>'+
'</table>'+
'</body>'+
'</html>');
}

