asked on
//Hides the div with the images and shows the main div
//The parent page must have a div with id="divMain"
function ShowMainDiv()
{
var divMain = document.getElementById('divMain');
var divImages = document.getElementById('<%= divImages.ClientID %>');
divImages.style.display = "none";
divMain.style.display = "";
}
//Selects the Image and send it's information to the ChangeImage function on the main page
function SelectImage(imgID, caption, filename, height, width)
{
var txtImgID = document.getElementById('<%= txtImgID.ClientID %>');
txtImgID.value = imgID;
parent.ChangeImage(imgID, caption, filename, height, width);
ShowMainDiv();
}
//The image div
<div id="divImages" runat="server" style="display:none;">
<b>Click on an image to select it.</b>
<br /><br />
<div id="divPgInfo" class="Footerlinks" runat="server" style="float: left; width: 100%;">
<span>Currently on page <asp:Label ID="lblCurrentPage" runat="server"></asp:Label></span><br />
<span>Viewing properties <asp:Label ID="lblNumItems" runat="server"></asp:Label></span><br />
<asp:LinkButton ID="lnkPrev" runat="server" Text="<< previous"
onclick="lnkPrev_Click" CausesValidation="false"></asp:LinkButton> 
<asp:LinkButton ID="lnkNext" runat="server" Text="next >>"
onclick="lnkNext_Click" CausesValidation="false"></asp:LinkButton>
</div>
<br />
<asp:DataList ID="dtlImages" runat="server" RepeatColumns="3"
RepeatDirection="Vertical" onitemdatabound="dtlImages_ItemDataBound">
<ItemTemplate>
<div style="border-style:solid; height:206px; width:206px; background-color:#F1F1F1">
<table width="100%" height="100%" onmouseover="this.style.backgroundColor = '#B8B9BD'"
onmouseout="this.style.backgroundColor = '#F1F1F1'">
<tr align="center" valign="middle">
<td>
<asp:LinkButton ID="lnkSelectImage" runat="server" CssClass="pointer" CausesValidation="false">
<div style="display:none;">
<asp:TextBox ID="txtID" runat="server"></asp:TextBox>
<asp:TextBox ID="txtCaption" runat="server"></asp:TextBox>
<asp:TextBox ID="txtFileName" runat="server"></asp:TextBox>
</div>
<di:DynamicImage ID="diImage" runat="server" />
</asp:LinkButton>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:DataList>
<input id="btnBack" type="button" value="Back" onclick="ShowMainDiv()" causesvalidation="false" />
</div>