<?php  //include('includes/FilePermissions.php');

   /* $Revision: 1.43 $ */
	// Titles and screen header
	// Needs the file config.php loaded where the variables are defined for
	//  $rootpath
	//  $title - should be defined in the page this file is included with
	if (!headers_sent()){
		header('Content-type: text/html; charset=' . _('iso-8859-1'));
	}
	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
			"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
	echo '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>' . $title . '</title>';
	echo '<link rel="stylesheet" type="text/css" href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/style.css" />';
	echo '<link rel="stylesheet" type="text/css" href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/forms.css" />';
	echo '<link rel="shortcut icon" href="'. $rootpath.'/favicon.ico" />';
	echo '<link rel="icon" href="' . $rootpath.'/favicon.ico" />';
	echo '<meta http-equiv="Content-Type" content="text/html; charset=' . _('ISO-8859-1') . '" />';
	echo '<link href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/default.css" rel="stylesheet" type="text/css" />';
	echo '<script src="'.$rootpath.'/javascripts/jquery-1.6.1.min.js" type="text/javascript"></script>';
	echo '<script src="'.$rootpath.'/javascripts/menu.js" type="text/javascript"></script>';
		echo ' <script language="javascript" type="text/javascript" src="js/function-ajax.js"></script>';

	/* JS Calendar */
echo '<link type="text/css" rel="stylesheet" href="'.$rootpath.'/jscal/css/jscal2.css" />';
echo '<link type="text/css" rel="stylesheet" href="'.$rootpath.'/jscal/css/border-radius.css" />';
echo '<link id="skin-steel" title="Steel" type="text/css" rel="alternate stylesheet" href="'.$rootpath.'/jscal/css/steel/steel.css" />';
echo '<link id="skin-win2k" title="Win 2K" type="text/css" rel="alternate stylesheet" href="'.$rootpath.'/jscal/css/win2k/win2k.css" />';
echo '<link id="skin-matrix" title="Matrix" type="text/css" rel="alternate stylesheet" href="'.$rootpath.'/jscal/css/matrix/matrix.css" />';
echo ' ';
echo '<script type="text/javascript" src = "'.$rootpath.'/javascripts/MiscFunctions.js"></script>';
echo '<link id="skinhelper-compact" type="text/css" rel="alternate stylesheet" href="'.$rootpath.'/jscal/css/reduce-spacing.css" />';

	
echo '<script src="'.$rootpath.'/jscal/js/jscal2.js"></script>';
echo '<script src="'.$rootpath.'/jscal/js/lang/en.js"></script>';
?>
<link rel="stylesheet" href="css/jquery.ui.all.css">

<script src="js/jquery-1.5.1.js"></script>
<script src="ui/jquery.ui.core.js"></script>
<script src="ui/jquery.ui.widget.js"></script>
<script src="ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="js/dynamicRow.js"></script>
<script src="js/tax_calculation.js"></script>
<script src="js/add_mrn.js"></script>

<script>
 $(function() {
$(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' ,changeMonth: true,
		changeYear: true,
		yearRange: '-80:+20'});
});
 function popup(url,width,height) 
{
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
 }
 </script>
<?php 	
	echo '</head>';
	echo '<body>';
	echo '<table class="callout_main" cellpadding="0" cellspacing="0">';
	echo '<tr>';
	echo '<td colspan="2" rowspan="2">';
	echo '<table class="main_page" cellpadding="0" cellspacing="0">';
	echo '<tr>';
	echo '<td>';
	echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" >';
	echo '<tr>';
	echo '<td>';
	echo '<div id="header">';
	if ($title AND substr($title,0,4) != 'Help') {
		echo '<table cellpadding="0" cellspacing="0" border="0" id="quick_menu" class="quick_menu">';
		echo '<tr>';
		echo '<td align="left" class="quick_menu_left">';
// Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail.

		echo '<div class="logo"><img src="'.$rootpath.'/css/'.$theme.'/images/login/acg-logo.png" TITLE="' . _('Company') . '" ALT="' . _('Company') . '" '.'width="60"'.' height="40"'.'style="margin:2px 0px 3px 15px;"></div>';
		echo '<div class="cname"> ' .$s->GetFieldValue('companies',"CompanyId='".$_SESSION['ACGCompanyId']."'" ,'CompanyName') . '<br><span style="font-size:12px; font-weight:normal;"></span></div>'.'<div class="userappear"><a href="' .  $rootpath . '/UserSettings.php?' . SID . '"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" TITLE="User" ALT="' . _('User') . '"> ' . stripslashes($_SESSION['UsersRealName']) .'</a></div>';
// Make the title text a class, can be set to display:none is some themes
		
		echo ' </td>';
		echo '<td class="quick_menu_tabs">';
		echo '<table cellpadding="0" cellspacing="0" class="quick_menu_tabs"><tr>';
		echo '<td class="quick_menu_tab" align="center"><a accesskey="1" href="' .  $rootpath . '/index.php?' . SID . '"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>';
		if (count($_SESSION['AllowedPageSecurityTokens'])>1){
			/*echo '<td class="quick_menu_tab" align="center"><a accesskey="2" href="' .  $rootpath . '/Show_client.php?' . SID . '"><span style="text-decoration:underline;">2</span> ' . _('Client') . '</a></td>';*/
			/*echo '<td class="quick_menu_tab" align="center"><a accesskey="4" href="' .  $rootpath . '/SelectSupplier.php?' . SID . '"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>';*/

			/*$DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" accesskey="8" href="' .  $rootpath . '/doc/Manual/ManualContents.php?' . SID . '"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>';*/

			if (substr($_SESSION['Language'],0,2) !='en'){
				if (file_exists('locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php')){
					echo '<td class="quick_menu_tab" align="center"><a target="_blank" accesskey="8" href="' .  $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php' . SID . '"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>';
				} else {
					echo $DefaultManualLink;
				}
			} else {
					echo $DefaultManualLink;
			}
		}
		echo '<td class="quick_menu_tab" align="center"><a accesskey="0" href="' . $rootpath . '/Logout.php?' . SID . '" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> '  . _('Logout') . '</a></td>';
		echo '</tr></table>';
		echo '</td></tr>';
		echo '</table>';
		include('includes/module_menu.php');
		echo '</div>';
	}
echo '</td>';
echo '</tr>';
echo '</table>';
?>
