/* easy peasy Template naming pragma:
 * 
 * function_name__template_name
 * 
 */

var Templates = $H({});		


Templates.lightbox_new__body = new Template(
	'<div id="lightboxPopUp">'
	+'<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" ALIGN="left" width="290" height="200"><TR>'
	+'<td class="dark1" valign=bottom width="100%"><DIV class="barheader">&nbsp;<FONT class="bartitle">Make a new lightbox</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>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>'
	+'</div>' 
);
		
Templates.lightbox_email__body = new Template(
	'<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" ALIGN="left" width="390" height="280"><TR>'
	+'<td class="dark1" valign=bottom width="100%"><DIV class="barheader"><FONT class="bartitle">Email your lightbox to a friend</font></DIV></td></tr>'
	+'<tr><TD ALIGN="left" VALIGN="top" width="390" class="dark1"><DIV class="light1" style="padding: 15px;"><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>.<BR>'
	+'</DIV></TD></TR></TABLE>'
);
		
Templates.lightbox_rename__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">Rename  lightbox</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><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/>'
	+'<A HREF="" onclick="lightbox_email(\'close\'); return false;">[X] close window</A>'
	+'</form></DIV></TD></TR></TABLE>'
);

Templates.simplemessage__body = new Template(
	'<DIV class=light1 style="text-align:center; width:400px; 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>'
);

//this is the metadata layout for a popup
Templates.sp_act__metadata = new Template (
	'<span class="blah"># #{displayimageid} <font class=rmrfindicator>#{rmrftype}</font> #{filesize} :: #{shortcaption} #{photographer} #{imagerestrictions}'
	+'<br/>'
	+'<span class="warning"> To turn live previews off, use Previews menu at top of page </span>'
);

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__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;padding-left:6px;">'
				+'<table cellspacing="4" cellpadding="0" border="0" width="920" height="99%" >'
				+'<TR><TD valign="top" align="left" width="430" height="440" style="min-width: 440px">'
					+'<div style="position:relative">#{themediainsert}</div>'
				+'<br/></td>'
				+'#{similarscolumn}'
				+'<TD align="left" valign="top" style="border-left: 1px solid #bbbbbb;"><div style="padding-left: 15px;">'
					+'#{navbacklink}'
					+'#{navenlargedlinks}'
					+'<br/><a href="" onclick="lightbox_addto(\'#{enlargetid}\'); return false;"><img src="/graphics/icon01.gif" width=11 height=16 border=0 alt=""> ADD TO CURRENT LIGHTBOX </a>'
					+'<br/><a href="" onclick="license(\'#{enlargetid}\'); return false;"><img src="/graphics/icon03.gif" width=10 height=16 border=0 alt=""> CHECK USAGE RATES</a>'
					+'<br/><a href="" onclick="cart_addto(\'#{enlargetid}\'); return false;"><img src="/graphics/icon02.gif" width=18 height=16 border=0 alt=""> ADD TO SHOPPING CART</a>'
					+'<br/>#{downloadcomplink}'
					+'#{ratetierinfo}'
					+'<BR/><b>Image Number:</b> #{displayenlargetid}&nbsp;<font class=rmrfindicator>#{rmrftype}</font>'
					+'<br/><b>Caption:</b> #{myshortcaption}<br/>'
					+'#{releaseinfo}'
					+'#{photographerinfo}'
					+'#{filesizeinfo}'
					+'#{restrictionsinfo}'
					+'<BR/><A class="olink" id="enalarge_keywords_text" onclick="popkeys2(\'enlarge_keywords\', this); return false;">Show keywords</A><BR>'
					+'<div id="enlarge_keywords" style="display:none; overflow-y:auto;">'
					+'#{keywordinfo}'
					+'</div></div>'
				+'</td></TR></table>'
	+'<BR></td></TR></table>'
);

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.tieredimgpricing__rfslug = new Template (
        '<h4 style="text-align: left;" class=RFselectfilesize>Select a File Size</h4>'+
        '<table style="text-align: left;width: 95%;" cellpadding=0 cellspacing=0 id=rfselectfilesizetable>#{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;" id=rfselectfilesizetabletdexpr>#{expr}</td>'+
        '<td align="right" valign=top style="border-bottom: solid #999 1px;padding-bottom: 4px; padding-top: 4px;" id=rfselectfilesizetabletdcurrency>#{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;"' +
        ' id=rfselectfilesizetabletdaddtocart>Add to Cart</a></nobr></td></tr>' 
);

function writephotographer(){
return('<div id="searchByPhotographers"><h3>Filter by photographer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:clearfotid()"><span style="color:#ffffff">clear</span></a></h3><select name="fotid" size="8" multiple class="photographersList" onKeyup="fotidOnKeyup()"><option value="AD" >Adam Den Haene</option><option value="AR" >Andersen Ross   </option><option value="A1" >ArabianEye</option><option value="AS" >Ariel Skelley   </option><option value="BH" >Bootsy Holler</option><option value="BL" >Bruce Laurance   </option><option value="CS" >Caroline Schiff   </option><option value="CA" >Colin Anderson   </option><option value="CB" >ColorBlind Images   </option><option value="DL" >Dave & Les Jacobs   </option><option value="DB" >David Buffington   </option><option value="DM" >Don Mason   </option><option value="SC" >DreamPictures  </option><option value="EI" >Erik Isakson</option><option value="ER" >ERproductions Ltd  </option><option value="GM" >Gabriela Medina  </option><option value="HS" >Hill Street Studios   </option><option value="IS" >Inti St Clair   </option><option value="JH" >Jack Hollingsworth   </option><option value="JC" >James Carman   </option><option value="JW" >Jeremy Woodhouse   </option><option value="JG" >JGI   </option><option value="SG" >Jinxy Productions</option><option value="HN" >John Henley   </option><option value="JL" >John Lund   </option><option value="JF" >Jon Feingersh   </option><option value="JP" >Jose Luis Pelaez Inc</option><option value="JS" >JoSon   </option><option value="KD" >Karin Dreyer   </option><option value="KS" >Kim Steele</option><option value="KL" >Klaus Tiedge   </option><option value="KT" >Kris Timken   </option><option value="LW" >LWA/Larry Williams   </option><option value="MA" >Mark Edward Atkinson   </option><option value="FX" >Moxie Productions   </option><option value="MY" >Mychal M Richardson</option><option value="NF" >Ned Frisk   </option><option value="NH" >Noel Hendrickson   </option><option value="PG" >Patterson Graham</option><option value="SF" >Paul Burns   </option><option value="PB" >PBNJ Productions    </option><option value="PD" >Peter Dressel</option><option value="PN" >Picturenet     </option><option value="PL" >Plush Studios   </option><option value="GZ" >Rick Gomez   </option><option value="RM" >RK Studio   </option><option value="RB" >Rolf Bruderer   </option><option value="RK" >Ronnie Kaufman   </option><option value="RA" >Ross Anania   </option><option value="SO" >Shalom Ormsby   </option><option value="LZ" >Studio Zanello   </option><option value="TC" >Tanya Constantine   </option><option value="BC" >Teresa De Paul   </option><option value="TV" >Terry Vine  </option><option value="A2" >Tetra Images</option><option value="TW" >Todd Wright</option><option value="TB" >TRBfoto   </option><option value="TL" >Trevor Lush   </option><option value="TR" >Trinette Reed   </option><option value="VI" >Visual Ideas</option></select>');

}







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];
		if (typeof(scp) != 'undefined' && (viewmode == 'list' || viewmode == 'editing') ) {myshortcaption=unescape(scp[showid]);} else {myshortcaption = "n/a";}
		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];
		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);

		 adminheight_custom=14;
		if(myhrdlink){
			myhrdlink = myhrdlink.replace(/(<br>|%3cbr%3e)/ig, '');
		} 
		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 = 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;"><div style="border: solid 1px #999;padding: 0px;height:' + (theight - 5 ) + 'px ;width:299px;">';
					html += '<TABLE width=298 cellspacing=2 cellpadding=0 border0><TR><TD valign=top class=imcell><a href="" onclick="hp(); enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;"><img src="http://globaldyn.ipnstock.com/'+dynimagesname+'/135/50/' + myid + '.JPG" 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><font class=xsmall>ID:' + displayid;
					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="" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="lblink" TITLE="Remove this image from the lightbox"><IMG SRC=/graphics/icon05.gif height=15 width=14 border=0></A>';
					}

					html += '<a href="" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"><IMG src=/graphics/icon01.gif height=15 width=11 border=0></a>';
					if(gsession){html += '<a href="" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"><IMG src=/graphics/icon02.gif height=15 width=18 border=0></a>';}

					html += '<a href="" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"><IMG src=/graphics/icon03.gif height=15 width=10 border=0></a>';
					html += '<a href="" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class=iconlink title="Enlarge image and more info"><IMG src=/graphics/icon04.gif height=15 width=12 border=0></a>';
					html += '</DIV>';
					
					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></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;"><div style="border: solid 1px #999;padding: 0px;height:135px;width:135px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','list', myhrdlink);
                                        //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:96px; height:' + theight + 'px; overflow:hidden;"><table cellpadding=0 height=' + (theight - 4) + ' width=92 cellspacing=0 style="border: solid 1px #999;padding: 0px;"><tr><td align=center class=imcell>';
					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=http://globaldyn.ipnstock.com/'+dynimagesname+'/135/50/' + myid + '.JPG 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></div>';
					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="" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlinktiny" TITLE="Remove this image from the lightbox"><IMG SRC=/graphics/icon05.gif height=15 width=14 border=0></A>';
					}

					html += '<a href="" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlinktiny" title="Add to your current lightbox"><IMG src=/graphics/icon01.gif height=15 width=11 border=0></a>';
					if(gsession){html += '<a href="" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlinktiny" title="Add this image to your shopping cart"><IMG src=/graphics/icon02.gif height=15 width=18 border=0></a>';}

					html += '<a href="" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlinktiny" Title="Price Image"><IMG src=/graphics/icon03.gif height=15 width=10 border=0></a>';
					html += '<a href="" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlinktiny" title="Enlarge image and more info"><IMG src=/graphics/icon04.gif height=15 width=12 border=0></a>';
					html += '</DIV>';
					html += '<DIV class=imidxxsmall>' + displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV>';
                                        html += myhrdlink;


					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:95px; height:' + theight + 'px; overflow:hidden;"><div style="border: solid 1px #999;padding: 0px;height:55px;width:88px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','tiny');		
					html += myhrdlink;
					html += '</DIV></SPAN>';
				}
			
			
			} else if (viewmode == "med"){
				//adminheight += 4; // tweaking adminheight...
				var theight = 120 + 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;"><table cellpadding=0 height=' + (theight - 4) + ' width=136 cellspacing=0 style="border: solid 1px #999;padding: 0px;"><tr><td align=center class=imcell>';
					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=http://globaldyn.ipnstock.com/'+dynimagesname+'/135/50/' + myid + '.JPG 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></div>';
					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="" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="lblink" TITLE="Remove this image from the lightbox"><IMG SRC=/graphics/icon05.gif height=15 width=14 border=0></A>';
					}

					html += '<a href="" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"><IMG src=/graphics/icon01.gif height=15 width=11 border=0></a>';
					if(gsession){html += '<a href="" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"><IMG src=/graphics/icon02.gif height=15 width=18 border=0></a>';}

					html += '<a href="" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"><IMG src=/graphics/icon03.gif height=15 width=10 border=0></a>';
					html += '<a href="" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"><IMG src=/graphics/icon04.gif height=15 width=12 border=0></a>';
					html += '</DIV>';
					html += '<DIV class=imidxxsmall>' + displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV>';
                                        html += myhrdlink;


					html += '</td></tr></table></DIV></SPAN>';
		

				} else {				
	
					html += '<span valign=bottom style="float:left;"><div style="border: solid 1px #999;padding: 0px;height:80px;width:120px;">';
					html += '<div id="d' + myid + '" align=center valign=bottom style="width:140px; height:' + theight + 'px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','med');		
					if(myhrdlink)
						html += myhrdlink;
					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;"><div class=imcell style="border: solid 1px #999;padding: 0px;height:192px;width:320px;">';
					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' + 'CAPTION: ' + myshortcaption + '"><img src="http://globaldyn.ipnstock.com/'+dynimagesname+'/420/60/' + myid + '.JPG" border="0" vspace="1" hspace="3" alt="loading..." height="192"></a></div>';
					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="" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="lblink" TITLE="Remove this image from the lightbox"><IMG SRC=/graphics/icon05.gif height=15 width=14 border=0></A>';
					}

					html += '<a href="" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"><IMG src=/graphics/icon01.gif height=15 width=11 border=0></a>';
					if(gsession){html += '<a href="" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"><IMG src=/graphics/icon02.gif height=15 width=18 border=0></a>';}

					html += '<a href="" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"><IMG src=/graphics/icon03.gif height=15 width=10 border=0></a>';
					html += '<a href="" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"><IMG src=/graphics/icon04.gif height=15 width=12 border=0></a> ';
					html += displayid;
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font> ';
					}
                                        html += '</DIV>'+ myhrdlink;

					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;"><div style="border: solid 1px #999;padding: 0px;height:192px;width:320px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','huge', myhrdlink);
                                        html += myhrdlink;

					html += '</DIV></SPAN>';
				}				
			} else {
				var theight = 166 + 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;"><table cellpadding=0 height=' + (theight - 4) + ' width=147 cellspacing=0 style="border: solid 1px #999;padding: 0px;"><tr><td align=center class=imcell>';
					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="http://globaldyn.ipnstock.com/'+dynimagesname+'/135/50/' + myid + '.JPG" class=pimg border="0"';
					html += " onmouseover=\"prloadimg('"+ myid +"'); sp(this, '" + myid + "','" + showid + "','"+tset+"');";
					html += '" onmouseout="hp();" id=' + myid + '>';
					
					html += '</a>';
					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="" onclick="lightbox_delete_image_enl(\'' + myid + '\'); return false;" class="iconlink" TITLE="Remove this image from the lightbox"><IMG SRC=/graphics/icon05.gif height=15 width=14 border=0></A>';
					}

					html += '<a href="" ONCLICK="lightbox_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add to your current lightbox"><IMG src=/graphics/icon01.gif height=15 width=11 border=0></a>';
					if(gsession){html += '<a href="" ONCLICK="cart_addto(\'' + myid + '\'); return false;" class="iconlink" title="Add this image to your shopping cart"><IMG src=/graphics/icon02.gif height=15 width=18 border=0></a>';}
					html += '<a href="" ONCLICK="return price_image(\'' + myid + '\',\''+myrmrftype+'\');" class="iconlink" Title="Price Image"><IMG src=/graphics/icon03.gif height=15 width=10 border=0></a>';
					html += '<a href="" ONCLICK="enlarge2(\'' + myid + '\'' + ',' + '\'' + showid + '\'); return false;" class="iconlink" title="Enlarge image and more info"><IMG src=/graphics/icon04.gif height=15 width=12 border=0></a>&nbsp;';
					html += '</div><div class=idrow><font class=imid>' + displayid + '</font>';
					if(typeof(suppressrmrftype) == 'undefined'){
						html += '  <font class=rmrfindicator>'+rm[showid]+'</font>';
					}
					html +='</DIV>';
                                        html += myhrdlink;


					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:152px; height:' + theight + 'px; overflow: hidden;"><div style="border: solid 1px #999;padding: 0px;height:135px;width:135px;">';
					html += writesimilar(myid,showid,myphotographer,myshortcaption,'start','normal');
                                        html += myhrdlink;

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

			}
		}
	} 
	return html;
};





















