<?php

// tariffguide.tpl
// -----------------------------------------------------------------------------
// Tariff Guide template
//
// Revision   > $Rev: 83 $
// Date		  > $Date: 2009-06-29 11:25:53 +0100 (Mon, 29 Jun 2009) $
// Author     > RAK for DML
// Copyright  > (C) Digital Mail Limited (2005-2009)
// -----------------------------------------------------------------------------

?>

<!---------------------------->
<!-- TARIFF GUIDE 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 = 'tariffguide';

// DECLARE VARIABLES
dmx.<?=$comp_name;?>.toptabs = new Array(); // array containing the IDs of the tabs
dmx.<?=$comp_name;?>.t2tabs  = new Array(); // array containing the IDs of the tabs

// -------------------------------------------------------------------------------------------------
// COMPONENT METHODS
	
dmx.<?=$comp_name;?>.switchtab = function(ref, tabarr)
{
	// show the tab with id tab_<ref>, and hide all the others (named in dmx.<?=$comp_name;?>.tabs)
	$('tab_' + ref).className = 'current';
	$('box_' + ref).style.display = 'block';
	for(i=0; i<tabarr.length; i++)
	{
		if (ref == tabarr[i]) continue;
		$('tab_' + tabarr[i]).className = '';
		$('box_' + tabarr[i]).style.display = 'none';
	}
}

dmx.<?=$comp_name;?>.kill = function()
{
	$('<?=$comp_name;?>').empty();
	$('<?=$comp_name;?>').style.display = 'none';
}

</script>

<style type="text/css">

#<?=$comp_name;?>_minusmargin
{
	margin-left: -10px;
	margin-right: -10px;
}

#box_<?=$comp_name;?>_outbound,
#box_<?=$comp_name;?>_os,
#box_<?=$comp_name;?>_op
{
	display: none;
}

.panel
{
	margin-top: 15px;
}

#<?=$comp_name;?>_plusbar
{
	padding: 3px;
	margin: 15px 0px 0px 0px;
	text-align: center;
	font-weight: bold;
}

/* T2 Styles */

.column1
{
	width: 120px !important;
	background-image: url("/dmx/core/b0/images/core_css/tg_t2_arrow.jpg");
	background-repeat: no-repeat;
}
.t2_current .column1
{
	background-image: url("/dmx/core/b0/images/core_css/tg_t2_arrow_focus.jpg");
	background-repeat: no-repeat;
}

.t2_txt
{
	position: relative;
	top: 38px;
	width: 95px;
	color: #333;
	font-weight: normal;
	line-height: 130%;
	text-align: right;
}

.column2 { width: 114px; }


td.col1i
{
	font-weight: bold;
}

td small
{
	font-size: 10px;
}

/* OB Styles */
#box_<?=$comp_name;?>_outbound h1
{
	color: #333;
	font-size: 11px;
	border-bottom: 1px solid #669;
	margin-bottom: 0px;
}

/* Overrule standard B0 styles for additional compactness */
.dmb0 .padded_table_thin th, .dmb0 .padded_table_thin td { padding: 1px 3px; }

table.ob
{
	width: 100%;
}

.ob th, .ob td
{
	font-size: 7pt;
	/* font-family: courier, monospace; */
}

.ob tr.plan th
{
	color: #FFF;
	background-color: #669;
	text-align: center;
	font-weight: bold;
}

.ob tr.time_zone th
{
	background-color: #E6E6FF;
	text-align: center;
	font-weight: bold;
}

.ob tr.cost_break th
{
	background-color: #F3F4FF;
	text-align: right;
}

.ob thead td
{
	text-align: right;
	font-weight: bold;
}

.ob tbody th
{
	text-align: right;
	font-weight: bold;
}

.ob tbody td
{
	text-align: right;
}

.ob tbody tr.col2f td
{
	background-color: #FFF3D9;
}

.ob tbody tr.col1fainter td
{
	background-color: #F3F4FF;
}

</style>

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

<?php if ($showheader && $showborder) : ?>
<h1 class="bordered">
<?php if ($ajax) : ?><a href="#" onclick="dmx.<?=$comp_name;?>.kill();"><img src="<?=$dmx_glib;?>interface/close_15.gif" alt="" width="15" height="15" border="0" class="close"></a><?php endif; ?>
Full Tariff Guide
</h1>
<?php elseif ($showheader) : ?>
<h1>Full Tariff Guide</h1>
<?php endif; ?>

<?php if ($showborder) : ?>
<div class="border col1fainter" style="<?=$box_size;?> padding-bottom: 0px; border-bottom: 0px;">
<?php else: ?>
<div style="<?=$box_size;?>">
<?php endif; ?>

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

<?php if ($showpreamble) : ?>
	<p>
	This guide gives comprehensive information about cost of ownership (rental + the cost of calls)..
	</p>
	
	<p>
	<b>The cost of calls has two components:</b><br>
	<b>1) The Tariff 2 (T2) call cost</b> (for the inbound leg of the call)<br>
	<b>2) the outbound (OB) call cost</b> (which varies according to destinations)
	</p>
	
	<p>
	CALL COST = T2 COST + OB COST
	</p>
<?php endif; ?>

<!-- TABBED LINKS -->
<ul class="tabs"<?php if ($showheader) : ?> id="<?=$comp_name;?>_minusmargin"<?php endif; ?>>
	<li><a id="tab_<?=$comp_name;?>_t2_comp" class="current infotext" href="#" onclick="this.blur(); dmx.<?=$comp_name;?>.switchtab('<?=$comp_name;?>_t2_comp', dmx.<?=$comp_name;?>.toptabs); return false;">T2 Comparison<span class="tipcontents"><b>Base Pricing:</b> The fixed costs of using the number</span></a></li>
	<li><a id="tab_<?=$comp_name;?>_outbound" class="infotext" href="#" onclick="this.blur(); dmx.<?=$comp_name;?>.switchtab('<?=$comp_name;?>_outbound', dmx.<?=$comp_name;?>.toptabs); return false;">T2 + Outbound<span class="tipcontents"><b>Outbound Pricing:</b> Variable divert-destination specific costs</span></a></li>
</ul>
<!-- END TABBED LINKS -->

</div>
<?php if ($showborder) : ?>
<div class="border" style="<?=$box_size;?> padding-top: 0px; border-top: 0px;">
<?php else: ?>
<div style="<?=$box_size;?>">
<?php endif; ?>

<br>	

<div id="box_<?=$comp_name;?>_t2_comp">

	<div class="t2_current">
		<?php $panel->render('xcom-dmshop-tariffguide', $t2_current); ?>
	</div>

	<!-- TABBED LINKS -->
	<ul class="tabs">
		<li><a id="tab_<?=$comp_name;?>_onr" class="current infotext" href="#" onclick="this.blur(); dmx.<?=$comp_name;?>.switchtab('<?=$comp_name;?>_onr', dmx.<?=$comp_name;?>.t2tabs); return false;">Other Number Ranges<span class="tipcontents">Other number ranges on<br />the same service and plan</span></a></li>
		<li><a id="tab_<?=$comp_name;?>_os" class="infotext" href="#" onclick="this.blur(); dmx.<?=$comp_name;?>.switchtab('<?=$comp_name;?>_os', dmx.<?=$comp_name;?>.t2tabs); return false;">Other Services<span class="tipcontents">Other services on the<br />same number range and plan</span></a></li>
		<li><a id="tab_<?=$comp_name;?>_op" class="infotext" href="#" onclick="this.blur(); dmx.<?=$comp_name;?>.switchtab('<?=$comp_name;?>_op', dmx.<?=$comp_name;?>.t2tabs); return false;">Other Plans<span class="tipcontents">Other plans on the<br />number range and service</span></a></li>
	</ul>
	<!-- END TABBED LINKS -->

	<div id="box_<?=$comp_name;?>_onr">
		<?php foreach($t2_ranges as $id) : ?>
			<div class="panel">
				<?php $panel->render('xcom-dmshop-tariffguide', $id); ?>
			</div>
		<?php endforeach; ?>
	</div>
	<script language="javascript">dmx.<?=$comp_name;?>.t2tabs.push('<?=$comp_name;?>_onr');</script>

	<div id="box_<?=$comp_name;?>_os">
		<?php foreach($t2_services as $id) : ?>
			<div class="panel">
				<?php $panel->render('xcom-dmshop-tariffguide', $id); ?>
			</div>
		<?php endforeach; ?>
	</div>
	<script language="javascript">dmx.<?=$comp_name;?>.t2tabs.push('<?=$comp_name;?>_os');</script>

	<div id="box_<?=$comp_name;?>_op">
		<?php foreach($t2_plans as $id) : ?>
			<div class="panel">
				<?php $panel->render('xcom-dmshop-tariffguide', $id); ?>
			</div>
		<?php endforeach; ?>
	</div>
	<script language="javascript">dmx.<?=$comp_name;?>.t2tabs.push('<?=$comp_name;?>_op');</script>

</div>
<script language="javascript">dmx.<?=$comp_name;?>.toptabs.push('<?=$comp_name;?>_t2_comp');</script>

<div id="box_<?=$comp_name;?>_outbound">
	
	<div class="t2_current">
		<?php $panel->render('xcom-dmshop-tariffguide', $t2_current); ?>
	</div>

	<div id="<?=$comp_name;?>_plusbar" class="col1i">
		Full cost = T2 cost (see above) + destination-dependant outbound (OB) cost (see below)
	</div>
	
	<?php foreach($ob_tariffs as $id) : ?>
		<div class="panel">
			<?php $panel->render('xcom-dmshop-tariffguide', $id); ?>
		</div>
	<?php endforeach; ?>

</div>
<script language="javascript">dmx.<?=$comp_name;?>.toptabs.push('<?=$comp_name;?>_outbound');</script>

<?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;?>
	</div>
<!-- END ERROR HANDLING -->
<?php endif; ?>

<?php // $panel->debug->display(); ?>

</div>

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

<!-------------------------------->
<!-- END TARIFF GUIDE COMPONENT -->
<!-------------------------------->
