window.addEvent('domready', function() {
	if( $('currencyButtons') ){
		els = $('currencyButtons').getChildren('input');
		
		els.each(function(cr){
			cr.addEvent('click',function(event){
				event.stop();
				mycur = false;
				regEx = /\[([A-Z]{3})\]/i;
				res = regEx.exec(cr.id);
		 		if( res[1].length == 3){
		 			mycur = res[1];
		 		}
	
		 		openCurrPop(mycur);
				
			});
		});
		
		if( $('basketChange') ){
			$('basketChange').addEvent('click',function(event){
			
				event.stop();
				openCurrPop();
						
			});
		}
	}
	
});

function openCurrPop(){

	var cur = typeof(arguments[0]) != 'undefined' ? arguments[0] : false;
	curUrl = '/change-your-country';
	if(cur){
		curUrl += '/q/cur-'+cur;
	}

	SqueezeBox.initialize();
	SqueezeBox.open(curUrl, {
		size: {x: 470, y: 320}
	});


}
