<?php
// Sheetal Added for customer greeting
/*
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce
  
  osCommRes, Services Online
  http://www.oscommres.com

  Copyright (c) 2005 osCommRes

  Released under the GNU General Public License
*/

// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
require(DIR_WS_LANGUAGES.'english/freeway_english.php');
define('DIR_WS_TEMPLATE_IMAGES', 'templates/Freeway/images/');
define('WELCOME_CUSTOMER', '<a href="%s">My Account</a>');
define('WELCOME_GUEST', 'Welcome <a href="%s">Guest</b>');
define('LOG_PAGE','<a href="%s">%s</a>');
$BOX_CONTENT_ICON='';
$INITIAL_WIDTH=1;
$template_file_name=$content;
$con_page = $content;
$HIDE_INDEX_TITLE=true;
$hide_row_top=true;
$CELL_PADDING_SUB=0;
$CONTENT_TOP_HEIGHT=5;
$hide_shopping_header=true;
$MASTER_BOX_HTML='<tr>
					<td width="{{INITIAL_WIDTH}}"></td><td class="{{CLASS}}" style="padding-left:{{SPACER}}">{{ICON}} <a href={{LINK_1}}>{{NAME}}</a></td>
				</tr>
				<tr>
					<td height="5"></td>
				</tr>';
			
if(!$joomla_include){
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<meta http-equiv="Page-Exit" content="BlendTrans(Duration=0.5)" />
<meta http-equiv="Page-Enter" content="BlendTrans(Duration=0.5)" />
<?php require(DIR_WS_INCLUDES . 'meta_tags.php');?>
<title><?php echo META_TAG_TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" /> 
<?php 
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
	if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) require(DIR_WS_INCLUDES . 'header_tags.php'); 
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
<style type="text/css">
	#pup {position:absolute; visibility:hidden; z-index:200; width:130; }
</style>
<?php if ($javascript) require(DIR_WS_JAVASCRIPT . $javascript);
if ((tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) || (tep_session_is_registered('contractor_first_name') && tep_session_is_registered('contractor_id')) ) {
      $greet = sprintf(WELCOME_CUSTOMER, tep_href_link(FILENAME_ACCOUNT));
      if(tep_session_is_registered('contractor_id')) $greet = sprintf(WELCOME_CUSTOMER, tep_href_link(FILENAME_CONTRACTOR_ENQUIRY));
	  $log_page = sprintf(LOG_PAGE,tep_href_link(FILENAME_LOGOFF),TEXT_LOGOFF);
    } else {
      $greet = sprintf(WELCOME_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
	  $log_page = sprintf(LOG_PAGE,tep_href_link(FILENAME_LOGIN),TEXT_LOGIN);
    }
// Sheetal Added for customer greeting
?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onLoad="javascript:move_cart()"  class="yui-skin-sam">
<!-- warnings //-->
<?php require(DIR_WS_INCLUDES . 'warnings.php'); ?>
<!-- warning_eof //-->

<!-- header //-->
<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<?php }
$styles=DIR_WS_HTTP_CATALOG.DIR_WS_TEMPLATES.DEFAULT_TEMPLATE.'/joomla_stylesheet.css';
if ($joomla_include) {
	if($javascript) require(DIR_WS_JAVASCRIPT . $javascript);
	if($styles!="") echo '<link rel="stylesheet" type="text/css" href="'.$styles.'">';	
}?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<?php
	if (DOWN_FOR_MAINTENANCE == 'true') {
	  $maintenance_on_at_time_raw = tep_db_query("select last_modified from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'DOWN_FOR_MAINTENANCE'");
	  $maintenance_on_at_time= tep_db_fetch_array($maintenance_on_at_time_raw);
	  define('TEXT_DATE_TIME', $maintenance_on_at_time['last_modified']);
	}
	?>
	   <td valign="top">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td valign="top">
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
					<tr>
						<?php
						$columns_total_width=0;
						if (DISPLAY_COLUMN_LEFT == 'yes')  {
						// WebMakers.com Added: Down for Maintenance
						// Hide column_left.php if not to show
						if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
						if(!$joomla_include) {							
						?>
						<td class="cell_border_gray" width="1"></td>
							<td id="boxes" valign="top" width="<?php echo BOX_WIDTH_LEFT+50; ?>">
							<table border="0" width="100%" cellspacing="0" cellpadding="0" id="infoboxes">
								<!-- left_navigation //-->
								<?php  require(DIR_WS_INCLUDES . 'column_left.php'); ?>
								<!-- left_navigation_eof //-->
							</table>
							</td>
							<td class="cell_border_gray" width="1"></td>
						<?php
						  }
						 }
						}
						?>
						<script language="javascript">
							function changeMenuStyle(element,mode){
								if (mode==1){
									element.className="menuOver";
								} else if (mode==2) {
									element.className="mainB";
								} else if (mode==3) {
									element.className="footerMenuOver";
								} else if (mode==4) {
									element.className="main";
								}
							}
						</script>
						<!-- content //-->
						<td valign="top">
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td valign="top">
								 <?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
								?>
								<table border="0" width="100%" cellspacing="0" cellpadding="2" id="headerError">
								  <tr>
									<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
								  </tr>
								</table>
								<?php
								  }
								  ?>
								<table width="100%" cellpadding="<?php echo $content==CONTENT_INDEX_DEFAULT?'0':'0';?>" cellspacing="0"  border="0" class="contentBack">
									<tr>
										<td id="content_text" valign="top">
										<table border="0" width="100%" cellpadding="<?php echo $content==CONTENT_INDEX_DEFAULT?'0':'4';?>" cellspacing="0">
											<tr>
												<td valign="top">
												<?php										
												  if (isset($content_template)) { 
													 require(DIR_WS_CONTENT . $content_template);
												  } else if (isset($GLOBALS["TPL_CONTENT"])){ 
												  	echo $GLOBALS["TPL_CONTENT"];
												  } else {
													 if (file_exists(DIR_FS_CATALOG . DIR_WS_TEMPLATES . TEMPLATE_NAME . "/content/" . $content . '.tpl.php')){
														require(DIR_FS_CATALOG . DIR_WS_TEMPLATES . TEMPLATE_NAME . "/content/" . $content . '.tpl.php');
													 } else { 
														require(DIR_WS_CONTENT . $content . '.tpl.php');
													 }
												  }
												?>
												</td>
											</tr>
										</table>
										</td>
									</tr>
									<!--  Footer Links Start !-->
									<?php if(!$joomla_include){ ?>
									<tr id="gap" style="height:10">
										<td valign="bottom" class="contentBack1">
										<table cellpadding="0" cellspacing="0" border="0" width="100%">
											<?php											
											if ($FOOTER_SHOPPING && $cart_count_elements>0) {?>
											<tr>
												<td class="contentBack">
												<!--  Shopping Cart Start !-->
												<?php 
												require(DIR_WS_LANGUAGES . $language . '/shopping_cart.php'); 
												require(DIR_WS_TEMPLATES . 'content/shopping_cart.tpl.php'); 
												?>
												<!--  Shopping Cart End !-->
												</td>
											</tr>
									<?php } else {?>
									<tr>
										<td valign="top"><?php echo tep_draw_separator('pixel_trans.gif',1,20); ?></td>
									</tr>
									<?php }  ?>											
											<tr>
												<td class="cell_background_footer1" valign="bottom">
													<table cellpadding="0" cellspacing="0" border="0" width="80%" align="center" id="title_search">
														<tr>
															<td height="27" valign="middle"><?php echo tep_template_image("arrow2.gif");?></td>
															<td class="title_search" height="27" valign="middle" align="left"><?php echo '<a href='.tep_href_link(FILENAME_DEFAULT,'stcPath=1').'>'.BOX_INFORMATION_SHIPPING.'</a>';?></td>
															<td height="27" valign="middle"><?php echo tep_template_image("arrow2.gif");?></td>
															<td class="title_search" height="27" valign="middle" align="left"><?php echo '<a href='.tep_href_link(FILENAME_DEFAULT,'stcPath=2').'>'.BOX_INFORMATION_PRIVACY.'</a>';?></td>
															<td height="27" valign="middle"><?php echo tep_template_image("arrow2.gif");?></td>
															<td class="title_search" height="27" valign="middle" align="left"><?php echo '<a href='.tep_href_link(FILENAME_DEFAULT,'stcPath=3').'>'.BOX_INFORMATION_CONDITIONS.'</a>';?></td>
															<td height="27" valign="middle"><?php echo tep_template_image("arrow2.gif");?></td>
															<td class="title_search" height="27" valign="middle" align="left"><?php echo '<a href='.tep_href_link(FILENAME_CONTACT_US).'>'.BOX_INFORMATION_CONTACT.'</a>';?></td>
														</tr>
													</table>
												</td>			
											</tr>
										</table>
										</td>
									</tr>
									<?php } ?>
									<!--  Footer Links End !-->
								</table>
								</td>
							</tr>
						</table>
						</td>
						<!-- content_eof //-->
						<?php
						// WebMakers.com Added: Down for Maintenance
						// Hide column_right.php if not to show
						if (DISPLAY_COLUMN_RIGHT == 'yes')  {
						if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
						if(!$joomla_include){
						?>
							<td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top">
							<table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>"  id="infoboxes">
								<!-- right_navigation //-->
								<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
								<!-- right_navigation_eof //-->
							</table>
							</td>
						<?php
						   } 
						  } 
						 }
						?>
									<script language="javascript">
										function move_cart(){
											var count = 0;
											if(document.getElementById("boxes") && document.getElementById("content_text"))
												count = document.getElementById("boxes").offsetHeight - document.getElementById("content_text").offsetHeight;
											if(count>0){
												if(document.getElementById("gap"))document.getElementById("gap").style.height=count;
											}
										}
									</script>
									</tr>
								</table>
								</td>
							</tr>
						</table>
						</td>
		</tr>
	</table>
<?php if(!$joomla_include) require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/footer.php'); ?>
<?PHP //checking the conversion code
	require(DIR_WS_INCLUDES . '/googly.php');
	?>
</body>
</html>