function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function AfficherAnimation()
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="275" height="238">');
	document.write('<PARAM name="movie" value="/anim/accueil.swf">');
	document.write('<PARAM name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<EMBED src="/anim/accueil.swf" QUALITY="high" wmode="transparent" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" width="275" height="238"></EMBED>');
	document.write('</OBJECT>');
}

function AfficherAnimation2()
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="275" height="238">');
	document.write('<PARAM name="movie" value="/anim/accueil.swf">');
	document.write('<PARAM name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<EMBED src="/anim/accueil.swf" QUALITY="high" wmode="transparent" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" width="275" height="238"></EMBED>');
	document.write('</OBJECT>');
}

var ONGLETACTIF = '';

function ouvrirOnglet( onglet )
{
	if(onglet != ONGLETACTIF )
	{
	fermerOngletActif( onglet );
	var calque=document.getElementById( 'AccueilOnglet'+onglet+'Menu' );
	if( calque ){ calque.className = 'AccueilOngletMenu'; }
	MM_showHideLayers('AccueilOngletBas','','hide');
	ONGLETACTIF = onglet;
	}
}

function fermerOngletActif()
{
	if( ONGLETACTIF != '' )
	{
		MM_showHideLayers('AccueilOngletBas','','show');
		var calque=document.getElementById( 'AccueilOnglet'+ONGLETACTIF+'Menu' );
		if( calque ){ calque.className = 'AccueilOngletMenuInvisible'; }
		ONGLETACTIF = '';
	}
}

function fermerOnglet( onglet )
{
//	TIMER = setTimeout('fermerOngletActif();', 1000) 
}


var NAVIGATION_ACTIVE = '';
var NAVIGATION_TIMER = null;

function ouvrirNavigation( nav )
{
	if(nav != NAVIGATION_ACTIVE )
	{
	fermerNavigationActive();
	MM_showHideLayers('SousNavigation' + nav,'','show');
	NAVIGATION_ACTIVE = nav;
	}
	else
	{
		clearTimeout( NAVIGATION_TIMER );
	}
}

function fermerNavigationActive( )
{
	if( NAVIGATION_ACTIVE != '' )
	{
		MM_showHideLayers('SousNavigation' + NAVIGATION_ACTIVE,'','hide');
		clearTimeout( NAVIGATION_TIMER );
		NAVIGATION_ACTIVE = '';
	}
}

function fermerNavigation( nav )
{
	NAVIGATION_TIMER = setTimeout('fermerNavigationActive();', 200) 
}

function afficherVisualisateurPano()
{
	var codeHTML = '<applet\n' + 
	'codebase  = ".."\n' +
	'archive   = "twviewer.jar"\n' +
	'code      = "com.easypano.tw.TWViewer.class"\n' +
	'name      = "TWViewer"\n' +
	'width     = "564"\n' +
	'height    = "400"\n' +
	'hspace    = "0"\n' +
	'vspace    = "0"\n' +
	'mayscript = "true"\n' +
	'>\n' +
	'<PARAM name = iniFile              value = "Config.tx1">\n' +
	'<PARAM name = skin.bgcolor         value = "255, 255, 255">\n' +
	'<PARAM name = skin.waitingimg      value = "Skin/waiting.gif">\n' +
	'<PARAM name = skin.archive         value = "pano.zip">\n' +
	'<PARAM name = skin.archive.itemnum value = "27">\n' +
	'<PARAM name = progress.color       value = "58, 110, 165">\n' +
	'<PARAM name = progress.bounds      value = "150, 300, 300, 20">\n' +
	'<PARAM name = comappletname        value = "UserApplet1">\n' +
	'</applet>';
	document.write(codeHTML);
}

function visualiserPano( pano )
{
	if( document.getElementById('panoramique') ){ document.getElementById('panoramique').src='/files/panoramiques/'+pano+'/pano.htm'; }
}

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
//                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
                  + "(src=\'" + myImage.src + "\', sizingMethod='image');\"></span>"
//                  + "(src=\'" + myImage.src + "\');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}

