


// Fonction de mise à jour de la vidéo
  function  changeVideo()
  {
  var returnStr = "";

  if(data.version == 2)
  {
    // 640 380
    data = {
      width: 500,
      height: 297,
      customerVideo: 2,
      playerTitles: 'yes',
      version: 1
    };
  }
  else
  {
    data = {
      width: 500,
      height: 297,
      customerVideo: 'All',
      playerTitles: 'no',
      version: 2
    };
  }


  if(hasRightVersion)
  {
    returnStr  = '<div style="width:' + data.width + 'px;height:' + data.height + 'px;Z-INDEX: -5" >';
    returnStr += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0" width="' + data.width + '" height="' + data.height + '" id="PlayerBezoom" align="middle">';
    returnStr += '<param name="allowScriptAccess" value="always" />';
    returnStr += '<param name="allowFullScreen" value="true" />';
    returnStr += '<param name="flashvars" value="CustomerId=32000154&CustomerVideo=' + data.customerVideo + '&PlayerSkin=Black&PlayerPlays=yes&PlayerTitles=' + data.playerTitles + '&PlayerWidth=' + data.width + '&PlayerHeight=' + data.height + '&CurrentVideo=&PlayerBack=&LogoBezoom=&Get3gp=&varresult=intoDB&PlayerLoop=" />';
    returnStr += '<param name="movie" value="http://france.bezoom.tv/PlayerBezoom/PlayerBezoom.swf" />';
    returnStr += '<param name="quality" value="best" />';
    returnStr += '<param name="wmode" value="transparent" />';
    returnStr += '<param name="bgcolor" value="#000000" />';
    returnStr += '<embed src="http://france.bezoom.tv/PlayerBezoom/PlayerBezoom.swf" flashvars="CustomerId=32000154&CustomerVideo=' + data.customerVideo + '&PlayerSkin=Black&PlayerPlays=yes&PlayerTitles=' + data.playerTitles + '&PlayerWidth=' + data.width + '&PlayerHeight=' + data.height + '&CurrentVideo=&PlayerBack=&LogoBezoom=&Get3gp=&varresult=intoDB&PlayerLoop=" quality="best" wmode="transparent" bgcolor="#000000" width="' + data.width + '" height="' + data.height + '" name="PlayerBezoom" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
    returnStr += '</object>';
    returnStr += '</div>';
  }
  else
  {
    returnStr = '<a href=http://www.macromedia.com/go/getflash/><img src="http://france.bezoom.tv/images/GetFlash.jpg" border="0" width="' + data.width + '" height="' + data.height + '" /></a>';
  }

  return returnStr;
  }


// common scripts

function OpenCenterPopUp(url) {
var wWidth = 930;
var wHeight = 720;
var Left=window.screen.width/2-wWidth/2;
var Top=window.screen.height/2-wHeight/2;
var Configuration='scrollbars=yes, resizable=yes, width='+wWidth+', height='+wHeight+', top='+Top+', left='+Left;
var f = window.open(url,'print',Configuration);
f.focus();
}

var emailregexp = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/i;

function trim(sString) {
while (sString.substring(0,1) == ' ') {
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ') {
sString = sString.substring(0,sString.length-1);
}
return sString;
}

function verifNewsletterForm(data) {
var form_err = "";
var item = trim(data);
if ( item.length < 0 || item.match(emailregexp) == null ) {
form_err += "Adresse e-mail non valide\r\n";
}
if(form_err.length > 0) 
{
alert(form_err);
return false;
}
else 
{
//window.open('', 'newsletter', 'height=400, width=600');
return true;
}
}

// Window open code

// Better window code


function openWin( winURL, winName, winWidth, winHeight, winX, winY, scrollBars, statusBar, menuBar, resizable ) {
	winName = window.open( winURL, winName, 'width='  + winWidth + ',height='  + winHeight + ',top=' + winX + ',left=' + winY + ',screenX=' + winX + ',screenY=' + winY + ',location=no,scrollbars=' + scrollBars + ',directories=no,status=' + statusBar + ',menubar=' + menuBar + ',personalbar=no,resizable=' + resizable );
	// winName.scrollTo( 0, 0 );
}

// Better window code lite
function openWinLite( winURL, winName ) {
	winName = window.open( winURL, winName, 'width=400,height=300,top=100,left=100,screenX=100,screenY=100,location=no,scrollbars=no,directories=no,status=no,menubar=no,personalbar=no,resizable=no' );
	// winName.scrollTo( 0, 0 );
}

function printerFriendlyWin(winURL) {
	winName = window.open( winURL, 'printerWin', 'width=570,location=yes,scrollbars=yes,directories=yes,status=yes,menubar=yes,personalbar=no,resizable=yes');
}

function openHelpWin( winURL, winName, winWidth, winHeight ) {
	winName = window.open( winURL, winName, 'width='  + winWidth + ',height='  + winHeight + ',top=100,left=100,screenX=100,screenY=100,location=no,scrollbars=yes,directories=no,status=yes,menubar=no,personalbar=no,resizable=yes' );
	// winName.scrollTo( 0, 0 );
}


// Calendar window opener
function calendarWin( winURL, winWidth, winHeight ) {
	calendarWinRef = window.open( winURL, 'calendarWinSysName', 'width='  + winWidth + ',height='  + winHeight + ',top=50,left=50,screenX=50,screenY=50,location=no,scrollbars=yes,directories=no,status=yes,menubar=no,personalbar=no,resizable=yes' );
	// calendarWinRef.scrollTo( 0, 0 );
}

function printerBCardWin(winURL) {
	winName = window.open( winURL, 'printerWin', 'width=400,height=350,location=yes,scrollbars=yes,directories=yes,status=yes,menubar=yes,personalbar=no,resizable=yes');
}


// Generally, it's safe to amalgamate all Dreamweaver code down here

function createObject( n, d ) {
	// Object creation code
	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 = createObject( n, d.layers[i].document );
		}
	}
	return x;
}

function preloadImages() {
	var d = document;
	if( d.images ){
		if( !d.preloadArr ) {
			d.preloadArr = new Array();
			var i, j = d.preloadArr.length, a = preloadImages.arguments;
			for( i = 0; i < a.length; i++ ) {
				if ( a[i].indexOf( "#" ) != 0 ){
					d.preloadArr[j] = new Image; d.preloadArr[j++].src = a[i];
				}
			}
		}
	}
}

function swapImage() {
	var i, j = 0, x, a = swapImage.arguments;
	document.imageRestoreArr = new Array;
	for( i = 0; i < ( a.length - 2 ); i += 3 )
		if( ( x = createObject( a[i] ) ) != null ) {
			document.imageRestoreArr[j++] = x;
			if( !x.oSrc )
				x.oSrc = x.src;
				x.src = a[i + 2];
				}
}

function swapImageRestore() {
	var i, x, a = document.imageRestoreArr;
	for( i = 0; a && i < a.length && ( x = a[i] ) && x.oSrc; i++ ) {
		x.src = x.oSrc;
	}
}

/* onLoad="preloadImages('images/navigation/home_over.gif')" */

/* onMouseOver="swapImage('aboutus','','image_over.file',1)" onfocus="swapImage('aboutus','','image_over.file',1)" onMouseOut="swapImageRestore()" onblur="swapImageRestore()" */
