<style>
						
#monedas{
	float:right;
	margin:18px 0;
	width:auto;
	position:relative;
	z-index:5000;
	right:0;
	cursor:pointer;
}
	
ul.currencies{
	display:none;
	padding:5px 10px;
	margin:16px 0;
	width:auto;
	position:absolute;
	float:right;
	overflow:hidden;
	}

ul.currencies li{
	width:auto;
	height:auto;
	text-align:left;
	list-style:none;
	}
ul.currencies li img{
	margin:5px 0px !important;
	float:left;
	}
ul.currencies li h6{
	margin:5px 0px !important;
	padding:0 5px;
	float:left;
	}
	
ul.currencies li img{
		border:1px solid #FFF;
}

.current_currency{
	float:right;
	position:relative;}
	
.caret{
	background:url('{$TEMPLATE_URL}/img/caret.png');
	width:9px !important;
	overflow:hidden;
	float:left;
	position:relative;
	top:5px;
	margin:0 10px;
	height:7px;
	}

</style>
<?php

if(isset($_GET['currency'])): $currency = $_GET['currency']; else: $currency = $_SESSION['currency']; endif;

	switch ($currency) {
    case '':
		$current_currency = 'mxn';
        break;
    case 'usd':
		$current_currency = 'usd';
        break;
    case 'gbp':
		$current_currency = 'gbp';
        break;
    case 'mxn':
		$current_currency = 'mxn';
        break;
    case 'eur':
		$current_currency = 'eur';
        break;
    case 'cop':
		$current_currency = 'cop';
        break;
    case 'ars':
		$current_currency = 'ars';
        break;
    case 'pen':
		$current_currency = 'pen';
        break;
    case 'uyu':
		$current_currency = 'uyu';
        break;
    case 'clp':
		$current_currency = 'clp';
        break;
    case 'vef':
		$current_currency = 'vef';
        break;} 
?>

<div id="monedas">
	<div class="current_currency">
    	<div><img style="float:left;" src="{$TEMPLATE_URL}/img/<?=$current_currency?>.png"> <b class="caret"></b></div>
    </div>

    <ul class="currencies">
        <li <? if($current_currency == 'usd'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=usd')"><img src="{$TEMPLATE_URL}/img/usd.png"></button></li>
        <li <? if($current_currency == 'gbp'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=gbp')"><img src="{$TEMPLATE_URL}/img/gbp.png"></button></li>
        <li <? if($current_currency == 'mxn'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=mxn')"><img src="{$TEMPLATE_URL}/img/mxn.png"></button></li>
        <li <? if($current_currency == 'eur'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=eur')"><img src="{$TEMPLATE_URL}/img/eur.png"></button></li>
        <li <? if($current_currency == 'clp'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=clp')"><img src="{$TEMPLATE_URL}/img/clp.png"></button></li>
        <li <? if($current_currency == 'vef'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=vef')"><img src="{$TEMPLATE_URL}/img/vef.png"></button></li>
        <li <? if($current_currency == 'uyu'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=uyu')"><img src="{$TEMPLATE_URL}/img/uyu.png"></button></li>
        <li <? if($current_currency == 'pen'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=pen')"><img src="{$TEMPLATE_URL}/img/pen.png"></button></li>
        <li <? if($current_currency == 'cop'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=cop')"><img src="{$TEMPLATE_URL}/img/cop.png"></button></li>
        <li <? if($current_currency == 'ars'):?>style="display:none; width:0px;"<? endif; ?>><button onclick="load_currency('{$SITE_URL}/{$SEO}/&currency=ars')"><img src="{$TEMPLATE_URL}/img/ars.png"></button></li>
    </ul>
</div>

{literal}
<script>

function load_currency(currency){
		$.ajax({
		  type: "GET",
		  url: currency,
		  success: function(res){
				document.location.reload(true);
			}
		 })
	
	}

	$(document).ready(function(){
		
		$('#monedas').hover(function(){$('.currencies').show().stop()},function(){$('.currencies').hide().stop()});
		
		});
</script>
{/literal}