// JavaScript Document
function SetCookie (name, value) {
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}

var pathname=location.pathname;
var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var date_exp = new Date();
date_exp.setTime(date_exp.getTime()+(14400*1000));
var sW=screen.width;
var sH=screen.height;
SetCookie("sW",sW,date_exp,myDomain);
SetCookie("sH",sH,date_exp,myDomain);
SetCookie("langdefaut","francais",date_exp,myDomain);


function popupcentree(page,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2;
var left=(screen.width-largeur)/2;
window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function validForm(){
// The information we're after
var screenWidth 	= screen.width;
var screenHeight 	= screen.height;
var colourDepth 	= screen.colorDepth;
var fm = 'entryform';
// Set the hidden vairable's values
document.forms[fm].elements['sW'].value = screenWidth;
document.forms[fm].elements['sH'].value = screenHeight;
document.forms[fm].elements['cD'].value = colourDepth;
}

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 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_findObj(n, d) { //v3.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); 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 customize(fm, url) {
//var fm = 'entryform';
//var address 	= document.forms[fm].elements[url].value;
var address 	= url;
var screenWidth = screen.width;
var screenHeight = screen.height;
var colourDepth = screen.colorDepth;
var op_tool  	= 1;
var op_loc_box  = 1;
var op_dir  	= 1;
var op_stat  	= 1;
var op_menu  	= 1;
var op_scroll  	= 1;
var op_resize  	= 0;
var op_wid  	= screenWidth - 5;
var op_heigh 	= screenHeight - 10;
var option = "toolbar="+ op_tool +",location="+ op_loc_box +",directories="
+ op_dir +",status="+ op_stat +",menubar="+ op_menu +",scrollbars="
+ op_scroll +",resizable="  + op_resize +",width=" + op_wid +",height="+ op_heigh;
//var win3 = window.open("", "Ce_que_je_veux", option);
var win4 = window.open(address, "Ce_que_je_veux", option);
win4.focus();

if(canDetectPlugins()) {
  var qtIsInstalled   = detectQuickTime();
  var wmvIsInstalled  = detectWindowsMedia();
  var realIsInstalled = detectReal();
  }
  
SetCookie("QTplugin",qtIsInstalled,date_exp,myDomain);
SetCookie("WMVplugin",wmvIsInstalled,date_exp,myDomain);
SetCookie("REALplugin",realIsInstalled,date_exp,myDomain);

// Set the hidden vairable's values
document.forms[fm].elements['sW'].value = screenWidth;
document.forms[fm].elements['sH'].value = screenHeight;
document.forms[fm].elements['cD'].value = colourDepth;
}

function detection_plugins_client() {

if(canDetectPlugins()) {
  var qtIsInstalled   = detectQuickTime();
  var wmvIsInstalled  = detectWindowsMedia();
  var realIsInstalled = detectReal();
  }
  
SetCookie("QTplugin",qtIsInstalled,date_exp,myDomain);
SetCookie("WMVplugin",wmvIsInstalled,date_exp,myDomain);
SetCookie("REALplugin",realIsInstalled,date_exp,myDomain);
}

function OnSubmitForm(fm) {

  window.document.forms[fm].submit();
}


function OnSubmitModeForm(fm, mode) {
  //var fm  = document.forms[frm];
  //var elt = fm.elements['mode'];
  //alert(fm);
  //alert(mode);
  window.document.forms[fm].elements['mode'].value = mode;
  window.document.forms[fm].submit();
}


function OnSubmitIdForm(fm, id, valueid) {
  window.document.forms[fm].elements[id].value = valueid;
  window.document.forms[fm].submit();
}

function OnSubmitLang(lang)  {
  this.document.forms['entrylang'].elements['lang'].value = lang;
	this.document.forms['entrylang'].submit();
	}
	
function Open(url){
  window.open (url,'help','scrollbars=yes,status=no,toolbar=no,menubar=no');
}

function charge(fr1){
	parent.grandephoto.location.href=fr1;
}

/******************************************
* Scrollable content script II- © Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/
//specify speed of scroll (greater=faster)
var speed=10
iens6=document.all||document.getElementById;
ns4=document.layers;

function getcontent_height(){
  if (iens6)
  contentheight=crossobj.offsetHeight
  else if (ns4)
  document.nscontainer.document.nscontent.visibility="show"
}
