setCurrencies = function(){
	if($j('#devise')){
		$j('#devise').children('.selected').click(function(a){
			$j('#devise ul').removeClass('none').addClass('show');
				
			$j('#devise ul a').click(function(b){
				$j('#currency').val($j(this).attr('rel'));
				$j('#chgCurrency').trigger('submit');
				b.preventDefault();
			});
			
			$j('#devise').mouseleave(function(){
				$j('#devise ul').removeClass('show').addClass('none');
			});
			
			a.preventDefault();
		});
	}
}

prepareToggleShow = function(){
	if($j('.toggleShow')) {
		$j('.toggleShow').click(function(e){
			var toggleElem = 	'.' + $j(this).attr('id') + '_toggle';	
			$j(toggleElem).toggleClass('none');
			//e.preventDefault();
		});
	}	
}

/**
 * This function will add a target _blank effect with the onclick attribute
 * on any css selector (i.e a.blank => all the a with the class blank)
 *
 * @author Francois Lavertu
 */
addTargetBlank = function(sCssSelector){
    $j(sCssSelector).click(function(e){
        // check if the element has the href attribute
        if($j(this).attr('href')){
            window.open($j(this).attr('href'));
            e.preventDefault();
        }
    });
}

$j(document).ready(function () {
	addTargetBlank('.blank');
	setCurrencies();
	prepareToggleShow();
	$j('.contentHolder li:first-child').addClass('noBorder');
});
