//*************************************************************************
function sifrPopup()
{
	sIFR.replaceElement(
	named({
	  	sSelector:".popupContent h3",
		sFlashSrc:"../_sifr/snell.swf",
		sColor:"#feebc4",
		sLinkColor:"#feebc4",
		sBgColor:"#000000",
		sWmode:"transparent",
		sHoverColor:"#feebc4",
		nPaddingTop:0,
		nPaddingBottom:0,
		sFlashVars:"textalign=left&offsetTop=0&offsetLeft=10"}
	));
	switchDisplay('popupTableau1');
	switchDisplay('popupTableau2');
	switchDisplay('popupTableau3');
	switchDisplay('popupTableau4');
	switchDisplay('popupTableau5');
	switchDisplay('popupTableau6');
	switchDisplay('popupTableau7');
	switchDisplay('popupTableau8');
	switchDisplay('popupTableau9');
}
//*************************************************************************

var MyPopupClass = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}

var IE_SaveContainer = null;
var IE_SaveContent = null;
var IE_SaveXmlhttp = null;
var MyPopup = MyPopupClass.create();
MyPopup.prototype = {
	initialize : function(varName,popContainer,popContent) {
		
		this.varName = varName;
		this.popContainer = popContainer;
		this.popContent = popContent;
		this.oldPopFile = null;
		
		document.getElementById(this.popContainer).style.display='none';
	
		this.xmlhttp=null
	},
	
	open : function(popFile)
	{
		if(this.oldPopFile == popFile)
		{
			this.close();
		}
		else
		{
			this.oldPopFile = popFile;

			if (window.ActiveXObject)
			{
				this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
				this.xmlhttp.onreadystatechange = this.IEhandleEvent;
				IE_SaveContainer = this.popContainer
				IE_SaveContent = this.popContent
				IE_SaveXmlhttp = this.xmlhttp;
			}
			else
			{
				this.xmlhttp=new XMLHttpRequest()
				this.xmlhttp.onreadystatechange = this;
			}
			
			if (this.xmlhttp!=null)
			{
				this.xmlhttp.open("GET",popFile+'?'+(Math.random()*1000),true);
				this.xmlhttp.send(null);
			}
		}
	},
	close : function()
	{
		this.oldPopFile = null;
		document.getElementById(this.popContainer).style.display='none';
	},

	IEhandleEvent : function()
	{
		if (IE_SaveXmlhttp.readyState==4)
		{
			// if "OK"
			if (IE_SaveXmlhttp.status==200)
			{
				document.getElementById(IE_SaveContent).innerHTML=IE_SaveXmlhttp.responseText
				document.getElementById(IE_SaveContainer).style.display='';
				document.getElementById(IE_SaveContainer).style.marginLeft=Math.round((1000-document.getElementById(IE_SaveContainer).offsetWidth)/2);
				sifrPopup();
			}
		}
	},
	
	handleEvent : function()
	{
		// if xmlhttp shows "loaded"
		if (this.xmlhttp.readyState==4)
		{
			// if "OK"
			if (this.xmlhttp.status==200)
			{
				document.getElementById(this.popContent).innerHTML=this.xmlhttp.responseText
				document.getElementById(this.popContainer).style.display='';
				document.getElementById(this.popContainer).style.marginLeft=Math.round((1000-document.getElementById(this.popContainer).offsetWidth)/2)+"px";
				sifrPopup();
			}
			else
			{
				alert("Problem retrieving data:" + this.xmlhttp.statusText)
			}
		}
	}
}