function i2h(id) {
	var handler = (document.getElementById(id))?document.getElementById(id):false;
	return handler;
}
function Ofavoris() {
	var theUrl = window.location.href;
	var sWGstuff = 'http://www.orange.fr/bin/frame.cgi?u=http%3A';
	if (theUrl.indexOf(sWGstuff)>-1 ) {
		theUrl = 'http://' + theUrl.substring(theUrl.indexOf(sWGstuff));
	}
	if (theUrl.indexOf('#')>-1 ) {
		theUrl = theUrl.substring(0, theUrl.indexOf('#'));
	}
	theUrl +=  '#favoris'
		if (document.all)	{
			window.external.AddFavorite(theUrl, document.title);
		} else if (window.sidebar) {
			window.sidebar.addPanel(document.title, theUrl, "");
		}
	var host = window.self.location.hostname.substring(0, window.self.location.hostname.indexOf('.orange.fr')).replace('.', '_','g');
	if (!i2h('spec_referer')) {
		document.body.innerHTML += '<img id="spec_referer" src="http://r.orange.fr/r?ref='+host+'_addfavoris&url=http%3A//c.orange.fr/z.gif" height="0" width="0" style="display:none;" />';
	} else {
		i2h('spec_referer').src = 'http://r.orange.fr/r?ref='+host+'_addfavoris&url=http://c.orange.fr/z.gif';
	}
}
function navCineOn(pageCourante){
    var theNav = document.getElementById('navCine');
    var itemsNav = theNav.getElementsByTagName('li');
    var strTest = '';
    for (var i=0; i < itemsNav.length; i++){
      if(pageCourante == itemsNav[i].firstChild.innerHTML){
				if(i == 1) itemsNav[i].className = 'first on'; 
        else itemsNav[i].className = 'on';
        if(itemsNav[i + 1].className == 'mobileOrange') itemsNav[i + 1].className = 'mobileOrange_onPlusUn';
        else itemsNav[i + 1].className = 'onPlusUn';
      }
    }
}
function afficheFavs(){
	var favs = i2h('Ofav');
	if (!(navigator.appName.indexOf('Microsoft') > -1)) favs.style.display = 'none';
}

sousNav = function(uneSousNav){
    var maSsNav = uneSousNav;
    var contSsNav='';
    this.afficheSsNav = function(){
      var contSsNav = '';
      for (var i = 0; i < maSsNav.length; i++){
        contSsNav += '<li><a href="' +  maSsNav[i][1] + '">' + maSsNav[i][0] + '</a></li>';
      }
      return contSsNav;
     }
  }
// Affichage de la Nav
  var itemNav = new Array();

	if(typeof(urlDomaine) != 'undefined' && urlDomaine) var urlD = 'http://cine.orange.fr';
	else var urlD = '';

  itemNav[0] = ['actu',urlD + '/actualites'];
  itemNav[1] = ['films',urlD + '/sorties-cinema-de-la-semaine'];
  itemNav[2] = ['bandes annonces',urlD + '/bandes-annonces-cinema'];
  itemNav[3] = ['avis spectateurs',urlD + '/avis'];
  itemNav[4] = ['critique presse',urlD + '/critique-presse'];
  itemNav[5] = ['box office',urlD + '/box-office'];
  itemNav[6] = ['stars',urlD + '/stars'];
  itemNav[7] = ['salles \/ séances',urlD + '/seances-cinema'];

  var theNav = '';
  theNav +='<div class="headerCine">';
	theNav +='<a href="'+ urlD + '/"><img src="http://c.orange.fr/Cinema/Icons/t_cinema.gif" alt="" width="126" height="24" style="float:left;"/></a>';
	theNav +='<a href="#" id="Ofav" onclick="Ofavoris();"><img src="http://c.orange.fr/Cinema/Icons/favorisCine.gif" alt="" width="135" height="24" style="float:left;"/></a>';
//	theNav +='&nbsp;<a id="cyprien" href="http://www.leblogdecyprien.com/" target="_top"><img src="http://c.orange.fr/Cinema/Icons/cyprien_cinema.gif" width="239" height="38" alt="Cyprien" title="Cyprien" /></a>';

//	theNav +='&nbsp;<a id="festivalDeCannes" href="http://festival-de-cannes.cine.orange.fr/" target="_top"><img src="http://c.orange.fr/Cinema/Icons/festival-de-cannes.gif" width="70" height="35" title="Festival de Cannes" /></a>';
//  theNav +='<a href="http://forum.orange.fr/liremessages.php?idservice=10004&idsection=1919" id="Oforum">forum</a>';
	theNav +='<div class="nusep"></div>';
  theNav +='<ul id="navCine" style="margin-top:10px;">';
  theNav +='<li class="accueil"><a href="' + urlD + '/">accueil</a></li>';
    for(var i = 0; i < itemNav.length; i++){
      if(i == 0) theNav += '<li class="first">';
			else theNav += '<li>';
      theNav +='<a href="' + itemNav[i][1] + '">' + itemNav[i][0] + '</a>';
      theNav +='</li>';
    }
  // theNav +='<li class="mobileOrange"><a href="http://mobile.orange.fr/content/ge/high/v2_thematiques/switch_cinema.html" target="_blank" onclick="return o_ref(this,\'mobile_switch_cinema\');">sur mobile Orange</a></li>';
  theNav +='<li class="mobileOrange"><a href="http://mobile.cine.orange.fr/" target="_blank" onclick="return o_ref(this,\'mobile_switch_cinema\');">sur mobile Orange</a></li>';
  //  theNav +='<li><a href="http://r.orange.fr/r?ref=promo_vod_cinema&url=http://2424video.orange.fr/" target="_blank" style="width:116px; background:url(http://c.orange.fr/Programmes/Icons/arrow_A.gif) no-repeat 38px 1px; padding-right:15px; font-weight:bold; font-size:11px; text-align:right;">24/24 Vidéo</a></li>';
  theNav +='<li class="video2424" style="width:144px;height:22px;padding:1px 0 0 0;line-height:20px;text-align:right;"><a href="http://r.orange.fr/r?ref=promo_vod_cinema&url=http://2424video.orange.fr/" target="_blank" style="display:inline; background:url(http://c.orange.fr/Programmes/Icons/arrow_A.gif) no-repeat left 1px; padding:0 13px 0 17px; margin:0;color:#333;">24/24 Vidéo</a></li>';
  theNav +='</ul>';
  theNav +='<div class="nusep"></div>';
  theNav +='</div>';

  document.write(theNav);
  navCineOn(cName);
	afficheFavs();

function afficheImgActu(){
	if(i2h('imgActu') && cName == '') i2h('imgActu').style.display = 'block';
}

o_onLoadPush('afficheImgActu()');

document.write('<LINK rel=stylesheet type="text/css" href="http://c.orange.fr/Css/o.css">');
document.write('<LINK rel=stylesheet type="text/css" href="http://c.orange.fr/Css/splink/splink_v2.css">');
document.write('<style>');
document.write('BODY { width:990px;}');
document.write('#sl { display:block;width:285px;_width:290px;_padding:37px 5px 5px 5px;filter:alpha(opacity=80); -moz-opacity:0.8; opacity:0.8;}');
document.write('#sl .sl_link { color:#F60;}');
document.write('#sl .sl_text009 { color:#F60;}');
document.write('</style>');

