//# -*- coding: utf-8 -*-
var cssTab = null ;
function createUI()
{
	jsFF.changeLocale(new_locale);
	
	var strChUserAgent = navigator.userAgent;
	var intSplitStart = strChUserAgent.indexOf("(",0);
	var intSplitEnd = strChUserAgent.indexOf(")",0);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

	if(strChMid.indexOf("MSIE") != -1) 
		IE=true;
	if(strChMid.indexOf("MSIE 6") != -1) 
		IE6 = true;
	if(strChMid.indexOf("MSIE 7") != -1) 
		IE7 = true;
	
	$('select_station').selectedIndex = 0 ;
	$('select_magasin').selectedIndex = 0 ;
	
	if(station_courante > 0 && station_courante_jumelee!='')
	{
		confirmation_choix_station(station_courante, station_courante_jumelee) ;
		for(var i=0 ; i<$('select_magasin').options.length ; i++)
		{
			if($('select_magasin').options[i].value == magasin_courant)
			{
				$('select_magasin').selectedIndex = i ;
				break ;
			}
		}
	}
	window.setTimeout('modifie_promotions();', 10000);
	//affiche_magasins('', true);
}

// --------------------------- Fonctions de choix des stations
function confirmation_choix_station(id_station, jumelage)
{
	if(typeof(id_station) != 'undefined' && id_station > 0 && typeof(jumelage) != 'undefined')
	{
		for(var i=0 ; i<$('select_station').options.length ; i++)
			if($('select_station').options[i].value == id_station && $('select_station').options[i].getAttribute('jumelage') == jumelage)
			{
				$('select_station').selectedIndex = i ;
				break;
			}
	}
	choix_station();
	
}

function choix_station()
{		
	var id_station = $('select_station').options[$('select_station').selectedIndex].value;
	var jumelage = $('select_station').options[$('select_station').selectedIndex].getAttribute('jumelage') ;
	window.location.href="ma_station.php?id_station="+id_station+'&j='+jumelage;
}
