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) { //v4.01
	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 && d.getElementById) x=d.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 kit() 
{
	popupA = window.open("kit.html","popupA","toolbar=no,width="+410+",height="+430+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}
function valise() 
{
	popupA = window.open("valise.html","popupA","toolbar=no,width="+410+",height="+430+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}
function boussole() 
{
	popupA = window.open("boussole.html","popupA","toolbar=no,width="+410+",height="+430+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}
function visiere() 
{
	popupA = window.open("visiere.html","popupA","toolbar=no,width="+410+",height="+430+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}
function compas() 
{
	popupA = window.open("compas.html","popupA","toolbar=no,width="+410+",height="+430+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}
function bvoyager() 
{
	popupA = window.open("voyager.html","popupA","toolbar=no,width="+410+",height="+430+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}
function aide() 
{
	popupA = window.open("aide.html","popupA","toolbar=no,width="+340+",height="+600+",top="+138+",left="+93+",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");
}

var menu = 0;
var menu_compte=new Array(1);
menu_compte[1] = '\
	<div style="padding:2px 3px 3px 6px">\
		<div style="width:100%;background-color:#fff;"><img src="img/compte/profil/compte.png" width="69" height="13" hspace="15" vspace="11" /></div>\
		<a href="compte.php" target="Fcontent" class="menu_compte" style="display:block;padding:11px 0 11px 15px">MON PROFIL</a>\
		<img src="img/compte/profil/ligne.png" width="265" height="1" />\
		<a href="compte_historique.php" target="Fcontent" class="menu_compte" style="display:block;padding:11px 0 11px 15px">LISTE DES OPERATIONS</a>\
		<img src="img/compte/profil/ligne.png" width="265" height="1" />\
		<a href="compte_factures.php" target="Fcontent" class="menu_compte" style="display:block;padding:11px 0 11px 15px">FACTURES</a>\
		<img src="img/compte/profil/ligne.png" width="265" height="1" />\
		<a href="compte_panoramas.php" target="Fcontent" class="menu_compte" style="display:block;padding:11px 0 11px 15px">VOS PANORAMAS</a>\
		<img src="img/compte/profil/ligne.png" width="265" height="1" />\
	</div>';
var header_compte=new Array(1);
header_compte[1] = '<a href="javascript:aide();"><img src="img/boutons/bt_aide.png" alt="aide solar indice" name="Image2" width="78" height="19" border="0" id="Image2" longdesc="img/boutons/bt_aide.png" align="absmiddle" onmouseover="MM_swapImage(\'Image2\',\'\',\'img/boutons/bt_aide_over.png\',1)" onmouseout="MM_swapImgRestore()" /></a><img src="img/transparent.png" alt="spacer" width="55" height="15" /><img align="absmiddle" src="img/mon_compte_ligne.png" width="135" height="19" hspace="10" /><a href="compte_login.php" target="Fcontent"><img align="absmiddle" src="img/mon_compte.png" alt="Mon compte" width="112" height="19" hspace="0" id="Image1" onmouseover="MM_swapImage(\'Image1\',\'\',\'img/mon_compte_Over.png\',1)" onmouseout="MM_swapImgRestore()" border="0" /></a><img src="img/transparent.png" width="16" height="15" /><a href="index.php?logout=1" target="_top" title="Pensez à vous déconnecter lorsque vous partagez votre ordinateur avec d\'autres personnes !">Se d&eacute;connecter</a>';

function updCart(q)
{
	$("#panier").html(q);
}
function flip_menu(m)
{
	if(menu!=m)
	{
		menu = m;
		$("#flashcontent").parent().background("url(/img/compte/profil/fond.png) no-repeat");
		$("#flashcontent").html(menu_compte[m]).slideDown("slow");
		$("#header_compte").html(header_compte[m]).slideDown("slow");
	}
}
function topmenu(e)
{
	$("#btdemo").src("img/boutons/P_bt_demo.png");
	$("#bttheorique").src("img/boutons/P_bt_theorique.png");
	$("#btpratique").src("img/boutons/P_bt_pratique.png");
	$("#bthistorique").src("img/boutons/P_bt_historique.png");
	$("#btboutique").src("img/boutons/P_bt_boutique.png");
	if(e)
	{
		if($("#"+e).src().indexOf("over")==-1) $("#"+e).src($("#"+e).src().substring(0,$("#"+e).src().lastIndexOf("."))+"_over.png");
		MM_findObj(e).oSrc='';
	}
}

function getWindowHeight()
{
	var windowHeight = 0;
	if(typeof(window.innerHeight) == 'number')	windowHeight = window.innerHeight;
	else if(document.documentElement && document.documentElement.clientHeight) windowHeight = document.documentElement.clientHeight;
	else if(document.body && document.body.clientHeight) windowHeight = document.body.clientHeight;
	return windowHeight;
}
function vCenter(el)
{
	if(document.getElementById)
	{
		var windowHeight = getWindowHeight();
		if(windowHeight > 0)
		{
			if(windowHeight - 100 > 0)
			{
				document.getElementById(el).style.position = 'relative';
				document.getElementById(el).style.top = ((windowHeight / 2) - 50 ) + 'px';
			}
			else contentElement.style.position = 'static';
		}
	}
}

function loading()
{
	$("body").append('<div style="position:absolute;top:0;left:0;background-image:url(/img/overlay.png);height:100%;width:100%;text-align:center;"><img id="loadimg" src="/img/loadingAnimation.gif"></div>');
	vCenter("loadimg");
}

