// CDA PRELOAD IMAGES -->

	NewSectionOff = new Image();
	NewSectionOff.src = "/images/NewSection_off.gif";

	NewSectionOn = new Image();
	NewSectionOn.src = "/images/NewSection_on.gif";

// End -->

// CDA CONTENT PROTECTION -->

var ContextMenuStatut = 'ON';
var DragStatut = 'ON';
var SelectStatut = 'ON';

function ContextMenu(Statut)
	{
	ContextMenuStatut = Statut;
	}

function Select(Statut)
	{
	SelectStatut = Statut;
	}

function Drag(Statut)
	{
	DragStatut = Statut;
	}

function OnContextMenu()
	{	
	if (ContextMenuStatut == 'ON')
		{
		return(true);
		}
	else
		{
		return(false);
		}
	}

function OnDragStart()
	{
	if (DragStatut == 'ON')
		{
		return(true);
		}
	else
		{
		return(false);
		}
	}

function OnSelectStart()
	{
	if (SelectStatut == 'ON')
		{
		return(true);
		}
	else
		{
		return(false);
		}
	}

document.oncontextmenu = OnContextMenu;
document.ondragstart = OnDragStart;
document.onselectstart = OnSelectStart;

// End -->

var Mic = "Mic";
var Nav = navigator.appName.substring(0,3);

var LockState = "OFF";
LockStateImg = new Image();
LockStateImg.src = "/images/LockFrame.gif";

function ChangeFrame()
{
	if (LockState == "OFF")
		{
		LockState = "ON";
		SetFrame();
		}
	else
		{
		LockState = "OFF";
		SetFrame();
		}
}

function SetFrame()
{
	if (LockState == "OFF")
		{
   		document.getElementById('LockFrame').style.backgroundImage = "url('images/FreeFrame.gif')";
		}
	else
		{
   		document.getElementById('LockFrame').style.backgroundImage = "url('images/LockFrame.gif')";
		}
}

function Introduction()
{
    var Curtains = document.getElementById('Curtains');
	var Title = document.getElementById('Title');
	var Wait = document.getElementById('Wait');

    if (Title.style.display == '' && Wait.style.display == '' && parseInt(Curtains.style.height) <= 20)
    	{
    	if (Nav == Mic)
			{
	    	FadeOutInt = setInterval("FadeOutIE()",10);
	    	}
	    else
			{
	    	FadeOutInt = setInterval("FadeOutFF()",10);
	    	}
    	}

	if (parseInt(Curtains.style.height) <= 20 && parseInt(Curtains.style.width) <= 20)
		{
		Curtains.style.height = "20px";
		LoadSiteInt = setInterval("LoadSite()",10);
		}
}

function Animation()
{
    var Curtains = document.getElementById('Curtains');
	var Title = document.getElementById('Title');
	var Wait = document.getElementById('Wait');

    if (parseInt(Curtains.style.width) == 760 && parseInt(Curtains.style.height) == 460)
    	{
		FrameCloseInt = setInterval("FrameClose()",10);
    	}

    if (parseInt(Curtains.style.width) == 0 && parseInt(Curtains.style.height) == 460)
    	{
		FrameOpenInt = setInterval("FrameOpen()",10);
    	}

    if (Title.style.display == 'none' && Wait.style.display == 'none')
    	{
    	if (Nav == Mic)
			{
	    	FadeInInt = setInterval("FadeInIE()",10);
	    	}
	    else
			{
	    	FadeInInt = setInterval("FadeInFF()",10);
	    	}
    	}

    if (Title.style.display == 'block' && Wait.style.display == 'block')
    	{
    	if (Nav == Mic)
			{
	    	FadeOutInt = setInterval("FadeOutIE()",10);
	    	}
	    else
			{
	    	FadeOutInt = setInterval("FadeOutFF()",10);
	    	}
    	}
}

function Link(what)
{
	URL = what.href;

	if (LockState == "ON")
		{
		NoAnimLink(URL);
		return false;
		}
	else
		{
		AnimLink(URL);
		return false;
		}
}

function AnimLink(URL)
{
    var Curtains = document.getElementById('Curtains');
	var LeftMenu = document.getElementById('LeftMenu');
	var LeftMenuPosition = parseInt(LeftMenu.style.left);

	if (parseInt(Curtains.style.width) == 760 && window.MainFrame.location != URL && LeftMenuPosition == 0)
		{
		MenuAnim();
		AnimLinkInt = setInterval("AnimLink(URL)",10);
		return false;
		}

	if (parseInt(Curtains.style.width) == 760 && window.MainFrame.location != URL && LeftMenuPosition == -170)
		{
		if (window.AnimLinkInt)
			{
			Animation();
			AnimLinkInt = clearInterval(AnimLinkInt);
			AnimLinkInt = setInterval("AnimLink(URL)",10);
			return false;
			}
		else
			{
			Animation();
			AnimLinkInt = setInterval("AnimLink(URL)",10);
			return false;
			}
		}

	if (parseInt(Curtains.style.width) == 0 && window.MainFrame.location != URL && LeftMenuPosition == -170)
		{
		AnimLinkInt = clearInterval(AnimLinkInt);
		window.MainFrame.location = URL;
		return false;
		}

	if (parseInt(Curtains.style.width) == 760 && window.MainFrame.location == URL && LeftMenuPosition == 0)
		{
		MenuAnim();
		return false;
		}
}

function NoAnimLink(URL)
{
	var LeftMenu = document.getElementById('LeftMenu');
	var LeftMenuPosition = parseInt(LeftMenu.style.left);

	if (window.MainFrame.location != URL && LeftMenuPosition == 0)
		{
		MenuAnim();
		NoAnimLinkInt = setInterval("NoAnimLink(URL)",10);
		return false;
		}
	else if (window.MainFrame.location == URL && LeftMenuPosition == 0)
		{
		MenuAnim();
		return false;
		}
	else if (window.MainFrame.location != URL && LeftMenuPosition == -170)
		{
		if (window.NoAnimLinkInt)
			{
			NoAnimLinkInt = clearInterval(NoAnimLinkInt);
			window.MainFrame.location = URL;
			return false;
			}
		else
			{
			window.MainFrame.location = URL;
			return false;
			}
		}
	else
		{
		return false;
		}
}

function ClosedCurtain()
{
    var Curtains = document.getElementById('Curtains');
	var LeftMenu = document.getElementById('LeftMenu');
	var LeftMenuPosition = parseInt(LeftMenu.style.left);

	if (parseInt(Curtains.style.width) == 760 && LeftMenuPosition == 0)
		{
		MenuAnim();
		AnimLinkInt = setInterval("ClosedCurtain()",10);
		return false;
		}

	if (parseInt(Curtains.style.width) == 760 && LeftMenuPosition == -170)
		{
		if (window.AnimLinkInt)
			{
			Animation();
			AnimLinkInt = clearInterval(AnimLinkInt);
			AnimLinkInt = setInterval("ClosedCurtain()",10);
			return false;
			}
		else
			{
			Animation();
			AnimLinkInt = setInterval("ClosedCurtain()",10);
			return false;
			}
		}

	if (parseInt(Curtains.style.width) == 0 && LeftMenuPosition == -170)
		{
		AnimLinkInt = clearInterval(AnimLinkInt);
		return true;
		}
}

function LoadSite()
{
    var Curtains = document.getElementById('Curtains');
    var CurrHeight = parseInt(Curtains.style.height);
    var NewHeight = CurrHeight + parseInt(20);

	if (NewHeight > 0)
		{
	    var LockFrame = document.getElementById('LockFrame');
		LockFrame.style.height = "";
		}
	
	if (NewHeight == 460)
		{
		LoadSiteInt = clearInterval(LoadSiteInt);
		Curtains.style.width = "20px";
		LoadMenuInt = setInterval("LoadMenu()",10);
		}

    Curtains.style.height = NewHeight + "px";
}

function LoadMenu()
{
    var Curtains = document.getElementById('Curtains');
    var CurrWidth = parseInt(Curtains.style.width);
    var NewWidth = CurrWidth + parseInt(20);

	if (NewWidth > 0)
		{
	    var LockFrame = document.getElementById('LockFrame');
		LockFrame.style.width = "";
		}

	if (NewWidth == 760)
		{
		LoadMenuInt = clearInterval(LoadMenuInt);
		MenuAnim();
		SetFrame();
		}

    Curtains.style.width = NewWidth + "px";
}

function FrameOpen()
{
    var Curtains = document.getElementById('Curtains');
    var CurrWidth = parseInt(Curtains.style.width);
    var NewWidth = CurrWidth + parseInt(20);

	if (NewWidth > 0)
		{
	    var LockFrame = document.getElementById('LockFrame');
		LockFrame.style.width = "";
		}

	if (NewWidth == 760)
		{
		FrameOpenInt = clearInterval(FrameOpenInt);
		}

    Curtains.style.width = NewWidth + "px";
}

function FrameClose()
{
    var Curtains = document.getElementById('Curtains');
    var CurrWidth = parseInt(Curtains.style.width);
    var NewWidth = CurrWidth - parseInt(20);

	if (NewWidth == 0)
		{
		FrameCloseInt = clearInterval(FrameCloseInt);
	    var LockFrame = document.getElementById('LockFrame');
		LockFrame.style.width = "20px";
		}

    Curtains.style.width = NewWidth + "px";
}

function FadeOutFF()
{
	var Title = document.getElementById('Title');
	var Wait = document.getElementById('Wait');

	if (Title.style.display != 'block' && Wait.style.display != 'block')
		{
		Title.style.display = 'block';
		Wait.style.display = 'block';
		}

	if (Title.style.opacity == 0 && Wait.style.opacity == 0)
		{
		FadeOutInt = clearInterval(FadeOutInt);

		if (Title.style.display != 'none' && Wait.style.display != 'none')
			{
			Title.style.display = 'none';
			Wait.style.display = 'none';
			}

		return false;
		}

    Title.style.opacity = ((Title.style.opacity*100)-5)/100;
    Wait.style.opacity = ((Wait.style.opacity*100)-5)/100;
}

function FadeOutIE()
{
	var Title = document.getElementById('Title');
	var Wait = document.getElementById('Wait');

	if (Title.style.display != 'block' && Wait.style.display != 'block')
		{
		Title.style.display = 'block';
		Wait.style.display = 'block';
		}

	if (Title.filters.alpha.opacity == 0 && Wait.filters.alpha.opacity == 0)
		{
		FadeOutInt = clearInterval(FadeOutInt);

		if (Title.style.display != 'none' && Wait.style.display != 'none')
			{
			Title.style.display = 'none';
			Wait.style.display = 'none';
			}

		return false;
		}

	Title.filters.alpha.opacity = Title.filters.alpha.opacity-5;
	Wait.filters.alpha.opacity = Title.filters.alpha.opacity-5;
}


function FadeInFF()
{
    var Curtains = document.getElementById('Curtains');

	var Title = document.getElementById('Title');
	var Wait = document.getElementById('Wait');

	if (Title.style.opacity >= 1 && Wait.style.opacity >= 1)
		{
		FadeInInt = clearInterval(FadeInInt);
		}

	if (Title.style.display != 'block' && Wait.style.display != 'block' && parseInt(Curtains.style.width) < 620)
		{
		Title.style.display = 'block';
		Wait.style.display = 'block';
		}

	if (parseInt(Curtains.style.width) < 630)
		{
	    Title.style.opacity = ((Title.style.opacity*100)+5)/100;
	    Wait.style.opacity = ((Wait.style.opacity*100)+5)/100;
		}
}

function FadeInIE()
{
    var Curtains = document.getElementById('Curtains');

	var Title = document.getElementById('Title');
	var Wait = document.getElementById('Wait');

    var TitleOpacity = Title.filters.alpha.opacity;
    var WaitOpacity = Wait.filters.alpha.opacity;

	if (WaitOpacity >= 100 && TitleOpacity >= 100)
		{
		FadeInInt = clearInterval(FadeInInt);
		}

	if (Title.style.display != 'block' && Wait.style.display != 'block' && parseInt(Curtains.style.width) < 620)
		{
		Title.style.display = 'block';
		Wait.style.display = 'block';
		}

	if (parseInt(Curtains.style.width) < 620)
		{
	    Title.filters.alpha.opacity = Title.filters.alpha.opacity+5;
	    Wait.filters.alpha.opacity = Title.filters.alpha.opacity+5;
		}
}

function MenuAnim()
{
    var MainFrame = document.getElementById('MainFrame');
    var FrameContent = (MainFrame.contentWindow || MainFrame.contentDocument);

    if (FrameContent.document)
    	{ FrameContent = FrameContent.document; }

    var Popup = FrameContent.getElementById('Popup');

    var LeftMenu = document.getElementById('LeftMenu');
    var LeftMenuPosition = parseInt(LeftMenu.style.left);

	if (Popup != null && Popup.innerHTML != "")
		{ window.frames['MainFrame'].ClosePopup(); }

	if (LeftMenuPosition == 0)
		{
		MenuInt = setInterval("MenuClose()",10);
	   	}

	else if (parseInt(LeftMenu.style.left) == -170)
		{
		MenuInt = setInterval("MenuOpen()",10);
		}
}

function MenuOpen()
{
    var LeftMenu = document.getElementById('LeftMenu');
    var CurrPosition = parseInt(LeftMenu.style.left);
    var NewPosition = CurrPosition + parseInt(10);

	if (NewPosition == 0)
		{
		MenuInt = clearInterval(MenuInt);
		}

    LeftMenu.style.left= NewPosition + "px";
}

function MenuClose()
{
    var LeftMenu = document.getElementById('LeftMenu');
    var CurrPosition = parseInt(LeftMenu.style.left);
    var NewPosition = CurrPosition - parseInt(10);

	if (NewPosition == -170)
		{
		MenuInt = clearInterval(MenuInt);
		}

    LeftMenu.style.left = NewPosition + "px";
}