<?php
?>
<!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 $_SESSION['language_charset']; ?>"> 
<?php include(DIR_WS_MODULES.FILENAME_METATAGS); ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="<?php echo 'templates/'.CURRENT_TEMPLATE.'/stylesheet.css'; ?>">
<?php
// require theme based javascript
require('templates/'.CURRENT_TEMPLATE.'/javascript/general.js.php');

if (strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_CREATE_ACCOUNT)) {
	require('includes/form_check.js.php');
}

if (strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_ACCOUNT_PASSWORD )) {
	require('includes/form_check.js.php');
}
if (strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_ACCOUNT_EDIT )) {
	require('includes/form_check.js.php');
}
if (strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_ADDRESS_BOOK_PROCES )) {
  if (isset($_GET['delete']) == false) {
    include('includes/form_check.js.php');
  }
}
if (strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_CHECKOUT_SHIPPING_ADDRESS )or strstr($_SERVER['SCRIPT_FILENAME'],FILENAME_CHECKOUT_PAYMENT_ADDRESS)) {
	require('includes/form_check.js.php');
?>
<script language="javascript"><!--
function check_form_optional(form_name) {
  var form = form_name;

  var firstname = form.elements['firstname'].value;
  var lastname = form.elements['lastname'].value;
  var street_address = form.elements['street_address'].value;

  if (firstname == '' && lastname == '' && street_address == '') {
    return true;
  } else {
    return check_form(form_name);
  }
}
</script>
<?php
}
if (strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_POPUP_IMAGE )) {
	echo '<body onload="resize();"> ';
} else {
	echo '<body>';
}


$smarty->assign('navtrail',$breadcrumb->trail(' &raquo; '));
if (isset($_SESSION['customer_id'])) {
	$smarty->assign('logoff',xtc_href_link(FILENAME_LOGOFF, '', 'SSL'));
}
if ( $_SESSION['account_type']=='0') {
	$smarty->assign('account',xtc_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
   

  if (isset($_GET['error_message']) && xtc_not_null($_GET['error_message'])) {

	$smarty->assign('error','
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr class="headerError">
        <td class="headerError">'. htmlspecialchars(urldecode($_GET['error_message'])).'</td>
      </tr>
    </table>');

  }

  if (isset($_GET['info_message']) && xtc_not_null($_GET['info_message'])) {

$smarty->assign('error','
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr class="headerInfo">
        <td class="headerInfo">'.htmlspecialchars($_GET['info_message']).'</td>
      </tr>
    </table>');

  }

?>
