var cSuperCookie=""
var nMaxCount = 0


//chargement de la fenetre
function R_LoadImage(cDocLoc){
var cString=""
var cCookie=cSuperCookie


// Fond d'écran
if (cCookie=="M") {R_LoadBackground("images/Disign/WallPaper/WallPaper33.jpg")}
else if (cCookie=="B") {R_LoadBackground("images/Disign/WallPaper/WallPaper01.jpg")}
else if (cCookie=="G") {R_LoadBackground("images/Disign/WallPaper/WallPaper01.jpg")}
else if (cCookie=="S") {R_LoadBackground("images/Disign/WallPaper/WallPaper01.jpg")}
else if (cCookie=="P") {R_LoadBackground("images/Disign/WallPaper/WallPaper01.jpg")}
else if (cCookie=="A") {R_LoadBackground("images/Disign/WallPaper/WallPaper01.jpg")}

// Cookie
cString=GetCookie(cCookie + "Type")

// Pas un cookie
if (cString !=null) {
	// affiche l'image sauvegardée
	FullImage.src=cString
	}
else {
	if (cCookie=="M") {FullImage.src="images/Defaut/Display/Pebrier/Main03.jpg"}
	else if (cCookie=="B") {FullImage.src="images/Defaut/Display/Buffy/Main01.jpg"}
	else if (cCookie=="G") {FullImage.src="images/Defaut/Display/Genealogie/Main01.jpg"}
	else if (cCookie=="S") {FullImage.src="images/Defaut/Display/Jedi/Main01.jpg"}
	else if (cCookie=="P") {FullImage.src="images/Defaut/Display/Philip/Main01.jpg"}
	else if (cCookie=="A") {FullImage.src="images/Defaut/Display/Philip/Main01.jpg"}
	}


ExpFirefox.style.visibility="visible"
ExpIExplorer.style.visibility="visible"
ExpSafari.style.visibility="visible"
thebutton.style.visibility="visible"
javapowered.style.visibility="visible"
flashpowered.style.visibility="visible"
ExpOpera.style.visibility="visible"
ExpChrome.style.visibility="visible"


TestedVista.style.visibility="visible"
TestedXp.style.visibility="visible"
TestedApple.style.visibility="visible"
TestedLinux.style.visibility="visible"
TestedSolaris.style.visibility="visible"

Webname.style.visibility="visible"
thefull.style.visibility="visible"
// change la taille de l'image
R_SizeImage()

}


function R_SizeImage() {

FullImage.height=document.body.clientHeight-300;
FullImage.width=(FullImage.height * 1.333333333333333)
thefull.style.left=(document.body.clientWidth-FullImage.width)/2;
thefull.style.top=100;

thebutton.style.top=document.body.clientHeight-100
thebutton.style.left=(document.body.clientWidth-img1.width)/2

ExpFirefox.style.left=document.body.clientWidth-75
ExpFirefox.style.top=document.body.clientHeight-100

ExpIExplorer.style.left=document.body.clientWidth-135
ExpIExplorer.style.top=document.body.clientHeight-100

ExpSafari.style.left=document.body.clientWidth-195
ExpSafari.style.top=document.body.clientHeight-100

ExpOpera.style.left=document.body.clientWidth-255
ExpOpera.style.top=document.body.clientHeight-100

ExpChrome.style.left=document.body.clientWidth-315
ExpChrome.style.top=document.body.clientHeight-100

javapowered.style.left=document.body.clientWidth-110
javapowered.style.top=10

flashpowered.style.left=document.body.clientWidth-110
flashpowered.style.top=110

TestedVista.style.left=20
TestedVista.style.top=document.body.clientHeight-100

TestedXp.style.left=80
TestedXp.style.top=document.body.clientHeight-100

TestedApple.style.left=140
TestedApple.style.top=document.body.clientHeight-100

TestedLinux.style.left=200
TestedLinux.style.top=document.body.clientHeight-100


TestedSolaris.style.left=260
TestedSolaris.style.top=document.body.clientHeight-100

}
function R_Zoom(objet,type,mode) {
var nSize
var nMove

// Zoom Plus
if (mode==1) {
	nSize=75;
	nMove=12   
}
else if (mode=2) {
	nSize=50;
	nMove=0    
}
// Taille
objet.width=nSize;
objet.height=nSize;
// Position
if (type==1){
	ExpFirefox.style.left=document.body.clientWidth-75-nMove;
	ExpFirefox.style.top=document.body.clientHeight-100-nMove;}
else if (type==2){
	ExpIExplorer.style.left=document.body.clientWidth-135-nMove;
	ExpIExplorer.style.top=document.body.clientHeight-100-nMove;}
else if (type==3){
	ExpSafari.style.left=document.body.clientWidth-195-nMove;
	ExpSafari.style.top=document.body.clientHeight-100-nMove;}
else if (type==4){
	ExpOpera.style.left=document.body.clientWidth-255-nMove;
	ExpOpera.style.top=document.body.clientHeight-100-nMove;}	
else if (type==5){
	ExpChrome.style.left=document.body.clientWidth-315-nMove;
	ExpChrome.style.top=document.body.clientHeight-100-nMove;}	
	
else if (type==10){
	TestedVista.style.left=20-nMove
	TestedVista.style.top=document.body.clientHeight-100-nMove;}	
else if (type==11){
	TestedXp.style.left=80-nMove
	TestedXp.style.top=document.body.clientHeight-100-nMove;}			
else if (type==12){
	TestedApple.style.left=140-nMove
	TestedApple.style.top=document.body.clientHeight-100-nMove;}	
else if (type==13){
	TestedLinux.style.left=200-nMove
	TestedLinux.style.top=document.body.clientHeight-100-nMove;}	
else if (type==14){
	TestedSolaris.style.left=260-nMove
	TestedSolaris.style.top=document.body.clientHeight-100-nMove;}	

		
}



function R_ChangeDisplay(){
var pathname="/" //location.pathname;
var date_exp = new Date();
var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var cImage = FullImage.src
var nLong = cImage.length
var cInter = ""
var nCalcul = 0


cInter=cImage.substring(nLong-6,nLong-4)
nCalcul=(cInter*1)+1


if (nCalcul > nMaxCount){nCalcul=1}

cInter="00" + nCalcul

cInter = cInter.substring(cInter.length-2,cInter.length)
cInter = cImage.substring(0,cImage.length-6) +cInter + cImage.substring(cImage.length-4,cImage.length)
FullImage.src=cInter

// sauvegarde Paramétres
date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));
// Ici on définit une durée de vie de 365 jours
SetCookie(cSuperCookie+"Type",cInter,date_exp,myDomain);



}

function R_LoadBackground(cParam){
var cString=GetCookie(cSuperCookie+"Background")

// Pas un cookie
if (cString !=null) {
	// affiche l'image sauvegardée
	document.body.background=cString
	}
else {
	document.body.background=cParam
	}


}

function R_ChangeBackground(){
var pathname="/" //location.pathname;
var date_exp = new Date();
var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var cImage=document.body.background
var nLong = cImage.length
var cInter = ""
var nCalcul = 0
var nMax=R_MaxParam()

cInter=cImage.substring(nLong-6,nLong-4)
nCalcul=(cInter*1)+1


if (nCalcul > nMax){nCalcul=1}

cInter="00" + nCalcul

cInter = cInter.substring(cInter.length-2,cInter.length)
cInter = cImage.substring(0,cImage.length-6) +cInter + cImage.substring(cImage.length-4,cImage.length)

// change le fond d'écran
document.body.background=cInter

// sauvegarde Paramétres
date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));
// Ici on définit une durée de vie de 365 jours
SetCookie(cSuperCookie + "Background",cInter,date_exp,myDomain);

}


function R_Initial(cDocLoc){
var d=document
var cTexte=""
var cRef=""
var cTitre=""
// Modele de Pebrier.com
cSuperCookie="M"
nMaxCount=10
cTexte="www.pebrier.com"
cRef="param/Fonctions/Menus/Saint_Aygulf.htm"
cTitre = "www.Pebrier.com Version 2.20 (c)R. Alexandre 2010"

// wWw.buffy.li
if (cDocLoc=="http://www.pebrier.com/index.php?B") {
	cSuperCookie="B"
	nMaxCount=1
	cTexte="www.buffy.li"
	cRef="param/Fonctions/Menus/Photos.htm"
	cTitre = "www.Buffy.li Version 2.20 (c)R. Alexandre 2010"
	}
else if (cDocLoc=="http://www.pebrier.com/index.php?G") {
	cSuperCookie="G"
	nMaxCount=4
	cTexte="www.genealogie-alexandre.fr"
	cRef="param/Fonctions/Menus/Genealogie.htm"
	cTitre = "www.genealogie-alexandre.fr Version 2.20 (c)R. Alexandre 2010"
	}
else if (cDocLoc=="http://www.pebrier.com/index.php?P") {
	cSuperCookie="P"
	nMaxCount=3
	cTexte="www.philip-alexandre.fr"
	cRef="param/Fonctions/Philip/Philip_Accueil.htm"
	cTitre = "www.philip-alexandre.fr Version 2.20 (c)R. Alexandre 2010"
	}
else if (cDocLoc=="http://www.pebrier.com/index.php?A") {
	cSuperCookie="A"
	nMaxCount=3
	cTexte="www.philip-alexandre.com"
	cRef="param/Fonctions/Philip/Philip_Accueil.htm"
	cTitre = "www.philip-alexandre.com Version 2.20 (c)R. Alexandre 2010"
	}
else if (cDocLoc=="http://www.pebrier.com/index.php?S") {
	cSuperCookie="S"
	nMaxCount=9
	cTexte="www.jedi.li"
	cRef="param/Fonctions/Autres/Main.php"
	cTitre = "www.Jedi.li Version 2.20 (c)R. Alexandre 2010"
	}


// Texte
//d.write("<p><b><font face='Comic Sans MS' color='#FFFF00' size='4'>" + cTexte + "</font></b></p>")
// Title de Head
document.title=cTexte

d.write("<span id='Webname' style='position: absolute; top:10px;left 0px;visibility: hidden'>")
d.write("<img border='0' src='images/Defaut/StartHeader/Header"+ cSuperCookie +".png' width='215' height='50' title='" + cTitre + "' ondblclick='R_ChangeBackground()'>")
d.write("</span>")


d.write("<span id='TestedVista' style='position: absolute; top:50px; left: 100px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.windowsvista.com/'>")
d.write("<img border='0' src='images/Defaut/System/vista.png' width='50' height='50' title='Testé avec Windows Vista et Windows 7' onmouseover='R_Zoom(this,10,1)' onmouseout='R_Zoom(this,10,2)'></a></font></b></p>")
d.write("</span>")
d.write("<span id='TestedXp' style='position: absolute; top:50px; left: 200px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.windowsxp.com/'>")
d.write("<img border='0' src='images/Defaut/System/xp.png' width='50' height='50' title='Testé avec Windows XP' onmouseover='R_Zoom(this,11,1)' onmouseout='R_Zoom(this,11,2)'></a></font></b></p>")
d.write("</span>")

d.write("<span id='TestedApple' style='position: absolute; top:50px; left: 300px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.apple.com/fr/macosx/'>")
d.write("<img border='0' src='images/Defaut/System/apple.png' width='50' height='50' title='Testé avec Mac OS' onmouseover='R_Zoom(this,12,1)' onmouseout='R_Zoom(this,12,2)'></a></font></b></p>")
d.write("</span>")
d.write("<span id='TestedLinux' style='position: absolute; top:50px; left: 400px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.linux.com/'>")
d.write("<img border='0' src='images/Defaut/System/tux.png' width='50' height='50' title='Testé avec Linux' onmouseover='R_Zoom(this,13,1)' onmouseout='R_Zoom(this,13,2)'></a></font></b></p>")
d.write("</span>")
d.write("<span id='TestedSolaris' style='position: absolute; top:50px; left: 500px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.sun.com/'>")
d.write("<img border='0' src='images/Defaut/System/sun.png' width='50' height='50' title='Testé avec Sun Solaris 10.00' onmouseover='R_Zoom(this,14,1)' onmouseout='R_Zoom(this,14,2)'></a></font></b></p>")
d.write("</span>")




d.write("<span id='ExpFirefox' style='position: absolute; top:100px; left: 500px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.mozilla.org/'>")
d.write("<img border='0' src='images/Defaut/Explorer/FireFox.png' width='50' height='50' title='Testé avec FireFox Version : 3.6.3' onmouseover='R_Zoom(this,1,1)' onmouseout='R_Zoom(this,1,2)'></a></font></b></p>")
d.write("</span>")
d.write("<span id='ExpIExplorer' style='position: absolute; top:100px; left: 600px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.microsoft.com/'>")
d.write("<img border='0' src='images/Defaut/Explorer/Internet%20Explorer.png' width='50' height='50' title='Testé avec Internet Explorer Version : 8.0.7600.16385' onmouseover='R_Zoom(this,2,1)' onmouseout='R_Zoom(this,2,2)'></a></font></b></p>")
d.write("</span>")
d.write("<span id='ExpSafari' style='position: absolute; top:100px; left: 700px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.apple.com/'>")
d.write("<img border='0' src='images/Defaut/Explorer/safari.png' width='50' height='50' title='Testé avec Safari Version : 4.0.5 (531.22.7)'  onmouseover='R_Zoom(this,3,1)' onmouseout='R_Zoom(this,3,2)' ></a></font></b></p>")
d.write("</span>")
d.write("<span id='ExpOpera' style='position: absolute; top:100px; left: 400px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.opera.com/'>")
d.write("<img border='0' src='images/Defaut/Explorer/opera.png' width='50' height='50' title='Testé avec Opera Version : 10.51 (3315)'  onmouseover='R_Zoom(this,4,1)' onmouseout='R_Zoom(this,4,2)' ></a></font></b></p>")
d.write("</span>")
d.write("<span id='ExpChrome' style='position: absolute; top:100px; left: 300px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.google.com/chrome'>")
d.write("<img border='0' src='images/Defaut/Explorer/chrome.png' width='50' height='50' title='Testé avec Google Chrome Version : 4.1.249.1045'  onmouseover='R_Zoom(this,5,1)' onmouseout='R_Zoom(this,5,2)' ></a></font></b></p>")
d.write("</span>")
d.write("<span id='javapowered' style='position: absolute; top:100px; left: 800px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.java.com/'>")
d.write("<img border='0' src='images/Defaut/AddOn/java_orange.png' width='100' height='100' title='Testé avec Java Version : 6 Update 17' ></a></font></b></p>")
d.write("</span>")
d.write("<span id='flashpowered' style='position: absolute; top:200px; left: 800px;visibility: hidden'>")
d.write("<a target='_blank' href='http://www.flash.com/'>")
d.write("<img border='0' src='images/Defaut/AddOn/flash.png' width='100' height='100' title='Testé avec Flash Version : 10.0.45.2' ></a></font></b></p>")
d.write("</span>")



d.write("<span id='thefull' style='position: absolute; top:50px; left: 50px;visibility: hidden'>")
d.write("<div align='center'>")
d.write("<table border='2' bordercolorlight='#000000' bordercolordark='#000000' bordercolor='#000000' bgcolor='#000000'>")
d.write("<tr>")
d.write("<td height='10' width='10'>")
d.write("<img id='FullImage' border='0' src='images/Defaut/Display/Main01.jpg' height='100' width='100' ondblclick='R_ChangeDisplay()' ></td>")
d.write("</tr>")
d.write("</table>")
d.write("</div>")
d.write("</span>")

d.write("<span id='thebutton' style='position: absolute; top: 250px; left: 450px; visibility: hidden'>")
d.write("<p align='center'>")
d.write("<a href='"+ cRef + "'>")
d.write("<img border='0' id='img1' src='images/Defaut/Boutons/TheButtonClick.jpg' height='60' width='300' alt='Entrez' fp-style='fp-btn: Embossed Capsule 5; fp-transparent: 1' fp-title='Entrez' onmouseover='R_SwapImage(1)' onmouseout='R_SwapImage(2)' onmousedown='R_SwapImage(3)' onmouseup='R_SwapImage(1)')'></a></p>")
d.write("</span>")


}

function R_SwapImage(nParam){
if (nParam==1){FP_swapImg(1,0,'img1','images/Defaut/Boutons/TheButtonActive.jpg')}
else if (nParam==2){FP_swapImg(0,0,'img1','images/Defaut/Boutons/TheButtonClick.jpg')}
else if (nParam==3){FP_swapImg(1,0,'img1','images/Defaut/Boutons/TheButtonMain.jpg')}

}
