/* easy peasy Template naming pragma function_name__template_name
* results_interstitial
* results_loading_interstitial
* results_pagination
* results_bottom_paging_row
* 	results_prev_link
* 	results_next_link
* 	results_gotopage_form
* 	results_droppanel
* 		results_droppanel_rmonly
* 		results_droppanel_showillusPhotog
* 		results_droppanel_suspendYesNoRestrictions
* 		results_droppanel_suspendWithPeople
* 		results_droppanel_showSearchWithin
* 		results_endofrange
* results_editing_save_all_releases
* results_requests_viewimagesfrom
* results_optimize_search
* results_editing_savereleases
* lightbox_new__body
* lightbox_list__body
* lightbox_email__body
* lightbox_rename__body
* simplemessage__body
* simplemessage__body_lightbox
* enlarge2_act__body
* 	enlarge2_act__similars
* 	enlarge2_lb_backtoresults
* 	enlarge2_act__navback_link
* 		enlarge2_act__previmage_link
* 		enlarge2_act__nextimage_link
* 	enlarge2_act__complink
* 	enlarge2_act__dateshot
*	enlarge2_act__restrictions
*	enlarge2_act__filesize
*	enlarge2_act__photographer
*	enlarge2_act__release
*	enlarge2_act__dimensions
* 	enlarge2_short_and_long_caption_combo
* tieredimgpricing__rfslug
* tieredimgpricing__rfslug_row
* tieredimgpricing__rrslug
* tieredimgpricing__rrslug_row
* tieredimgpricing__rrslug_row_removebutton
* hovercopyright__text
* footer__body
* login
* cart_tabulating_cart_message
* cart_loading_cart_message
* preview_metadata
	* preview_restrictions
 */

var Templates = $H({});		
//******** search results *****************************************************************************************//

Templates.results_interstitial = new Template (
	'<table width=100% height=100%><tr width=100% height=100%><td valign=middle align=center width=100% height=100%><h1 id="results_interstitial_message">Searching for #{url2} <blink>.</blink></h1></td></tr></table>');
Templates.results_loading_interstitial = new Template (
	'<div id=results_loading_interstitial>loading #{results_loading_interstitial_whatisloading}...</div>');
Templates.results_pagination = new Template (
	'<table width="100%"><tr><td valign="top">'
	+'<div id=results_page_block_top class=page>#{prev_link_html}#{pagehtml}#{next_link_html}</div>'
	+'</td><td align="right">'
	+'</td></tr></table>'
	);
		Templates.results_gotopage_form = new Template (
		'<div id="results_gotopage_block"><NOBR>Go&nbsp;to&nbsp;Page:&nbsp;'
		+'<SELECT name="pageurl" align="absmiddle" onChange="document.currentLayer1Mode=\'searchresults\'; self.location=this.options[this.selectedIndex].value; return false;" class="smallmenu" id="results_gotopage_menu">'
		+'#{thehtml}'
		+'</NOBR></div>');

Templates.results_bottom_paging_row = new Template (
	'<table id=\"footerpaging\" style=\"position:absolute; z-index:999;\" width=100% height=17 cellpadding=0 cellspacing=0 border=0><tr><td align=left width=40%>'
	+ '#{results_prev_link}</td><td align=\"middle\" width=20%><center><nobr>#{footer}</nobr></center></td><td width=40% align=right>'	
	+ '#{results_next_link}</td></tr></table>');
	Templates.results_prev_link = new Template (
		'<div class="results_prev_link_#{prevactive} results_prev_link_#{prevlink_toporbottom}"><A href="javascript: return false;" onclick="document.currentLayer1Mode=\'searchresults\';prevpage(); return false;">&#8592; PREV PAGE</A></div>');	
	Templates.results_next_link = new Template (
		'<div class="results_next_link results_next_link_#{nextlink_toporbottom}"><A HREF="javascript: return false;" onclick="document.currentLayer1Mode=\'searchresults\';nextpage(); return false;">NEXT PAGE &#8594;</A></div>');	

	Templates.results_droppanel = new Template (
	'<form action="javascript:g(); return false;" method=get name=displaypanel id=displaypanel>'
	+  '<div id=searchpanelouter><table cellspacing=0 cellpadding=10 border=0 width=100% height=#{panelheight}>'
	+  '<tr><td valign=top align=left class="light1"><div id="searchpanelcolumn1">'
	+  '	<div id=searchpanel_label_orientation class=searchpanel_label>ORIENTATION:</div>'
	+  '		<div class=searchpanel_item><nobr><input type=checkbox name=orient value=horizontal onclick=javascript:fsearchprefs("f","add"); #{temph}> Horizontal</nobr></div>'
	+  '		<div class=searchpanel_item><nobr><input type=checkbox name=orient value=vertical onclick=javascript:fsearchprefs("g","add"); #{tempv}> Vertical</nobr></div>'
	+  '		<div class=searchpanel_item><nobr><input type=checkbox name=orient value=panoramic onclick=javascript:fsearchprefs("h","add"); #{tempp}> Panororamic</nobr></div>'
	+  '		<div class=searchpanel_item_last><nobr><input type=checkbox name=orient value=square onclick=javascript:fsearchprefs("i","add"); #{temps}> Square</nobr></div>'
	+  '	<div id=searchpanel_label_color class=searchpanel_label>COLOR:</div>'
	+  '		<div class=searchpanel_item><nobr><input #{tempcolany} type=radio name=color value="" onclick=javascript:fsearchprefs("color","add");> Any</nobr></div>'
	+  '		<div class=searchpanel_item><nobr><input #{tempcolcol} type=radio name=color value=color onclick=javascript:fsearchprefs("color","add");> Color</nobr></div>'
	+  '		<div class=searchpanel_item_last><nobr><input #{tempcolbw} type=radio name=color value=gray onclick=javascript:fsearchprefs("color","add");> B/W</nobr></div>'
	+  '	#{results_droppanel_rmonly}'
	+  '</td>'
	+  '<td valign=top align=left class="light1"><div id="searchpanelcolumn2">'
	+  '	#{results_droppanel_showillusPhotog}'
	+  '	#{results_droppanel_suspendYesNoRestrictions}'
	+  '	#{results_droppanel_suspendWithPeople}'
	+  '	<div id=searchpanel_label_releases class=searchpanel_label>RELEASES:</div>'
	+  '		<div class=searchpanel_item><input #{temprelany} type=radio name=xtrasql value="" onclick=javascript:fsearchprefs("released","remove");> Any release status</div>'
	+  '		<div class=searchpanel_item_last><input #{temprelonly} type=radio name=xtrasql value=released onclick=javascript:fsearchprefs("released","add");> Only show released images</div>'
	+  '	#{results_droppanel_searchwithin}'
	+  '	<div id="searchpanel_gobutton><a href="javascript: return false;" onclick="g(); return false;"><img src="/graphics/button_go.gif" alt="search" border="0"></a></div>'
	+  '	<div id="searchpanel_closebutton><A href="javascript: return false;" onclick="hidedisplaypanel(1); return false;">[x] close search options panel</A></div>'
	+  '</td></tr></table>');
		Templates.results_droppanel_rmonly = new Template (
				'<div id=searchpanel_label_type class=searchpanel_label>TYPE:</div>'
				+  '	<div class=searchpanel_item><nobr><input type="checkbox" name="rmrftype" value="RM" #{rmc} onclick=javascript:fsearchprefs("RM","add");> Rights Managed</nobr></font></div>'
				+  '	<div class=searchpanel_item_last><nobr><input type="checkbox" name="rmrftype" value="RF" #{rfc} onclick=javascript:fsearchprefs("RF","add");> Royalty Free</nobr></font></div>');
		
		Templates.results_droppanel_showillusPhotog = new Template (
				'<div id=searchpanel_label_media class=searchpanel_label>MEDIA:</div>'
				+  '	<div class=searchpanel_item><input type="checkbox" name="searchinclude" value="illustration"#{tempillustration} onclick=javascript:fsearchprefs("1","add"); />Illustration<br/></div>'
				+  '	<div class=searchpanel_item_last><input type="checkbox" name="searchinclude" value="photography"#{tempphotography} onclick=javascript:fsearchprefs("0","add"); />Photography<br/></div>');
		
		Templates.results_droppanel_suspendYesNoRestrictions = new Template (
				'<div id=searchpanel_label_restrictions class=searchpanel_label>RESTRICTIONS:</div>'
				+  '	<div class=searchpanel_item><input #{temprany} type=radio name=restrictions value="" onclick=javascript:fsearchprefs("norestrictions","remove");> Any</div>'
				+  '	<div class=searchpanel_item_last><input #{temprno} type=radio name=restrictions value=not+imagehasrestrictions  onclick=javascript:fsearchprefs("norestrictions","add");> No Restrictions</div>');
		
		Templates.results_droppanel_suspendWithPeople = new Template (
				'<div id=searchpanel_label_people class=searchpanel_label>PEOPLE:</div>'
				+  '	<div class=searchpanel_item><input #{temppeopany} type=radio name=people value="" onclick=javascript:fsearchprefs("people","remove");> Any</div>'
				+  '	<div class=searchpanel_item><input #{temppeopwith} type=radio name=people value=withpeople onclick=javascript:fsearchprefs("withpeople","add");> With People</div>'
				+  '	<div class=searchpanel_item><input #{temppeopwithout} type=radio name=people value=nobody onclick=javascript:fsearchprefs("nobody","add");> Without People</div>'
				+  '	<div class=searchpanel_item_last><input #{temppeopcrowd} type=radio name=people value=withcrowd onclick=javascript:fsearchprefs("withcrowd","add");> Crowd</div>');
		
		Templates.results_droppanel_showSearchWithin = new Template (
				'<div id=searchpanel_label_method class=searchpanel_label>METHOD:</div/>'
				+  '<div id=searchpanel_method_select><select id="method" name="method" class="smallmenu">'
				+  '<option value="new" #{tempsearchnew}>as a new search</option>'
				+  '<option value="within" #{tempsearchwithin}>within current results</option></select></nobr></div>');
		Templates.results_endofrange = new Template (
			'<span valign=bottom style="float:left;"><div id=results_endofrange_box  class="endof#{endtype}images">'
			+ '<nobr>[ end of #{endtype} images ]</nobr></div></span> ');		

//******* editing templates IPN ***************************************************************************//
Templates.results_editing_save_all_releases = new Template (
	'<a onclick="return save_all_releases();" href="javascript: return false;">Save All Releases</a> &nbsp;&nbsp; '
	+'[ Set All: <a href="javascript: return false;" onclick="return share_set_page(\'shared\'); ">Accepted</a> |'
	+'<a href="javascript: return false;" onclick="return share_set_page(\'rejected\'); ">Rejected</a> |'
	+'<a href="javascript: return false;" onclick="return share_set_page(\'pending\'); ">Pending</a>  &nbsp;|'
	+'&nbsp;  <a onclick="return release_set_page(\'NOT RELEASED\');" href="javascript: return false;" title="NOT RELEASED">NR</a> |'
	+'<a onclick="return release_set_page(\'NOT APPLICABLE\');" href="javascript: return false;" title="NOT APPLICABLE">NA</a> |'
	+'<a onclick="return release_set_page(\'NOT RECOGNIZABLE\');" href="javascript: return false;" title="NOT RECOGNIZABLE">NR</a> |'
	+'<a onclick="return release_set_page(\'MODEL AND PROPERTY RELEASED\');" href="javascript: return false;" title="MODEL AND PROPERTY RELEASED">MaPR</a> ]');
Templates.results_requests_viewimagesfrom = new Template (
		'<a href="/R?#{feat_requestview}" id=results_request_link><nobr>View images from</nobr> <br/><nobr><b>All IPN Members</b></nobr></a>');
Templates.results_optimize_search = new Template (
	'<table cellspacing=0 cellpadding=1 border=0>'
	+ '<FORM name="optimizer" action="#" id=results_form_optimizer>'
	+ '<tr><td>'
	+ '<SELECT id=results_optimizer_select NAME="narrow" ONCHANGE="narrowit(this.form.narrow.options[this.form.narrow.selectedIndex].value);" class="smallmenu">'
	+ '<OPTION VALUE="#">Narrow your search results'
	+ '<OPTION VALUE="colorgray">Remove black and white images'
	+ '<OPTION VALUE="colorrgb">Remove color images'
	+ '<OPTION VALUE="imagehasrestrictions">Remove restricted images'
	+ '<OPTION VALUE="orientationvertical">Remove verticals'
	+ '<OPTION VALUE="(orientationhorizontal+OR+orientationpanoramic)">Remove horizontals'
	+ '<OPTION VALUE="agefiveyears">Only show recent images (<5 yrs)'
	+ '<OPTION VALUE="agetenyears">Remove very old images (>10 yrs)'
	+ '</SELECT></td></tr></form></table>');
Templates.results_editing_savereleases = new Template (
	'<div id="shortrel#{showid}">Release: #{shortrel}</div> <div>  <form id="releasecontrol#{showid}" > #{relcon} <input type="hidden" name="shdex" value="#{showid}"/></form>'
	+ '<a href="javascript: return false;" onclick="sor(#{showid}); return false;" >Save Release</a></div>');
	
//******** pop-up panels ******************************************************************************************//
	
Templates.lightbox_new__body = new Template (	
	'<div id="lightboxPopUpNew" class="PopUpWindoid">'
	+'<table width="100%" cellspacing="0" cellpadding="0" border="0" class="guidebox2"><tbody><tr><td class="guideTopL"/><td class="guideTopM"/><td class="guideTopR"/></tr><tr><td class="guideMid guideMidL"/><td valign=top align=left class=guideMidM>'
	+'<h1>Make new lightbox</h1>'
	+'<form action="javascript:nada();" method="get" name="send"><p>Enter a name for your new lightbox in the box below '
	+'</p><p><input type="text" name="lightbox_new_name" id="lightbox_new_name" size="15" class="emailbox" value="My new LB name" onfocus="if (this.value == \'My new LB name\'){ this.value=\'\';}">'
	+'<A href="" onclick="lightbox_new_send(); return false;" class=lblink style="font-size: 10pt; font-weight:bold;">Create the Lightbox</A><br /><br />'
	+'Note:  You must enter a unique name for your new lighbox.  It will only be viewable by you unless you use the "E-mail this lightbox" function to share it with someone.<br /><br />'
	+'If you do not need a lightbox anymore click the link below.<br /><br /><A HREF="" onclick="lightbox_email(\'close\'); return false;">[X] close window</A></form>'
	+'</td><td class="guideMid guideMidR"/></tr><tr><td class="guideBotL"/><td class="guideBotM"/><td class="guideBotR"/></tr></tbody></table>'
	+'</div>' );

	
		
Templates.lightbox_list__body = new Template (
	'<table BORDER="0" CELLSPACING="0" CELLPADDING="1" ALIGN="left" width="290"><tr>'
	+'<td class="dark1" valign=bottom width="100%"><DIV class="barheader">&nbsp;<font class="bartitle">"#{currentlbname}"</font></div></td></tr>'
	+'<tr><td ALIGN="left" VALIGN="top" width="290" class="dark1"><DIV class="light1" style="padding: 15px;"><form action="javascript:nada();" method="get" name="send"><p>'
	+'</p><p><textarea style="float: left" name="lightbox_images" id="lightbox_images" rows="25" cols="50" class="lightbox_new_name">#{content}</textarea>'
	+'<A href="javascript: void(0);" onclick="javascript:$(\'lightbox_images\').focus();$(\'lightbox_images\').select(); return false;" class=lblink style="float: right; font-size: 10pt; font-weight:bold;">Select All</A><br/>'
	+'<input type=checkbox id="ipn_id" name=ipn_id CHECKED onclick="switchList()"> IPN IDs<br /><input type=checkbox id="orig_id" name=orig_id onclick="switchList()"> Original IDs<br /><br /><br />'
	+'<A style="display: block; clear: both" HREF="" onclick="lightbox_list({ mode : \'close\'}); return false;">[X] close window</A>'
	+'<input type="hidden" id="images" name="images" value="#{images}">'
	+'<input type="hidden" id="origs" name="origs" value="#{origs}">'
	+'</form></div></td></tr></table>');

Templates.lightbox_email__body = new Template (
	'<div id="lightboxPopUpEmail" class="PopUpWindoid">'
	+'<table width="100%" cellspacing="0" cellpadding="0" border="0" class="guidebox2"><tbody><tr><td class="guideTopL"/><td class="guideTopM"/><td class="guideTopR"/></tr><tr><td class="guideMid guideMidL"/><td valign=top align=left class=guideMidM>'
	+'<h1>Email your lightbox to a friend</h1>'
	+'<form action="javascript:nada();" method="get" name="send"><p><b>E-mail your lightbox '
	+'"#{currentlbname}"</b> to a friend or colleague.</p><p><b>1.</b> Send To:<code>*</code></b></font><br /><input type="text" name="to_email" id="to_email" size="35" class="emailbox" value="friend@domain.com" onfocus="if (this.value == \'friend@domain.com\') {this.value=\'\';}"><br />'
	+'<br /><b>2.</b> Message:<br /><textarea NAME="mail_text" ID="mail_text" ROWS="7" COLS="45"></textarea><br /><br /><b>3.</b> <input type="checkbox" id="readonly" name="readonly" value=1> Read only<br /><font CLASS="xsmall">check this box to prevent recipient from changing your lightbox.</font></p>'
	+'<b>4.</b> <input type="checkbox" name="notify" id="notify" value="1"><font class="small">Notify me when this lightbox is viewed</font><br />'
	+'#{emaillbaddhtml}<br /><p><A href="" onclick="lightbox_email_send(); return false;" class=lblink style="font-size: 10pt;font-weight:bold;">Send the Lightbox</A>'
	+'<input type="hidden" name="ot" value="2"><input type="hidden" name="dsm" value="1"></center></form><br /><br /><p>If you have changed your mind, click the link below.<br /><br /> <A HREF="" onclick="lightbox_email(\'close\'); return false;">[X] close window</A>.</form>'
	+'</td><td class="guideMid guideMidR"/></tr><tr><td class="guideBotL"/><td class="guideBotM"/><td class="guideBotR"/></tr></tbody></table>'
	+'</div>' );
			
Templates.lightbox_rename__body = new Template (
	'<div id="lightboxPopUpRename" class="PopUpWindoid">'
	+'<table width="100%" cellspacing="0" cellpadding="0" border="0" class="guidebox2"><tbody><tr><td class="guideTopL"/><td class="guideTopM"/><td class="guideTopR"/></tr><tr><td class="guideMid guideMidL"/><td valign=top align=left class=guideMidM>'
	+'<h1>Rename  lightbox</h1>'
	+'<form action="javascript:nada();" method="get" name="send"><p>'
	+'</p><p><input type="text" name="lightbox_new_name" id="lightbox_new_name" size="15" class="lightbox_new_name" value="#{currentlbname}" onfocus=" if (this.value == \'#{currentlbname}\'){ this.value=\'\';}">'
	+'<A href="" onclick="lightbox_rename_send(); return false;" class=lblink style="font-size: 10pt; font-weight:bold;">Rename</A><br/>'
	+'<br/><A HREF="" onclick="lightbox_email(\'close\'); return false;">[X] close window</A>'
	+'</form>'
	+'</td><td class="guideMid guideMidR"/></tr><tr><td class="guideBotL"/><td class="guideBotM"/><td class="guideBotR"/></tr></tbody></table>'
	+'</div>' );

Templates.simplemessage__body = new Template (
	'<DIV class=light1 style="text-align:center; width:400px; height:100px; text-align:left; padding:10px; margin-top:200px"><font class="header">#{message}</div>');

Templates.simplemessage__body_lightbox = new Template (
	'<DIV class=light1 style="position:absolute; left:0px; bottom:0px; width:100%; height:30px; text-align:left; padding:10px 20px 10px 20px; margin-top:20px"><font class="header">#{message}</div>');


//******** enlarge view ******************************************************************************************//
		
Templates.enlarge2_act__body = new Template (
	'<table cellspacing="0" cellpadding="0" border="0" width="99%" style="height:99%;overflow:auto">'
		+'<tr height="99%">'
			+'<td align="left" valign="top" width="99%" height="99%" style="overflow:auto">'
				+'<table cellspacing="4" cellpadding="0" border="0" width="920" height="470" style="margin-left: 8px;">'
				+'<tr><td valign="top" align="center" width="420" height="440" style="min-width: 420px">'
					+'<div style="position:relative;">#{themediainsert}</div>'
				+'<br/></td>'


				+'#{similarscolumn}'
				+'<td align="left" valign="top" width="320" id="enlarged_link_data_column">'
					+'#{enlarge_navback_link}'
					+'<div id=enlarged_navlinks>#{enlarge_previmage_link}#{enlarge_nextimage_link}</div>'
					+'<div class=enlarged_icon><div id="iconlb"><a href="" onclick="lightbox_addto(\'#{enlargetid}\'); return false;"></a></div><div class="iconlabel"><a href="" onclick="lightbox_addto(\'#{enlargetid}\'); return false;">ADD TO CURRENT LIGHTBOX</a></div></div>'
					+'<div class=enlarged_icon><div id="iconprice"><a href="" onclick="license(\'#{enlargetid}\'); return false;"></a></div><div class="iconlabel"><a href="" onclick="license(\'#{enlargetid}\'); return false;">CHECK USAGE RATES</a></div></div>'
					+'<div class=enlarged_icon><div id="iconcart"><a href="" onclick="cart_addto(\'#{enlargetid}\'); return false;"></a></div><div class="iconlabel"><a href="" onclick="cart_addto(\'#{enlargetid}\'); return false;">ADD TO SHOPPING CART</a></div></div>'
					+'#{downloadcomp_link}'
					+'<div class="enlarged_field" id="enlarged_field_id"><div class="enlarged_field_title" id=enlarged_field_title_id>Image Number:</div><div class="enlarged_field_value">#{displayenlargetid}&nbsp;[#{rmrftype}]</div><br clear=all/></div>'
					+'#{dateshot_string}'
					+'<div class="enlarged_field" id="enlarged_field_caption"><div class="enlarged_field_title" id=enlarged_field_title_caption>Caption:</div>#{myshortcaption}</div>'
					+'#{release_string}'
					+'#{photographerinfo_string}'
					+'#{filesize_string}'
					+'#{dimensions_string}'
					+'#{restrictions_string}'
					+'<div class="enlarged_field"><A class="olink" id="enlarge_keywords_text" onclick="popkeys2(\'enlarge_keywords\', this); return false;">Show keywords</A></div>'
					+'<div id="enlarge_keywords" style="display:none; overflow-y:auto;">'
					+'#{keywordinfo}'
					+'</div>'
					+'</td><td rowspan=2 align="left" valign="top" id="enlarged_rates_column_3">'
					+'#{ratetierinfo}'
					+'</td></tr>'
					+'<tr><td>#{rfcdlinkslug}</td></tr>'
					+'</table>'


	+'<br /></td></tr></table>');

	Templates.enlarge2_act__navback_link = new Template (
		'<div class="enlarged_field" id="enlarged_field_navback">'
		+ '<A HREF="" onclick="document.currentLayer1Mode=\'#{currentLayer1Mode}\'; viewmode=\'#{viewmode}\';gsetCookie(\'gviewmode\',\'#{viewmode}\', \'\', \'/\', gGetCookieDom());#{postprocessfunction} return false;">'
		+ '&#8593; #{navbacklinktext}'
		+ '</A></div>');
	Templates.enlarge2_lb_backtoresults = new Template (
		'&nbsp;&nbsp;<A href="javascript: return false;" onclick="viewmode=\'#{viewmode}\';gsetCookie(\'gviewmode\',\'#{viewmode}\', \'\', \'/\', gGetCookieDom()); self.location=\'/SwishSearch#{pre_q_args}\'; return false;"><font style="font-size:9pt; font-family:Arial;">&#8593;</font> BACK TO SEARCH RESULTS</A><BR/><BR/>');
	
	Templates.enlarge2_act__similars = new Template (
		'<td valign="top" align="left" width="120" height="440">'
		+'<div style="position:relative; overflow: auto; overflow-y: auto; overflow-x: hidden; height:75%">'
		+"<b>Similar Images:</b><br />"
		+'#{simcolinfo}'
		+'</div></td>');

			
		Templates.enlarge2_act__previmage_link = new Template (
			'<div id="enlarged_field_previmage">'
			+ '<A HREF="" onclick="enlarge2(\'#{previmageid}\',\'#{previmage}\'); return false;" TITLE="GO TO THE PREVIOUS IMAGE">&#8592; Prev Image </A></div>');
			
		Templates.enlarge2_act__nextimage_link = new Template (
			'<div id="enlarged_field_nextimage">'
			+'<A HREF="" onclick="enlarge2(\'#{nextimageid}\',\'#{nextimage}\'); return false;" TITLE="GO TO THE NEXT IMAGE">Next Image &#8594;</A><br style="clear: both;"/></div>');

	Templates.enlarge2_act__complink = new Template (
		'<div class=enlarged_icon><div id="iconcomp">'
		+ '<a href="/bin/Comp/'
		+ '#{downloadcomp_username}'
		+ '/#{downloadcomp_key}'
		+ '/#{enlargetid}'
		+ '"></a></div><div class="iconlabel">'
		+ '<a href="/bin/Comp/'
    + '#{downloadcomp_username}'
    + '/#{downloadcomp_key}'
    + '/#{enlargetid}'
    + '">'
		+ 'DOWNLOAD COMP IMAGE</a></div></div>');
	
	Templates.enlarge2_short_and_long_caption_combo = new Template (
		'<span id="enlarge_short_caption">#{testshortcaption}'
		+ '<a href="javascript: return false;" onclick="$(\'enlarge_short_caption\').style.display=\'none\'; $(\'enlarge_long_caption\').style.display=\'inline\'; return false;">'
		+ 'more&nbsp;&gt;&gt;</a></span>'
		+ '<span style="display:none" id="enlarge_long_caption">#{testlongcaption} '
		+ '<a href="javascript: return false;" onclick="$(\'enlarge_long_caption\').style.display=\'none\'; $(\'enlarge_short_caption\').style.display=\'inline\'; return false;">'
		+ '&lt;&lt;&nbsp;less</a></span>');
		
	Templates.enlarge2_act__dateshot = new Template (
		'<div class=enlarged_field id=enlarged_field_dateshot><div class=enlarged_field_title id=enlarged_field_title_dateshot>Date Shot:</div><div class=enlarged_field_value id=enlarged_field_value_dateshot>#{dateshot}</div></div>');
	Templates.enlarge2_act__restrictions = new Template (
		'<div class=enlarged_field id=enlarged_field_restrictions><div class=enlarged_field_title id=enlarged_field_title_restrictions>Restrictions:</div><div class=enlarged_field_value id=enlarged_field_value_restrictions>#{myrestrictions}</div></div>');
	Templates.enlarge2_act__filesize = new Template (
		'<div class=enlarged_field id=enlarged_field_filesize><div class=enlarged_field_title id=enlarged_field_title_filesize>File Size:</div><div class=enlarged_field_value id=enlarged_field_value_filesize>#{myfilesize}</div></div>');
	Templates.enlarge2_act__photographer = new Template (
		'<div class=enlarged_field id=enlarged_field_photographer><div class=enlarged_field_title id=enlarged_field_title_photographer>Photographer:</div><div class=enlarged_field_value id=enlarged_field_value_photographer>'
		+'<A href="/SwishSearch?Keywords=#{linked_photog}&spec_idx=ne&method=photographer">#{myphotographer}</a></div></div>');
	Templates.enlarge2_act__release = new Template (
		'<div class=enlarged_field id=enlarged_field_releases><div class=enlarged_field_title id=enlarged_field_title_releases>Release:</div><div class=enlarged_field_value id=enlarged_field_value_released>#{myreleased}</div></div>');
	Templates.enlarge2_act__dimensions = new Template (
		'<div class=enlarged_field id=enlarged_field_dimensions><div class=enlarged_field_title ie=enlarged_field_title_dimensions>Image Dimensions:</div><div class=enlarged_field_value id=enlarged_field_value_dimensions>#{dimensions_value}</div></div>');
	
//******** enlarge view pricing display templates ******************************************************************************************//


Templates.tieredimgpricing__rfslug = new Template (
        '<h4 style="text-align: left;">Select a File Size</h4>'+
        '<table style="text-align: left;width: 95%;" cellpadding=0 cellspacing=0>#{rows}</table>');

Templates.tieredimgpricing__rfslug_row = new Template (
        '<tr><td align="left" nowrap="nowrap" valign="top" style="padding-bottom: 4px; padding-top: 4px;border-bottom: solid #999 1px;">#{expr}</td><td align="right" valign=top style="border-bottom: solid #999 1px;padding-bottom: 4px; padding-top: 4px;">#{currency} #{price}<br /><nobr><A href="#" class=orangelink onclick="cart_addto(\'#{enlargetid}\', { ln:\'#{enlargetid}\', lictype:\'RF\', base:\'#{base}\', Size_opname:\'#{id}\', usage:\'#{usage}\'}); return false;">Add to Cart</a></nobr></td></tr>' );

Templates.tieredimgpricing__rrslug = new Template (
        '<div align="left">Rights Ready Licensing</div>'+
        '<h4 style="text-align: left;">Select one or more uses below</h4>'+
        '<A href="/EULA.pdf" TITLE="View License Agreement as a pdf" class="orangelink" target="eula">View Rights Ready License Agreement (pdf file)</A><BR clear=all>'+
        '<table cellspacing=0 cellpadding=0 width="100%" >#{rows}</table>');
        
Templates.tieredimgpricing__rrslug_row = new Template (
        '<tr><td colspan=2><h2>#{name}<h2></td></tr>'+
        '<tr><td align=left style="border-bottom: 1px solid rgb(187, 187, 187);padding-bottom: 3px; padding-top: 4px;"><span><nobr><b>#{optname}</b></nobr></span><br />'+
        '<div id="d#{id}"><a href="javascript:ShowOrHideComboText(\'d#{id}\', \'none\',\'e#{id}\'); ShowOrHideComboText(\'d#{id}2\', \'block\');" class="orangelink">Show Details</a></div>'+
        '  <div id="d#{id}2" style="display:none;"><a href="javascript:ShowOrHideComboText(\'d#{id}\', \'block\'); ShowOrHideComboText(\'d#{id}2\', \'none\');" class="orangelink">Hide Details</a>'+
        '<br />#{expr}<br />'+
        '<div id="d#{id}e" style="display:none;"><a href="javascript:ShowOrHideComboText(\'d#{id}e\', \'none\'); ShowOrHideComboText(\'d#{id}e2\', \'block\');" class="orangelink">Show Examples</a></div>'+
        '  <div id="d#{id}e2" style="display:none;"><a href="javascript:ShowOrHideComboText(\'d#{id}e\', \'block\'); ShowOrHideComboText(\'d#{id}e2\', \'none\');" class="orangelink">Hide Examples</a>'+
        '  <div id="e#{id}">#{expr_extended}</div></div>'+
        '</div></td><td align=right valign=top style="border-bottom: 1px solid rgb(187, 187, 187);padding-bottom: 4px; padding-top: 4px;">'+
            '<div style="min-width: 50px; padding-right: 5px;">#{currency} #{price}</div> '+
            '<div style="min-width: 50px;">'+
                '#{removebutton}'+
                '<nobr><A href="#" onclick="cart_addto(\'#{enlargetid}\',{ \'ln\':\'#{enlargetid}\', \'lictype\':\'RR\', \'base\':\'#{price}\', \'Size_opname\':\'#{id}\', \'usage\':\'#{usage}\', \'callback\':\'enlarge2(#{img_id},#{encount},null,1);\' }); return false;" class="orangelink">Add to Cart</a></nobr>'+
            '</div>'+
        '</td></tr>');

Templates.tieredimgpricing__rrslug_row_removebutton = new Template (
        '<nobr><a href="#" class="orangelink" onclick="cart_delete_license(#{img_id},{ \'lictype\':\'RR\', \'usage\':#{usage}, \'opts\':#{id}, \'callback\':\'enlarge2(#{img_id},#{encount},null,1);\' }); return false;">Remove Option</a><nobr> &nbsp;&nbsp;');

Templates.hovercopyright__text = new Template (
	'&copy;#{currentyear} #{baseurl}  All rights reserved <a href=/help.shtml#Terms_Conditions class=disclaimer>Terms</a>&nbsp;&nbsp; <a href=/help.shtml#Privacy_Policy class=disclaimer>Privacy Policy</A> &nbsp;&nbsp;<A HREF=/contact.shtml class=disclaimer>Contact</a></font></nobr>');
	
Templates.footer__body = new Template (
	'<DIV id="copyright"><span class="disclaimer"><A href="/aboutus_mission.shtml" onmouseover="hovercopyright();" class="disclaimer">&copy; #{currentyear} </A></span></div>');


Templates.login = new Template (
 '<div id="loginRegister" >'
        +'<table BORDER="0" CELLSPACING="0" CELLPADDING="1" ALIGN="left" width="450" height="275"><tr>'
        +'<td class="dark1" valign=bottom width="100%"><DIV class="barheader"><div style="float:right"><A HREF="javascript:return false;" onclick="javascript:hide_login(); return false;" style="text-decoration:none;font-size:85%">&nbsp;[x] close window&nbsp;</A></div><div style="float:left">&nbsp;<font class="bartitle">Login</font></div></div></td></tr>'
        +'<tr><td ALIGN="left" VALIGN="top" width="290" class="dark1"><DIV class="light1" style="padding: 15px;font-size:85%"><p>By signing back in you will be able to buy images through your Cart, use your Lightboxes, download comp images and access and amend your profile details.</p><p>If you have not had a chance to Register yet, please take a moment to do so. You will be able to use all the features of this site once you have.</p>'
	+'<p><div id="loginMessage"></div></p>'
        +'<p><form name="loginForm" id="loginForm"><table cellspacing=5 cellpadding=5>'
	+'<tr><td>Email</td><td>:</td><td><input type="text" name="username" id="username" size="25" class="emailbox" ></td><td></tr>'
        +'<tr><td>Password</td><td>:</td><td><input type="password" name="password" id="password" size="25" class="emailbox" ><input type="hidden" name="sphotog" id="sphotog" value="antphoto"></td><td>'
	+'<div id=sbuttonenter class="spritebuttons"><a href="javascript:return false;" onclick="javascript:return evaluate_login();"></a></div>'+'</td></tr>'
	+'</table></form></p>'
	+'<br /><a href="/bin/Register" class="small">Not a registered user?</a>&nbsp;&nbsp;'
	+'<a href="/bin/Lostpass" class="small">Forgot your password?</a>&nbsp;&nbsp;'
	+'<a href="/bin/Changepass" class="small">Change your password?</a><br />'
        +'</div>');

Templates.cart_tabulating_cart_message = new Template (
	'<a id="cart_tabulating_cart_message_link" title="click here if you find you are waiting too long to load." onclick="cart_check();">Tabulating Shopping Cart <blink>.</blink> </a>');
Templates.cart_loading_cart_message = new Template (
	'<a id="cart_loading_cart_message_link" title="click here if you find you are waiting too long to load." onclick="cart_build(\'changing_again\');"> Loading Shopping Cart <blink>.</blink></a>');
Templates.preview_metadata = new Template (
	'<div id=preview_text_block>'
	+'	<div class="preview_text"># #{displayimageid} #{rmrftype} #{filesize} #{dimensions} :: #{shortcaption} #{photographer} #{imagerestrictions}</div>'
	+'	<div class="preview_warning"> To turn live previews off, use Previews menu at top of page </div></div>');
	Templates.preview_restrictions = new Template (
		' :: <span id=preview_restrictions> This image has restrictions. Click to View </span>');
		


Templates.preview_window = new Template (
'<div id=previewpaneshadow2><div id=previewpaneshadow1><div id=previewpane><div id=preview_image_wrapper>'
+'<IMG id=previewimg_#{prid} src=/graphics/loading.png border=0 alt="#{alt}" #{sizeoption} lowsrc="/graphics/spacer.gif">'
+'<div id=previewpane_metdat_#{prid}>'
//+'<img src="#{previewdynamic}" style="display:none;" onload="if($(\'previewimg_#{prid}\')) $(\'previewimg_#{prid}\').src = this.src">'
+'</div></div></div></div>' );



function htmlit_custom(showid){

	// build html for each image depending on viewing mode
	var html='';
	switchpage = false;
	if (id[showid]){
		
		var myrmrftype = rm[showid];
		myid = id[showid];
		mysimilarto=st[showid];
		//mysimilarto=myid;
		if (typeof(scp) != 'undefined' && (viewmode == 'list' || viewmode == 'editing') ) {myshortcaption=unescape(scp[showid]);} else {myshortcaption = "";}
		var temp = true;
		var tempshortcaption='';
		myreleased = rel[showid];

		 if(showrelease){
			if(! ( myreleased == "MODEL RELEASED" || myreleased == "MODEL AND PROPERTY RELEASED" || myreleased == "PROPERTY RELEASED") ){
				myreleased = "Release: " + myreleased;
			}
			if (typeof(relcon) != 'undefined' && relcon[showid] && mysimilarto.length < 13)
				myreleased ='<br/>'+myreleased;

		} else { myreleased="";}
		//shorten long captions
		if(myshortcaption.length > 90){
			for(z=0; z < 130; z++){
				var c = myshortcaption.charAt(z);
				if(temp == true){
					if((z > 90) && (c == ".")){
						temp = false;
						tempshortcaption+=c + " ...";
					} else if((z > 110) && (c == " ")){
						temp = false;
						tempshortcaption+=" ...";
					} else {
						tempshortcaption+= c;
					}
				}
	   		}
	   		myshortcaption = tempshortcaption;
    		}
    		var thishassimilars = "yes";
		myphotographer=pho[showid];
		myrgdynxf = rm[showid];
		myfilesize=fs[showid];
		var myhrdlink = hrdl[showid];

		var mysharestatuses = html_share_con_opts(showid);
		var mysiteweight = html_weight_con_opts(showid);
		var mycombinedcon = html_combined_con_opts(showid);

		   var thisisacoverimage_feature = '';
		var thisisacdimage = '';
		var cover_caption = '';
			 var rfCDinfo = unescape(rfcd[showid] + " ");
		if ( rfCDinfo.toString().length > 1 )
			 	rfCDinfo = rfCDinfo.evalJSON();

		if (typeof(rfCDinfo) == 'object' && rfCDinfo.type)
		{
			if (rfCDinfo.type == 'COVER')
			{
				thisisacoverimage_feature = rfCDinfo.featureNumber;
				cover_caption = 'VCD: '+rfCDinfo.featureTitle ;
			}
			else if (rfCDinfo.type == 'IMAGE')
			{
				thisisacdimage = rfCDinfo.featureNumber;
			}
		}

		



		var lbremove=0;
		if (	( 	typeof(q_args) != 'undefined' && 
				( 	q_args.match(/vmo=/) || 
					q_args.match(/rid=/) || 
					q_args.match(/lb_view=1/) || 
					q_args.match(/fn=/) && ! (totestman == 'Feature: ' || totestman == 'Virtual CD Store:' )
				)
			) 
		){
			lbremove=1;
		}

		adminheight=0;
		if(myhrdlink){
		adminheight=14;
			myhrdlink = myhrdlink.replace(/(<br>|%3cbr%3e)/ig, '');
			myhrdlink = '<a href='+myhrdlink+' class=hiresdl_link>Download</a>';
		} 
		if(myfilesize < 5){myfilesize='Scan on Demand';} //else {myfilesize+=" Mb";}
		if(myid.length > 9){
			if ( o[showid] ){displayid=o[showid];} else {displayid=myid;}	
/////////////////
			if(viewmode == "list"){
				var theight = 152 + adminheight +  + (typeof(vertremainder)=='undefined' ? 0 : vertremainder);
				var twidth = 305 + (typeof(horizremainder)=='undefined' ? 0 : horizremainder);
				html += '<span id="cellwrapper'+showid+'" valign=bottom style="float:left;">';
				html += '	<div align=center valign=bottom style="width:' + twidth + 'px; height:' + theight + 'px;" id="d' + myid + '">';
				if ( mysimilarto.length < 13){	
					html += '<div style="border: solid 0px #999;padding: 0px;height:' + (theight - 5 ) + 'px ;width:299px;">';
					html += '		<TABLE width=298 cellspacing=1 cellpadding=0 border0><TR><TD valign=bottom class="imcell imcellleft">';
					if(thisisacoverimage_feature) //myid is in the info for the link, hence this is the cover image
						   html += '<a href="/SwishSearch?n=1&fn='+thisisacoverimage_feature+'&supst=cd" >';
					else
						   html += '<a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;">';
					html += '<img src="' +  ImageUrl('135/50',myid,showid) + '" border=0 class=pimg vspace=2 hspace=3';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "','" + showid + "','"+tset+"');";html += '" onmouseout="hp();" id=' + myid + '>';
					html += '</a><BR>';
					if(myhrdlink)
						html += '<center>'+myhrdlink+'</center>';
					html += '</TD><TD valign="top" class="imcell imcellright">';
					
					if(thisisacoverimage_feature){html += '<div class=cdtitle>' + cover_caption + '</div>';mysshortcaption = 'Virtual CD';}
					if(thisisacoverimage_feature){
						html += '<div class=cdtitle>' + cover_caption + '';
					} else {
						html += '<div class=idrow><font class=xsmall>' + displayid + ' | </font>';
					}
					html += '<span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span>';

					html += '<hr class=results_divider_horizontal />';
					html += '<DIV class=icons>';
					html += '<table><tr><td>'
					if(lbremove==1){
						html+='<div id=icondelete class=iconnormal><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
					}
					html += '<div id=iconenlarge class=iconnormal><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
					html += '<div id=iconlb class=iconnormal><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					html += '<div id=iconcart class=iconnormal><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
					html += '<div id=iconprice class=iconnormal><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if(thisisacoverimage_feature){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					} else if(thisisacdimage){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacdimage + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					}
					html += '</td></tr></table></div>';


					html +='</div>';
					//html += myhrdlink;
					html += '</div></span>';
					
					
				
					if(showphotographer == 1){html +='<BR>&copy; '+currentYear+' ' + myphotographer;}
					if(showfilesize && ! thisisacoverimage_feature){html += myfilesize;}
					
					if(! thisisacoverimage_feature){html += '<br/>CAPTION: ' + myshortcaption + '<div>'+myreleased+'</div></font>';}

				} else {	
					html += ( typeof(writesimilar_custom) == 'function' ? writesimilar_custom(myid,showid,myphotographer,myshortcaption,'start','list', myhrdlink,myreleased,thisisacoverimage_feature,lbremove,myrmrftype,thisisacdimage) : writesimilar(myid,showid,myphotographer,myshortcaption,'start','list', myhrdlink) );
				}
				html += '</TD></TR></TABLE></div></div></span>';
////////////tiny
			} else if (viewmode == "tiny"){
				var theight = 106 + adminheight +  + (typeof(vertremainder)=='undefined' ? 0 : vertremainder);
				var twidth = 108 + (typeof(horizremainder)=='undefined' ? 0 : horizremainder);
				html += '<span valign=bottom style="float:left;">';
				html += '<div align=center valign=bottom style="width:' + twidth + 'px; height:' + theight + 'px; overflow: hidden;" id="d' + myid + '">';
				if ( mysimilarto.length < 13){	
					html += '<div style="border: solid 0px #999;padding: 0px;height:55px;width:82px;">';
					if(thisisacoverimage_feature){ //myid is in the info for the link, hence this is the cover image
						html += '<a href="/SwishSearch?n=1&fn='+thisisacoverimage_feature+'&supst=cd" ';
					} else {   
						html += '<a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" TITLE="ID:' + displayid;
					}
					if(document.page.previews.selectedIndex == 1){html += ' TITLE="ID:' + displayid;
						if(showphotographer == 1){html += '  \r&copy; ' + myphotographer;}
						if(showfilesize){html += '\rSIZE: ' + myfilesize ;}
					}
					html += ' \r' + 'CAPTION: ' + myshortcaption + '"';
					html += '><img src="' +  ImageUrl('135/50',myid,showid) + '" border=0 vspace=0 class=pimg hspace=0 height=55';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "', '" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					html += '</a></div>';
					if(thisisacoverimage_feature){
						html += '<div class=cdtitle>' + cover_caption + ' | ';
					} else {
						html += '<div class=idrowtiny style="clear: both; display: block; margin-top: 2px; max-width: 83px;"><font class=imid>' + displayid + ' ';
					}
					html += '<span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span>';
					html +='</font><hr class=results_divider_horizontal /></div>';

					html += '<div class=icons style="padding-top: 0px;">';
					html += '<table><tr><td>'
					if(lbremove==1){
						html+='<div id=smallicondelete class=icontiny><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
					}
					html += '<div id=smalliconenlarge class=icontiny><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
					html += '<div id=smalliconlb class=icontiny><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					html += '<div id=smalliconcart class=icontiny><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
					html += '<div id=smalliconprice class=icontiny><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if(thisisacoverimage_feature){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					} else if(thisisacdimage){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacdimage + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					}
					html += '</td></tr></table></div>';
					html += '<font class="idrowtiny">' + myhrdlink + '</font>';
				} else {				
					html += ( typeof(writesimilar_custom) == 'function' ? writesimilar_custom(myid,showid,myphotographer,myshortcaption,'start','tiny', myhrdlink,myreleased,thisisacoverimage_feature,lbremove,myrmrftype,thisisacdimage) : writesimilar(myid,showid,myphotographer,myshortcaption,'start','tiny', myhrdlink) );
					html += '</td></tr></table></div>';
				}
				html += '</div></span>';								
///med///////////
			} else if (viewmode == "med"){
				var theight = 120 + adminheight  + (typeof(vertremainder)=='undefined' ? 0 : vertremainder);
				var twidth = 140 + (typeof(horizremainder)=='undefined' ? 0 : horizremainder);
				html += '<span valign=bottom style="float:left;">';
				html += '<div align=center valign=bottom style="width:' + twidth + 'px; height:' + theight + 'px; overflow: hidden;" id="d' + myid + '">';
				if ( mysimilarto.length < 13){	
					html += '<div style="border: solid 0px #999;padding: 0px;height:79px;width:128px;">';
					if(thisisacoverimage_feature){ //myid is in the info for the link, hence this is the cover image
						html += '<a href="/SwishSearch?n=1&fn='+thisisacoverimage_feature+'&supst=cd" ';
					} else {   
						html += '<a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" TITLE="ID:' + displayid;
					}
					if(document.page.previews.selectedIndex == 1){html += ' TITLE="ID:' + displayid;
						if(showphotographer == 1){html += '  \r&copy; ' + myphotographer;}
						if(showfilesize){html += '\rSIZE: ' + myfilesize ;}
					}
					html += ' \r' + 'CAPTION: ' + myshortcaption + '"';
					html += '><img src="' +  ImageUrl('135/50',myid,showid) + '" border=0 vspace=0 class=pimg hspace=0 height=79';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "', '" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					html += '</a></div>';
					if(thisisacoverimage_feature){
						html += '<div class=cdtitle>' + cover_caption + ' | ';
					} else {
						html += '<div class=idrow style="clear: both; display: block; margin-top: 4px; max-width: 117px;"><font class=imid>' + displayid + ' | ';
					}
					html += '<span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span>';
					html +='</font><hr class=results_divider_horizontal /></div>';

					html += '<div class=icons style="padding-top: 0px;">';
					html += '<table><tr><td>'
					if(lbremove==1){
						html+='<div id=smallicondelete class=icontiny><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
					}
					html += '<div id=smalliconenlarge class=icontiny><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
					html += '<div id=smalliconlb class=icontiny><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					html += '<div id=smalliconcart class=icontiny><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
					html += '<div id=smalliconprice class=icontiny><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if(thisisacoverimage_feature){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					} else if(thisisacdimage){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacdimage + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					}
					html += '</td></tr></table></div>';
					html += myhrdlink;
				} else {				
					html += ( typeof(writesimilar_custom) == 'function' ? writesimilar_custom(myid,showid,myphotographer,myshortcaption,'start','med', myhrdlink,myreleased,thisisacoverimage_feature,lbremove,myrmrftype,thisisacdimage) : writesimilar(myid,showid,myphotographer,myshortcaption,'start','med', myhrdlink) );
					html += '</td></tr></table></div>';
				}
				html += '</div></span>';					
			} else if (viewmode == "ss"){			
				html = '  ';
///huge////////////////
			} else if (viewmode == "huge"){		
				var theight = 238 + adminheight +  + (typeof(vertremainder)=='undefined' ? 0 : vertremainder);
				var twidth = 340 + (typeof(horizremainder)=='undefined' ? 0 : horizremainder);
				html += '<span valign=bottom style="float:left;">';
				html += '<div align=center valign=bottom style="width:' + twidth + 'px; height:' + theight + 'px; overflow: hidden;" id="d' + myid + '">';
				if ( mysimilarto.length < 13){	
					html += '<div style="border: solid 0px #999;padding: 0px;height:202px;width:340px;">';
					if(thisisacoverimage_feature){ //myid is in the info for the link, hence this is the cover image
						html += '<a href="/SwishSearch?n=1&fn='+thisisacoverimage_feature+'&supst=cd" ';
					} else {   
						html += '<a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" TITLE="ID:' + displayid;
					}
					if(showphotographer == 1){html += '\r&copy; ' + myphotographer;}
					if(showfilesize){html +=   '\rSIZE: ' + myfilesize ;}
					html += ' \r"><img src="' +  ImageUrl('420/60',myid,showid) + '" border="0" vspace="1" hspace="3" alt="loading..." height="202"></a></div>';
					html += '<DIV class=icons>';


					html += '<table><tr><td>'
					if(lbremove==1){
						html+='<div id=icondelete class=iconnormal><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
					}
					html += '<div id=iconenlarge class=iconnormal><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
					html += '<div id=iconlb class=iconnormal><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					html += '<div id=iconcart class=iconnormal><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
					html += '<div id=iconprice class=iconnormal><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if(thisisacoverimage_feature){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					} else if(thisisacdimage){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacdimage + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					}
					if(thisisacoverimage_feature){
						html += '</td></tr></table></div><div class=cdtitle>' + cover_caption + '';
					} else {
						html += '</td><td><div class=imid style="margin-top:2px;">&nbsp;' + displayid + ' | <span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span></div></td></tr></table>';
					}
				html += '</div>'+ myhrdlink;
				} else {
					html += ( typeof(writesimilar_custom) == 'function' ? writesimilar_custom(myid,showid,myphotographer,myshortcaption,'start','huge', myhrdlink,myreleased,thisisacoverimage_feature,lbremove,myrmrftype,thisisacdimage) : writesimilar(myid,showid,myphotographer,myshortcaption,'start','huge', myhrdlink) );
				html += '</div>';
				}	
				html += '</div></div></span>';
////large//////////				
			} else if (viewmode == "large"){
				var theight = 210 + adminheight  + (typeof(vertremainder)=='undefined' ? 0 : vertremainder);
				var twidth = 187 + (typeof(horizremainder)=='undefined' ? 0 : horizremainder);
				html += '<span valign=bottom style="float:left;">';
				html += '<div align=center valign=bottom style="width:' + twidth + 'px; height:' + theight + 'px; overflow:hidden;" id="d' + myid + '">';
				if ( mysimilarto.length < 13){		
					html += '<div style="border: solid 0px #999;padding: 0px;height:170px;width:172px;background: url(' +  ImageUrl('170/85',myid,showid) + ') center bottom no-repeat;">';
					if(thisisacoverimage_feature) //myid is in the info for the link, hence this is the cover image
						   html += '<a href="/SwishSearch?n=1&fn='+thisisacoverimage_feature+'&supst=cd" ';
					else
						   html += '<a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;"'

					if(document.page.previews.selectedIndex == 1){html += ' TITLE="ID:' + displayid;
						if(showphotographer == 1){html +=  '\r&copy; ' + myphotographer;}
						if(showfilesize){html += '\rSIZE: ' + myfilesize ;}
						html += ' \r' + 'CAPTION: ' + myshortcaption + '"';
					}
					html += '><img src="/graphics/spacer.gif" class=pimg height=170 width=170 border="0"';
					
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "','" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					
					html += '</a></div>';
					html += '<DIV class=icons>';


					html += '<table><tr><td>'
					if(lbremove==1){
						html+='<div id=icondelete class=iconnormal><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
					}
					html += '<div id=iconenlarge class=iconnormal><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
					html += '<div id=iconlb class=iconnormal><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					html += '<div id=iconcart class=iconnormal><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
					html += '<div id=iconprice class=iconnormal><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if(thisisacoverimage_feature){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					} else if(thisisacdimage){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacdimage + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					}
					if(thisisacoverimage_feature){
						html += '</td></tr></table></div><div class=cdtitle>' + cover_caption + '';
					} else {
						html += '</td></tr></table></div><div class=idrow><font class=imid>' + displayid + ' | <span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span></font>';
					}			
					html +='</div>';
					html += myhrdlink;
				} else {			
					html += ( typeof(writesimilar_custom) == 'function' ? writesimilar_custom(myid,showid,myphotographer,myshortcaption,'start','normal', myhrdlink,myreleased,thisisacoverimage_feature,lbremove,myrmrftype,thisisacdimage) : writesimilar(myid,showid,myphotographer,myshortcaption,'start','normal', myhrdlink) );
					html +='</div>';
				}
				html += '</div></span>';
//default////////
			} else {
				var theight = 179 + adminheight + (typeof(vertremainder)=='undefined' ? 0 : vertremainder);
				var twidth = 152 + (typeof(horizremainder)=='undefined' ? 0 : horizremainder);
				html += '<span valign=bottom style="float:left;">';
				html += '<div align=center valign=bottom style="width:' + twidth + 'px; height:' + theight + 'px; overflow:hidden;" id="d' + myid + '">';
				if ( mysimilarto.length < 13){		
					html += '<div style="border: solid 0px #999;padding: 0px;height:137px;width:137px;background: url(' +  ImageUrl('135/50',myid,showid) + ') center bottom no-repeat;">';
					if(thisisacoverimage_feature){ //myid is in the info for the link, hence this is the cover image
					   html += '<a href="/SwishSearch?n=1&fn='+thisisacoverimage_feature+'&supst=cd" ';
					} else {
					   html += '<a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;"'
					}
					if(document.page.previews.selectedIndex == 1){
						html += ' TITLE="ID:' + displayid;
						if(showphotographer == 1){html +=  '\r&copy; ' + myphotographer;}
						if(showfilesize){html += '\rSIZE: ' + myfilesize ;}
						html += ' \r' + 'CAPTION: ' + myshortcaption + '"';
					}
					html += '><img src="/graphics/spacer.gif" class=pimg height=135 width=135 border="0"';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "','" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					html += '</a></div>';
					if(thisisacoverimage_feature){
						html += '<div class=cdtitle>' + cover_caption + ' | ';
					} else {
						html += '<div class=idrow style="clear: both; display: block; margin-top: 2px; max-width: 135px;"><font class=imid>' + displayid + ' | ';
					}
					html += '<span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span>';
					html +='</font><hr class=results_divider_horizontal /></div>';

					html += '<div class=icons>';
					html += '<table><tr><td>'
					if(lbremove==1){
						html+='<div id=icondelete class=iconnormal><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
					}
					html += '<div id=iconenlarge class=iconnormal><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
					html += '<div id=iconlb class=iconnormal><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					html += '<div id=iconcart class=iconnormal><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
					html += '<div id=iconprice class=iconnormal><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if(thisisacoverimage_feature){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					} else if(thisisacdimage){
						html += '<A href="/SwishSearch?n=1&fn=' + thisisacdimage + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
					}
					html += '</td></tr></table></div>';
					html += myhrdlink;
				} else {			
					html += ( typeof(writesimilar_custom) == 'function' ? writesimilar_custom(myid,showid,myphotographer,myshortcaption,'start','normal', myhrdlink,myreleased,thisisacoverimage_feature,lbremove,myrmrftype,thisisacdimage) : writesimilar(myid,showid,myphotographer,myshortcaption,'start','normal', myhrdlink) );
				}
				html += '</div></span>';
			}
		}
	} 
	return html;
};


function setuppagesize_cellsizes_custom(){

	imagerows=Math.floor(winH/(179 + adminheight));
	imagespaceheight=imagerows * (179 + adminheight);
	area=imagerows * Math.floor(winW/150);
	
	if(! viewmode && imagerows == 1)
	{
	 viewmode='med';
	 gsetCookie('gviewmode','med', '', '/', gGetCookieDom());
	}
	if(!viewmode){viewmode='table';}
	if(viewmode){
	 if(viewmode == 'editing'){
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('135/50');};
		    imagerows=Math.floor(winH/(160 + adminheight));
		    if(imagerows == 0)
			    imagerows=1;
		    imagespaceheight=imagerows * (160 + adminheight);
		    area=imagerows * Math.floor(winW/300.00);
				vertremainder=Math.floor((winH - (imagerows*(160 + adminheight)))/imagerows);
				horizremainder=Math.floor(    (winW - (Math.floor(winW/300) * 300))	 /    Math.floor(winW/300)		   );
	 } else  if(viewmode == 'list'){
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('135/50');};
		    imagerows=Math.floor(winH/(152.00 + adminheight));
		    if(imagerows == 0)
				  imagerows=1;
		    imagespaceheight=imagerows * (152 + adminheight);
		    area=imagerows * Math.floor(winW/305.00);
				vertremainder=Math.floor((winH - (imagerows*(152 + adminheight)))/imagerows);
		    horizremainder=Math.floor(    (winW - (Math.floor(winW/305) * 305))	 /    Math.floor(winW/305)		   );
	 } else  if (viewmode == 'tiny'){
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('135/50');};
		    imagerows=Math.floor(winH/(106.00 + adminheight));
		    if(imagerows == 0)
				  imagerows=1;
		    imagespaceheight=imagerows * (106 + adminheight);
		    area=imagerows * Math.floor(winW/108.00);
				vertremainder=Math.floor((winH - (imagerows*(106 + adminheight)))/imagerows);
		    horizremainder=Math.floor(    (winW - (Math.floor(winW/108) * 108))	 /    Math.floor(winW/108)		   );
	 } else if (viewmode == 'med'){
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('135/50');};
		    imagerows=Math.floor(winH/(120.00 + adminheight));
		    if(imagerows == 0)
				  imagerows=1;
		    imagespaceheight=imagerows * (120 + adminheight);
		    area=imagerows * Math.floor(winW/140.00);
				vertremainder=Math.floor((winH - (imagerows*(120 + adminheight)))/imagerows);
		    horizremainder=Math.floor(    (winW - (Math.floor(winW/140) * 140))	 /    Math.floor(winW/140)		   );
	 } else if (viewmode == 'huge'){
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('420/60');};
		    imagerows=Math.floor(winH/(238.00 + adminheight));
		    if(imagerows == 0)
				  imagerows=1;
		    imagespaceheight=imagerows * (238 + adminheight);
		    area=imagerows * Math.floor(winW/340.00);
				vertremainder=Math.floor((winH - (imagerows*(238 + adminheight)))/imagerows);
		    horizremainder=Math.floor(    (winW - (Math.floor(winW/340) * 340))	 /    Math.floor(winW/340)		   );
	 } else if (viewmode == 'large'){
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('170/85');};
		    imagerows=Math.floor(winH/(210.00 + adminheight));
		    if(imagerows == 0)
			  imagerows=1;
		    imagespaceheight=imagerows * (210 + adminheight);
		    area=imagerows * Math.floor(winW/187.00);
				vertremainder=Math.floor((winH - (imagerows*(210 + adminheight)))/imagerows);
		    horizremainder=Math.floor(    (winW - (Math.floor(winW/187) * 187))	 /    Math.floor(winW/187)		   );
	
	 } else {
		if(typeof(InitSafetyCheck)=='function'){InitSafetyCheck('135/50');};
	 	 imagerows=Math.floor(winH/(179+ adminheight));
		    if(imagerows == 0)
			imagerows=1;
		    imagespaceheight=imagerows * (179 + adminheight);
		    area=imagerows * Math.floor(winW/152);
				vertremainder=Math.floor((winH - (imagerows*(179 + adminheight)))/imagerows);
				horizremainder=Math.floor(    (winW - (Math.floor(winW/152) * 152))	 /    Math.floor(winW/152)		   );
				}
	}
}





 function writesimilar_custom(myid,showid,myphotographer,myshortcaption,action,mode,myhrdlink,myreleased,tiacif,lbre,myrmrf,tiacdi) { 
	myhrdlink = ( myhrdlink || '' );
	myreleased = ( myreleased || '' );
	var simlist =st[showid];
	var simarray=simlist.split(" ");
	var temparray = simarray[1].split(",");
	if(temparray.length > 1){temparray=simarray[0] + ' ' + temparray.join(' ');simarray=temparray.split(' ');}
	var simcount =simarray.length;
	if(mode =='normal' || mode=='huge'){
	 	if(parseInt(simcount) < 5 ){simindicator=simcount;} else {simindicator=4;}
	} else {
	 	if(parseInt(simcount) < 4 ){simindicator=simcount;} else {simindicator=3;}
	}

	var thehtml='';
	var wmyid = myid;
	var setid = myid;
	var iconheight=15;var iconwidth=15;
 
	if (action == 'next'){		
		var n=sw[showid];
		n++;
		sw[showid] = n;
		if(sw[showid] >= simcount) { sw[showid]=0;n=0;}
		wmyid = simarray[n];
	} else if (action == 'prev'){
		var n=sw[showid];
		n--;
		sw[showid] = n;
		if(sw[showid] < 0) { sw[showid]=simcount - 1;n=simcount - 1;}
		wmyid = simarray[n];
	}
 	//empty array fix for a single image returned which is a similar
 	if ( isNaN((sw[showid] + 1)) ){
		sw[showid] = 0;
	}
	
	/// list
	
	myhrdlink = myhrdlink.split(id[showid])[0] + wmyid + myhrdlink.split(id[showid])[1];

					

	// similar graphics zzz
	thehtml += '<div>' + (mode=='list' ? 	
		'<table width=298 cellspacing=1 cellpadding=0 border0><tr><td valign=bottom class="imcell imcellleft">' : '');
	thehtml += '<table cellpadding=0 cellspacing=0 border=0 width=90><tr><td colspan=2 align=right valign=bottom bgcolor=#fff width=18 height=18>';

	thehtml += '<a href="javasc' + 'ript:enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\', \''+wmyid+'\');" TITLE="ID:' + wmyid;
	if(showphotographer == 1){'  \r&copy; ' + myphotographer;}
	if(showfilesize){thehtml += '  \rSIZE: '+ myfilesize;}
	thehtml += '  \r' + 'CAPTION: ' + myshortcaption;
	if (mode == 'huge'){
	     thehtml += '"><img src="' + ImageUrl('420/60',wmyid) + '" border="0" alt="loading..." height="190"></a></td>';
	} else if( mode == 'med'){
	     iconheight=10;iconwidth=14;
	     thehtml += '"><img src="' + ImageUrl('135/50',wmyid) + '" border="0" vspace="0" hspace="0" alt="loading..." height=72></a></td>';
	} else if( mode == 'tiny'){
	     iconheight=8;iconwidth=12;
	     thehtml += '"><img src="' + ImageUrl('135/50',wmyid) + '" border="0" vspace="0" hspace="0" alt="loading..." height=45></a></td>';		
	} else {
		iconheight=12;iconwidth=16;
	    thehtml += '"><img src="' + ImageUrl('135/50',wmyid) + '" border="0" vspace="0" hspace="0" alt="loading..."></a>' + (mode=='list' ? myhrdlink : '') + '</td>';
	}
	//simindicator="";
	
	thehtml += '<td background=/graphics/similars_rc' + simindicator + '.gif valign=top width=9><IMG SRC=/graphics/similars_ru' + simindicator + '.gif width=12 height=9></td></tr><tr height=8>';
	if(mode == 'normal' || mode=='huge' || mode=='large'  || mode=='list'){
		thehtml += '<td background=/graphics/similars_ll' + simindicator + '.gif height=8 width=12></td><td background=/graphics/similars_lc' + simindicator + '.gif height=8><div style="width: 18px;height:8px;padding:0;margin:0;"></DIV></td>';
 	} else {
 		thehtml+='<td colspan=2 background=/graphics/similars_lc' + simindicator + '.gif height=8></td>';
 	}
 	thehtml += '<td width=12 height=8 background=/graphics/similars_lr' + simindicator + '.gif></td></tr></table>';

	if(mode=='list'){
		thehtml += '</td><td valign="top" class="imcell imcellright">';
	}
	if(tiacif){
		thehtml += '<div class=cdtitle>' + cover_caption + ' | ';
	} else {
		thehtml += '<div class=idrow style="clear: both; display: block; margin-top: 2px; max-width: 135px;"><font class=imid>' + wmyid + ' | ';
	}
	thehtml += '<span class=iconrmrfindicator'+rm[showid]+'>' + rm[showid] + '</span>';
	
	thehtml +='</font><hr class=results_divider_horizontal /></div>';

	thehtml += '<div class=icons>';
	thehtml += '	<table><tr><td>'
	var tpre='';var ticonstyle='';
	if(mode=='tiny' || mode == 'med'){
		tpre='small';
		ticonstyle='icontiny';
	} else {
		ticonstyle='iconnormal';
	}
	
	//<div id=smallicondelete class=icontiny><
	if(lbre==1){
		thehtml+='<div id=' + tpre + 'icondelete class=' + ticonstyle + '><a href="#" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"></A></div>';
	}
	thehtml += '<div id=' + tpre + 'iconenlarge class=' + ticonstyle + '><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="View details about this image"></a></div>';
	thehtml += '<div id=' + tpre + 'iconlb class=' + ticonstyle + '><a href="#" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
	thehtml += '<div id=' + tpre + 'iconcart class=' + ticonstyle + '><a href="#" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';
	thehtml += '<div id=' + tpre + 'iconprice class=' + ticonstyle + '><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrf+'\');" class="iconlink" Title="Price Image"></a></div>';
	if(tiacif){
		thehtml += '<A href="/SwishSearch?n=1&fn=' + thisisacoverimage_feature + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
	} else if(tiacdi){
		thehtml += '<A href="/SwishSearch?n=1&fn=' + tiacdi + '&supst=cd"><IMG src=/graphics/cd.gif height=16 width=18 border=0></a>';
	}


	
	thehtml += '<a href="javascript:writesimilar_custom(\'' + setid + '\',\'' + showid + '\',\'';
	thehtml += myphotographer + '\',\'';
	thehtml += myshortcaption + '\',\'prev\',\'' + mode + '\',\'' + myhrdlink + '\',\'' + myreleased + '\',\'' + tiacif + '\',\'' + lbre + '\',\'' + myrmrf + '\',\'' + tiacdi + '\');" TITLE="show similars">';
	thehtml += '<IMG SRC="/graphics/similars_prev.gif" border="0" hspace="1" height="' + iconheight + '" width="' + iconwidth + '" align="absmiddle"></A>';

	if (mode == 'list' || mode == 'huge' || mode == 'normal' || mode=='large' || mode == 'editing'){
		thehtml += '<font class=xsmall>' + (sw[showid] + 1) + ' of ' + simcount + '</font>';
	}		
	thehtml += '<a href="javascript:writesimilar_custom(\'' + setid + '\',\'' + showid + '\',\'';
	thehtml += myphotographer + '\',\'';
	thehtml += myshortcaption + '\',\'next\',\'' + mode + '\', \'' + myhrdlink + '\',\'' + myreleased + '\',\'' + tiacif + '\',\'' + lbre + '\',\'' + myrmrf + '\',\'' + tiacdi + '\');" TITLE="show similars">';
	thehtml += '<IMG src="/graphics/similars_next.gif" border="0" hspace="1" height="' + iconheight + '" width="' + iconwidth + '" align="absmiddle"></A></nobr><br />';
	if(mode=='list'){
		if(tiacif){
			thehtml += '<div class=cdtitle>' + cover_caption + '</div>';mysshortcaption = 'Virtual CD';
		}
		thehtml +='<br/><br/>&copy; '+currentYear+' ' + myphotographer;
		if( ! tiacif){thehtml += myfilesize;}
		if(! tiacif){thehtml += '<br/>CAPTION: ' + myshortcaption + '<div>'+myreleased+'</div></font>';}
		thehtml += '</td></tr></table>';
	}
	thehtml += '</td></tr></table></div></div>';
	if(mode !='list'){thehtml += myhrdlink;}
	if (action == 'start'){
		return thehtml;
	}
	if (action == 'prev' || action == 'next'){
		$('d' + setid).innerHTML = thehtml;
	}
};













