<?php
/*
  osCommerce, Open Source E-Commerce Solutions 
http://www.oscommerce.com 

Copyright (c) 2003 osCommerce 

osCommRes, Services Oline 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare 

Released under the GNU General Public License
*/
// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
?>
<!-- currencies //-->
<tr>
	<td>
<?php
	if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
		if(!defined('BOX_HEADING_CURRENCIES'))define('BOX_HEADING_CURRENCIES', 'Currencies');
		$info_box_contents = array();
		$info_box_contents[] = array('text'  =>  BOX_HEADING_CURRENCIES );
		new infoBoxHeading($info_box_contents, true, true);

		$select_currency_box='<select name="currency" onChange="this.form.submit();" style="width:150px">';
		reset($currencies->currencies);
		while (list($key, $value) = each($currencies->currencies)) {
			$select_currency_box .= '<option value="' . $key . '"';
			// $currency is a session variable
			if ($currency == $key) {
				$select_currency_box .= ' SELECTED';
			}
			$select_currency_box .= '>' . $value['title'] . '</option>';
		}
		$select_currency_box .= "</select>";
 		$select_currency_box .= tep_hide_session_id();

		$hidden_get_variables = '';
		reset($HTTP_GET_VARS);
		while (list($key, $value) = each ($HTTP_GET_VARS)) {
			if ( ($key != 'currency') && ($key != tep_session_name()) ) {
			  $hidden_get_variables .= tep_draw_hidden_field($key, $value);
			}
		}
		if (getenv('HTTPS') == 'on') $connection = 'SSL';
		else $connection = 'NONSSL';
		
		$select_currency_box= '<form name="currencies" method="get" action="' . tep_href_link(basename($PHP_SELF), '', $connection, false) . '">' . $select_currency_box . $hidden_get_variables . '</form>';

		$info_box_contents = array();
		$info_box_contents[] = array('align' => 'center',
								   'text'  => '<table border="0" cellpadding="0" cellspacing="0"><tr><td height="30">' . $select_currency_box . '</td></tr></table>'
								  );
		new infobox($info_box_contents);
		
		$info_box_contents = array();
		$info_box_contents[] = array('align' => 'left',
									'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
								  );
		new infoboxFooter($info_box_contents, true, true);
	}
?>
     </td>
</tr>
<!-- currencies_eof //-->
