﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:msxsl="urn:schemas-microsoft-com:xslt">

	<xsl:import href="CommLinkedToPubDisplay.xslt"/>

	<xsl:template match="/">
		<xsl:variable name="TemplatePathURL" select="PublicationData/AjaxRequest/TemplateURL"/>
		<xsl:variable name="Mode" select="PublicationData/Mode"/>
		<xsl:variable name="Title" select="PublicationData/UpdatePublication/Content/Title"/>
		<xsl:variable name="ItemID" select="PublicationData/UpdatePublication/Content/ItemID"/>
		<xsl:variable name="SubTitle" select="PublicationData/UpdatePublication/Content/SubTitle"/>
		<xsl:variable name="StartDate" select="PublicationData/UpdatePublication/Content/StartDate"/>
		<xsl:variable name="EndDate" select="PublicationData/UpdatePublication/Content/EndDate"/>
		<xsl:variable name="PublicationLevel" select="PublicationData/UpdatePublication/Content/PublicationLevel"/>
		<xsl:variable name="ActiveYN" select="PublicationData/UpdatePublication/Content/ActiveYN"/>
		<xsl:variable name="PublishedYN" select="PublicationData/UpdatePublication/Content/PublishedYN"/>
		<xsl:variable name="Summary" select="PublicationData/UpdatePublication/Content/Summary"/>
		<xsl:variable name="IntroHTML" select="PublicationData/UpdatePublication/Content/IntroHTML"/>
		<xsl:variable name="ConclusionHTML" select="PublicationData/UpdatePublication/Content/ConclusionHTML"/>
		<xsl:variable name="ImageURL" select="PublicationData/UpdatePublication/Content/ImageURL"/>
		<xsl:variable name="Origin" select="PublicationData/Origin"/>
		<xsl:variable name="PublcationUpdatePermissionID" select="PublicationData/PublcationUpdatePermissionID"/>
		<xsl:variable name="BrandPermissionID" select="PublicationData/BrandPermissionID"/>
		<xsl:variable name="BrandImage" select="PublicationData/Brand/Detail/BrandLogoSmallURL"/>
		<xsl:variable name="IsCommunityAdmin" select="PublicationData/IsCommunityAdmin"/>
		<xsl:variable name="BrandID" select="PublicationData/BrandID"/>
		<xsl:variable name="BrandCount" select="count(PublicationData/Brands/Brand)"/>
		<xsl:variable name="OwnerBrandID" select="PublicationData/UpdatePublication/Content/OwnerBrandID"/>
		<xsl:variable name="PublicationStartDate" select="PublicationData/StartDate"/>
		<xsl:variable name="PromoteKey" select="PublicationData/Brand/Detail/PromoteKey"/>
		<xsl:variable name="DisplayName" select="PublicationData/User/UserData/DisplayName"/>
		<xsl:variable name="HostName">
			<xsl:choose>
				<xsl:when test="PublicationData/AjaxRequest/HostName">
					<xsl:value-of select="PublicationData/AjaxRequest/HostName"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="PublicationData/HostName"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="UserID" select="PublicationData/UserID"/>
		<xsl:variable name="AuthorID" select="PublicationData/UpdatePublication/Content/AuthorID"/>
		<xsl:variable name="DomainName" select="AjaxRequest/Settings/DomainName"></xsl:variable>
		<xsl:variable name="CommunitiesXML" select="PublicationData/Communities/."></xsl:variable>
		<xsl:variable name="CommunityID" select="PublicationData/AjaxRequest/Params/CommunityID"></xsl:variable>
		<xsl:variable name="CommunityName" select="PublicationData/CategoryList/Item[ItemID = $CommunityID]/CommunityName"></xsl:variable>
		<xsl:variable name="CurrentCommunityCategoryID" select="PublicationData/CategoryList/Item[ItemID = $CommunityID]/ID"></xsl:variable>
		<xsl:variable name="MasterBrandName" select="PublicationData/MasterBrandName"></xsl:variable>
		<xsl:variable name="IsSecureConnection" select="PublicationData/AjaxRequest/IsSecureConnection"/>
		<xsl:variable name="Version" select="PublicationData/AjaxRequest/Settings/BetaVersion"/>

		<xsl:variable name="Protocol">
			<xsl:choose>
				<xsl:when test="$IsSecureConnection = 1">
					<xsl:text>https://</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>http://</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="BrandDDRowDisplayStyle">
			<xsl:choose>
				<xsl:when test ="$BrandCount > 0">
					display:table-row;
				</xsl:when>
				<xsl:otherwise>
					display:none;
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="PublicationTitle">
			<xsl:choose>
				<xsl:when test="$Title != ''">
					<xsl:value-of select="$Title"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>Post Title</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="PublicationSubTitle">
			<xsl:choose>
				<xsl:when test="$SubTitle != ''">
					<xsl:value-of select="$SubTitle"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>Post Sub-Title</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="ImageSource">
			<xsl:choose>
				<xsl:when test="$ImageURL != ''">
					<xsl:value-of select="$ImageURL"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$TemplatePathURL"></xsl:value-of>
					<xsl:text>/Web/Images/Ver_2_0/DefaultPubImage.png</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>


		<xsl:choose>
			<xsl:when test="$Mode = 'UpdateItem' and $PublcationUpdatePermissionID != 4 and $BrandPermissionID != 4">
				<div id="divUnAuthorizedUsers">
					<span class="labelError">You are not an authorized user.</span>
				</div>
			</xsl:when>
			<xsl:otherwise>

				<input id="pubImagePath" type="hidden" value=""></input>

				<div id="divAuthorizedUsers">
					<div id="hdnCommunityXML" style="display:none;">
						<xsl:choose>
							<xsl:when test="PublicationData/ItemCategories/ItemCategory">
								<xsl:text disable-output-escaping="yes">&lt;community&gt;</xsl:text>
								<xsl:for-each select="PublicationData/ItemCategories/ItemCategory">
									<xsl:text disable-output-escaping="yes">&lt;communityid&gt;</xsl:text>
									<xsl:value-of select="categoryID"/>
									<xsl:text disable-output-escaping="yes">&lt;/communityid></xsl:text>
								</xsl:for-each>
								<xsl:text disable-output-escaping="yes">&lt;/community&gt;</xsl:text>
							</xsl:when>
							<xsl:otherwise>
								<xsl:copy-of select="PublicationData/Community/."/>
							</xsl:otherwise>
						</xsl:choose>
					</div>



					<table class="tableMaster" cellpadding="5" cellspacing="0">
						<tr>
							<td width="60%">
								<table class="tableMaster" cellpadding="5" cellspacing="0">
									<tr>
										<td>
											<input id="txtPublicationTitle" type="text" class="wideText" style="width: 649px;height:30px;font-size:20px;color:gray;font-style:italic;"
                                                   value="{$PublicationTitle}" tabindex="1" maxlength="75"
                                                   onFocus='SetTextAreaValue("txtPublicationTitle", "Post Title", "focus")'
                                                   onBlur='SetTextAreaValue("txtPublicationTitle", "Post Title", "blur")'/>
										</td>
									</tr>
									<tr>
										<td>
											<textarea id="txtIntroHtml" type="text" class="wideText mceEditor" tabindex="10" rows="16"
                                                      style="width: 649px; height:350px;"
													  onblur="addBlogPost_CopySummary('txtIntroHtml');">
												<xsl:value-of select ="$IntroHTML" disable-output-escaping ="yes"/>
											</textarea>
										</td>
									</tr>
									<tr style="display:none;">
										<td>
											<textarea id="txtSummary" type="text" class="wideText" tabindex="8" rows="8" maxlength="500"
                                                      style="width: 649px; height:200px;">
												<xsl:value-of select ="$Summary" disable-output-escaping ="yes"/>
											</textarea>
										</td>
									</tr>
								</table>
							</td>
							<td width="40%">
								<div style="border:1px solid #D1D3D4;" >
									<table class="tableMaster" cellpadding="5" cellspacing="0">
										<tr>
											<td colspan="2" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient" style="color:#FFFFFF;height:36px;">
												<span class="paddingTop15" style="text-transform: capitalize;">
													Publish This Post
												</span>
											</td>
										</tr>
										<tr>
											<td width="45%" nowrap="nowrap">
												<span class="labelGoalTitle">Start Date</span>
											</td>
											<td width="55%" nowrap="nowrap">
												<xsl:choose>
													<xsl:when test="$Mode = 'AddNew'">
														<input id="txt_Item_StartDate" type="text" onblur="checkdate(this)"
                                                               style="height:30px;font-size:20px;width:120px;"
                                                               class="text" tabindex="3" value="{normalize-space($PublicationStartDate)}"/>
													</xsl:when>
													<xsl:otherwise>
														<input id="txt_Item_StartDate" type="text" onblur="checkdate(this)"
                                                               style="height:30px;font-size:20px;width:120px;"
                                                               class="text" tabindex="3" value="{normalize-space($StartDate)}"/>
													</xsl:otherwise>
												</xsl:choose>
												<img src="{normalize-space($TemplatePathURL)}Web/Images/big_spacer.gif"></img>
												<img id="img_Item_StartDate"
                                                     src="{normalize-space($TemplatePathURL)}Web/Images/CalendarIcon.gif" width="30" height="30"
                                                     align="absmiddle" style="padding-bottom:8px;"
                                                     onclick='dp("txt_Item_StartDate", "img_Item_StartDate");'></img>
											</td>
										</tr>
										<tr>
											<td nowrap="nowrap">
												<span class="labelGoalTitle">End Date</span>
											</td>
											<td nowrap="nowrap">
												<input id="txt_Item_EndDate" type="text" onblur="checkdate(this)" style="height:30px;font-size:20px;width:120px;"
                                                       class="text" value ="{normalize-space($EndDate)}" tabindex="4"/>
												<img src="{normalize-space($TemplatePathURL)}Web/Images/big_spacer.gif"></img>
												<img id="img_Item_EndDate"
                                                     src="{normalize-space($TemplatePathURL)}Web/Images/CalendarIcon.gif" width="30" height="30"
                                                     align="absmiddle" style="padding-bottom:8px;"
                                                     onclick='dp("txt_Item_EndDate", "img_Item_EndDate");'></img>
											</td>
										</tr>
										<tr style='{$BrandDDRowDisplayStyle};'>
											<td nowrap="nowrap">
												<span class="labelGoalTitle">Brand</span>
											</td>
											<td nowrap="nowrap">
												<select id ="ddlBrand" name="Brand" class="smallDropdown"
                                                        style="height:35px;width:120px;font-size:18px;">
													<xsl:if test ="$Mode != 'AddNew'">
														<xsl:choose>
															<xsl:when test="$OwnerBrandID = ''">
																<option value="-1" selected="selected">
																	Select Brand
																</option>
															</xsl:when>
															<xsl:otherwise>
																<option value="-1">
																	Select Brand
																</option>
															</xsl:otherwise>
														</xsl:choose>

														<xsl:for-each select="PublicationData/Brands/Brand">
															<xsl:if test ="$OwnerBrandID = ''">
																<option value="{BrandID/.}">
																	<xsl:value-of select="normalize-space(BrandKey/.)"/>
																</option>
															</xsl:if>
															<xsl:if test ="$OwnerBrandID != ''">
																<xsl:if test ="normalize-space(BrandID/.) = $OwnerBrandID">
																	<option value="{BrandID/.}" selected="selected">
																		<xsl:value-of select="normalize-space(BrandKey/.)"/>
																	</option>
																</xsl:if>
																<xsl:if test ="normalize-space(BrandID/.) != $OwnerBrandID">
																	<option value="{BrandID/.}">
																		<xsl:value-of select="normalize-space(BrandKey/.)"/>
																	</option>
																</xsl:if>
															</xsl:if>
														</xsl:for-each>
													</xsl:if>
												</select>
											</td>
										</tr>
										<xsl:if test="$BrandID != 0">
											<tr>
												<td nowrap="nowrap">
													<span class="labelFormFields lineHeight">Author</span>
												</td>
												<td nowrap="nowrap">
													<xsl:choose>
														<xsl:when test="$Mode = 'AddNew'">
															<select id="ddlAuthor" name="Author" class="smallDropdown"
                                                                    style="height:35px;width:190px;font-size:18px;">
																<xsl:for-each select="PublicationData/ShareITRecords/ShareIT">
																	<xsl:choose>
																		<xsl:when test="ID = $UserID">
																			<option value="{ID}" selected="selected">
																				<xsl:value-of select="Name"/>
																			</option>
																		</xsl:when>
																		<xsl:otherwise>
																			<option value="{ID}">
																				<xsl:value-of select="Name"/>
																			</option>
																		</xsl:otherwise>
																	</xsl:choose>
																</xsl:for-each>
															</select>
														</xsl:when>
														<xsl:otherwise>
															<select id="ddlAuthor" name="Author" class="smallDropdown"
                                                                    style="height:35px;width:190px;font-size:18px;">
																<xsl:for-each select="PublicationData/ShareITRecords/ShareIT">
																	<xsl:choose>
																		<xsl:when test="ID = $AuthorID">
																			<option value="{ID}" selected="selected">
																				<xsl:value-of select="Name"/>
																			</option>
																		</xsl:when>
																		<xsl:otherwise>
																			<option value="{ID}">
																				<xsl:value-of select="Name"/>
																			</option>
																		</xsl:otherwise>
																	</xsl:choose>
																</xsl:for-each>
															</select>
														</xsl:otherwise>
													</xsl:choose>
												</td>
											</tr>
										</xsl:if>
										<tr>
											<td nowrap="nowrap">
												<span class="labelGoalTitle">Publication Level</span>
											</td>
											<td nowrap="nowrap">
												<select id ="opt_Item_PublicationLevel" name="PublicationLevel" class="smallDropdown" tabindex="5"
                                                        style="height:35px;width:120px;font-size:18px;">
													<xsl:if test ="$Mode != 'AddNew'">
														<xsl:for-each select="PublicationData/Publication/Item">
															<xsl:if test ="$PublicationLevel = ''">
																<option value="{ID/.}">
																	<xsl:value-of select="normalize-space(Type/.)"/>
																</option>
															</xsl:if>
															<xsl:if test ="$PublicationLevel != ''">
																<xsl:if test ="normalize-space(ID/.) = $PublicationLevel">
																	<option value="{ID/.}" selected="selected">
																		<xsl:value-of select="normalize-space(Type/.)"/>
																	</option>
																</xsl:if>
																<xsl:if test ="normalize-space(ID/.) != $PublicationLevel">
																	<option value="{ID/.}">
																		<xsl:value-of select="normalize-space(Type/.)"/>
																	</option>
																</xsl:if>
															</xsl:if>
														</xsl:for-each>
													</xsl:if>
													<xsl:if test ="$Mode = 'AddNew'">
														<xsl:for-each select="PublicationData/Publication/Item">
															<option value="{ID/.}">
																<xsl:value-of select="normalize-space(Type/.)"/>
															</option>
														</xsl:for-each>
													</xsl:if>
												</select>
											</td>
										</tr>
										<tr>
											<td nowrap="nowrap">
												<span class="labelGoalTitle">Active</span>
											</td>
											<td nowrap="nowrap">
												<select id="opt_Item_Active" name="Active" class="smallDropdown" tabindex="6"
                                                        style="height:35px;width:120px;font-size:18px;">
													<xsl:if test="$Mode != 'AddNew'">
														<xsl:if test ="$ActiveYN != ''">
															<xsl:if test="$ActiveYN = 'True'">
																<option value="True" selected="selected">
																	<xsl:text>Yes</xsl:text>
																</option>
																<option value="False">
																	<xsl:text>No</xsl:text>
																</option>
															</xsl:if>
															<xsl:if test="$ActiveYN ='False'">
																<option value="True">
																	<xsl:text>Yes</xsl:text>
																</option>
																<option value="False" selected="selected">
																	<xsl:text>No</xsl:text>
																</option>
															</xsl:if>
														</xsl:if>
														<xsl:if test="$ActiveYN= ''">
															<option value="True" selected="selected">
																<xsl:text>Yes</xsl:text>
															</option>
															<option value="False">
																<xsl:text>No</xsl:text>
															</option>
														</xsl:if>
													</xsl:if>
													<xsl:if test="$Mode='AddNew'">
														<option value="True" selected="selected">
															<xsl:text>Yes</xsl:text>
														</option>
														<option value="False" >
															<xsl:text>No</xsl:text>
														</option>
													</xsl:if>
												</select>
											</td>
										</tr>

										<xsl:if test ="$Mode != 'AddNew'">

											<xsl:variable name="UpdatePublishedDisplay">
												<xsl:choose>
													<xsl:when test="$IsCommunityAdmin = 'True'">
														<xsl:text></xsl:text>
													</xsl:when>
													<xsl:otherwise>display:none;</xsl:otherwise>
												</xsl:choose>
											</xsl:variable>
											<tr style="{$UpdatePublishedDisplay}">
												<td nowrap="nowrap">
													<span class="labelGoalTitle">Published</span>
												</td>
												<td nowrap="nowrap">
													<select id ="opt_Item_Published" name="Published" class="smallDropdown" tabindex="7"
                                                            style="height:35px;width:120px;font-size:18px;">
														<xsl:if test ="$PublishedYN != ''">
															<xsl:if test ="$PublishedYN = 'True'">
																<option value="True" selected="selected">
																	<xsl:text>Yes</xsl:text>
																</option>
																<option value="False">
																	<xsl:text>No</xsl:text>
																</option>
															</xsl:if>
															<xsl:if test ="$PublishedYN = 'False'">
																<option value="True" >
																	<xsl:text>Yes</xsl:text>
																</option>
																<option value="False" selected="selected">
																	<xsl:text>No</xsl:text>
																</option>
															</xsl:if>
														</xsl:if>
														<xsl:if test ="$PublishedYN = ''">
															<option value="True" selected="selected">
																<xsl:text>Yes</xsl:text>
															</option>
															<option value="False">
																<xsl:text>No</xsl:text>
															</option>
														</xsl:if>
													</select>
												</td>
											</tr>
										</xsl:if>
										<xsl:if test ="$Mode = 'AddNew'">
											<tr style="display:none;">
												<td nowrap="nowrap">
													<select id ="opt_Item_Published" name="Published" class="smallDropdown" tabindex="7"
                                                            style="height:35px;width:120px;font-size:18px;">
														<option value="True" >
															<xsl:text>Yes</xsl:text>
														</option>
														<option value="False" selected="selected">
															<xsl:text>No</xsl:text>
														</option>
													</select>
												</td>
											</tr>
										</xsl:if>

										<xsl:variable name="DisplayAddCommLink">
											<xsl:choose>
												<xsl:when test="PublicationData/CategoryList/Item != ''">
													<xsl:text>inline</xsl:text>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>none</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:variable>

										<xsl:variable name="DisplayAddCommDD">
											<xsl:choose>
												<xsl:when test="PublicationData/CategoryList/Item != ''">
													<xsl:text>none</xsl:text>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>inline</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:variable>
										<xsl:variable name="DisStyle">
											<xsl:choose>
												<xsl:when test="$Version >=3">
													display:none;
												</xsl:when>
											</xsl:choose>
										</xsl:variable>
										<tr style="{$DisStyle}">
											<td nowrap="nowrap" colspan="2">
												<span class="labelGoalTitle">Communities:</span>
											</td>
										</tr>
										<tr style="{$DisStyle}">
											<td nowrap="nowrap" class="verticallyMiddle" colspan="2">
												<table id="tab_Communities" class="tableMaster" cellpadding="0" cellspacing="1">
													<xsl:for-each select="PublicationData/SelectedCategoryList/Item">
														<tr id="tr_Communities_{ID}">
															<td colspan="2" id="td_community"  width="50%" class="verticallyMiddle">
																<xsl:call-template name="CommLinkedToPublication">
																	<xsl:with-param name="TemplateURL" select="$TemplatePathURL"></xsl:with-param>
																	<xsl:with-param name="CommunityID" select="ID"></xsl:with-param>
																	<xsl:with-param name="CommunityName" select="Name/."></xsl:with-param>
																	<xsl:with-param name="Mode">
																		<xsl:text>Update</xsl:text>
																	</xsl:with-param>
																</xsl:call-template>
															</td>
														</tr>
													</xsl:for-each>
													<xsl:if test="$CommunityID != 0">
														<xsl:for-each select="PublicationData/ItemCategories/ItemCategory">
															<tr id="tr_Communities_{ID}">
																<td colspan="2" id="td_community"  width="50%" class="verticallyMiddle">
																	<xsl:call-template name="CommLinkedToPublication">
																		<xsl:with-param name="TemplateURL" select="$TemplatePathURL"></xsl:with-param>
																		<xsl:with-param name="CommunityID" select="categoryID"></xsl:with-param>
																		<xsl:with-param name="CommunityName" select="categoryName"></xsl:with-param>
																		<xsl:with-param name="Mode">
																			<xsl:text>AddNew</xsl:text>
																		</xsl:with-param>
																	</xsl:call-template>
																</td>
															</tr>
														</xsl:for-each>
													</xsl:if>


													<tr id="tr_AddNewCommunity">
														<td colspan="2" class="verticallyMiddle">
															<span id="span_AddCommunities" class="publicationSummary onMouseOver marginTop10"
																  style="font-size:16px; display:{$DisplayAddCommLink};"
																  onclick="document.getElementById('optCommunities').style.display='inline';
                                                                           document.getElementById('optCommunities').selectedIndex='0';
                                                                           document.getElementById('span_AddCommunities').style.display='none';"
																  onmouseover="document.getElementById('span_AddCommunities').style.textDecoration='underline';"
																  onmouseout="document.getElementById('span_AddCommunities').style.textDecoration='none';">Click to Link</span>
														</td>
													</tr>

												</table>

												<select id="optCommunities" class="smallDropdown"
														style="width:160px;height:35px;font-size:18px;display:{$DisplayAddCommDD};margin-top:10px;"
														onchange="LinkCommToPublication('optCommunities');">
													<option value="-99">-Select-</option>
													<xsl:for-each select="PublicationData/CategoryList/Item[CommunityName != '']">
														<option value="{ID}">
															<xsl:value-of select="normalize-space(CommunityName/.)"/>
														</option>
													</xsl:for-each>
												</select>

											</td>
										</tr>


									</table>
								</div>
								<div style="border:1px solid #D1D3D4;" class="marginTop20">
									<table class="tableMaster" cellpadding="5" cellspacing="0">
										<tr>
											<td colspan="2" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient" style="color:#FFFFFF;height:36px;">
												<span class="paddingTop15" style="text-transform: capitalize;">
													Featured Image
												</span>
											</td>
										</tr>
										<tr>
											<td class="verticallyMiddle">
												<xsl:choose>
													<xsl:when test="$ItemID != ''">
														<div align="center" id="div_PublicationImage"
                                                             onclick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=Publication&amp;cropRatio=1&amp;requiredHeight=100&amp;requiredWidth=0&amp;requiredFileName=Thumbnail&amp;Key=UploadPathItems&amp;TemplateID={$ItemID}',
                                                             'Upload_Image','530','390','{$ItemID}','UpdatePublicationImage','div_PublicationImage',null,0);"
                                                             class="onMouseOver" style="height:135px;">
															<img align="absmiddle"
                                                                 onmouseout="this.setAttribute('class','');document.getElementById('span_imageText').style.display ='none';"
                                                                 onmouseover="this.className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                                 style="display:none;border:0px;" onload="setWidthAndHeightImage(this, 135);"
                                                                 src="{$ImageSource}"
                                                                 id="img_UserImage_56310">
																<span onmouseout="document.getElementById('img_UserImage_56310').setAttribute('class','');document.getElementById('span_imageText').style.display ='none';"
                                                                      onmouseover="document.getElementById('img_UserImage_56310').className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                                      class="labelLifespaceItem " style="display:none;position:relative;top:-75px;color:gray"
                                                                      id="span_imageText">Change Image</span>
															</img>
														</div>
													</xsl:when>
													<xsl:otherwise>
														<div align="center" id="div_PublicationImage"
                                                             onclick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=TempItemsPublications&amp;cropRatio=1&amp;requiredHeight=100&amp;requiredWidth=0&amp;requiredFileName=Thumbnail&amp;Key=UploadPathTempLocation',
                                                             'Upload_Image','530','390','0','UploadPublicationImage','div_PublicationImage',null,0);"
                                                             class="onMouseOver" style="height:135px;">
															<img align="absmiddle"
                                                                 onmouseout="this.setAttribute('class','');document.getElementById('span_imageText').style.display ='none';"
                                                                 onmouseover="this.className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                                 style="display:none;border:0px;" onload="setWidthAndHeightImage(this, 135);"
                                                                 src="{$ImageSource}"
                                                                 id="img_UserImage_56310">
																<span onmouseout="document.getElementById('img_UserImage_56310').setAttribute('class','');document.getElementById('span_imageText').style.display ='none';"
                                                                      onmouseover="document.getElementById('img_UserImage_56310').className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                                      class="labelLifespaceItem " style="display:none;position:relative;top:-75px;color:gray"
                                                                      id="span_imageText">Change Image</span>
															</img>
														</div>
													</xsl:otherwise>
												</xsl:choose>



											</td>
										</tr>
									</table>
								</div>
								<xsl:choose>
									<xsl:when test="$Version >=3">
										<div style="border:1px solid #D1D3D4;display:none" class="marginTop20" >
										<table class="tableMaster" cellpadding="5" cellspacing="0">
											<tr>
												<td colspan="2" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient" style="color:#FFFFFF;height:36px;">
													<span class="paddingTop15" style="text-transform: capitalize;">
														File / Link
													</span>
												</td>
											</tr>
											<tr>
												<td>
													<button type="button"
										   onClick="document.getElementById('div_MediaList_UploadSuite').style.display='block';
							   $au.imageUploaderFlash('UploadSuit').uploadPane().addFiles();" class="btn btn btn-primary pull-left">Add Files...</button>
													<input type="text" class="form-control addlink AdLink"
															   onkeyup="addResourceLink({$ItemID}, 'div_MediaList_FileContainer', event, {$ItemID});"
							   
														   Placeholder="Add Link ..." id="txtAddLink_{$ItemID}"></input>

													<div id="div_MediaList_UploadSuite" style="height:400px;display:none;">
														<input type="hidden" id="EmbededScript_UploadSuite"
															   name="EmbededScript_UploadSuite"
															   style="display:none;"/>
													</div>
												</td>
											</tr>
										</table>
											</div>
									</xsl:when>
								</xsl:choose>
							</td>
						</tr>
						<tr>
							<td>
								<xsl:if test ="$Mode = 'AddNew'">
									<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray marginBottom10 marginTop10"
                                        style="width:80px;line-height:30px;text-align:center;float:left;"
                                        onmouseover="document.getElementById('img_AddPublication').src='{$TemplatePathURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                        onmouseout="document.getElementById('img_AddPublication').src='{$TemplatePathURL}Web/Images/Ver_2_0/icon_Add.png';"
                                        onClick='return publications_AddPublishingData(
                                                      "txtPublicationTitle",
                                                      "txt_Item_StartDate",
                                                      "txt_Item_EndDate",
                                                      "opt_Item_PublicationLevel",
                                                      "opt_Item_Active",        
                                                      "opt_Item_Published",
                                                      "txtSummary",
                                                      "txtIntroHtml",
                                                      "pubImagePath","22","hdnCommunityXML");'>
										<img id="img_AddPublication" src="{$TemplatePathURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle"  class="marginRight5"></img>
										<span id="span_Cancel" style="font-size:14px;">SAVE</span>
									</div>
								</xsl:if>
								<xsl:if test ="$Mode = 'UpdateItem'">
									<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray marginBottom10 marginTop10"
                                       style="width:100px;line-height:30px;text-align:center;float:left;"
                                       onmouseover="document.getElementById('img_AddPublication').src='{$TemplatePathURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                       onmouseout="document.getElementById('img_AddPublication').src='{$TemplatePathURL}Web/Images/Ver_2_0/icon_Add.png';"
                                       onClick='return publications_UpdatePublishingData("{normalize-space($ItemID)}",
                                                          "txtPublicationTitle",
                                                          "txt_Item_StartDate",
                                                          "txt_Item_EndDate",
                                                          "opt_Item_PublicationLevel",
                                                          "opt_Item_Active",        
                                                          "opt_Item_Published",
                                                          "txtSummary",
                                                          "txtIntroHtml",
                                                          "ddlBrand",
                                                          "pubImagePath","22", "hdnCommunityXML", "ddlAuthor","{$ImageSource}");'>
										<img id="img_AddPublication" src="{$TemplatePathURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle"  class="marginRight5"></img>
										<span id="span_Cancel">UPDATE</span>
									</div>
								</xsl:if>
							</td>
						</tr>
					</table>
				</div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
