var pathname = window.location.pathname;

function resize() {

	document.getElementById('scroll_container').style.minHeight = "610px";
	document.getElementById('html').style.overflow = "auto";
	//document.getElementById('scroll_container').style.height = "880px";
	
	removeEventSimple(window,'load',resize);
	
}

function embedFlash(){
		
	getPathUrl();
	
	/*var flashvars = {};
	flashvars.pathname = pathname;
	var params = {};
	params.menu = "false";
	var attributes = {};
	attributes.id = "sanogyl_flash_container";
	attributes.name = "sanogyl_flash_container";*/
	//swfobject.embedSWF("/index.swf", "flash_container", "100%", "100%", "8.0.0", "/swf/expressInstall.swf",flashvars,params,attributes);
	
	var FO = {
	movie:"/index.swf", id:"home", width:"100%", height:"100%", align:"middle", menu:"false", setcontainercss:"true", bgcolor:"#FFFFFF" , majorversion:"8", build:"0", xi:"true",
	flashvars:'pathname='+pathname+''};
	UFO.create(FO, "flash_container");
	
	removeEventSimple(window,'load',embedFlash);
	
}

function getPathUrl(){
	var longueurURL = pathname.length;
	var extension = pathname.lastIndexOf(".") - 1;
	pathname = pathname.slice(1,longueurURL);
	pathname = pathname.slice(0,extension);
}

function openPopUp(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function addEventSimple(obj,evt,fn) {
   if (obj.addEventListener)
          obj.addEventListener(evt,fn,false);
   else if (obj.attachEvent)
          obj.attachEvent('on'+evt,fn);
}

function removeEventSimple(obj,evt,fn) {
   if (obj.removeEventListener)
          obj.removeEventListener(evt,fn,false);
   else if (obj.detachEvent)
          obj.detachEvent('on'+evt,fn);
}

addEventSimple(window,'load',embedFlash);
addEventSimple(window,'load',resize);

function formSubmitted(valeur,orderid){
	var objImg = new Image(1,1);
	 objImg.src="http://tsw0.com/6593/?aid="+valeur+"&value=1&ordid="+escape(orderid) ;
	//alert( objImg.src );
};

function statTradeDoubler(uid){
	var objImg = new Image(1,1);
	 objImg.src="https://tbl.tradedoubler.com/report?organization=1429108&event=178602&leadNumber="+uid ;
	//alert( objImg.src );
};

//window.onLoad = embedFlash ;

var urlBr = "http://reduction.sanogyl.fr/Pixiboxautologin.aspx?Email=USER_EMAIL&PartnerKey=BB210F37D6&Returnurl=http://reduction.sanogyl.fr/Offers/OnlyStoreOffers.aspx";

function displayPopHtml( str ) {

	var fakeMailExploded = urlBr.split('USER_EMAIL');
	var currentUrl = fakeMailExploded[0]+ str +fakeMailExploded[1];
	
	document.getElementById("objBr").src = currentUrl ;
	
	document.getElementById("popup").style.display = "block" ;
	
	return false;
	
}

function hidePopup(){
	//alert("hidepopup");
	document.getElementById("popup").style.display = "none" ;
	document.getElementById("home").removePopupHtml();
}
