// La pub -----------
if(sas_master_flag != 1 && sas_master_flag != 0) {
var sas_master_flag=1;
}
var sas_tmstp=Math.round(Math.random()*10000000000);
var rand=0;
var sas_target_val='';
var temps_pub_interstitiel = 12;
// Pour la pub MSN Messenger dans les séances
var flagMSN = 0; // A supprimer
function SmartAdServer_dev(sas_pageid,sas_formatid,sas_master_inutile,sas_target) {
if (sas_master_flag==1) {
sas_master='M';
sas_master_flag=0;
} else {
sas_master='S';
}
if (sas_target_val=='') {
sas_target_val = sas_target;
}
document.write('');
}
function SmartAdServer(sas_pageid,sas_formatid,sas_master_inutile,sas_target) {
if ("object" == typeof(sas_manager)) {
sas_manager.render(sas_formatid);
}
else{
//-- ancien SmartAdServer
if (sas_master_flag==1) {
sas_master='M';
sas_master_flag=0;
} else {
sas_master='S';
}
if (sas_target_val=='') {
sas_target_val = sas_target;
}
var sas_emplacement = sas_pageid + '/' + sas_formatid;
var sas_go=1;
if (sas_emplacement == '513/3654/1799') {
SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target_val,'770','170'); sas_go=0; }
if (sas_emplacement == '513/3654/192') {
SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target_val,'770','210'); sas_go=0; }
if ((sas_emplacement == '513/3654/190')||(sas_emplacement == '513/3654/191')||(sas_emplacement == '513/3654/197')) {
SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target_val,'230','90'); sas_go=0; }
if (sas_emplacement == '513/3654/264') {
SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target_val,'300'); sas_go=0; }
if (sas_go==1)
{
// if ((sas_formatid == '46') && ((window.location.hostname.toLowerCase() == 'v5.allocine.fr') || (window.location.hostname.toLowerCase() == 'www.allocine.fr')))
// SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target_val,'728', '90');
//else
document.write('');
}
//-- fin ancien SmartAdServer
}
}
function SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target,sas_w,sas_h) {
sas_w = sas_w || '100%';
var FrameID = 'SAS' + Math.round(Math.random()*1000000)
document.write('');
}
function SmartAdServer_iframe_dev(sas_pageid,sas_formatid,sas_target,sas_w,sas_h) {
if (sas_master_flag==1) {
sas_master='M';
sas_master_flag=0;
} else {
sas_master='S';
}
if (sas_target_val=='') {
sas_target_val = sas_target;
}
if (window.location.hostname.toLowerCase() == 'v5.allocine.fr' && 1==2)
{
//document.write('iframepub
');
//document.write('http://smart.allocine.fr/call/pubif/' + sas_pageid + '/' + sas_formatid + '/' + sas_master + '/' + sas_tmstp + '/' + escape(sas_target_val) + '?
');
document.write('
| ');
document.write('');
document.write(' |
');
}
else
{
//document.write('iframepub
');
//document.write('http://pub.allocine.fr/printpub_iframe_test2.html?sas_pageid=' + sas_pageid + '&sas_formatid=' + sas_formatid + '&sas_master='+ sas_master + '&sas_tmstp=' + sas_tmstp + '&sas_target=' + escape(sas_target_val) + '
');
if (sas_h == '' || sas_h == null) { sas_w = '100%'; }
if (sas_h == '' || sas_h == null) { sas_h = '1'; }
var FrameID = 'SAS' + Math.round(Math.random()*1000000)
document.write('');
}
}
function SmartAdServer_OLD(sas_pageid,sas_formatid,sas_master,sas_target) {
if ((sas_master!='M')&&(sas_master!='S')) {sas_master='S'};
document.write('');
}
//-------------------
// COOKIES ----------
var Nav = navigator;
var Agent = ' ' + Nav.userAgent.toLowerCase();
var Version = Nav.appVersion;
var Netscape = Agent.indexOf('mozilla') > 0;
if (Agent.indexOf('compatible') > 0) Netscape = false;
var Explorer = Agent.indexOf('msie') > 0;
var VMajeure = parseInt( Version );
var VMineure = parseFloat( Version );
function GetCookie(NomCookie)
{
var dc = document.cookie;
var prefix = NomCookie + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}
// options number -> offset en jours
// options objet ->
// {
// date: (Date) date absolue
// days: (number) offset en jours
// hours: (number) offset en heures
// minutes: (number) offset en minutes
// midnight: (bool) mettre à minuit la date calculée / spécifiée
//}
function SetCookie(NomCookie, Valeur, options)
{
var expiration;
if ("number" == typeof options)
{
expiration = new Date();
expiration.setTime(expiration.getTime() + options*24*60*60*1000);
}
else
{
options = options||{};
expiration = options.date?options.date:new Date();
var offset = 0;
if ("number" == typeof options.days)
offset += options.days*24*60*60*1000;
if ("number" == typeof options.hours)
offset += options.hours*60*60*1000;
if ("number" == typeof options.minutes)
offset += options.minutes*60*1000;
if (offset)
expiration.setTime(expiration.getTime() + offset);
if (options.midnight)
expiration.setHours(0, 0, 0, 0);
}
var Domaine = DomaineCookie();
if (Domaine != "")
Domaine = "; domain=" + Domaine;
document.cookie = NomCookie + "=" + escape(Valeur) + "; expires=" + expiration.toGMTString() + Domaine + "; path=/";
}
// Longévité en Minutes
function SetCookieM(NomCookie, Valeur, LongeviteM)
{
if ("number" != typeof LongeviteM)
LongeviteM = 1;
SetCookie(NomCookie, Valeur, {minutes:LongeviteM});
}
function DomaineCookie()
{
var acDomains = ["allocine", "ac-net.net"];
var Domaine = window.location.hostname;
var domaineIndex = -1;
for (var i = 0; i 0 && parseInt(navigator.appVersion.substring(0,1)) > 3))
FenAC.focus();
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
// Remplacement de chaine pour nommer les fenetres
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function NomFen(Adresse)
{
Adresse = Remplace(Adresse, 'http://', '');
Adresse = Remplace(Adresse, '/', '');
Adresse = Remplace(Adresse, '.', '');
Adresse = Remplace(Adresse, '=', '');
Adresse = Remplace(Adresse, '?', '');
Adresse = Remplace(Adresse, '&', '');
Adresse = Remplace(Adresse, '-', '');
Adresse = Remplace(Adresse, ';', '');
Adresse = Remplace(Adresse, '%', '');
Adresse = Remplace(Adresse, '|', '');
Adresse = Remplace(Adresse, '_', '');
Adresse = Remplace(Adresse, '@', '');
return(Adresse.slice(-15));
}
function Remplace(Chaine, Ancien, Nouveau)
{
if (Ancien != Nouveau && Ancien.length > 0 )
{
Pos = Chaine.indexOf(Ancien, 0);
while (Pos >= 0)
{
Chaine = Chaine.substring(0, Pos) + Nouveau + Chaine.substring(Pos + Ancien.length, Chaine.length);
Pos = Chaine.indexOf(Ancien, 0);
}
}
return Chaine;
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
// Ouverture AlloCiné Vision
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function FenACVision_popup(CVid, Emission, TimeCode, Cobranding, TypeLecteur, Debit)
{
/*
if ( ((typeof(CVid)!="number") || (CVid=="0")) && Emission!=100 )
CVid="";
else
if (typeof(Emission)!="number") Emission=1;
if (typeof(Emission)!="number") Emission=0;
*/
if (typeof(TimeCode)!="number") TimeCode="";
if (typeof(Cobranding)!="string") Cobranding="www";
if (Cobranding=="") Cobranding="www";
if (typeof(TypeLecteur)!="string") TypeLecteur="";
if (typeof(Debit)!="string") Debit="";
//Recherche le nombre de caractère . dans le parametre CoBranding
var extension = Cobranding.indexOf(".");
if (extension != -1)
{
URL = "http://" + Cobranding + "/webtv/acvision.asp?cvid=" + CVid + "&player=" + TypeLecteur + "&emission=" + Emission + "&debit=" + Debit
}else
{
URL = "http://" + Cobranding + ".allocine.fr/webtv/acvision.asp?cvid=" + CVid + "&player=" + TypeLecteur + "&emission=" + Emission + "&debit=" + Debit
}
FenACVisionURL(URL);
}
function FenACVision(CVid, Emission, TimeCode, Cobranding, TypeLecteur, Debit)
{
if (typeof(TimeCode)!="number") TimeCode="";
if (typeof(Cobranding)!="string") Cobranding="www";
if (Cobranding=="") Cobranding="www";
if (typeof(TypeLecteur)!="string") TypeLecteur="";
if (typeof(Debit)!="string") Debit="";
//Recherche le nombre de caractère . dans le parametre CoBranding
var extension = Cobranding.indexOf(".");
var myurl = window.location.href;
if (extension != -1) {
URL = "http://" + Cobranding + "/webtv/acvision.asp?cvid=" + CVid + "&player=" + TypeLecteur + "&emission=" + Emission + "&debit=" + Debit;
}
else {
// if (myurl.indexOf("v5.") > -1) {
if (Cobranding == "www") {
URL = "/video/player_gen_cmedia=" + CVid;
if (typeof(CVid) == "string") { /* pour les playlists */
if (CVid.indexOf(":") > -1) {
var debutCVid = CVid.indexOf(":")+1;
var finCVid = CVid.indexOf(",");
if (finCVid == -1) {finCVid = CVid.length;}
URL = "/video/player_gen_cmedia=" + CVid.substring(debutCVid,finCVid);
}
}
if (myurl.indexOf("/film/")>0 && myurl.indexOf("cfilm=")>0) {
URL = URL + "&cfilm=" + getQueryString("cfilm");
} // fin "/film/"
if (myurl.indexOf("/personne/")>0 && myurl.indexOf("cpersonne=")>0) {
URL = URL + "&cpersonne=" + getQueryString("cpersonne");
} // fin "/personne/"
if (myurl.indexOf("/series/")>0 && myurl.indexOf("cserie=")>0) {
URL = URL + "&cserie=" + getQueryString("cserie");
} // fin "/series/"
if (Debit == "") {
URL = URL + ".html"
}
else {
URL = URL + "&hd=1.html"
}
}
else {
URL = "http://" + Cobranding + ".allocine.fr/webtv/acvision.asp?cvid=" + CVid + "&player=" + TypeLecteur + "&emission=" + Emission + "&debit=" + Debit;
} // fin "www."
} // fin (extension = -1)
FenACVisionURL(URL);
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
// URL spécifiée en paramètre (Bandeaux Pub)
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function FenACVisionURL_Old(URL)
{
var FenACV;
FenACV = window.open(URL,"PopUpACVision","toolbar=no,scrollbars=no,resizable=yes,width=604,height=480,left=250,top=150,location=0,menubar=0");
if (navigator.userAgent.indexOf("MSIE") > 0 && parseInt(navigator.appVersion.substring(0,1)) > 3) {FenACV.focus();}
}
function FenACVisionURL(URL)
{
if (URL.indexOf("/video/player")>-1) {
window.location = URL;
}
else {
var FenACV;
FenACV = window.open(URL,"PopUpACVision","toolbar=no,scrollbars=no,resizable=yes,width=604,height=480,left=250,top=150,location=0,menubar=0");
if (navigator.userAgent.indexOf("MSIE") > 0 && parseInt(navigator.appVersion.substring(0,1)) > 3) {FenACV.focus();}
}
}
// FONCTIONS DE DECOUPAGE D'URL
function urlencode(string) {
string = string.replace(/\//g, "%2F");
string = string.replace(/\?/g, "%3F");
string = string.replace(/=/g, "%3D");
string = string.replace(/&/g, "%26");
string = string.replace(/\./g, "%2E");
return string;
}
function stripScript(src) {
var __qstr = new String();
var __tmpNum;
__tmpNum = src.indexOf('://');
__qstr = (__tmpNum != -1) ? src.substr(__tmpNum + 3, src.length) : src;
__tmpNum = __qstr.indexOf('_gen_');
__qstr = (__tmpNum != -1) ? __qstr.substr(0, __tmpNum) + '.html' : __qstr;
__tmpNum = __qstr.indexOf('/');
__qstr = (__tmpNum != -1) ? __qstr.substr(__tmpNum, __qstr.length) : __qstr;
if (__qstr.indexOf('_gen_') != -1)
{
__tmpNum = __qstr.length - stripArgs(src).length;
__qstr = (__qstr.indexOf('?') != -1) ? __qstr.substr(0, __tmpNum - 1) : __qstr.substr(0, __tmpNum);
__qstr = __qstr.substr(0, __tmpNum);
}
__tmpNum = __qstr.indexOf('#');
__qstr = (__qstr.indexOf('#') != -1) ? __qstr.substr(0, __tmpNum) : __qstr;
delete __tmpNum;
return __qstr;
}
function stripArgs(src) {
var __qstr = new String();
var __tmpNum;
__tmpNum = src.indexOf('?');
__qstr = (__tmpNum != -1) ? src.substr(__tmpNum + 1, src.length) : '';
__tmpNum = src.indexOf('_gen_');
__qstr = (__tmpNum != -1) ? src.substring(__tmpNum + 5, src.indexOf('.html')) : '';
delete __tmpNum;
return __qstr;
}
function stripHost(src) {
var __qstr = new String();
var __tmpNum;
__tmpNum = src.indexOf('://');
__qstr = (__tmpNum != -1) ? src.substr(__tmpNum + 3, src.length) : src;
__tmpNum = __qstr.indexOf('/');
__qstr = (__tmpNum != -1) ? __qstr.substr(0, __tmpNum) : __qstr;
delete __tmpNum;
return __qstr;
}
function forum_img_over() {
window.status='Cette image a été réduite. Cliquez pour l\'agrandir';
document.body.style.cursor = "pointer";
return true;
}
function forum_img_out() {
window.status='';
document.body.style.cursor = "default";
return true;
}
// Ne sert plus si MSN n'est plus dans le menu déroulant de recherche
function searchAC(choix, motCle) {
if (choix == 5) {
window.open('http://smart.allocine.fr/call/cliccommand/116995/' + Math.round(Math.random()*10000000000) + '/?http://clk.atdmt.com/GBL/go/llcnfhse0030000066gbl/direct/01/?q=' + escape(motCle) + '&cp=1252');
} else {
document.location.href = '/recherche/?motcle=' + escape(motCle) + '&rub=' + choix;
}
return true;
}
function getElementDiv(id) {
if (!document.getElementById) {
return;
}
if (document.all) {
return eval("document.all." + id);
} else {
return document.getElementById(id);
}
}
function DisplayDiv(id) {
var DivArray;
var i;
DivArray = id.split(",")
for (i = 0; i < DivArray.length; i++) {
getElementDiv(DivArray[i]).style.display = (getElementDiv(DivArray[i]).style.display == "none" ? "inline" : "none");
}
}
function DivOn(id) {
var DivArray;
var i;
DivArray = id.split(",")
for (i = 0; i < DivArray.length; i++) {
getElementDiv(DivArray[i]).style.display = "inline";
}
}
function DivOff(id) {
var DivArray;
var i;
DivArray = id.split(",")
for (i = 0; i < DivArray.length; i++) {
getElementDiv(DivArray[i]).style.display = "none";
}
}
function adjustIFrameSize (iframeWindow) {
if (iframeWindow.document.height) {
var iframeElement = document.getElementById(iframeWindow.name);
// if (iframeWindow.document.scrollHeight > 1000)
// {
// iframeWindow.document.scrollHeight = 1;
// }
iframeElement.style.height = iframeWindow.document.height + 'px';
//iframeElement.style.width = iframeWindow.document.width + 'px';
}
else if (document.all) {
var iframeElement = document.all[iframeWindow.name];
if (iframeWindow.document.compatMode &&
iframeWindow.document.compatMode != 'BackCompat')
{
// if (iframeWindow.document.body.scrollHeight > 1000)
// {
// iframeWindow.document.documentElement.scrollHeight = 1;
// }
iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
//iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
}
else {
// if (iframeWindow.document.body.scrollHeight > 1000)
// {
// iframeWindow.document.body.scrollHeight = 1;
// }
iframeElement.style.height = iframeWindow.document.body.scrollHeight + 'px';
//iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
}
}
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
function getQueryString(cle, url) {
return new Url(url).params[cle] || "";
var valeur='';
if (typeof(url) != 'undefined') {
var myurl = url;
} else {
var myurl = self.location.href.toLowerCase();
}
cle = cle.toLowerCase();
if (cle!='' && cle!=null) {
var debutcode = myurl.indexOf(cle);
if (debutcode > -1) {
var myurl2 = myurl.substr(debutcode + cle.length + 1);
var fincode1 = myurl2.indexOf('.html');
var fincode2 = myurl2.indexOf('&');
if(fincode2<=0){fincode2=myurl2.length;};
var fincode=-1;
if(fincode1>-1 && fincode2>-1){fincode=Math.min(fincode1,fincode2);}else{fincode=Math.max(fincode1,fincode2);}
if(fincode > -1) {
valeur = myurl2.substring(0,fincode);
}
}
}
return valeur;
}
function vire_accents(my_string) {
var new_string = "";
var pattern_accent = new Array("À","Á","Â","Ã","Ä","Å","à","á","â","ã","ä","å","Ò","Ó","Ô","Õ","Ö","Ø","ò","ó","ô","õ","ö","ø","È","É","Ê","Ë","è","é","ê","ë","Ì","Í","Î","Ï","ì","í","î","ï","Ù","Ú","Û","Ü","ù","ú","û","ü","ÿ","Ñ","ñ","Ç","ç");
var pattern_replace_accent = new Array("A","A","A","A","A","A","a","a","a","a","a","a","O","O","O","O","O","O","o","o","o","o","o","o","E","E","E","E","e","e","e","e","I","I","I","I","i","i","i","i","U","U","U","U","u","u","u","u","y","N","n","C","c");
if (my_string && my_string != "") {
new_string = preg_replace (pattern_accent, pattern_replace_accent, my_string);
}
return new_string;
}
function preg_replace (array_pattern, array_pattern_replace, my_string) {
var new_string = String (my_string);
for (i=0; i=0?"allocine.fr":labels.join(".");
if (labels.join(".").indexOf('xiti',0)<0){
document.domain = labels.join(".");
}
}
function addEngineText(){
var N=navigator.appName;
var V=navigator.appVersion;
var version="?";
var nav = '';
if (N=="Microsoft Internet Explorer") {
version=V.substring(V.indexOf("MSIE",0)+5,V.indexOf(";",V.indexOf("MSIE",0)));
nav = 'Internet Explorer';
}
if (N=="Netscape") {
if (navigator.vendor=="") {
nav = 'Firefox';
}
}
document.write ('') ;
}
function addEngine() {
var N=navigator.appName;
var V=navigator.appVersion;
var version="?";
if (N=="Microsoft Internet Explorer") {
version=V.substring(V.indexOf("MSIE",0)+5,V.indexOf(";",V.indexOf("MSIE",0)));
if (version="8.0") {
window.external.AddSearchProvider('http://www.allocine.fr/xml/searchprovider/opensearch.xml');
}
}
if (N=="Netscape") {
if (navigator.vendor=="") {
window.sidebar.addSearchEngine(
'http://www.allocine.fr/skin/allocine/plugins/firefox/allocine.src',
'http://www.allocine.fr/skin/allocine/plugins/firefox/allocine.gif',
'AlloCine',
'Cinema');
}
}
}
// ACAjax : wrapper sur XmlHTTP ; compatible avec prototype.js
// new ACAjax.Request(
// "http://www.allocine.fr/series/ficheserie.html",
// {
// method:"get",
// onSuccess:function(xhr){window.alert(xhr.responseText);},
// onFailure:function(xhr){window.alert(xhr.status);},
// parameters:"cserie=221"
// }
// );
//
// Helper ACAjax.encodeParameters : ACAjax.encodeParameters({cSerie:221,csaison:1492}) revoie "cserie=221&csaison=1492"
// Helper ACAjax.sameDomain : ACAjax.sameDomain("http://www.allocine.fr/ws.html") depuis "http://01net.allocine.fr/XXX" revoie "http://01net.allocine.fr/ws.html"
ACAjax = {};
ACAjax.Request = function(url, options){
var request = null;
var tentatives = [
function(){return new XMLHttpRequest();},
function(){return new ActiveXObject("Msxml2.XMLHTTP");},
function(){return new ActiveXObject("Microsoft.XMLHTTP");},
];
for (i=0;(null==request)&&i-1)
params[decodeURIComponent(unescape(ps[i].substr(0,n)))] = decodeURIComponent(unescape(ps[i].substr(n+1)));
else
params[decodeURIComponent(unescape(ps[i]))] = "";
}
return params;
}
if (!fullUrl)
return;
var reUrlAc;
var reUrlWithExt;
var reProtocolServer;
var url = "";
var params = "";
var stem = "";
var ext = "";
var server = "";
var n;
reUrlAC = /^(.+)_gen_([^.]+)(\.[^.]+)$/ig;
if (reUrlAC.test(fullUrl)) {
reUrlAC.exec(fullUrl);
fullUrl = RegExp.$1 + RegExp.$3 + "?" + RegExp.$2;
}
n = fullUrl.indexOf("?");
if (n>-1){
url = fullUrl.substr(0, n);
params = fullUrl.substr(n+1);
}
else
url = fullUrl;
var reUrlWithExt = /^(.+)(\.[^.\/]+)$/ig;
if (reUrlWithExt.test(url)) {
reUrlWithExt.exec(url);
stem = RegExp.$1;
ext = RegExp.$2;
}
else
stem = url;
var reProtocolServer = /^([^:]+:\/\/[^\/]+)(\/?.+)$/;
if (reProtocolServer.test(stem)){
reProtocolServer.exec(stem);
server = RegExp.$1;
stem = RegExp.$2;
}
this.server = server;
this.uriStem = stem;
this.ext = ext;
this.params = fillParams(params);
}
ACUtils.Url.prototype.buildSearch = function(){
var s = "";
for (p in this.params)
s += (s?"&":"") + encodeURIComponent(escape(p)).replace("%25", "%") + "=" + encodeURIComponent(escape(this.params[p])).replace("%25", "%");
return s;
}
ACUtils.Url.prototype.buildAC = function(stripServer, stripSearch){
if (!this.ext)
return this.build();
var s = stripSearch?"":this.buildSearch();
return (stripServer?"":this.server) + (this.uriStem || "/") + ((s && this.ext)?("_gen_" + s):"") + this.ext;
}
ACUtils.Url.prototype.build = function(stripServer, stripSearch){
var s = stripSearch?"":this.buildSearch();
return (stripServer?"":this.server) + (this.uriStem || "/") + this.ext + (s?("?" + s):"");
}