<?php

// header.php
// -----------------------------------------------------------------------------
// The common header for all dmABS web pages
//
// Project    > A16-dmABS-1.5-Feb09
// Copyright  > (C) Digital Mail Limited (2005 - 2009)
// Author     > RAK for DML
// -----------------------------------------------------------------------------

include_once(DOCROOT . $abs_root . '/config/tech_options.php');
include_once('abs_lib.php');
include_once('abs_run.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php if ($abs_title) : ?><?=$abs_title;?><?php else : ?>{SUB:company_brandname} ::: advanced telecommunications<?php endif; ?></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="<?=$abs_description;?>">
<meta name="keywords" content="<?=$abs_keywords;?>">
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="7 days">

<meta name="Project" content="A16-dmABS-1.6-Feb09">
<meta name="Version" content="1.6.0.A">
<meta name="Date" content="17-03-2009">
<meta name="Copyright" content="Digital Mail Limited 2005/2006">
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">

<!-- dmABS STYLESHEETS & JS-->
<link href="<?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/css/layout.css" rel="stylesheet" type="text/css" media="All">
<link href="<?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/css/typography_and_colours.css" rel="stylesheet" type="text/css" media="All">
<script language="javascript" src="<?=$abs_root;?>/js/abs_interface.js" type="text/javascript"></script>

<?php if ($abs_sitemode != 'proplus') : ?>
<!-- Stylesheet overrides generated from $abs_opt -->
<style type="text/css">
<?=$abs_header_bg;?>
#header, .header_bar { background-color: <?=$abs_opt['header_block_colour'];?>; }
#header, .header_bar, #header a { color: <?=$abs_header_text_col;?>; }
#header a { border-bottom: 1px solid <?=$abs_header_text_col;?>; }

/* h1, h2 { color: <?=$abs_opt['col1'];?>; } */

</style>
<!-- End stylesheet overrides generated from $abs_opt -->
<?php endif; ?>

<!-- ************************** -->
<!-- (1) INITIALISE XCOMPONENTS -->
<!-- ************************** -->
<?php
dmx_initialise_trolley();
$tst_additional_params_json = abs_get_tst_additional_params_json();
?>

<!-- **************************** -->
<!-- (2) SEED ADDITIONAL TST DATA -->
<!-- **************************** -->

<script language="javascript" type="text/javascript">
/*<![CDATA[[*/
try
{
	var tst_additional_params = <?=$tst_additional_params_json;?>;
}
catch(error) {;}
/*]]>*/
</script>

<script language="javascript" type="text/javascript">
/*<![CDATA[[*/
var abs_root = '<?=$abs_root;?>';
/*]]>*/
</script>

<!-- *************** -->
<!-- (3) INCLUDE TST -->
<!-- *************** -->
<?php
dmx_include_tst();
?>
</head> <!-- XCom & TST modifications added -->
<?php
// $abs_login_status = get_login_status(); // Get login status XComponent in its unboxed form
ob_start(array($abs_glos, 'substitute'));
abs_prepend_dynamic_substitutions(); // Only known once trolley session has been initialised
?>

<body>

<?php if (!isset($abs_no_header)) : // Miss page header for popups ?>
<div id="centred_page">
		
<?php include('toolbar.php'); // Include admin toolbar ?>

<div id="spacer_block_top"></div>

<!--HEADER -->
<div id="header" onmouseover="sub_menu_hide();">
	<div id="header_content">
		<div id="header_logo_contact">
		
			<a href="<?=$abs_root;?>/index.php" style="border: 0px;">
			<?php if ($abs_opt['company_logo'] != '') : ?>
			<img src="{SUB:company_logo}" alt="{SUB:company_brandname}" border="0">
			<?php else : ?>
			<span id="displayname">{SUB:company_displayname}</span>
			<?php endif; ?>
			</a>
		
			<div>
				<span id="call_brand_on"><span ondblclick="abs_kill_tst('<?=$abs_root;?>', event);">C</span>all {SUB:company_brandname} <span ondblclick="abs_toolbar_show(1); return false;">on</span><br></span>
				<span id="big_contact_no">{SUB:contact_tel}</span><br>
				<span id="other_contact_channels">
					<?php if ($abs_opt['whoson'] != 'OFF') : ?>
					<span style="white-space: pre;">  </span>
						<?php if ($abs_chat_status) : ?>
							<a href="#" onclick="window.open('http://<?=$abs_opt['whoson'];?>/chat/chatstart.htm?domain=<?=$_SERVER['HTTP_HOST'];?>&bg=http://<?=$_SERVER['HTTP_HOST'];?><?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/gen_images/chat_bg.jpg', 'new_win', 
'width=484,height=361'); return false;"><img src="<?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/gen_images/icon_chat_on_<?=$abs_header_text_col;?>.gif" alt="" width="116" height="14" border="0"></a>
						<?php else : ?>
							<img src="<?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/gen_images/icon_chat_off_<?=$abs_header_text_col;?>.gif" alt="" width="116" height="14" border="0">
						<?php endif; ?>
					<?php endif; if ($abs_opt['contact_email']) :?>
					<span style="white-space: pre;">  </span>
					<img src="<?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/gen_images/icon_email_<?=$abs_header_text_col;?>.gif" alt="" width="26" height="14" border="0">
					<a href="mailto:{SUB:contact_email}">Email us</a>
					<?php endif; if ($abs_opt['contact_skype']) : ?>
					<span style="white-space: pre;">  </span>
					<img src="<?=$abs_root;?>/themes/<?=$abs_opt['theme'];?>/gen_images/icon_skype_<?=$abs_header_text_col;?>.gif" alt="" width="24" height="14" border="0">
					<a href="callto://{SUB:contact_skype}">Skype us</a>
					<?php endif; ?>
				</span>
			</div>

		</div>
	</div>
</div>
<!-- END HEADER -->

<!-- TABBED MENU -->
<?php
// Generate menu and footer links
$abs_menu = array();
$dtype = strtolower($abs_opt['dealer_type']);
include(DOCROOT . $abs_root . '/config/menudef.php');
if (!$abs_opt['dealer_tab']) unset($abs_menu[5]);
list($abs_tab_menu_html, $abs_sub_menu_html, $abs_hidden_menu_html, $abs_footer_links) = abs_construct_menu($abs_menu, $_SERVER['PHP_SELF']);
?>
<?=$abs_tab_menu_html;?>
<!-- END TABBED MENU -->
<div id="sub_menu_container">
	<!-- VISIBLE SUB-MENU -->
	<?=$abs_sub_menu_html;?>
	<!-- END VISIBLE SUB-MENU -->

	<div style="padding:10px; border: 3px #888 solid; display: none;">
		<?php
		if (!$abs_current_tariff) echo('TARIFF NOT SET IN XPARAMS!<br />');
		print_r($abs_xstate);
		?>
	</div>
	<div id="spacer_block_under_menu"></div>
<?php endif; // End of Miss page header for popups ?>

<?php ob_end_flush(); ob_start(array($abs_glos, 'substitute')); ?>
