//==================================================================================================================
// variable URL
//
var nomvar=window.name;
var nom_url=new Array(29);
var alt_url=new Array(29);

nom_url = [ "./trains.htm" , "./trains_jouef.htm" , "./trains_roco.htm" , "./trains_decors.htm" , "./trains_pieces.htm" , "./trains_rails.htm" , "./trains_revues.htm" , "**" , 
		"./default.htm" , "./technique.htm" , "./trains_O.htm" , "./trains_N.htm" , "./maquettes.htm" , "./tank.htm" , "./voitures.htm" , "./rcboat.htm" , "./divers.htm" , "**" , 
		"./index.html" , "./accueil.htm" , "./information.htm" , "./test_HO.htm" , "./suivi.htm" , "./perso.htm" , "./jouef.htm" , "./achat.htm" , "**" , "./contact.htm" , "./vitrine.htm"];

if (!document.cookie)
{
	alt_url = [ "TRAINS ECHELLE HO" , "TRAINS ECHELLE HO : JOUEF" , "TRAINS ECHELLE HO : ROCO" , "TRAINS ECHELLE HO : DECORS" , "TRAINS ECHELLE HO : PIECES" , "TRAINS ECHELLE HO : RAILS & ACC. ELEC" , "TRAINS : LIVRES, CATALOGUES, SNCF ..." , 
		    "**" , "TRAINS : LA SUITE" , "TECHNIQUE : PONT TOURNANT JOUEF" , "TRAINS ECHELLE O" , "TRAINS ECHELLE N" , "MAQUETTES AERONEFS" , "MAQUETTES MILITAIRES" , "VOITURES & T.P." , "BATEAU R.C." , "OBJETS DIVERS" , "TRAINS ECHELLE HO" , 
		    "PORTAIL D\'ENTREE DU SITE" , "ACCUEIL" , "ACHETER DIRECTEMENT SUR MON SITE" , "LES TESTS HO" , "SUIVI DE VOTRE COMMANDE" , "INFORMATIONS DE VENTES" , "REFERENCES JOUEF" , "BOURSE D\'ECHANGE" , "OBJETS A VENDRE" , "E MAIL" , "MA COLLECTION"];
}
else
{
	alt_url = [ "HO SCALE TRAINS" , "HO SCALE TRAINS : JOUEF" , "HO SCALE TRAINS : ROCO" , "HO SCALE TRAINS : BUILDINGS, FIGURES & CARS" , "HO SCALE TRAINS : PARTS for REPAIR" , "HO SCALE TRAINS : TRACKS & ELECTRIC" , "TRAINS : BOOKS, CATALOG, SNCF ..." , 
		    "**" , "TRAINS : OTHERS ITEMS " , "TECHNIC : TURNABLE BRIDGE BY JOUEF" , "O SCALE TRAINS" , "N SCALE TRAINS" , "AIRPLANE MODELKITS" , "MILITARY MODELKITS" , "VEHICUL MODELS" , "RC BOAT MODELS" , "OTHER ITEMS" , "HO SCALE TRAINS" ,
		    "ENTRANCE PORTAL OF THE SITE" , "ACCUEIL" , "BUYING DIRECTLY ON MY WEBSITE" , "HO TESTS" , "TRACKING YOUR ORDER" , "SALING INFORMATIONS" , "JOUEF REFERENCES" , "I AM LOOKING FOR" , "FOR SALE ITEMS" , "E MAIL" , "MY TRAINS"];
}

//==================================================================================================================
// construction de la date
//
var day="";
var mois="";
var month="";
var myweekday="";
var year="";

mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getYear();
year = myyear

if(myday == 0) day = " dimanche, "      
else if(myday == 1) day = " lundi "
else if(myday == 2) day = " mardi "   
else if(myday == 3) day = " mercredi "   
else if(myday == 4) day = " jeudi "
else if(myday == 5) day = " vendredi "
else if(myday == 6) day = " samedi "

if(mymonth == 0)
	{mois = "Janvier ";month = "Janury ";}
else if(mymonth ==1)
	{mois = "Février ";month = "Febrary ";}
else if(mymonth ==2)
	{mois = "Mars ";month = "March ";}
else if(mymonth ==3)
	{mois = "Avril ";month = "April ";}
else if(mymonth ==4)
	{mois = "Mai ";month = "May ";}
else if(mymonth ==5)
	{mois = "Juin ";month = "Jun ";}
else if(mymonth ==6)
	{mois = "Juillet ";month = "July ";}
else if(mymonth ==7)
	{mois = "Août ";month = "August ";}
else if(mymonth ==8)
	{mois = "Septembre ";month = "September ";}
else if(mymonth ==9)
	{mois = "Octobre ";month = "October ";}
else if(mymonth ==10)
	{mois = "Novembre ";month = "November ";}
else if(mymonth ==11)
	{mois = "Décembre ";month = "December ";}


//==================================================================================================================
// gestion des cookies
//
var Nom; // nom du cookie
var Contenu = " "; // contenu du cookie
var expdate ; // pour créer un objet date, 

function EcritCook()
{
	expdate = new Date ();
	expdate.setTime (expdate.getTime() + (10 * 24 * 60 * 60 * 1000));
	Nom = "UserLangCookie";
	Contenu = "UK";
	document.cookie = Nom + "=" + Contenu + "; expires=" + expdate.toGMTString();
}

function SupprCook()
{
	expdate = new Date ();
	expdate.setTime (expdate.getTime() - (60 * 1000) );
	Nom = "UserLangCookie";
	document.cookie = Nom + "=" + Contenu + "; expires=" + expdate.toGMTString();
}

//==================================================================================================================
// gestion des fenetres
//
if (nomvar == "page_active")
	var en_cours=parent.page_active.location;

function window_affich(index)
{
	window.location=index;
}

function GetLink(link,arg)
{
	new_window = "http://auvergne.jouet.chez.com/";
	new_window += link;
	if (!document.cookie)
		new_window += ".htm?lang=FR";
	else
		new_window += ".htm?lang=UK";
	window.open(new_window,"",arg);
}

function call_window(index,arg)
{
	new_window = "http://auvergne.jouet.chez.com/";
	new_window += index;
	new_window += ".htm";
	window.open(new_window,"",arg);
}

function new_window(index)
{
	label = '<IMG class=imageAlign alt=Détail src=./photos/thumbnail/';
	label += index;
	label += '.jpg border=0 width=100%>';

	titre = 'référence de la vente : ';
	titre += index;

	image = window.open("","image","resizable=1,width=350,height=290");

	image.document.write('<Title>');
	image.document.write(titre);
	image.document.write('</Title>');
	image.document.write('<SPAN style="position:absolute;top:0px;left:0px">');
	image.document.write(label);
}

function test_motrice(index)
{
	label = '<IMG class=imageAlign alt=Détail src=./tests_machines/';
	label += index;
	label += '_test.jpg border=0>';

	titre = 'référence de la vente : ';
	titre += index;

	image = window.open("","image","resizable=1,scrollbars=yes,width=700,height=500");

	image.document.write('<Title>');
	image.document.write(titre);
	image.document.write('</Title>');
	image.document.write('<P align=left>');
	image.document.write(label);
	image.document.write('<BR>');
	image.document.write('<BR>');
	image.document.write('</P>');
}

//==================================================================================================================
// gestion des images
//
function change1(picName,imgName)
{
	if (document.images)
		{
		imgOn=eval(imgName + ".src");
		document[picName].src= imgOn;
		}
}

//==================================================================================================================
// gestion des images
//
function change2(picName,imgName, altName)
{
	if (document.images)
		{
		imgOn=eval(imgName + ".src");
		document[picName].src= imgOn;
		document[picName].alt= altName;
		}
}

//==================================================================================================================
// gestion audio
//
if (document.images)
{
	var image_audio_off= new Image(24,16);
	image_audio_off.src="./logos/audio_off.gif";  
	image_audio_off.alt="audio ON";  

	var image_audio_on= new Image(24,16);
	image_audio_on.src="./logos/audio_on.gif";
	image_audio_on.alt="audio OFF";  
}

function audio_(fichier_audio,pic_audio)
{
//	if (!audio) var audio="on";
	if (audio == "on")
		{
		SON.setAttribute('src', 'beep' , 0);
		SON.setAttribute('loop', 0 , 0);
		audio="off";
		change2(pic_audio,'image_audio_on',image_audio_off.alt);
		}
	else
		{
		SON.setAttribute('src', fichier_audio , 0);
		SON.setAttribute('loop', -1 , 0);
		audio="on";
		change2(pic_audio,'image_audio_off',image_audio_on.alt);
		}
}
//==================================================================================================================
// gestion attribut
//
function obj_set_attr(obj,attr,val)
{
	obj.setAttribute(attr, val , 0);
}
