/* 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="430" height="440" style="min-width: 440px">'
					+'<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="Javascr' + 'ipt:displayWindow(\'/comp_view.shtml?'
		+ '#{downloadcomp_username}'
		+ '/#{downloadcomp_key}'
		+ '/#{enlargetid}'
		+ '.JPG\',\'600\',\'640\');"> 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_login.shtml#Terms_and_Conditions class=disclaimer>Terms</a> <a href=/help_faq.shtml#Privacy_Policy class=disclaimer>Privacy policy</A> &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="mysphotog"></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];
		if (typeof(suspendsimilars) == 'undefined'){
			mysimilarto=st[showid];
		} else { 
			mysimilarto='';
		}
			
		if (typeof(scp) != 'undefined' && (viewmode == 'list' || viewmode == 'editing') ) {myshortcaption=unescape(scp[showid]);} else {myshortcaption = "n/a";}
		var temp = true;
		var tempshortcaption='';
		var myreleased = '';

		if (! relcon[showid])
			myreleased = rel[showid];

		if (typeof(relcon) != 'undefined' && relcon[showid] && mysimilarto.length < 13) {  //share control style..
			var shortrel = myreleased; ///( $('gRelease'+showid) && $('gRelease'+showid).value ) ? $('gRelease'+showid).value : myreleased;
			shortrel = shortrel.substring(0,16) + (myreleased.length > 16 ? '...' : '');

			myreleased = Templates.results_editing_savereleases.evaluate({'showid':showid,'relcon':relcon[showid],'shortrel':shortrel});
		} 
		else 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];
		myrglobaldynf = 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 = '';
                if(rfcd[showid].match(myid)) //myid is in the info for the link, hence this is the cover image
                {
                        var pm = unescape(rfcd[showid]).match(/SwishSearch\?n\=1\&fn\=(.*)\&supst\=cd/);
                        if(pm != null)
                                thisisacoverimage_feature = pm[1];
                }

		adminheight=0;
		if(myhrdlink){
                        if (viewmode != 'editing')
                                adminheight=11;
		} 
		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 == "editing"){
					var theight = 160 + adminheight;

					var sharesync = unescape(shsync[showid]);
					sharesync=sharesync.split('|');
					//so 0 is type, 1 is if it matchess
					var shbg = 'white';
					if (sharesync[0] == 'shared') {
							shbg = '#77BB33';
					} else if (sharesync[0].toString().match(/notshared|rejected/)) {
							shbg = '#DF0000';
					}
					var shbdr = 'white';
					if ( parseInt(sharesync[1]) )
					{
							shbdr = 'orange';
					}
					if ( mysimilarto.length < 13){

						html += '<span id="cellwrapper'+myid+'" valign=bottom style="float:left;background-color:'+shbdr+'; padding:0 6px; 0 6px">';

						html += '<div id="d'+myid+'" align=center valign=bottom style=" background-color:'+shbg+'; width:288px; height:' + theight + 'px;">';
						html += '<TABLE width=298 cellspacing=2 cellpadding=0 border=0><TR><TD valign=top><div style="position:relative;height:160px;"><a href="javasc' + 'ript:enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\');"><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>';
						html += mycombinedcon + mysharestatuses;
                                        html += '</div></td><td valign="top"><font class=xsmall>ID:' + myid;
                                        if(typeof(suppressrmrftype) == 'undefined'){
                                                html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
                                        }
                                        html += '<DIV class=icons>';

                                        if ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) )
                                        {
                                                html+='<A href="javascript:lightbox_delete_image_enl(\'' + myid + '\');" class="lblink" TITLE="Remove this image from the lightbox">X</A>';
                                        }

                                        html += '</DIV>';

                                        myphotographer = unescape(myphotographer);
                                        if (myphotographer.length > 18)
                                                myphotographer = myphotographer.substring(0,18) + '...';

                                        if(showphotographer == 1){html +='&copy; '+currentYear+' ' + myphotographer;}
                                        html += '  <nobr>';
                                        if(showfilesize){html += myfilesize;}

                                        html += '</nobr><br/>CAPTION: ' + myshortcaption+'<div>'+myreleased+'</div></font>';

                                        html += mysiteweight;

                                        if(myhrdlink)
                                                html += '<br/><NOBR><a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a></NOBR>';
                                        html += '<br/><div id="iconlb"><a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';

                                        html += '</td></tr></table></DIV></span></SPAN>';
                                } else {

                                        html += '<span id="cellwrapper'+myid+'" valign=bottom style="float:left;background-color:'+shbdr+'; padding:0 6px; 0 6px;">';
                                        html += '<div id="d' + myid + '" align=center valign=bottom style=" background-color:'+shbg+'; width:288px; height:' + theight + 'px;">';
                                        html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','editing', myhrdlink, myreleased);
                                        html += '</DIV></span></SPAN>';
                                }

                        }
                        else if(viewmode == "list"){
				var theight = 172 + adminheight;
				if ( mysimilarto.length < 13){	
					
					html += '<span id="cellwrapper'+showid+'" valign=bottom style="float:left;">';
					html += '<div align=center valign=bottom style="width:305px; height:' + theight + 'px;">';
					html += '<table width=298 cellspacing=2 cellpadding=0 border0><tr><td valign=top>';

                                        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="javascript: return false;" 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><a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a></center>';
					html += '</td><td valign="top"><font class=xsmall>ID:' + displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html += '<DIV>';

					if (  ! thisisacoverimage_feature && ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) ) )	
					{
						html+='<A href="javascript: return false;" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="lblink" TITLE="Remove this image from the lightbox">X</A>';
					}

					html += '<div id="iconlb"><a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					if(gsession){html += '<div id="iconcart"><a href="javascript: return false;" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';}

					html += '<div id="iconprice"><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if (! thisisacoverimage_feature )
						html += '<div id="iconenlarge"><a href="javascript: return false;" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class=iconlink title="Enlarge image and more info"></a></div>';

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


					html += '</td></tr></table></DIV></SPAN>';
				} else {	
			
	
					html += '<span valign=bottom style="float:left;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:305px; height:' + theight + 'px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','list', myhrdlink, myreleased);
                                        //html += myhrdlink + '<br/>' + myreleased + mysharestatuses;

					html += '</DIV></SPAN>';
				}
				
			
			} else if (viewmode == "tiny"){
				//adminheight += 8;
				var theight = 100 + adminheight;
				if ( mysimilarto.length < 13){	
					
					html += '<span valign=bottom style="float:left;">';
					html += '<div align=center valign=bottom style="width:95px; height:' + theight + 'px; overflow: hidden;">';

                                        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="javascript: return false;" 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="' +ImageUrl('135/50',myid,showid)+ '" border=0 class=pimg vspace=1 hspace=1 height=55';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "', '" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					
					//sp('','" + myid + "','" + myrglobaldynf + "','" + myphotographer + "','" + myid + "','" + showid + "')
					html += '</a><br />';
					html += '<font class="xxsmall"><DIV>';

					if (! thisisacoverimage_feature && ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) ) )
					{
						html+='<A href="javascript: return false;" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlinktiny" TITLE="Remove this image from the lightbox">X</A>';
					}


					html += '<div id="iconlb"><a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlinktiny" title="Add to your current lightbox"></a></div>';
					if(gsession){html += '<div id="iconcart"><a href="javascript: return false;" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlinktiny" title="Add this image to your shopping cart"></a></div>';}

					html += '<div id="iconprice"><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlinktiny" Title="Price Image"></a></div>';
					if (! thisisacoverimage_feature)
						html += '<div id="iconenlarge"><a href="javascript: return false;" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlinktiny" title="Enlarge image and more info"></a></div>';

					/*  if(typeof(gusert) != 'undefined' && gusert =='IPN'){
						html += '<A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?good=1&id=' + myid + '&q=' + dsplkys + '\'); return false;"><IMG src=/graphics/rating_enhance.gif width=18 height=12 border=0 style="margin-bottom: -3px;"></a><A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?bad=1&id=' + myid + '&q=' + dsplkys + '\'); return false;"><IMG src=/graphics/rating_discourage.gif width=18 border=0 height=12 style="margin-bottom: -3px;"></a>';
					}  */

					html += '</DIV></font>';
					html += '<DIV class=imidxxsmall>' + displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV>';

					if (myhrdlink)
						html += '<a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a>';
					html += '</DIV></SPAN>';

				} else {				
	
					html += '<span valign=bottom style="float:left;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:95px; height:' + theight + 'px; overflow:hidden;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','tiny',myhrdlink,myreleased);		
					html += '</DIV></SPAN>';
				}
			
			
			} else if (viewmode == "med"){
				//adminheight += 4; // tweaking adminheight...
				var theight = 130 + adminheight;
				if ( mysimilarto.length < 13){	
				
					html += '<span valign=bottom style="float:left;">';
					html += '<div align=center valign=bottom style="width:140px; height:' + theight + 'px; overflow: hidden;">';

                                        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="javascript: return false;" 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="' + ImageUrl('135/50',myid,showid) + '" border=0 vspace=1 class=pimg hspace=1 height=80';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "', '" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
						//sp('','" + myid + "','" + myrglobaldynf + "','" + myphotographer + "','" + myid + "','" + showid + "')
					html += '</a><br />';
					html += '<div class="xsmall"><DIV class=icons>';

					if (! thisisacoverimage_feature && ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) ) )
					{
						html+='<A href="javascript: return false;" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="lblink" TITLE="Remove this image from the lightbox">X</A>';
					}

					html += '<div id="iconlb"><a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					if(gsession){html += '<div id="iconcart"><a href="javascript: return false;" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';}

					html += '<div id="iconprice"><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if (! thisisacoverimage_feature)
						html += '<div id="iconenlarge"><a href="javascript: return false;" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"></a></div>';

					if(typeof(gusert) != 'undefined' && gusert =='IPN'){
						html += '<A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?good=1&id=' + myid + '&q=' + dsplkys + '\',getpost); return false;"><IMG src=/graphics/rating_enhance.gif width=18 height=12 border=0 style="margin-bottom: -3px;"></a><A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?bad=1&id=' + myid + '&q=' + dsplkys + '\', getpost); return false;"><IMG src=/graphics/rating_discourage.gif width=18 border=0 height=12 style="margin-bottom: -3px;"></a>';
					}
					html += '</DIV></div>';
				//	html += '<DIV class=imidxxsmall>' + displayid;
					html += '<div class=idrow>' + displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV>';
					if (myhrdlink)
						html += '<a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a>';
					
					

					html += '</DIV></SPAN>';

				} else {				
	
					html += '<span valign=bottom style="float:left;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:140px; height:' + theight + 'px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','med',myhrdlink,myreleased);		
					html += '</DIV></SPAN>';
				}
			} else if (viewmode == "ss"){			
				html = '  ';
			} else if (viewmode == "huge"){		
				var theight = 220 + adminheight;
				if ( mysimilarto.length < 13){	
					html += '<span valign=bottom style="float:left;">';
					html += '<div align=center valign=bottom style="width:330px; height:' + theight + 'px; overflow: hidden;">';

                                        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="javascript: return false;" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" TITLE="ID:' + displayid;

					if(showphotographer == 1){html += '\r&copy; ' + myphotographer;}
					if(showfilesize){html +=   '\rSIZE: ' + myfilesize ;}
					html += ' \r' + 'CAPTION: ' + myshortcaption + '"><img src="' + ImageUrl('420/60',myid,showid) + '" border="0" vspace="1" hspace="3" alt="loading..." height="192"></a><br />';
					html += '<font class="xsmall"><DIV class=icons>';

					if ( ! thisisacoverimage_feature && ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) ) )
					{
						html+='<A href="javascript: return false;" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="lblink" TITLE="Remove this image from the lightbox">X</A>';
					}

					html += '<a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox">LIGHTBOX+</a>';
					if(gsession){html += '<div id="iconcart"><a href="javascript: return false;" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';}

					html += '<div id="iconprice"><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if (! thisisacoverimage_feature)
						html += '<div id="iconenlarge"><a href="javascript: return false;" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"></a></div>';

					if(typeof(gusert) != 'undefined' && gusert =='IPN'){
						html += '<A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?good=1&id=' + myid + '&q=' + dsplkys + '\', getpost); return false;"><IMG src=/graphics/rating_enhance.gif width=18 height=12 border=0 style="margin-bottom: -3px;"></a><A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?bad=1&id=' + myid + '&q=' + dsplkys + '\',getpost); return false;"><IMG src=/graphics/rating_discourage.gif width=18 border=0 height=12 style="margin-bottom: -3px;"></a>';
					}
					html += displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font> ';
					}
	                                html += '</DIV></font>';

					if (myhrdlink)
						html += '<a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a>';

					html += '</DIV></SPAN>';
					
				} else {
					html += '<span valign=bottom style="float:left;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:330px; height:' + theight + 'px; overflow: hidden;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','huge', myhrdlink, myreleased);

					html += '</DIV></SPAN>';
				}				
			} else if (viewmode == "large"){
				var theight = 199 + adminheight;
				if ( mysimilarto.length < 13){		
					html += '<span valign=bottom style="float:left;">';
					html += '<div align=center valign=bottom style="width:187px; height:' + theight + 'px; overflow:hidden;">';
                                        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="javascript: return false;" 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="' + ImageUrl('170/85', myid,showid) + '" class=pimg border="0" vspace="0" hspace="3"';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "','" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					
					html += '</a><br />';
					html += '<font class="xsmall"><DIV class=icons>';

					
					if (! thisisacoverimage_feature && ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) ) )						{
						html+='<A href="javascript: return false;" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox">X</A>';
					}

					html += '<div id="iconlb"><a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					if(gsession){html += '<div id="iconcart"><a href="javascript: return false;" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';}
					html += '<div id="iocnprice"><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if (! thisisacoverimage_feature )
						html += '<div id="iconenlarge"><a href="javascript: return false;" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"></a></div>&nbsp;';

					if(typeof(gusert) != 'undefined' && gusert =='IPN'){
						html += '<A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?good=1&id=' + myid + '&q=' + dsplkys + '\',getpost); return false;"><IMG src=/graphics/rating_enhance.gif width=18 height=12 border=0 style="margin-bottom: -3px;"></a><A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?bad=1&id=' + myid + '&q=' + dsplkys + '\',getpost); return false;"><IMG src=/graphics/rating_discourage.gif width=18 border=0 height=12 style="margin-bottom: -3px;"></a>';
					}

					html += '</div><div class="idrow"><font class=imid>' + displayid + '</font>';
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV></font>';

					if (myhrdlink)
	                                        html += '<a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a>';

					html += '</DIV></SPAN>';
		
			
				} else {			
					html += '<span valign=bottom style="float:left;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:187px; height:' + theight + 'px; overflow: hidden;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','large', myhrdlink, myreleased);

					html += '</DIV></SPAN>';
				}
			} else {
				var theight = 176 + adminheight;
				if ( mysimilarto.length < 13){		
					html += '<span valign=bottom style="float:left;">';
					html += '<div align=center valign=bottom style="width:152px; height:' + theight + 'px; overflow:hidden;">';
                                        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="javascript: return false;" 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="' + ImageUrl('135/50', myid,showid) + '" class=pimg border="0" vspace="0" hspace="3"';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "','" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					
					html += '</a><br />';
					html += '<font class="xsmall"><DIV class=icons>';

					
					if (! thisisacoverimage_feature && ((typeof(pre_q_args) != 'undefined' && pre_q_args.match(/fn=/) ) || (typeof(q_args) != 'undefined' && ( q_args.match(/vmo=/) || q_args.match(/rid=/) || q_args.match(/lb_view=1/) || q_args.match(/fn=/))) ) )						{
						html+='<A href="javascript: return false;" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox">X</A>';
					}

					html += '<div id="iconlb"><a href="javascript: return false;" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"></a></div>';
					if(gsession){html += '<div id="iconcart"><a href="javascript: return false;" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"></a></div>';}
					html += '<div id="iconprice"><a href="javascript: return false;" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"></a></div>';
					if (! thisisacoverimage_feature)
						html += '<div id="iconenlarge"><a href="javascript: return false;" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"></a></div>&nbsp;';

					if(typeof(gusert) != 'undefined' && gusert =='IPN'){
						html += '<A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?good=1&id=' + myid + '&q=' + dsplkys + '\',getpost); return false;"><IMG src=/graphics/rating_enhance.gif width=18 height=12 border=0 style="margin-bottom: -3px;"></a><A href="javascript: return false;" onclick="ajax_TEXT(\'/bin/KeywordAdjust?bad=1&id=' + myid + '&q=' + dsplkys + '\',getpost); return false;"><IMG src=/graphics/rating_discourage.gif width=18 border=0 height=12 style="margin-bottom: -3px;"></a>';
					}
					 
					html += '</div><div class="idrow"><font class=imid>' + displayid + '</font>';
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV></font>';

					if (myhrdlink)
	                                        html += '<a href="'+myhrdlink+'" class="hiresdl_link"><font color="#cc0000">Download Hires</font></a>';


					html += '</DIV></SPAN>';
		
			
				} else {			
					html += '<span valign=bottom style="float:left;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:152px; height:' + theight + 'px; overflow: hidden;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','normal', myhrdlink, myreleased);

					html += '</DIV></SPAN>';
				}

			}
		}
	} 
	return html;
 };


function topcartrefresh() {
        if(gsession){
                self.location.replace(  ( typeof(baseurl) != 'undefined' ? baseurl : '' ) + "/bin/Cklb?ref=/bin/Cart?op~view" + Math.random(100)); // added random to make cart refresh itself if called locally
        } else {
                self.location=( typeof(baseurl) != 'undefined' ? baseurl : '' ) + "/bin/Cklb?ref=/bin/Cart?op~view";
        }
 };
function toplightboxrefresh() {
        if(gsession){
                self.location="/bin/Cklb?ref=/bin/Search?n~1^fmt~table";
        } else {
                self.location = '/bin/Cklb?ref=/bin/Search?n~1^fmt~table';
        }
};

function topsearchrefresh() {
        if(gsession){
                self.location="/bin/Cklb?ref=/user/search.shtml";
        } else {
                self.location = '/bin/Cklb?ref=/user/search.shtml';
        }

};






























