function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function goArticle(id)
{
	var id;
	document.location.href = '/fcf/root/core/D000' + id;
}

function checkmail(email)
{
	arobase = false;
	point = false;
	for (i=0; i<email.length; i++)
	{
		if (email.substr(i,1) == '@') arobase = true;
		if (arobase && email.substr(i,1) == '.') point = true;
	}
	return arobase && point;
}

function submit_searchForm()
{
	titre = "Vous devez obligatoirement saisir ";
	chaine = "";

	if (document.forms.searchForm.search_string.value == "") chaine += "un ou plusieurs mot(s) clé(s) pour effectuer votre recherche !";

	if (chaine != "")
		alert(titre + chaine);
	else
		document.forms.searchForm.submit();
}

function submit_searchForm2()
{
	titre = "Vous devez obligatoirement saisir ";
	chaine = "";

	if (document.forms.searchForm2.search_string.value == "") chaine += "un ou plusieurs mot(s) clé(s) pour effectuer votre recherche !";

	if (chaine != "")
		alert(titre + chaine);
	else
		document.forms.searchForm2.submit();
}

function submit_newsletterForm()
{
	titre = "Vous devez obligatoirement saisir ";
	chaine = "";

	if (!checkmail(document.forms.newsletterForm.email.value)) chaine += "une adresse email valide pour vous inscrire à la lettre d'information !";
	
	if (chaine != "")
		alert(titre + chaine);
	else
		document.forms.newsletterForm.submit();
}

function submit_newsletterForm2()
{
	titre = "Vous devez obligatoirement saisir ";
	chaine = "";

	if (!checkmail(document.forms.newsletterForm2.email.value)) chaine += "une adresse email valide pour vous inscrire à la lettre d'information !";
	
	if (chaine != "")
		alert(titre + chaine);
	else
		document.forms.newsletterForm2.submit();
}

function submit_contactForm()
{
	titre = "Vous devez obligatoirement saisir :\n\n";
	chaine = "";

	if (document.forms.contactForm.nom.value == "") chaine += "     - votre NOM\n";
	if (document.forms.contactForm.prenom.value == "") chaine += "     - votre PRÉNOM\n";
	if (!checkmail(document.forms.contactForm.email.value)) chaine += "     - votre ADRESSE EMAIL\n";
	if (document.forms.contactForm.telephone_mobile.value == "") chaine += "     - votre N° DE TÉLÉPHONE MOBILE\n";
	if (document.forms.contactForm.sujet.value == "") chaine += "     - le SUJET de votre message\n";
	if (document.forms.contactForm.message.value == "") chaine += "     - le CONTENU de votre message\n";

	if (chaine != "")
		alert(titre + chaine);
	else
		document.forms.contactForm.submit();
}

function submit_mediasLoginForm()
{
        titre = "Vous devez obligatoirement saisir :\n\n";
        chaine = "";

        if (document.forms.mediasLoginForm.nom_d_utilisateur.value == "") chaine += "     - votre NOM D'UTILISATEUR\n";
        if (document.forms.mediasLoginForm.code_client.value == "") chaine += "     - votre MOT DE PASSE\n";

        if (chaine != "")
                alert(titre + chaine);
        else
			document.forms.mediasLoginForm.submit();
}

function add_bookmark()
{
	var bookmark_url = document.location.href;
	var bookmark_title = "Films Christian Fechner";
	window.external.AddFavorite(bookmark_url,bookmark_title);
}

function PopUp(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function popize(element,width,height,scrollbar)
{
	if(
		element == null ||
		typeof element.nodeName == 'undefined' ||
		element.nodeName != 'A' ||
		typeof element.getAttributeNode == 'undefined' ||
		(width != null && parseInt(width) == 'NaN') ||
		(height != null && parseInt(height) == 'NaN')
	)
		return true;
	if(
		width == null &&
		height == null &&
		scrollbar == null
	)
	{
		width=750;
		height=510;
		window.open(
			element.getAttributeNode('href').nodeValue,
			'_blank',
			'width=' + width + ',' +
			'height=' + height + ',' +
			'scrollbars=yes'
		);
	}
	else
		window.open(
			element.getAttributeNode('href').nodeValue,
			parseInt(Math.random()*99999999)+'new',
			'width=' + width + ',' +
			'height=' + height + ',' +
			'scrollbars=yes'
		);
	return false;
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

var detect = navigator.userAgent.toLowerCase();
var OS;
var browser;
var version;
var total;
var thestring;

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "Unknown operating system !";
}

if (!browser)
{
	if (checkIt('konqueror'))
	{
		OS = "Linux";
		browser = "Konqueror";
	}
	else if (checkIt('safari')) browser = "Safari"
	else if (checkIt('omniweb')) browser = "OmniWeb"
	else if (checkIt('opera')) browser = "Opera"
	else if (checkIt('webtv')) browser = "WebTV";
	else if (checkIt('icab')) browser = "iCab"
	else if (checkIt('msie')) browser = "Internet Explorer"
	else if (!checkIt('compatible'))
	{
		browser = "Netscape Navigator"
		version = detect.charAt(8);
	}
	else browser = "Unknown browser !";
}

if (!version)
	version = detect.charAt(place + thestring.length);

function affQTPlayer(videoFile)
{
        var videoFile;
        videoFile = "http://vod.fr.nexint.net/fcf/" + videoFile + ".mov";

        if (browser == 'Internet Explorer')
        {
                document.write('<object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="256">\n');
                document.write('<param name="src" value="' + videoFile + '"/>\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
        else
        {
                document.write('<object type="video/quicktime" data="' + videoFile + '" width="320" height="256">\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
}

function affQTPlayer2(videoFile)
{
        var videoFile;
        videoFile = "http://vod.fr.nexint.net/fcf/" + videoFile + ".mov";

        if (browser == 'Internet Explorer')
        {
                document.write('<object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="480" height="376">\n');
                document.write('<param name="src" value="' + videoFile + '"/>\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
        else
        {
                document.write('<object type="video/quicktime" data="' + videoFile + '" width="480" height="376">\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
}

function affQTPlayer3(videoFile)
{
        var videoFile;
        videoFile = "http://vod.fr.nexint.net/fcf/" + videoFile + ".mov";

        if (browser == 'Internet Explorer')
        {
                document.write('<object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="196">\n');
                document.write('<param name="src" value="' + videoFile + '"/>\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
        else
        {
                document.write('<object type="video/quicktime" data="' + videoFile + '" width="320" height="196">\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
}

function affQTPlayer4(videoFile)
{
        var videoFile;
        videoFile = "http://vod.fr.nexint.net/fcf/" + videoFile + ".mov";

        if (browser == 'Internet Explorer')
        {
                document.write('<object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="314" height="186">\n');
                document.write('<param name="src" value="' + videoFile + '"/>\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
        else
        {
                document.write('<object type="video/quicktime" data="' + videoFile + '" width="314" height="186">\n');
                document.write('<param name="bgcolor" value="black"/>\n');
                document.write('</object>');
        }
}

function affWMPlayer(videoFile)
{
        var videoFile;
        videoFile = "mms://vod.fr.nexint.net/fcf/" + videoFile + ".wmv";

        document.write('<object type="video/x-ms-wmv" width="384" height="333">\n');
        document.write('<param name="src" value="' + videoFile + '"/>\n');
        document.write('</object>\n');
}

function affWMPlayer2(videoFile)
{
        var videoFile;
        videoFile = "mms://vod.fr.nexint.net/fcf/" + videoFile + ".wmv";

        document.write('<object type="video/x-ms-wmv" width="320" height="285">\n');
        document.write('<param name="src" value="' + videoFile + '"/>\n');
        document.write('</object>\n');
}

function affWMPlayer3(videoFile)
{
        var videoFile;
        videoFile = "mms://vod.fr.nexint.net/fcf/" + videoFile + ".wmv";

        document.write('<object type="video/x-ms-wmv" width="320" height="225">\n');
        document.write('<param name="src" value="' + videoFile + '"/>\n');
        document.write('</object>\n');
}