var shopoon = {};
shopoon.shoppingBoxes = new Array();
shopoon.shoppingBox = function(name, flagOP, width, height, src, parentId){
this.name = name;
this.flagOP = flagOP;
this.width = width;
this.height = height;
this.src = src;
this.parentId = parentId;
this.init();
shopoon.shoppingBoxes.push(this);};
//Méthodes publiques
shopoon.shoppingBox.prototype =
{
init: function()
{
this.expand = false;
if(this.height > 250)
this.expand = true;
},
writeIframe: function()
{
return "<iframe name=\"shopoon-box\" src=\""+this.src+"\" width=\""+this.width+"\" height=\""+this.height+"\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\"></iframe>";
},
loadIframe: function()
{
	if(top.frames["shopoon"])
	{
		try{
		top.frames["shopoon"].location.href=this.src;
		}catch(e){}
	}
},
setFLAG: function(flag)
{
this.flag=flag;
this.src = this.src.replace(/FLAGREP/gi, this.flag);
},
setMOD: function(mod)
{
this.mod=mod;
this.src = this.src.replace(/MODREP/gi, this.mod);
},
setCSS: function(css)
{
this.css = css;
this.src = this.src.replace(/CSSREP/gi, this.css);
},
toString: function()
{
return "shoppingBox Object";
}
};
//Méthodes statiques
shopoon.shoppingBox.getByName = function(name)
{
for (var i = 0; shopoon.shoppingBoxes[i]; i++)
{
if (shopoon.shoppingBoxes[i].name == name)
{
return shopoon.shoppingBoxes[i];
}
}
return false;
};
var mainShoppingBox;
if(!shopoon.shoppingBox.getByName("mainShoppingBox"))
{
mainShoppingBox = new shopoon.shoppingBox("mainShoppingBox", "shopoon", 0,0, "http://box.shopoon.fr/ShopBox.aspx?flag=FLAGREP&mod=MODREP&css=CSSREP", "shoppingBox");
}

function WriteShoppingBox(flag, mod, css, width, height)
{
if(mainShoppingBox.parentId != undefined && mainShoppingBox.parentId != "")
{
	mainShoppingBox.setFLAG(flag);
	mainShoppingBox.setMOD(mod);
	mainShoppingBox.setCSS(css);
	mainShoppingBox.width=width;
	mainShoppingBox.height=height;
    if(document.getElementById(mainShoppingBox.parentId))
	{
        document.getElementById(mainShoppingBox.parentId).innerHTML = mainShoppingBox.writeIframe();
		mainShoppingBox.loadIframe();
	}
    else
	{
        document.write(mainShoppingBox.writeIframe());
		mainShoppingBox.loadIframe();
	}
}
else
{
    document.write(mainShoppingBox.writeIframe());
	mainShoppingBox.loadIframe();
}
}
WriteShoppingBox("lemondetechno", "", "lmfr_rouge", 300,250);