// La pub -----------
var sas_tmstp=Math.round(Math.random()*10000000000);
var rand=0;
var sas_master_flag=1;
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(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;
}
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,'728','120'); 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,'230'); sas_go=0; }
if (sas_go==1)
{
document.write('');
}
}
function SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target,sas_w,sas_h) {
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));
}
// Longévité en Jours
function SetCookie(NomCookie, Valeur, Longevite)
{
SetCookieM(NomCookie, Valeur, Longevite * 60 * 24 );
}
// Longévité en Minutes
function SetCookieM(NomCookie, Valeur, LongeviteM)
{
var Now = new Date();
if (typeof(Longevite)!="number") Longevite=1;
Now.setTime(Now.getTime() + LongeviteM * 1000 * 60 );
var Domaine = DomaineCookie();
if (Domaine != "") Domaine = "; domain=" + Domaine;
var CookieCrt = NomCookie + "=" + escape(Valeur) + "; expires=" + Now.toGMTString() + Domaine + "; path=/";
document.cookie = CookieCrt;
}
function DomaineCookie()
{
var Domaine = window.location.hostname;
if (Domaine.indexOf('.allocine') == -1 && Netscape && VMajeure == 4)
return ("");
else
return ('.'+Domaine.substr(Domaine.indexOf('allocine')));
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
// Fenetre Surgissante
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function Fenetre(URL, Lg, Ht, Px, Py, Scroll, Resize, Nom, Adresse, Bouton, Menu )
{
if (typeof(Lg)!="number") Lg=320;
if (typeof(Ht)!="number") Ht=430;
if (typeof(Px)!="number") Px=0;
if (typeof(Py)!="number") Py=0;
if ((typeof(Scroll)!="number") || Scroll!=1) Scroll="no"; else Scroll="yes";
if ((typeof(Resize)!="number") || Resize!=1) Resize="no"; else Resize="yes";
if (typeof(Nom)!="string") Nom="FenAlloCine" + NomFen(URL);
if ((typeof(Adresse)!="number") || Adresse!=1) Adresse="no"; else Adresse="yes";
if ((typeof(Bouton)!="number") || Bouton!=1) Bouton="no"; else Bouton="yes";
if ((typeof(Menu)!="number") || Menu!=1) Menu="no"; else Menu="yes";
FenAC = window.open(URL,Nom,"toolbar=" + Bouton + ",scrollbars=" + Scroll + ",resizable=" + Resize + ",width=" + Lg +
",height=" + Ht + ",left=" + Px + ",top=" + Py + ",location=" + Adresse + ",menubar=" + Menu )
if (navigator.appName == "Netscape" || (navigator.userAgent.indexOf("MSIE") > 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_old(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(".");
if (extension != -1) {
URL = "http://" + Cobranding + "/webtv/acvision.asp?cvid=" + CVid + "&player=" + TypeLecteur + "&emission=" + Emission + "&debit=" + Debit;
}
else {
if (Cobranding == "www") {
URL = "http://www.allocine.fr/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 = "http://www.allocine.fr/video/player_gen_cmedia=" + CVid.substring(debutCVid,finCVid);
}
}
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)
{
var FenACV;
FenACV = window.open(URL);
}
// 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);
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')
{
iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
//iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
}
else {
iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + '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) {
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;
}