<html>
<head>
<link rel="stylesheet" type="text/css" href="||nwimg||||tpl_color||/surge.css" />
<script type="text/javascript">
<!--
var ut="&utoken=||putoken||";
var fld="&fld=||encode_text||folder||&encode_text=fld";
var act="||action||?cmd=";
var do_wait=||ifdef||safari_version||true||else||false||endif||;

function clickAddress(address){
		window.opener.location = act+"msg_new&get_attach_id=true&encode_text=h_from&h_from="+address+ut;
		window.opener.focus();
		if (do_wait)
			setTimeout("",1000);
		window.close();
}

// -->
</script>
<title>||cust_title|| - ||html_text||h_subject||</title>
</head>
<body class="body">
||ifdef||error||
	||include||_errorinline.tpl||
||endif||
||ifdef||msg||
	||include||_msginline.tpl||
||endif||


<form name="external_search" action="||action||" method="post">
	<input type="hidden" name="utoken" value="||utoken||" />
	<input type="hidden" name="cmd" value="" />

<center>
<h2>Search External Address Book</h2>

||ifdef||ext_books||
	<table>
	<tr>
		<td class="b">Address Book:</td>
		<td>
			<select name="book_selected" size="1" onchange="this.form.cmd.value='ext_addr';this.form.submit();">
				||begin_ext_book||
					||ifequal||book_selected||book_name||
						<option value="||book_name||" selected="selected"> ||book_name|| - ||book_text|| </option>
					||else||
						<option value="||book_name||" > ||book_name|| - ||book_text|| </option>
					||endif||
				||end_ext_book||
			</select>
		</td>
	</tr>
	</table>
||endif||


||ifdef||ext_search||
<table class="bg1">
<tr><td>
<table>
	||begin_ext_search||
	<tr>
		<td class="rt b">||field_text||:</td>
		<td>
			||ifequal||field_type||2||
			<!-- Number Field 	-->
				<input type="text" size="5" name="ext_||field_name||.x" value="||build(ext_||field_name||.x)||" /><b>to</b>
				<input type="text" size="5" name="ext_||field_name||.y" value="||build(ext_||field_name||.y)||" />
			||else||
				||ifequal||field_type||4||
			<!-- Date Field -->
					<input type="text" size="2" name="ext_||field_name||.dx" value="||build(ext_||field_name||.dx)||" /><b>/</b>
					<input type="text" size="2" name="ext_||field_name||.mx" value="||build(ext_||field_name||.mx)||" /><b>/</b>
					<input type="text" size="2" name="ext_||field_name||.yx" value="||build(ext_||field_name||.yx)||" /> <b>to</b>

					<input type="text" size="2" name="ext_||field_name||.dy" value="||build(ext_||field_name||.dy)||" /><b>/</b>
					<input type="text" size="2" name="ext_||field_name||.my" value="||build(ext_||field_name||.my)||" /><b>/</b>
					<input type="text" size="2" name="ext_||field_name||.yy" value="||build(ext_||field_name||.yy)||" /> (d/m/y)
				||else||
			<!-- String Field (default) -->
					<input type="text" size="30" name="ext_||field_name||." value="||build(ext_||field_name||.)||" />
				||endif||
			||endif||
		</td>
	</tr>
	||end_ext_search||
	<tr><td class="rt b">Match All:</td><td><input type="checkbox" name="ext_match" checked="checked" /></td></tr>
	<tr><td align="center" colspan="2"><input class="btn" type="submit" value="Search Address Book" name="ext_search" /></td></tr>
</table>
</td></tr>
</table>
||else||
	<h2>Address Book does not support searching</h2>
||endif||


||ifdef||ext_available||
<hr />
<table class="LT" border="0" cellspacing="0" width="95%">
<TR class="bg1">
||begin_ext_avail||
	||ifequal||field_name||record_id||
	||else||
		<th>||field_text||</th>
	||endif||
||end_ext_avail||
</tr>
||define||color||1||
||begin_ext_results||
<tr class="L||color||">
	||ifequal||color||1|| ||define||color||0|| ||else|| ||define||color||1|| ||endif||
	||begin_ext_avail||
		||ifequal||field_name||full_name||
			<td><a href="||action||?cmd=create_addr&amp;abk_full_name=||ext_display||field_name||&amp;abk_email=||ext_display||email_address||&amp;utoken=||utoken||">||ext_display||field_name||</a></td>
		||else||
		||ifequal||field_name||email_address||
			<td><a href="javascript:clickAddress('||encode_text||(||ext_display||field_name||)||');">||ext_display||field_name||</a></td>
		||else||
			||ifequal||field_name||record_id||
			||else||
				<td>||ext_display||field_name||</td>
			||endif||
		||endif||
		||endif||
	||end_ext_avail||
</tr>
||end_ext_results||
</table>
||else||
	<h2>No Data Available in this Address Book</h2>
||endif||




</center>
</form>
</body>
</html>
