<?php

// serviceplanselector.tpl
// -------------------------------------------------------------------------------------------------
// ServicePlanSelector template
//
// Revision   > $Rev: 125 $
// Date		  > $Date: 2009-10-15 10:32:22 +0100 (Thu, 15 Oct 2009) $
// Author     > RAK for DML
// Copyright  > (C) Digital Mail Limited (2005-2009)
// -------------------------------------------------------------------------------------------------

?>

<!-- ********************* -->
<!-- SERVICE PLAN SELECTOR -->
<!-- ********************* -->

<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 = 'serviceplanselector';

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

// DECLARE VARIABLES
// Current service and plan index
dmx.<?=$comp_name;?>.csi = <?=$csi;?>; 
dmx.<?=$comp_name;?>.cpi = <?=$cpi;?>;

// What's open?
dmx.<?=$comp_name;?>.open = '';

// Pricing Grid
dmx.<?=$comp_name;?>.grid =	<?=$grid_json;?>;

// Links to other XComponents
dmx.<?=$comp_name;?>.link = new Object();
dmx.<?=$comp_name;?>.link.callcostexplorer = '<?=$link_cce;?>'; // Name of linked Call Cost Explorer

dmx.<?=$comp_name;?>.ajax_debug = true;

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

dmx.<?=$comp_name;?>.toggle = function(what, link)
{
	if (dmx.<?=$comp_name;?>.open == what)
	{
		dmx.<?=$comp_name;?>.hide(what);
		dmx.<?=$comp_name;?>.open = '';
		$(link).className = 'options';
	}
	else
	{
		dmx.<?=$comp_name;?>.show(what);
		dmx.<?=$comp_name;?>.open = what;
		var spc = $('<?=$comp_name;?>_1234').getElements('a');
		spc[0].className = spc[1].className = 'options';
		$(link).className = 'options_open';
	}
}

dmx.<?=$comp_name;?>.show = function(what)
{
	if (what == 'services')
	{
		dmx.<?=$comp_name;?>.hide('plans');
		$('<?=$comp_name;?>_services_on').style.display  = 'block';
		$('<?=$comp_name;?>_services_box').style.display = 'block';
	}
	else if (what == 'plans')
	{
		dmx.<?=$comp_name;?>.hide('services');
		$('<?=$comp_name;?>_plans_on').style.display  = 'block';
		$('<?=$comp_name;?>_plans_box').style.display = 'block';
	}
}

dmx.<?=$comp_name;?>.hide = function(what)
{
	if (what == 'services')
	{
		$('<?=$comp_name;?>_services_on').style.display  = 'none';
		$('<?=$comp_name;?>_services_box').style.display = 'none';
	}
	else if (what == 'plans')
	{
		$('<?=$comp_name;?>_plans_on').style.display  = 'none';
		$('<?=$comp_name;?>_plans_box').style.display = 'none';
	}
}

dmx.<?=$comp_name;?>.update = function(sp, ind)
{
	// Update current selection and all prices
	//
	if (sp == 'service') dmx.<?=$comp_name;?>.csi = ind;
	if (sp == 'plan')	 dmx.<?=$comp_name;?>.cpi = ind;

	var csi = dmx.<?=$comp_name;?>.csi;
	var cpi = dmx.<?=$comp_name;?>.cpi;
	
	var grid = dmx.<?=$comp_name;?>.grid;
	
	// Update text at top of component
	$('<?=$comp_name;?>_text_fb').innerHTML = grid[csi][cpi].service + ' number on our ' + grid[csi][cpi].plan;

	// Update tariff in form
	document.<?=$comp_name;?>_form.dmx_tariff.value = grid[csi][cpi].tariff;

	// Update current prices
	$('cur_setup').innerHTML 		= grid[csi][cpi].setup;
	$('cur_rental').innerHTML 		= grid[csi][cpi].rental;
	$('cur_months_min').innerHTML 	= grid[csi][cpi].months_min;
	$('cur_ppm_text').innerHTML 	= grid[csi][cpi].ppm_text;
	
	var link = dmx.<?=$comp_name;?>.link.callcostexplorer;
	if (!(link && $defined(dmx[link]) && dmx[link].xclass == 'callcostexplorer')) link = false;

	if (sp == 'service')
	{
		// Change service and feature icons, and update hidden plan prices
		
		document.<?=$comp_name;?>_form.dmx_service[csi].checked = true;
		
		var i = $('s_icon_' + csi).cloneNode(true);
		var t = $('<?=$comp_name;?>_service_c');
		t.innerHTML = '';
		t.appendChild(i);

		var i = $('s_func_' + csi).cloneNode(true);
		var t = $('<?=$comp_name;?>_features_c');
		t.innerHTML = '';
		t.appendChild(i);

		for (var i = 0; i < <?=$num_plans;?>; i++)
		{
			$('p_setup_' + i).innerHTML 		= grid[csi][i].setup;
			$('p_rental_' + i).innerHTML 		= grid[csi][i].rental;
			$('p_months_min_' + i).innerHTML 	= grid[csi][i].months_min;
			$('p_ppm_text_' + i).innerHTML		= grid[csi][i].ppm_text;
		}
		
		// If there is a linked call cost explorer, update the prices it displays
		if (link) dmx[link].change_service(csi);
		
	}
	else if (sp == 'plan')
	{
		// Change plan icon, and update hidden service prices

		document.<?=$comp_name;?>_form.dmx_plan[cpi].checked = true;

		var i = $('p_icon_' + cpi).cloneNode(true);
		var t = $('<?=$comp_name;?>_plan_c');
		t.innerHTML = '';
		t.appendChild(i);

		for (var i = 0; i < <?=$num_servs;?>; i++)
		{
			$('s_setup_' + i).innerHTML 		= grid[i][cpi].setup;
			$('s_rental_' + i).innerHTML 		= grid[i][cpi].rental;
			$('s_months_min_' + i).innerHTML 	= grid[i][cpi].months_min;
			$('s_ppm_text_' + i).innerHTML 		= grid[i][cpi].ppm_text;
		}

		// If there is a linked call cost explorer, update the highlighted plan
		if (link) dmx[link].change_plan(cpi);

	}
}

dmx.<?=$comp_name;?>.show_tariffguide = function(sp, name, link)
{
	// Show full tariff guide
	
	var params = new Object();
	if (sp == 'service')
	{
		params.service	= name;
		params.plan		= dmx.<?=$comp_name;?>.grid[0][dmx.<?=$comp_name;?>.cpi].plan;
	}
	else if (sp == 'plan')
	{
		params.service	= dmx.<?=$comp_name;?>.grid[dmx.<?=$comp_name;?>.csi][0].service;
		params.plan 	= name;
	}
	else
	{
		params.service	= dmx.<?=$comp_name;?>.grid[dmx.<?=$comp_name;?>.csi][0].service;
		params.plan		= dmx.<?=$comp_name;?>.grid[0][dmx.<?=$comp_name;?>.cpi].plan;
	}
	<?php if ($div_fulltariff) : ?>

	params.dmb1_SessRef		= '<?=$dmx_session;?>';
	params.family 			= 'dmshop';
	params.xclass 			= 'tariffguide';
	params.name	  			= '<?=$div_fulltariff;?>';
	params.ajax   			= 1;
	params.ajax_debug   	= dmx.<?=$comp_name;?>.ajax_debug;
	params.skip_dmshop		= 1; // Initialise trolley from session, don't go via dmShop
	params.response_type	= 'html';
	params.dmx_glib			= '<?=$dmx_glib;?>';
	params.index  			= <?=$focus;?>;
	params.close_func		= 'dmx.<?=$div_fulltariff;?>.kill(); return false;';

	<?php if ($hook_fulltariff) : ?>
	// This executes designer specified function in client page, and exits if return value is false, otherwise continue
	// It can modify the ajax request params if desired, otherwise should return them
	params = <?=$hook_fulltariff;?>(params);
	if (params == false) return; 
	<?php endif; ?>
	
	$('<?=$div_fulltariff;?>').style.display = 'block';

	// Load by ajax
	var xajax = new Request.HTML( {
			url: '/dmx/core/php/xcom_server.php',
			data: params,
			update: '<?=$div_fulltariff;?>',
			onSuccess: function() { new FancyTips($('<?=$div_fulltariff;?>').getElements('.infotext')); },
		}
	);
	xajax.post();
	return false;
	<?php else: ?>

	// We're not using ajax, so open tariff guide in new window
	link.href += '&dmx_service=' + params.service;
	link.href += '&dmx_plan=' + params.plan;
	return true;
	<?php endif; ?>

}

dmx.<?=$comp_name;?>.show_typinv = function(link)
{
	// Show typical invoice
	<?php if ($div_typinv) : ?>

	var params = new Object();
	params.dmb1_SessRef		= '<?=$dmx_session;?>';
	params.family 			= 'dmshop';
	params.xclass 			= 'typicalfirstinvoice';
	params.name	  			= '<?=$div_typinv;?>';
	params.ajax   			= 1;
	params.skip_dmshop		= 1; // Initialise trolley from session, don't go via dmShop
	params.response_type	= 'html';
	params.dmx_glib			= '<?=$dmx_glib;?>';
	params.ajax_debug   	= dmx.<?=$comp_name;?>.ajax_debug;
	params.index			= <?=$focus;?>;
	params.tariff			= dmx.<?=$comp_name;?>.grid[dmx.<?=$comp_name;?>.csi][dmx.<?=$comp_name;?>.cpi].tariff;
	params.buttonfunc		= 'dmx.<?=$div_typinv;?>.kill(); return false;';
	
	<?php if ($hook_typinv) : ?>
	// This executes designer specified function in client page, and exits if return value is false, otherwise continue
	// It can modify the ajax request params if desired, otherwise should return them
	params = <?=$hook_typinv;?>(params);
	if (params == false) return; 
	<?php endif; ?>

	$('<?=$div_typinv;?>').style.display = 'block';

	// Load by ajax
	var xajax = new Request.HTML( { url: '/dmx/core/php/xcom_server.php', data: params, update: '<?=$div_typinv;?>' } );
	xajax.post();
	return false;
	<?php else: ?>

	// We're not using ajax, so open typical invoice as usual
	link.href += '&dmx_tariff='  + dmx.<?=$comp_name;?>.grid[dmx.<?=$comp_name;?>.csi][dmx.<?=$comp_name;?>.cpi].tariff;
	return true;
	<?php endif; ?>
}

<?php endif; ?>

</script>

<style type="text/css">

#<?=$comp_name;?>_origin
{
	position: relative;
	overflow: visible;
	height: 510px;
	margin-top: 20px;
	padding-top: 5px;
}

#<?=$comp_name;?>_1234
{
	/* Should be position: relative, no top or left offet, but positioned absolutely to deal with IE6 z-index bug */
	position: absolute;
	top: 7px;
	left: 0px;
	z-index: 100;
	width: <?=$width;?>px;
	padding-bottom: 25px;
}

#<?=$comp_name;?>_divider
{
	/* Should be position: relative, no top or left offet, but positioned absolutely to deal with IE6 z-index bug */
	position: absolute;
	top: 33px;
	left: 0px;
	z-index: 1;
	height: 1px;
	width: <?=$width;?>px;
}

#<?=$comp_name;?>_current
{
	/* Should be position: relative, no top or left offet, but positioned absolutely to deal with IE6 z-index bug */
	position: absolute;
	top: 37px;
	left: 0px;
	z-index: 100;
	width: <?=$width;?>px;
	margin-top: 5px;
}

#<?=$comp_name;?>_number, #<?=$comp_name;?>_number_c
{
	float: left;
	width: 115px;
}

#<?=$comp_name;?>_service, #<?=$comp_name;?>_service_c
{
	float: left;
	width: 100px;
}

#<?=$comp_name;?>_plan, #<?=$comp_name;?>_plan_c
{
	float: left;
	width: <?php echo($width - 490); ?>px;
}

#<?=$comp_name;?>_service_c img, #<?=$comp_name;?>_plan_c img
{
	cursor: pointer;
}

#<?=$comp_name;?>_features, #<?=$comp_name;?>_features_c
{
	float: left;
	width: 150px;
}

#<?=$comp_name;?>_confirm, #<?=$comp_name;?>_confirm_c
{
	float: right;
	width: 120px;
	text-align: right;
}

#<?=$comp_name;?>_services_on
{
	display: none;
	position: absolute;
	z-index: 99;
	top: 0px;
	left: 105px;
	width: 95px;
	height: 125px;
	border-width: 1px 1px 0px 1px;
	border-color: #669;
	border-style: solid;
	background-color: #FFFAEE;
}

#<?=$comp_name;?>_services_box
{
	display: none;
	position: absolute;
	z-index: 98;
	top: 125px;
	left: 85px;
	width: <?php echo($width - 85); ?>px;
	padding: 0px;
	border-top: 1px #669 solid;
}

#<?=$comp_name;?>_plans_on
{
	display: none;
	position: absolute;
	z-index: 99;
	top: 0px;
	left: 205px;
	width: 90px;
	height: 125px;
	border-width: 1px 1px 0px 1px;
	border-color: #669;
	border-style: solid;
	background-color: #FFFAEE;
}

#<?=$comp_name;?>_plans_box
{
	display: none;
	position: absolute;
	z-index: 98;
	top: 125px;
	left: 185px;
	width: <?php echo($width - 185); ?>px;
	padding: 0px;
	border-top: 1px #669 solid;
}

.optbox
{
	padding: 10px;
	border-width: 0px 1px 1px 1px;
	border-color: #669;
	border-style: solid;
	background-color: #FFFAEE;
	cursor: pointer;
	height: 75px;
	overflow: hidden;
}

.optbox:hover
{
	background-color: #FFC;
}

.optbox input
{
	display: block;
	float: left;
	margin: 12px 3px;
}

.sicon
{
	float: left;
	width: 70px;
}

.sdesc
{
	float: left;
	width: <?php echo($width - 470); ?>px;
	padding-right: 10px;
}

.sfunc
{
	float: left;
	width: 145px;
}

.sprice
{
	float: right;
	text-align: right;
	width: 110px;
}

.picon
{
	float: left;
	width: 88px;
}

.pdesc
{
	float: left;
	width: <?php echo($width - 450); ?>px;
	padding-right: 10px;
}

.pprice
{
	float: right;
	text-align: right;
	width: 110px;
}

#<?=$comp_name;?>_tariffguide, #<?=$comp_name;?>_typinv
{
	position: absolute;
	z-index: 150;
	top: 0px;
	left: 0px;
	display: none;	
	background-color: #FFF;
	margin: 20px;
}

</style>

<div class="dmb0" style="<?=$comp_width;?>">
<div class="dmx">
<div class="serviceplanselector">
<div class="<?=$comp_name?>">

<?php if (!$err_msg) : ?>
	
	<?php if ($showheader) : ?>
		<h1<?php if ($showborder) : ?> class="bordered"<?php endif;?>>
		Change your service and call plan
		</h1>
	<?php endif; ?>
	
<?php else: ?>
	<?php if ($showheader) : ?><h1<?php if ($showborder) : ?> class="bordered"<?php endif;?>>Service Plan Selector</h1><?php endif; ?>
<?php endif; ?>
	
<?php if ($showborder) : ?>
<div class="border" style="<?=$box_size;?>">
<?php else: ?>
<div style="<?=$box_size;?>">
<?php endif; ?>

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

	<form action="<?=DMX_SELF;?>" method="get" name="<?=$comp_name;?>_form" onsubmit="tst_submit_form(this);">
	<input type="hidden" name="dmx_action" 		  value="modify">
	<input type="hidden" name="dmx_comp_class" 	  value="serviceplanselector">
	<input type="hidden" name="dmx_comp_name" 	  value="<?=$comp_name;?>">
	<input type="hidden" name="dmx_num" 		  value="<?=$number_native;?>">
	<input type="hidden" name="dmx_item_index" 	  value="<?=$index;?>">
	<input type="hidden" name="dmx_rc" 			  value="<?=$rc_links;?>">

	<input type="hidden" name="dmx_tariff"		  value="<?=$cur_tariff;?>">

	<div class="ie6_7_is_buggy"><!-- Empty Div to get rid of IE6/7 CSS 'quirk' --></div>
	
	<p>
	<b><?=$number_formatted;?> is a <span id="<?=$comp_name;?>_text_fb"><?=$cs;?> number on our <?=$cp;?></span> call plan.</b><br>
	When the number is configured with the service and plan you want, click "Confirm".
	</p>
	
	<div id="<?=$comp_name;?>_origin">
		<div id="<?=$comp_name;?>_1234">
			<div id="<?=$comp_name;?>_number">
				1) Number
			</div>
			<div id="<?=$comp_name;?>_service">
				<a href="#" class="options" onclick="this.blur(); dmx.<?=$comp_name;?>.toggle('services', this); return false;"><span class="nu">2) </span>Service</a>
			</div>
			<div id="<?=$comp_name;?>_plan">
				<a href="#" class="options" onclick="this.blur();  dmx.<?=$comp_name;?>.toggle('plans', this); return false;"><span class="nu">3) </span>Plan</a>
			</div>
			<div id="<?=$comp_name;?>_features">
				<b>Features</b>
			</div>
			<div id="<?=$comp_name;?>_confirm">
				<div class="grabut_right_forward">
					<ul>
						<li><a href="#" onclick="tst_submit_form(document.forms.<?=$comp_name;?>_form); event.cancelBubble=true; return false;">4) Confirm</a></li>
					</ul>
				</div>
			</div>
		</div>
		
		<div id="<?=$comp_name;?>_divider" class="col1i"><!-- This comment is here to fix IE6 CSS bug with height --></div>
	
		<div id="<?=$comp_name;?>_current">
			<div id="<?=$comp_name;?>_number_c">
				<!-- SERVICE GRAPHIC NUMBER, WITH ACTUAL NUMBER INSERTED -->
				<table border="0" cellspacing="0" cellpadding="0" class="sg_num">
				<tr>
					<td><img src="<?=$dmx_glib;?>numbers/butt_32.gif" alt="" width="12" height="32" border="0"></td>
					<td class="mid"><?=$sg_num;?></td>
					<td><img src="<?=$dmx_glib;?>numbers/cap_32.gif" alt="" width="12" height="32" border="0"></td>
				</tr>
				</table>
				<!-- END SERVICE GRAPHIC NUMBER, WITH ACTUAL NUMBER INSERTED -->
			</div>
			<div id="<?=$comp_name;?>_service_c" onclick="this.blur(); dmx.<?=$comp_name;?>.toggle('services', this); return false;">
				<img src="<?=$dmx_glib;?>numbers/<?=$sg_service;?>_sa_32.gif" alt="<?=$cs;?>" width="56" height="32" border="0" class="infotext" />
				<span class="tipcontents"><?=$cs;?></span>
			</div>
			<div id="<?=$comp_name;?>_plan_c" onclick="this.blur(); dmx.<?=$comp_name;?>.toggle('plans', this); return false;">
				<img src="<?=$dmx_glib;?>numbers/<?=$sg_plan;?>_32.gif" alt="<?=$cp;?>" width="73" height="32" border="0" class="infotext" />
				<span class="tipcontents"><?=$cp;?></span>
			</div>
			<div id="<?=$comp_name;?>_features_c">
				<?php foreach($sg_functions as $f) : ?>
					{GLOS:<?=$f['infovar'];?>_small}
				<?php endforeach; ?>
			</div>
			<div id="<?=$comp_name;?>_confirm_c">
				Setup <?=$currency_symbol;?><span id="cur_setup"><?=$cur_setup;?></span><br>
				<?=$currency_symbol;?><span id="cur_rental"><?=$cur_rental;?></span> / month<br>
				<span style="font-size: smaller">(<span id="cur_months_min"><?=$cur_months_min;?></span> months min)</span><br>
				<span id="cur_ppm_text" style="font-size: smaller"><?=$cur_ppm_text;?></span><br>
				<a href="<?=DMX_SELF;?>?dmx_action=show_typical_invoice&dmx_index=<?=$focus;?>&dmx_num=<?=$number_native;?>&dmx_num_f=<?=$number_formatted;?>&dmx_popup=1&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="popup" target="_blank" onclick="this.blur(); return dmx.<?=$comp_name;?>.show_typinv(this);">Example Invoice</a>
			</div>
		</div>
		
		<div id="<?=$comp_name;?>_services_on"></div>
		<div id="<?=$comp_name;?>_services_box">
			<?php foreach($services as $i => $s) : ?>
				<div id="<?=$comp_name;?>_s<?=$i;?>" class="optbox" onmouseover="" onmouseout="" onclick="dmx.<?=$comp_name;?>.update('service', <?=$i;?>);">
					<input type="radio" name="dmx_service" value="<?=$i;?>"<?php if ($i == $csi) : ?> checked<?php endif; ?>>
					<div id="s_icon_<?=$i;?>" class="sicon">
						<img src="<?=$dmx_glib;?>numbers/<?=$s['icon'];?>_sa_32.gif" alt="<?=$s['name'];?>" width="56" height="32" border="0" class="infotext" />
						<span class="tipcontents">Select <?=$s['name'];?></span>
					</div>
					<div class="sdesc">
						<b><?=$s['name'];?></b><br>
						<?=$s['desc'];?>
					</div>
					<div id="s_func_<?=$i;?>" class="sfunc">
						<?php foreach($s['func'] as $f) : ?>
							{GLOS:<?=$f['infovar'];?>_small}
						<?php endforeach; ?>
					</div>
					<div class="sprice">
						Setup <?=$currency_symbol;?><span id="s_setup_<?=$i;?>"><?=$grid[$i][$cpi]['setup'];?></span><br>
						<?=$currency_symbol;?><span id="s_rental_<?=$i;?>"><?=$grid[$i][$cpi]['rental'];?></span> / month<br>
						<span style="font-size: smaller">(<span id="s_months_min_<?=$i;?>"><?=$grid[$i][$cpi]['months_min'];?></span> months min)</span><br>
						<span id="s_ppm_text_<?=$i;?>" style="font-size: smaller"><?=$grid[$i][$cpi]['ppm_text'];?></span><br>
						<!-- <a href="<?=DMX_SELF;?>?dmx_action=show_fulltariff&dmx_index=<?=($i+1);?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=serviceplanselector" target="_blank" class="popup" onclick=" return dmx.<?=$comp_name;?>.show_tariffguide('service', '<?=$s['name'];?>', this);">Full Tariff</a> -->
					</div>
				</div>
			<?php endforeach; ?>
		</div>

		<div id="<?=$comp_name;?>_plans_on"></div>
		<div id="<?=$comp_name;?>_plans_box">
			<?php foreach($plans as $i => $p) : ?>
				<div id="<?=$comp_name;?>_p<?=$i;?>" class="optbox" onmouseover="" onmouseout="" onclick="dmx.<?=$comp_name;?>.update('plan', <?=$i;?>);">
					<input type="radio" name="dmx_plan" value="<?=$i;?>"<?php if ($i == $cpi) : ?> checked<?php endif; ?>>
					<div id="p_icon_<?=$i;?>" class="picon">
						<img src="<?=$dmx_glib;?>numbers/<?=$p['icon'];?>_32.gif" alt="<?=$p['name'];?>" width="73" height="32" border="0" class="infotext" />
						<span class="tipcontents">Select <?=$p['name'];?></span>
					</div>
					<div class="pdesc">
						<b><?=$p['name'];?></b><br>
						<?=$p['desc'];?>
					</div>
					<div class="pprice">
						Setup <?=$currency_symbol;?><span id="p_setup_<?=$i;?>"><?=$grid[$csi][$i]['setup'];?></span><br>
						<?=$currency_symbol;?><span id="p_rental_<?=$i;?>"><?=$grid[$csi][$i]['rental'];?></span> / month<br>
						<span style="font-size: smaller">(<span id="p_months_min_<?=$i;?>"><?=$grid[$csi][$i]['months_min'];?></span> months min)</span><br>
						<span id="p_ppm_text_<?=$i;?>" style="font-size: smaller"><?=$grid[$csi][$i]['ppm_text'];?></span><br>
						<!-- <a href="<?=DMX_SELF;?>?dmx_action=show_fulltariff&dmx_index=<?=($i+1);?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=serviceplanselector" target="_blank" class="popup" onclick="return dmx.<?=$comp_name;?>.show_tariffguide('plan', '<?=$p['name'];?>', this);">Full Tariff</a> -->
					</div>
				</div>
			<?php endforeach; ?>
		</div>

	</div>

	</form>
		
<?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">ERROR<br><?=$err_msg;?></span>
</div>
<!-- END ERROR HANDLING -->
<?php endif; ?>

</div>

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

</div>

<div id="<?=$comp_name;?>_tariffguide"><img src="<?=$dmx_glib;?>interface/ajax_loader_col1.gif" width="16" height="16" alt="" class="loaderpad"> Loading Tariff Guide</div>
<div id="<?=$comp_name;?>_typinv"><img src="<?=$dmx_glib;?>interface/ajax_loader_col1.gif" width="16" height="16" alt="" class="loaderpad"> Loading Example Invoice</div>

<!-- *********************************** -->
<!-- END SERVICE PLAN SELECTOR COMPONENT -->
<!-- *********************************** -->