var newTemplates = {
	detail: {
		photoTemplates: {
			averageVotesText: "${num_of_votes}&nbsp;ratings&nbsp;|&nbsp;${text_rating}&nbsp;stars",
			getPageUrl: function(){return window.location.href;},
			html: '\
				<div class="${classes.ITEM} ${classes.PHOTO}{if !photo.previous} ${classes.FIRST}{/if}{if !photo.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">\
				<div class="${classes.NAVIGATION}">\
					<div class="${classes.NEXT} ${hooks.MEDIA_NEXT}">${templates.getNextLabel()}</div>\
					<div class="${classes.PREVIOUS} ${hooks.MEDIA_PREVIOUS}">${templates.getPreviousLabel()}</div>\
				</div>\
				<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">\
					<h1>${photo.title|ellipse:config.titleLength || photo.title.length}</h1>\
					<div class="hdPhotoInfo">\
						<div class="submitInfo">\
							<div class="${classes.DATE}">\
								<div class="${classes.LABEL}">${templates.getDateLabel()}</div>\
								<div class="${classes.VALUE}">${photo.uploadedDate|date}</div>\
							</div>\
							{if !photo.hiddenAuthor}\
								<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">\
									<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>\
									<div class="${classes.VALUE}">${photo.author}</div>\
								</div>\
							{/if}\
						</div>\
					</div>\
				</div>\
				<div class="detailWrapper">\
					<div class="${classes.LARGE_THUMB_WRAPPER}">\
						{var originalURL = photo.url}\
						{var photoURL = originalURL.replace("320X240", "420X315")}\
						<div class="${classes.LARGE_THUMB}" style="background: transparent url(${photoURL}) no-repeat 50% 50%;"></div>\
						<div class="${classes.THUMB_OVERLAY}"></div>\
					</div>\
					<div class="${classes.DESCRIPTION}">\
						<div>${templates.getPhotoDescription(photo.description)}</div>\
					</div>\
					<div class="detailFacebookContainer">\
						<iframe src="http://www.facebook.com/plugins/like.php?app_id=214144668605863&amp;href=http%3A%2F%2Fwww.harley-davidson.com%2Fen_US%2FContent%2FPages%2Fdark-custom%2Fbikes-gallery.html%23loc%3Ddetail%2Fphoto%2F${photo.mediaId}&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=verdana&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>\
					</div>\
					<div class="${classes.RATING}">\
						<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">\
							<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> \
							<div class="artRating">\
								<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
							</div>\
							<div class="${ratingClasses.NUM_OF_VOTES}-container">${templates.getAverageVotesText(\'<div class="\'+templates.getVotesText()+\'"></div>\',\'<div class="\'+templates.getRatingText()+\'"></div>\')}</div>\
						</div>\
						<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">\
							<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}">YOUR RATING:</div> \
							<div class="artRating">\
								<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
							</div>\
							<div class="${ratingClasses.NUM_OF_VOTES}-container"><div class="${hooks.MEDIA_RATING_TEXT}"></div></div>\
						</div>\
					</div>\
					<div class="hdCommentsButton ${hooks.MEDIA_COMMENTS_BTN}">\
					${templates.getCommentsText(photo.numberOfComments)}\
					</div>\
					{if photo.numberOfComments > 0}\
					<div class="hdSubmitComment">${templates.getCommentsButtonText()}</div>\
					{/if}\
					<div style="clear:both"></div>\
					<div class="${classes.TAG_LIST}">\
					{if hasTags}\
						<div class="${classes.LABEL}">${templates.getTagsLabel()}</div>\
						<div class="${classes.VALUE}">\
						{for tag in photo.tags}{if tag_index > 0}${", "}{/if}<a class="${classes.TAG} ${hooks.MEDIA_TAG}" href="javascript:void(0)">${tag}</a>{/for}\
						</div>\
					{/if}\
					</div>\
				</div>\
			</div>'
		},
		videoTemplates: {
			averageVotesText: "${num_of_votes}&nbsp;ratings&nbsp;|&nbsp;${text_rating}&nbsp;stars",
			getPageUrl: function(){return window.location.href;},
			html: '\
				<div class="${classes.ITEM} ${classes.VIDEO}{if !video.previous} ${classes.FIRST}{/if}{if !video.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">\
				<div class="${classes.NAVIGATION}">\
					<div class="${classes.NEXT} ${hooks.MEDIA_NEXT}">${templates.getNextLabel()}</div>\
					<div class="${classes.PREVIOUS} ${hooks.MEDIA_PREVIOUS}">${templates.getPreviousLabel()}</div>\
				</div>\
				<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">\
					<h1>${video.title|ellipse:config.titleLength || video.title.length}</h1>\
					<div class="hdVideoInfo">\
						<div class="submitInfo">\
							<div class="${classes.DATE}">\
								<div class="${classes.LABEL}">${templates.getDateLabel()}</div>\
								<div class="${classes.VALUE}">${video.uploadedDate|date}</div>\
							</div>\
							{if !video.hiddenAuthor}\
								<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">\
									<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>\
									<div class="${classes.VALUE}">${video.author}</div>\
								</div>\
							{/if}\
						</div>\
					</div>\
				</div>\
				<div class="detailWrapper">\
					<div class="${classes.LARGE_THUMB_WRAPPER}">\
						<div class="${classes.LARGE_THUMB} ${hooks.MEDIA_THUMB_LG}"></div>\
					</div>\
					<div class="${classes.DESCRIPTION}">\
						<div>${templates.getVideoDescription(video.description)}</div>\
					</div>\
					<div class="detailFacebookContainer">\
						<iframe src="http://www.facebook.com/plugins/like.php?app_id=214144668605863&amp;href=http%3A%2F%2Fwww.harley-davidson.com%2Fen_US%2FContent%2FPages%2Fdark-custom%2Fbikes-gallery.html%23loc%3Ddetail%2Fvideo%2F${video.mediaId}&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=verdana&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>\
					</div>\
				<div class="${classes.RATING}">\
					<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">\
						<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> \
						<div class="artRating">\
							<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
						</div>\
						<div class="${ratingClasses.NUM_OF_VOTES}-container">${templates.getAverageVotesText(\'\',\'<div class="\'+templates.getRatingText()+\'"></div>\')}</div>\
					</div>\
					<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">\
						<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}">YOUR RATING:</div> \
						<div class="artRating">\
							<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
						</div>\
						<div class="${ratingClasses.NUM_OF_VOTES}-container"><div class="${hooks.MEDIA_RATING_TEXT}"></div></div>\
					</div>\
				</div>\
				<div class="hdCommentsButton ${hooks.MEDIA_COMMENTS_BTN}" id="${commentsButtonId}">\
					${templates.getCommentsText(video.numberOfComments)}\
				</div>\
				{if video.numberOfComments > 0}\
					<div class="hdSubmitComment">${templates.getCommentsButtonText()}</div>\
				{/if}\
				<div class="${classes.TAG_LIST}">\
					{if hasTags}\
						<div class="${classes.LABEL}">${templates.getTagsLabel()}</div>\
						<div class="${classes.VALUE}">\
						{for tag in video.tags}{if tag_index > 0}${", "}{/if}<a class="${classes.TAG} ${hooks.MEDIA_TAG}" href="javascript:void(0)">${tag}</a>{/for}\
						</div>\
					{/if}\
					</div>\
				</div>\
			</div>'
		}
	},
	gallery: {
		html: '\
			<div class="${classes.GALLERY} ${classes.WIDGET}">\
			<div class="${classes.CONTENT_PANEL}">\
				{var rows = Math.ceil(items.length / config.itemsX)}\
				<div class="${classes.FIRST} hdRow">\
				{for item in items}\
					{if item_index > 0 && item_index % config.itemsX == 0}\
						{if rows == (Math.ceil(item_index / config.itemsX) + 1)}\
							</div><div class="hdClear"></div><div class="${classes.LAST} hdRow">\
						{else}\
							</div><div class="hdClear"></div><div class="hdRow">\
						{/if}\
					{/if}\
					<div class="{if item_index % config.itemsX == 0}${classes.FIRST}{/if} hdItemWrapper">${item|facade}</div>\
					{/for}\
					<div class="hdClear"></div>\
				</div>\
			</div>\
		</div>',	
		photoTemplates: {
			html: '\
				<div class="${classes.ITEM} ${classes.PHOTO}{if !photo.previous} ${classes.FIRST}{/if}{if !photo.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">\
					<div class="${classes.SMALL_THUMB_WRAPPER}">\
						<div class="${classes.SMALL_THUMB} ${hooks.MEDIA_THUMB}" style="background: transparent url(${photo.thumbUrl}) no-repeat 50% 50%;">\
							<div class="${classes.THUMB_OVERLAY}"></div>\
						</div>\
					</div>\
					<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">${photo.title|ellipse:config.titleLength || photo.title.length}</div>\
					<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">\
					{if !photo.hiddenAuthor}\
						<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>\
						<div class="${classes.VALUE}">${photo.author}</div>\
					{/if}\
					</div>\
					<div class="detailWrapper">\
						<div class="${classes.RATING}">\
							<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">\
								<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div>\
								<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
								<div class="${classes.WRAPPER}">\
								(<div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>)\
								</div>\
							</div>\
							<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">\
								<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> \
								<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
								<div class="${ratingClasses.NUM_OF_VOTES}-container"><div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>&nbsp;rating{if photo.numberOfVotes != 1}s{/if}</div>\
							</div>\
						</div>\
					</div>\
				</div>'
			},
			videoTemplates: {
				html: '\
					<div class="${classes.ITEM} ${classes.VIDEO}{if !video.previous} ${classes.FIRST}{/if}{if !video.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">\
						<div class="${classes.SMALL_THUMB_WRAPPER}">\
							<div class="${classes.SMALL_THUMB} ${hooks.MEDIA_THUMB}" style="background: transparent url(${video.thumbUrl}) no-repeat 50% 50%;">\
								<div class="${classes.THUMB_OVERLAY}"></div>\
							</div>\
						</div>\
						<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">${video.title|ellipse:config.titleLength || video.title.length}</div>\
						<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">\
						{if !video.hiddenAuthor}\
							<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>\
							<div class="${classes.VALUE}">${video.author}</div>\
						{/if}\
						</div>\
						<div class="${classes.RATING}">\
							<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">\
								<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div>\
								<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
								<div class="${classes.WRAPPER}">\
								(<div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>)\
								</div>\
							</div>\
							<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">\
								<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> \
								<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>\
								<div class="${ratingClasses.NUM_OF_VOTES}-container"><div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>&nbsp;rating{if video.numberOfVotes != 1}s{/if}</div>\
							</div>\
						</div>\
					</div>'
			}
		},
	featuredPosts: {
		blogTemplates: {
			html: '\
				<div class="${classes.ITEM} ${classes.BLOG}{if !blog.previous} ${classes.FIRST}{/if}{if !blog.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">\
				<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">${blog.title|ellipse:config.titleLength || blog.title.length}</div>\
			</div>'
		},
		templates: {
			html : '\
				<div class="${classes.FEATURE_STORIES} ${classes.WIDGET}">\
						<ul class="${classes.LIST}">\
						{for item in items}\
							{var post = parseInt(item_index)+1}\
							{if post % 2 == 0}\
								<li class="${hooks.STORY} ${classes.ACTIVE}">\
							{else}\
								<li class="${hooks.STORY}">\
							{/if}\
							${item|facade}\
							</li>\
						{/for}\
						</ul>\
					<a href="#featAnchorAll" name="featAnchorAll" class="${classes.VIEW_ALL} ${classes.CONTROL} ${hooks.VIEW_ALL}">${templates.getViewAllStoriesText()}</a>\
				</div>'		
		}
	},
	moreBikes: {
		templates: {
			viewAllStoriesText : ['More User Submitted Bikes','More User Submitted Harleys'],
			getViewAllStoriesText : function(category) {
			
				if (category == 'Bikes/Other bike'){
					return this.viewAllStoriesText[0];
				}
				else{
					return this.viewAllStoriesText[1];
				}
			},
			featureStoriesLabel : ['MORE IRON 883 BIKE PROFILES',
			                       'MORE FAT BOB BIKE PROFILES',
			                       'MORE STREET BOB BIKE PROFILES',
			                       'MORE NIGHTSTER BIKE PROFILES',
			                       'MORE H-D BIKE PROFILES',
			                       'MORE FORTY-EIGHT BIKE PROFILES',
			                       'OTHER BIKE PROFILES',
			                       'MORE BLACKLINE BIKE PROFILES',
			                       'MORE SEVENTY TWO BIKE PROFILES'],
			
			getFeatureStoriesLabel : function(category) {
				
				if (category == 'Bikes/Iron 883'){
					return this.featureStoriesLabel[0];
				}
				else if (category == 'Bikes/Fat Bob'){
					return this.featureStoriesLabel[1];
				}
				else if (category == 'Bikes/Street Bob'){
					return this.featureStoriesLabel[2];
				}
				else if (category == 'Bikes/Nightster'){
					return this.featureStoriesLabel[3];
				}
				else if (category == 'Bikes/Other H-D bike'){
					return this.featureStoriesLabel[4];
				}
				else if (category == 'Bikes/Forty-Eight'){
					return this.featureStoriesLabel[5];
				}
				else if (category == 'Bikes/Blackline'){
					return this.featureStoriesLabel[7];
				}
				else if (category == 'Bikes/Seventy Two'){
					return this.featureStoriesLabel[8];
				}
				else{
					return this.featureStoriesLabel[6];
				}
			},
			bikeAdText : '<h5><img src="/en_US/Media/images/Content/Pictorial/dark_custom_v3/hdr_hd_bikes.gif" height="19" width="159" alt="BIKES FROM H-D" title="BIKES FROM H-D" /></h5><a href="iron_883.html" class="bikeType">IRON 883<span class="serviceMark">TM</span></a><a href="nightster.html" class="bikeType right">NIGHTSTER <span class="serviceMark">&reg;</span></a><a href="street_bob.html" class="bikeType">STREET BOB<span class="serviceMark">&reg;</span></a><a href="fat_bob.html" class="bikeType">FAT BOB<span class="serviceMark">&reg;</span></a><a href="forty-eight.html" class="bikeType right">FORTY-EIGHT<span class="serviceMark">TM</span></a><a href="seventy-two.html" class="bikeType right">SEVENTY TWO<span class="serviceMark">TM</span></a><div class="hdClear"></div>',
			getBikeAdText : function(category) {
				if (category == 'Bikes/Other H-D bike' || category == 'Bikes/Other bike'){
					return this.bikeAdText;
				}
			},
			html : '\
				<div class="${classes.FEATURE_STORIES} ${classes.WIDGET}">\
					{var category = DarkCustom.engineMore.dao.config.categories}\
					<span class="${classes.TITLE}">${templates.getFeatureStoriesLabel(category)}</span>\
						<ul class="${classes.LIST}">\
						{for item in items}\
							{var post = parseInt(item_index)+1}\
							{if post % 2 == 0}\
								<li class="${hooks.STORY} ${classes.ACTIVE}">\
							{else}\
								<li class="${hooks.STORY}">\
							{/if}\
							${item|facade}\
							</li>\
						{/for}\
						</ul>\
					<a href="#featAnchorAll" name="featAnchorAll" class="${classes.VIEW_ALL} ${classes.CONTROL} ${hooks.VIEW_ALL}">${templates.getViewAllStoriesText(category)}</a>\
				</div>'		
		}
	}
};

DarkCustom.templates = HD.merge(HD.clone(DarkCustom.templates || {}, true), newTemplates);
					
