<?php

// numberchooser.tpl
// -----------------------------------------------------------------------------
// NumberChooser template
//
// Revision   > $Rev: 133 $
// Date		  > $Date: 2009-10-28 14:25:20 +0000 (Wed, 28 Oct 2009) $
// Author     > RAK for DML
// Copyright  > (C) Digital Mail Limited (2005-2009)
// -----------------------------------------------------------------------------

?>

<!------------------------------>
<!-- NUMBER CHOOSER COMPONENT -->
<!------------------------------>

<script language="javascript" type="text/javascript">

// CREATE 'PUBLIC' JS INTERFACE FOR COMPONENT
dmx.<?=$comp_name;?> = new Object();
dmx.<?=$comp_name;?>.name  = '<?=$comp_name;?>';
dmx.<?=$comp_name;?>.xclass = 'numberchooser';
dmx.<?=$comp_name;?>.tariff = '<?=$tariff;?>';

// Contains special sequences
dmx.<?=$comp_name;?>.sequence = new Array;

// -------------------------------------------------------------------------------------------------
// COMPONENT METHODS

<?php if (isset($tariffspec)) : ?>
dmx.<?=$comp_name;?>.add_to_trolley = function(e)
{
	// Add number to trolley
	var targ = dmb1_get_target(e);
	if ($(targ).hasClass('nu'))
	{
		var num = targ.name.substring(targ.name.lastIndexOf('/') + 1);
		targ.href = '<?=DMX_SELF;?>?dmx_action=add_to_trolley&dmx_num=' + num + '&dmx_tariffspec=<?=$tariffspec;?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=numberchooser'
		<?php if ($transfer_target == 'new' || $transfer_target == 'new-force') : ?>
			targ.target = 'dmabs';
		<?php elseif ($transfer_target == 'same') : ?>
			targ.target = '_self';
		<?php elseif ($transfer_target == 'top') : ?>
			targ.target = '_top';
		<?php endif; ?>
		<?php if ($transfer_target == 'new' || $transfer_target == 'new-force') : ?>
			if (typeof e != 'undefined') e.cancelBubble = true;
			<?php if ($transfer_target == 'new-force') : ?>
				var open_opts = 'width=1000,height=700,status=1,toolbar=1,scrollbars=1';
			<?php else : ?>
				var open_opts = '';
			<?php endif; ?>
			var dmabs = window.open(targ.href, 'dmabs', open_opts);
			dmabs.focus(); // NB:User can often disable this in javascript prefs, and there's nothing we can do
			return false;
		<?php endif; ?>
	}
}
<?php else: ?>
dmx.<?=$comp_name;?>.add_to_trolley = function(e)
{
	return;
}
<?php endif; ?>

dmx.<?=$comp_name;?>.init = function()
{
	// Set special sequence
	dmx.<?=$comp_name;?>.set_sequence();
}

dmx.<?=$comp_name;?>.set_sequence = function()
{
	// Set special sequence using 'public' dmx object if it contains a value in dmx.<compname>.pattern[1..2]

	// if (document.<?=$comp_name;?> == undefined) return; // The search form isn't there
	
	if (typeof dmx.<?=$comp_name;?>.sequence[1] != 'undefined') document.<?=$comp_name;?>.dmx_pattern1.value = dmx.<?=$comp_name;?>.sequence[1];
	if (typeof dmx.<?=$comp_name;?>.sequence[2] != 'undefined') document.<?=$comp_name;?>.dmx_pattern2.value = dmx.<?=$comp_name;?>.sequence[2];
}

dmx.<?=$comp_name;?>.set_prefix = function(p_arr)
{
	// Create the Prefix drop-down, and show it if there are multiple choices
	
	var prefixmenu = document.<?=$comp_name;?>.dmx_prefix_pattern;
	prefixmenu.options.length = 0;
	for (var i = 0; i < p_arr.length; i++)
	{
		var opt = new Option(p_arr[i][0], p_arr[i][1], p_arr[i][2], p_arr[i][3]);
		// prefixmenu.add(opt, null); // W3C DOM only, so...
		prefixmenu[prefixmenu.length] = opt;
	}
	if (i > 1) $('<?=$comp_name;?>_prefix').style.display = 'inline';
}

dmx.<?=$comp_name;?>.search = function(message, e)
{
	// Trigger serach
	
	if (typeof message != 'undefined' && message == '') message = 'Searching for matching numbers';
	if (typeof e != 'undefined') e.cancelBubble=true;
	tst_submit_form(document.forms.<?=$comp_name;?>);
	var results = $('<?=$comp_name;?>_results');
	try
	{
		results.innerHTML = '<div class="searching"><img src="<?=$dmx_glib;?>interface/ajax_loader_col1.gif" width="16" height="16" alt=""><br \/><br \/><b>' + message + '<\/b><\/div>';
	}
	catch(err)
	{
		var temp; // Do nothing
	}
}

dmx.<?=$comp_name;?>.check_range_change = function(sel)
{
	if (!document.forms.<?=$comp_name;?>.dmx_prefix_pattern) return;
	var range  = dmx.<?=$comp_name;?>.get_range(sel.value); // Check this works in IE6/7
	var active = range == dmx.<?=$comp_name;?>.ranget;
	document.forms.<?=$comp_name;?>.dmx_prefix_pattern.disabled = !active;
	$('<?=$comp_name;?>_prefix').set('opacity', active ? 1 : 0.2);
}

dmx.<?=$comp_name;?>.get_range = function(tariff)
{
	var temp = tariff.split('-');
	return(temp[1] + '-' + temp[2] + '-' + temp[3]);
}

// SCAN OBJECT ON PAGE LOAD
// Set up page initialisation event handler
if (window.addEventListener)
{
	// W3C
	window.addEventListener('load', dmx.<?=$comp_name;?>.init, true);
}
else if (window.attachEvent)
{
	// IE  - Quirks Mode
	window.attachEvent('onload', dmx.<?=$comp_name;?>.init);
}

dmx.<?=$comp_name;?>.ranget = dmx.<?=$comp_name;?>.get_range(dmx.<?=$comp_name;?>.tariff);

</script>

<style>

#<?=$comp_name?>_prefix
{
	margin-left: 10px;
	display: <?=$prefix_display;?>;
}

</style>

<div class="dmb0" style="<?=$comp_width;?>">
<div class="dmx">
<div class="numberchooser">
<div class="cols_<?=$cols;?>">
<div class="<?=$comp_name;?>" onclick="dmx.<?=$comp_name;?>.add_to_trolley(event);">

<?php if ($showheader && $showborder) : ?>
<h1 class="bordered">Number Chooser</h1>
<?php elseif ($showheader) : ?>
<h1>Number Chooser</h1>
<?php endif; ?>

<?php if ($showborder) : ?>
<div class="border" style="<?=$box_size;?>">
<?php else: ?>
<div style="<?=$box_size;?>">
<?php endif; ?>

<?php if (!$err_msg) : ?>

	<?php if ($showpreamble) : ?>
	<!-- HELPTEXT -->
		<!-- SERVICE GRAPHIC  -->
		<span class="icon_blocks float_left">
			<img src="<?=$dmx_glib;?>numbers/butt_32.gif" width="12" height="32" alt="" />
			<span class="range"><?=$icon_range;?></span>
			{GLOS:icon_num_cap_<?=$service;?>}
			{GLOS:icon_<?=$plan;?>}
		</span>
		<!-- END SERVICE GRAPHIC  -->
		<b>Choose your own phone number (from the numbers we have available).</b>
		You are free to select multiple numbers. If you see another number you want select it as well. This feature is great for getting adjacent phone and fax numbers.
	<!-- END HELPTEXT -->
	<?php endif; ?>
	
	<?php if ($showsearch) : ?>
		<!-------------------->
		<!-- SEARCH SECTION -->
		<!-------------------->
		
		<?php if ($showpreamble) : ?>
			<!-- HELPTEXT -->
			<h2>Search criteria</h2>
			<!-- END HELPTEXT -->
		<?php endif; ?>
		
		<?php if ($comp_err_msg) : ?>
			<span class="error"><?=$comp_err_msg;?><br></span>
		<?php elseif ($comp_msg) : ?>
			<?=$comp_msg;?><br>
		<?php endif; ?>

		<form action="<?=DMX_SELF;?>" method="get" name="<?=$comp_name?>" id="<?=$comp_name?>">
			<input type="hidden" name="dmx_comp_class" value="numberchooser" />
			<input type="hidden" name="dmx_comp_name" value="<?=$comp_name?>" />
			<input type="hidden" name="dmx_rc" value="<?=$rc_forms?>" />
			<input type="hidden" name="dmb1_SessRef" value="" />
			<?php if (!$showtariffs) : ?>
				<input type="hidden" name="dmx_tariff" value="<?=$tariff;?>" /> 
			<?php endif; ?>
			
			<table>

			<?php if ($showtariffs) : // Show tariffs drop-down ?>
			<tr>
				<td style="text-align: right">
					<span class="infotext"><?php if ($cols > 1) : ?>Number <?php endif; ?>Range<span class="tipcontents"><b>Number Range:</b> The main number range to which the number belongs</span></span>
					&nbsp;
				</td>
				<td>
					<select class="form_select<?=$form['error']['dmx_tariff'];?>" name="dmx_tariff" onchange="dmx.<?=$comp_name;?>.check_range_change(this);"> 
						<?=$tariffs;?>
					</select>
				</td>
			</tr>
			<?php endif; ?>
			
			<?php if ($showspseq) : ?>
			<tr>
				<td style="text-align: right">
					<span class="infotext"><?php if ($cols > 1) : ?>Special&nbsp;<?php endif; ?>Sequence</span>
					<span class="tipcontents">
						<b>Special Sequence:</b> Enter a number sequence here if you want the search mechanism to try to find numbers containing a certain run of digits<br />
						<br />
						Examples<br />
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td style="vertical-align: top;"><b>123</b></td>
								<td>&nbsp;&nbsp;&nbsp;</td>
								<td>Find numbers containing 123</td>
							</tr>						
							<tr>
								<td style="vertical-align: top;"><b>!4420*</b></td>
								<td></td>
								<td>Find UK numbers starting with 020 (note international format)</td>
							</tr>						
							<tr>
								<td style="vertical-align: top;"><b>!44161*9!</b></td>
								<td></td>
								<td>Find Manchester numbers<br />ending in 9</td>
							</tr>						
							<tr>
								<td style="vertical-align: top;"><b>!4420*JOE*</b></td>
								<td></td>
								<td>Find a London number<br />with JOE (563) in</td>
							</tr>						
						</table>
					</span>
					&nbsp;
				</td>
				<td>
					<input class="form_text_field<?=$form['error']['dmx_pattern1'];?>" type="text" name="dmx_pattern1" value="<?=$form['value']['dmx_pattern1'];?>" size="7"> or
					<input class="form_text_field<?=$form['error']['dmx_pattern2'];?>" type="text" name="dmx_pattern2" value="<?=$form['value']['dmx_pattern2'];?>" size="7">
					<span class="infotext"> (also accepts A-Z)<span class="tipcontents">Most phone keypads have letters alongside the numbers. Try short words in the number chooser, e.g. TAXI matches 8294.</span></span>
				</td>
			</tr>
			<?php endif; ?>
		
			<tr>
				<td style="text-align: right">
					<span class="infotext">Gold<?php if ($cols > 1) : ?> Value<?php endif; ?><span class="tipcontents"><b>Gold Value:</b> A premium charged for particularly memorable numbers</span></span>
					&nbsp;
				</td>
				<td>
					<select class="form_select<?=$form['error']['dmx_goldrange'];?>" name="dmx_goldrange"> 
						<?=$gold_drop_down;?>
					</select>
					
					<span id="<?=$comp_name;?>_prefix">
						<span class="infotext">Prefix<span class="tipcontents"><b>Prefix:</b> This number range has more than<br />one prefix option</span></span>
						&nbsp;
						<select class="form_select<?=$form['error']['dmx_prefix_pattern'];?>" name="dmx_prefix_pattern" id="dmx_prefix_pattern">
							<?=$prefix_drop_down;?>
						</select>
					</span>	
				
				</td>
			</tr>
			<tr><td colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="10" alt=""></td></tr>
			<tr>
				<td></td>
				<td>
					<input type="hidden" name="dmx_action" value="search">
					<div class="grabut_left_reload"><ul><li><a href="" onclick="this.blur(); dmx.<?=$comp_name;?>.search('', event); return false;">Search</a></li></ul></div>
				</td>
			</tr>
			</table>
		</form>
		<!------------------------>
		<!-- END SEARCH SECTION -->
		<!------------------------>
	<?php else: ?>
		<form action="<?=DMX_SELF;?>" method="get" name="<?=$comp_name?>" id="<?=$comp_name?>">
		<input type="hidden" name="dmx_comp_class" value="numberchooser" />
		<input type="hidden" name="dmx_comp_name" value="<?=$comp_name?>" />
		<input type="hidden" name="dmx_action" value="search" />
		<input type="hidden" name="dmx_rc" value="<?=$rc_forms?>" />
		<input type="hidden" name="dmb1_SessRef" value="" />
		<input type="hidden" name="dmx_tariff" value="<?=$tariff;?>" />
		<input type="hidden" name="dmx_prefix_pattern" value="" />
		<input type="hidden" name="dmx_pattern1" value="" />
		<input type="hidden" name="dmx_pattern1" value="" />
		<input type="hidden" name="dmx_goldrange" value="" />
		</form>
	<?php endif; ?>
		
	<!---------------------------->
	<!-- SEARCH RESULTS SECTION -->
	<!---------------------------->
	
	<div id="<?=$comp_name;?>_results">
	<?php if ($showresults) : ?>
		<?php if ($num_results > 0): ?>
		
			<?php if ($showpreamble): ?>
				<h2>Search results</h2>
				<p>
				<b>To add a <?=$range;?> number to your order</b> (with the {GLOS:<?=$service;?>} service on the {GLOS:<?=$plan;?>} price plan) just click on it.
				</p>
			<?php elseif ($showsearch): ?>
				<br>
			<?php endif; ?>
						
			<?php if ($cols == 1): ?>
				<!-- SEARCH RESULTS TABLE: 1 column form -->
				<table class="vert_centered_leaded" style="width: 100%;">
				<tr>
					<td class="cell1i">{GLOS:ch_number} <small><small>( {GLOS:<?=$service;?>}-{GLOS:<?=$plan;?>} )</small></small></td>
					<?php if ($showclass) : ?><td class="cell1i">Class</td><?php endif; ?>
					<?php if ($showgold) : ?><td class="cell1i" style="text-align: right;">{GLOS:gold}</td><?php endif; ?>
				</tr>
				<tr><td colspan="<?=$num_r_table_cols;?>" class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="2" alt=""></td></tr>
				
				<?php for ($i=0; $i<$rows; $i++): ?>
				<?php $class = ($i/$cols)%2 ? 'cell_plain_thin' : 'cell1f_thin'; ?>
				<tr>
					<td class="<?=$class;?>"><a name="<?=$numbers[$i]['native'];?>" class="nu"><?=$numbers[$i]['formatted'];?></a></td>
					<?php if ($showclass) : ?><td class="<?=$class;?>" style="text-align: center;"><img src="<?=$dmx_glib;?>interface/<?=$numbers[$i]['class_icon'];?>" alt="PRO" width="8" height="8"></td><?php endif; ?>
					<?php if ($showgold) : ?><td class="<?=$class;?>" style="text-align: right;"><?=$numbers[$i]['goldval'];?></td><?php endif; ?>
				</tr>
				<?php endfor; ?>
				
				<tr><td colspan="<?=$num_r_table_cols;?>" class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="2" alt=""></td></tr>
				</table>
				<!-- END SEARCH RESULTS TABLE -->
			<?php endif; ?>
			
			<?php if ($cols == 2): ?>
				<!-- SEARCH RESULTS TABLE: 2 column form -->
				<table class="vert_centered_leaded" style="width: 100%;">
				<tr>
					<td class="cell1i" style="width: 50%;">{GLOS:ch_number} <small><small>( {GLOS:<?=$service;?>}-{GLOS:<?=$plan;?>} )</small></small></td>
					<?php if ($showclass) : ?><td class="cell1i">Class</td><?php endif; ?>
					<?php if ($showgold) : ?><td class="cell1i" style="text-align: right;">{GLOS:gold}</td><?php endif; ?>
					<td class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td>
					<td class="cell1i" style="width: 50%;">{GLOS:ch_number}</td>
					<?php if ($showclass) : ?><td class="cell1i">Class</td><?php endif; ?>
					<?php if ($showgold) : ?><td class="cell1i" style="text-align: right;">{GLOS:gold}</td><?php endif; ?>
				</tr>
				<tr><td colspan="<?=$num_r_table_cols;?>" class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="2" alt=""></td></tr>
				
				<?php for ($i=0; $i<$rows*2; $i+=2): ?>
				<?php $class = ($i/$cols)%2 ? 'cell_plain_thin' : 'cell1f_thin'; ?>
				<tr>
					<td class="<?=$class;?>"><a name="<?=$numbers[$i]['native'];?>" class="nu"><?=$numbers[$i]['formatted'];?></a></td>
					<?php if ($showclass) : ?><td class="<?=$class;?>" style="text-align: center;"><img src="<?=$dmx_glib;?>interface/<?=$numbers[$i]['class_icon'];?>" alt="PRO" width="8" height="8"></td><?php endif; ?>
					<?php if ($showgold) : ?><td class="<?=$class;?>" style="text-align: right;"><?=$numbers[$i]['goldval'];?></td><?php endif; ?>
					<?php if (!$i): ?><td class="divider" rowspan="<?=$rows;?>"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td><?php endif; ?>
					<td class="<?=$class;?>"><a name="<?=$numbers[$i+1]['native'];?>" class="nu"><?=$numbers[$i+1]['formatted'];?></a></td>
					<?php if ($showclass) : ?><td class="<?=$class;?>" style="text-align: center;"><img src="<?=$dmx_glib;?>interface/<?=$numbers[$i]['class_icon'];?>" alt="PRO" width="8" height="8"></td><?php endif; ?>
					<?php if ($showgold) : ?><td class="<?=$class;?>" style="text-align: right;"><?=$numbers[$i+1]['goldval'];?></td><?php endif; ?>
				</tr>
				<?php endfor; ?>
				
				<tr><td colspan="<?=$num_r_table_cols;?>" class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="2" alt=""></td></tr>
				</table>
				<!-- END SEARCH RESULTS TABLE -->
			<?php endif; ?>
			
			<?php if ($cols == 3): ?>
				<!-- SEARCH RESULTS TABLE: 3 column form -->
				<table class="vert_centered_leaded" style="width: 100%;">
				<tr>
					<td class="cell1i" style="width: 33%;">{GLOS:ch_number} <small><small>( {GLOS:<?=$service;?>}-{GLOS:<?=$plan;?>} )</small></small></td>
					<?php if ($showclass) : ?><td class="cell1i">Class</td><?php endif; ?>
					<?php if ($showgold) : ?><td class="cell1i" style="text-align: right;">{GLOS:gold}</td><?php endif; ?>
					<td class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td>
					<td class="cell1i" style="width: 33%;">{GLOS:ch_number}</td>
					<?php if ($showclass) : ?><td class="cell1i">Class</td><?php endif; ?>
					<?php if ($showgold) : ?><td class="cell1i" style="text-align: right;">{GLOS:gold}</td><?php endif; ?>
					<td class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td>
					<td class="cell1i" style="width: 33%;">{GLOS:ch_number}</td>
					<?php if ($showclass) : ?><td class="cell1i">Class</td><?php endif; ?>
					<?php if ($showgold) : ?><td class="cell1i" style="text-align: right;">{GLOS:gold}</td><?php endif; ?>
				</tr>
				<tr><td colspan="<?=$num_r_table_cols;?>" class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="2" alt=""></td></tr>
				
				<?php for ($i=0; $i<$rows*3; $i+=3): ?>
				<?php $class = ($i/$cols)%2 ? 'cell_plain_thin' : 'cell1f_thin'; ?>
				<tr>
					<td class="<?=$class;?>"><a name="<?=$numbers[$i]['native'];?>" class="nu"><?=$numbers[$i]['formatted'];?></a></td>
					<?php if ($showclass) : ?><td class="<?=$class;?>" style="text-align: center;"><img src="<?=$dmx_glib;?>interface/<?=$numbers[$i]['class_icon'];?>" alt="PRO" width="8" height="8"></td><?php endif; ?>
					<?php if ($showgold) : ?><td class="<?=$class;?>" style="text-align: right;"><?=$numbers[$i]['goldval'];?></td><?php endif; ?>
					<?php if (!$i): ?><td class="divider" rowspan="<?=$rows;?>"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td><?php endif; ?>
					<td class="<?=$class;?>"><a name="<?=$numbers[$i+1]['native'];?>" class="nu"><?=$numbers[$i+1]['formatted'];?></a></td>
					<?php if ($showclass) : ?><td class="<?=$class;?>" style="text-align: center;"><img src="<?=$dmx_glib;?>interface/<?=$numbers[$i]['class_icon'];?>" alt="PRO" width="8" height="8"></td><?php endif; ?>
					<?php if ($showgold) : ?><td class="<?=$class;?>" style="text-align: right;"><?=$numbers[$i+1]['goldval'];?></td><?php endif; ?>
					<?php if (!$i): ?><td class="divider" rowspan="<?=$rows;?>"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td><?php endif; ?>
					<td class="<?=$class;?>"><a name="<?=$numbers[$i+2]['native'];?>" class="nu"><?=$numbers[$i+2]['formatted'];?></a></td>
					<?php if ($showclass) : ?><td class="<?=$class;?>" style="text-align: center;"><img src="<?=$dmx_glib;?>interface/<?=$numbers[$i]['class_icon'];?>" alt="PRO" width="8" height="8"></td><?php endif; ?>
					<?php if ($showgold) : ?><td class="<?=$class;?>" style="text-align: right;"><?=$numbers[$i+2]['goldval'];?></td><?php endif; ?>
				</tr>
				<?php endfor; ?>
				
				<tr><td colspan="<?=$num_r_table_cols;?>" class="divider"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="2" alt=""></td></tr>
				</table>
				<!-- END SEARCH RESULTS TABLE -->
			<?php endif; ?>
			
			<?php if ($showpages) : ?>
			<!-- PAGE-TO-PAGE NAVIGATION -->
			<p style="text-align: right;">
				<span style="white-space: nowrap;">Page <?=$page_no;?> of <?=$num_pages;?></span>
				<span style="white-space: nowrap;">
				<a href="<?=DMX_SELF;?>?dmx_action=page&dmx_page=1&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=numberchooser" class="img"><img src="<?=$dmx_glib;?>interface/page_first_8.gif" alt="" width="13" height="8" border="0"></a>&nbsp;
				<?php if ($num_pages > 2) : ?>
				<a href="<?=DMX_SELF;?>?dmx_action=page&dmx_page=<?=($page_no-1);?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=numberchooser" class="img"><img src="<?=$dmx_glib;?>interface/page_back_8.gif" alt="" width="8" height="8" border="0"></a>&nbsp;
				<?php endif; ?>
				<?php if ($from_page > 1) : ?>...&nbsp;<?php endif ?>
				<?php for ($i=$from_page; $i<=$to_page; $i++) : ?>
				<a href="<?=DMX_SELF;?>?dmx_action=page&dmx_page=<?=$i;?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=numberchooser"><?=$i;?></a>&nbsp;
				<?php endfor; ?>
				<?php if ($to_page < $num_pages) : ?>...&nbsp;<?php endif ?>
				<?php if ($num_pages > 2) : ?>
				<a href="<?=DMX_SELF;?>?dmx_action=page&dmx_page=<?=($page_no+1);?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=numberchooser" class="img"><img src="<?=$dmx_glib;?>interface/page_forward_8.gif" alt="" width="8" height="8" border="0"></a>&nbsp;
				<?php endif; ?>
				<a href="<?=DMX_SELF;?>?dmx_action=page&dmx_page=<?=$num_pages;?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=numberchooser" class="img"><img src="<?=$dmx_glib;?>interface/page_final_8.gif" alt="" width="13" height="8" border="0"></a>
				</span>
			</p>
			<!-- END PAGE-TO-PAGE NAVIGATION -->
			<?php endif; ?>
				
		<?php else: ?>
			<?php if ($showpreamble): ?>
			<h2>Search results</h2>
			<?php endif; ?>
			<p>
			<b>Your search produced no results.</b> Please try different search criteria.
			</p>
		<?php endif; ?>

	<?php endif; ?>
	</div>
	<!-------------------------------->
	<!-- END SEARCH RESULTS SECTION -->
	<!-------------------------------->

<?php else : ?>
<!-- ERROR HANDLING -->
<div style="vertical-align: middle;">
<img src="<?=$dmx_glib;?>interface/error_32.gif" alt="" width="36" height="32" border="0" style="float: left; padding: 0 10px 0 0;"><span class="error">WE'RE SORRY<br><?=$err_msg;?></span>
</div>
<!-- END ERROR HANDLING -->
<?php endif; ?>

</div>

</div>
</div>
</div>
</div>
</div>

<!---------------------------------->
<!-- END NUMBER CHOOSER COMPONENT -->
<!---------------------------------->
