/* Header Flash : renvoie une chaine de caractère contenant le code du player à afficher */
function headVille(urlAnim,unTitre,unCorps,uneCouleur,uneLargeur,uneHauteur){
	var hV ='';
	var leTitre = '';
	var leCorps = '';
	var laCouleur = '';
	if(unTitre['vname'] != '' && typeof(unTitre['vname']) != 'undefined'){
		if(navigator.userAgent.indexOf('MSIE') > -1) leTitre = 'titre=' + unTitre['vname'] + '&';
		else leTitre = 'titre=' + unTitre['vname'] + '&';
	}
	if(unCorps != '' && typeof(unCorps) != 'undefined') leCorps = 'corps=' + unCorps + '&';
	if(uneCouleur != '' && typeof(uneCouleur) != 'undefined') laCouleur = 'couleur=' + uneCouleur;
	hV += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
	hV += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
	hV += 'width="' + uneLargeur + '"';
	hV += 'height="' + uneHauteur + '"';
	hV += 'id="flash-headVille"';
	hV += 'align="left">';
	hV += '<param name="allowScriptAccess" value="sameDomain" />';
	hV += '<param name="movie" value="'+ urlAnim + '?' + leTitre + leCorps + laCouleur + '" />';
	hV += '<param name="loop" value="false" />';
	hV += '<param name="menu" value="false" />';
	hV += '<param name="quality" value="high" />';
	hV += '<param name="scale" value="noscale" />';
	hV += '<param name="salign" value="lt" />';
	hV += '<param name="bgcolor" value="#ffffff" />';
	hV += '<param name="wmode" value="transparent" />';
	hV += '<embed src="'+ urlAnim + '?' + leTitre + leCorps + laCouleur + '"';
	hV += 'loop="false" ';
	hV += 'menu="false" ';
	hV += 'quality="high" ';
	hV += 'scale="noscale" ';
	hV += 'salign="lt" ';
	hV += 'bgcolor="#ffffff" ';
	hV += 'width="' + uneLargeur + '" ';
	hV += 'height="' + uneHauteur + '" ';
	hV += 'name="titre_enville" ';
	hV += 'align="left" ';
	hV += 'allowScriptAccess="sameDomain" ';
	hV += 'type="application/x-shockwave-flash" ';
	hV += 'pluginspage="http://www.macromedia.com/go/getflashplayer"';
	hV += 'wmode="transparent" />';
	hV += '</object>';
	return hV;
}
/* / header Flash */


var random_number="ord="+(Math.round(Math.random()*10000000000))+"?";
//var OAS_listpos='';
var maville = new Array();
var nomville = ''; var pubville = ''; 

pubville = (typeof vpub[ville] != 'undefined')?vpub[ville]:ville;
nomville = (typeof vname[ville] != 'undefined')?vname[ville]:capitalizeMe(ville);
function capitalizeMe(str) {
    var my_str = '';
    var val = str.split(' ');
    for(var c=0; c < val.length; c++) {
        my_str += val[c].substring(0,1).toUpperCase() +
        val[c].substring(1,val[c].length) + ' ';
    }
    return my_str;
}   

function setVilleFavorit(ville)
{
	var date_exp = new Date();
	date_exp.setTime(date_exp.getTime()+(315360000000));

	SetCookie("wooville", "Valide=1|Nom="+ville+"|Code="+ville,date_exp,"/",".orange.fr");
	alert("Votre ville a été enregistrée comme ville favorite, vous aurez désormais la météo et une actualité de votre ville en page d'accueil www.orange.fr");
}

var dns = '.ville.orange.fr';


if(document.body.id == 'restos' || document.body.id == 'sorties'){
	var switchMobile = 'BODY DIV#switchmobile {display: block; position: absolute; left: 668px; width:150px; z-index: 10; bottom: -16px;}';
}else{
	var switchMobile = 'BODY DIV#switchmobile {display: none;}';
}

document.write('<style type="text/css" media="all">'+
   '@import url(http://c.orange.fr/Ville/Css/woovillev2.css);'+
		switchMobile +
'</style>');

document.write('<table border="0" cellpadding="0" cellspacing="0" class="header">'+
'<tr>'+
'<td width="465">' + headVille('http://c.orange.fr/Ville/headerVille.swf',listeVilles[ville],32,'#992222',445,41) + '</td>' +
'<td width="180" class="deca"><a href="http://en-ville.orange.fr" onclick="setVilleFavorit(ville);return false;">Choisir cette ville comme favorite</a></td>'+
'<td width="135" class="deca"><a href="http://en-ville.orange.fr">Choisir une autre ville</a></td>'+
'<td class="leVide"></td>'+
'</tr>'+
'</table>');

document.write('<div class="nav" style="position: relative;">'+
'<table cellpadding="0" cellspacing="0" border="0">'+
'<tr>'+
    '<td class="accueil"><a href="http://'+ville+dns+'" class="accueil_link">Accueil</a></td>'+
    '<td class="ong_l"> </td>'+
    '<td class="direct"><a href="http://'+ville+dns+'/direct">En direct</td>'+
    '<td class="ong_m"> </td>'+
    '<td class="pratique"><a href="http://'+ville+dns+'/pratique">Pratique</a></td>'+
    '<td class="ong_m"> </td>'+
    '<td class="ensemble"><a href="http://'+ville+dns+'/ensemble">La ville ensemble</a></td>'+
    '<td class="ong_m"> </td>'+
    '<td class="cinema"><a href="http://www.fra.sortie.ville.orange.fr/cinema_'+ listeVilles[ville]['cityvox'] +'/'+ listeVilles[ville]['cityvox'] +'_/Cinema" target="_top">Cin&eacute;ma</a></td>'+
    '<td class="ong_m"> </td>'+
    '<td class="restos"><a href="http://www.fra.sortie.ville.orange.fr/bonnes-adresses_'+ listeVilles[ville]['cityvox'] +'/'+ listeVilles[ville]['cityvox'] +'_/AccueilLieux">Restos, bars, bo&icirc;tes</a></td>'+
    '<td class="ong_m"> </td>'+
	'<td class="sorties"><a href="http://www.fra.sortie.ville.orange.fr/agenda_'+ listeVilles[ville]['cityvox'] +'/'+ listeVilles[ville]['cityvox'] +'_/MaVille" target="_top">Sorties, &eacute;v&egrave;nements</a></td>'+
    '<td class="ong_m"> </td>'+
    '<td class="sports"><a href="http://'+ville+dns+'/sport">Sports</a></td>'+
    '<td class="ong_r"> </td>'+
    '<td class="ong_vide"> </td>'+
'</tr>'+
'</table>'+
'<div id="switchmobile"><a href="http://mobile.orange.fr/content/ge/high/v2_thematiques/them_guide_de_sortie3.html?ville='+ville+'">sur mobile orange</a></div>'+
'</div>');

