
var sas_w3c=(document.getElementById)? true: false;
var sas_ns4=(document.layers)?true:false;
var sas_ie5=(sas_w3c && document.all)? true : false;
var sas_ns6=(sas_w3c && !document.all)? true: false;
var sas_d=document;
sas_currIDb=null; sas_xoff=0; sas_yoff=0;
sas_currRS=null; sas_rsxoff=0; sas_rsyoff=0;
sas_oldac=null; sas_newac=null; sas_zdx=100; sas_mx=0; sas_my=0;
var sas_currFb=null; var sas_currFs=null; var sas_currFID=0; var sas_currFcnt=0;
var sas_cidlist=new Array();

function sas_fadeboxin(id){
if((sas_currFb==null) && sas_w3c){
clearInterval(sas_currFID);
sas_currFb=sas_d.getElementById(id+'_b');
sas_currFs=sas_d.getElementById(id+'_s');
if(sas_currFb.style.display=='none'){
sas_currFcnt=0;
if(sas_ie5)sas_currFb.style.filter=sas_currFs.style.filter="alpha(opacity=0)";
else sas_currFb.style.MozOpacity=sas_currFs.style.MozOpacity=0;
sas_setAllScrollbars(true);
sas_currFb.style.display=sas_currFs.style.display='block';
sas_changez(sas_currFb);
sas_currFID=setInterval('sas_sub_fadein()',20);
}else sas_currFb=null;
}}

function sas_fadeboxout(id){
if((sas_currFb==null) && sas_w3c){
clearInterval(sas_currFID);
sas_currFb=sas_d.getElementById(id+'_b');
sas_currFs=sas_d.getElementById(id+'_s');
if(sas_currFb.style.display=='block'){
sas_currFcnt=100;
if(sas_ie5){
sas_currFb.style.filter="alpha(opacity=100)";
sas_currFs.style.filter="alpha(opacity=50)";
}else{
sas_currFb.style.MozOpacity=1;
sas_currFs.style.MozOpacity=.5;
}
sas_setAllScrollbars(true);
sas_currFb.style.display=sas_currFs.style.display='block';
sas_changez(sas_currFb);
sas_currFID=setInterval('sas_sub_fadeout()',20);
}else sas_currFb=null;
}}

function sas_hidebox(id){
if(sas_w3c){
//if(sas_currFb!=sas_d.getElementById(id+'_b')){
sas_d.getElementById(id+'_b').style.display='none';
sas_d.getElementById(id+'_s').style.display='none';
//}
}}

function sas_showbox(id){
if(sas_w3c){
var sas_bx=sas_d.getElementById(id+'_b');
var sas_sh=sas_d.getElementById(id+'_s');
sas_bx.style.display='block';
sas_sh.style.display='block';
sas_sh.style.zIndex=++sas_zdx;
sas_bx.style.zIndex=++sas_zdx;
if(sas_ns6){
sas_bx.style.MozOpacity=1;
sas_sh.style.MozOpacity=.5;
}else{
sas_bx.style.filter="alpha(opacity=100)";
sas_sh.style.filter="alpha(opacity=50)";
}
sas_changez(sas_bx);
}}

function sas_changecontent(id,text){
if(!document.getElementById(id+'_b').isExt){
var sas_d=document.getElementById(id+'_c');
if(sas_ns6)sas_d.style.overflow="hidden";
sas_d.innerHTML=text;
if(sas_ns6)sas_d.style.overflow="block";
}else document.getElementById(id+'_ifrm').src=text;
}

function sas_movePopup(ids,x,y){
if(sas_w3c){
var sas_idb=document.getElementById(ids+'_b');
var sas_ids=document.getElementById(ids+'_s');
sas_idb.style.left=x+'px';
sas_ids.style.left=x+8+'px';
sas_idb.style.top=y+'px';
sas_ids.style.top=y+8+'px';
}}

function sas_resizePopup(ids,rx,ry){
if(sas_w3c){
if(sas_d.getElementById(ids+'_rs').rsEnable){
sas_d.gEl=sas_d.getElementById;
sas_d.gEl(ids+"_extWA").style.display="block";
sas_d.gEl(ids+"_rs").style.left=Math.max(rx,((sas_ie5)?88:92))+'px';
sas_d.gEl(ids+"_rs").style.top=Math.max(ry,((sas_ie5)?68:72))+'px';
sas_d.gEl(ids+"_b").style.width=Math.max(rx+((sas_ie5)?12:8),100)+'px';
sas_d.gEl(ids+"_b").style.height=Math.max(ry+((sas_ie5)?12:8),80)+'px';
sas_d.gEl(ids+"_t").style.width=Math.max(rx+((sas_ie5)?4:3),((sas_ns6)?95:92))+'px';
sas_d.gEl(ids+"_btt").style.left=parseInt(sas_d.gEl(ids+"_t").style.width)-48+'px';
sas_d.gEl(ids+"_s").style.width=Math.max(rx+12,((sas_ie5)?100:104))+'px';
sas_d.gEl(ids+"_s").style.height=Math.max(ry+((sas_ie5)?12:13),((sas_ie5)?80:86))+'px';
sas_d.gEl(ids+"_c").style.width=Math.max(rx-((sas_ie5)?-5:5),((sas_ie5)?92:87))+'px';
sas_d.gEl(ids+"_c").style.height=Math.max(ry-((sas_ie5)?24:28),44)+'px';
sas_d.gEl(ids+"_max").h=parseInt(sas_d.gEl(ids+"_b").style.height);
}}}

function sas_setAllScrollbars(ishide){
if(document.all){
var sas_id;
for(sas_i=0;sas_i<sas_cidlist.length;sas_i++){
sas_id=sas_cidlist[sas_i];
if(!document.getElementById(sas_id+'_b').isExt)document.getElementById(sas_id+'_c').style.overflow=(ishide)?"hidden":"auto";
}}}

function sas_sub_fadein(){
sas_currFcnt+=4;
if(sas_ie5){
sas_currFb.style.filter="alpha(opacity="+sas_currFcnt+")";
sas_currFs.style.filter="alpha(opacity="+(sas_currFcnt/2)+")";
}else{
sas_currFb.style.MozOpacity=sas_currFcnt/100;
sas_currFs.style.MozOpacity=(sas_currFcnt/2)/100;
}
if(sas_currFcnt>=99){
sas_currFb.style.display=sas_currFs.style.display='block';
sas_setAllScrollbars(false)
sas_currFb=null;
clearInterval(sas_currFID);
}}

function sas_sub_fadeout(){
sas_currFcnt=sas_currFcnt-4;
if(sas_ie5){
sas_currFb.style.filter="alpha(opacity="+sas_currFcnt+")";
sas_currFs.style.filter="alpha(opacity="+(sas_currFcnt/2)+")";
}else{
sas_currFb.style.MozOpacity=sas_currFcnt/100;
sas_currFs.style.MozOpacity=(sas_currFcnt/2)/100;
}
if(sas_currFcnt<=0){
sas_currFb.style.display=sas_currFs.style.display='none';
sas_setAllScrollbars(false)
sas_currFb=null;
clearInterval(sas_currFID);
}}

function sas_preloadBttns(){
var sas_btns=new Array();
sas_btns[0]=new Image(); sas_btns[0].src="/images/min.gif";
sas_btns[1]=new Image(); sas_btns[1].src="/images/max.gif";
sas_btns[2]=new Image(); sas_btns[2].src="/images/close.gif";
sas_btns[3]=new Image(); sas_btns[3].src="/images/resize.gif";
}
sas_preloadBttns();

function sas_minimize(){
if(sas_w3c){
sas_d.getElementById(this.cid+"_b").style.height=(sas_ie5)? '28px':'24px';
sas_d.getElementById(this.cid+"_s").style.height='28px';
sas_d.getElementById(this.cid+"_c").style.display='none';
sas_d.getElementById(this.cid+"_rs").style.display='none';
sas_ns6bugfix();
}}

function sas_restore(){
if(sas_w3c){
sas_d.getElementById(this.cid+"_b").style.height=this.h+'px';
sas_d.getElementById(this.cid+"_s").style.height=(sas_ie5)? this.h+'px':this.h+5+'px';
sas_d.getElementById(this.cid+"_c").style.display='block';
sas_d.getElementById(this.cid+"_rs").style.display='block';
sas_ns6bugfix();
}}

function sas_ns6bugfix(){
if(navigator.userAgent.indexOf("Netscape/6")>0)setTimeout('self.resizeBy(0,1); self.resizeBy(0,-1);', 100);
}

function sas_trackmouse(evt){
sas_mx=(sas_ie5)?event.clientX+sas_d.body.scrollLeft:evt.pageX;
sas_my=(sas_ie5)?event.clientY+sas_d.body.scrollTop:evt.pageY;
if(!sas_ns6)sas_movepopup();
if((sas_currIDb!=null)||(sas_currRS!=null))return false;
}

function sas_movepopup(){
if((sas_currIDb!=null)&&sas_w3c)sas_movePopup(sas_currIDb.cid,sas_mx+sas_xoff,sas_my+sas_yoff);
if((sas_currRS!=null)&&sas_w3c)sas_resizePopup(sas_currRS.cid,sas_mx+sas_rsxoff,sas_my+sas_rsyoff);
return false;
}

function sas_stopRS(){
sas_d.getElementById(this.cid+"_extWA").style.display="none";
sas_currRS=null;
}

function sas_startRS(evt){
var sas_ex=(sas_ie5)?event.clientX+sas_d.body.scrollLeft:evt.pageX;
var sas_ey=(sas_ie5)?event.clientY+sas_d.body.scrollTop:evt.pageY;
sas_rsxoff=parseInt(this.style.left)-sas_ex;
sas_rsyoff=parseInt(this.style.top)-sas_ey;
sas_currRS=this;
if(sas_ns6)sas_d.getElementById(this.cid+"_c").style.overflow='hidden';
return false;
}

function sas_changez(v){
var sas_th=(v!=null)?v:this;
if(sas_oldac!=null)sas_d.getElementById(sas_oldac.cid+"_t").style.backgroundColor=sas_oldac.inactivecolor;
if(sas_ns6)sas_d.getElementById(sas_th.cid+"_c").style.overflow='auto';
sas_oldac=sas_th;
sas_d.getElementById(sas_th.cid+"_t").style.backgroundColor=sas_th.activecolor;
sas_d.getElementById(sas_th.cid+"_s").style.zIndex=++sas_zdx;
sas_th.style.zIndex=++sas_zdx;
sas_d.getElementById(sas_th.cid+"_rs").style.zIndex=++sas_zdx;
}

function sas_stopdrag(){
sas_currIDb=null;
document.getElementById(this.cid+"_extWA").style.display="none";
sas_ns6bugfix();
}

function sas_grab_id(evt){
var sas_ex=(sas_ie5)?event.clientX+sas_d.body.scrollLeft:evt.pageX;
var sas_ey=(sas_ie5)?event.clientY+sas_d.body.scrollTop:evt.pageY;
sas_xoff=parseInt(sas_d.getElementById(this.cid+"_b").style.left)-sas_ex;
sas_yoff=parseInt(sas_d.getElementById(this.cid+"_b").style.top)-sas_ey;
sas_currIDb=sas_d.getElementById(this.cid+"_b");
sas_currIDs=sas_d.getElementById(this.cid+"_s");
sas_d.getElementById(this.cid+"_extWA").style.display="block";
return false;
}

function sas_subBox(x,y,w,h,bgc,id){
var sas_v=sas_d.createElement('div');
sas_v.setAttribute('id',id);
sas_v.style.position='absolute';
sas_v.style.left=x+'px';
sas_v.style.top=y+'px';
sas_v.style.width=w+'px';
sas_v.style.height=h+'px';
if(bgc!='')sas_v.style.backgroundColor=bgc;
sas_v.style.visibility='visible';
sas_v.style.padding='0px';
return sas_v;
}

function sas_get_cookie(Name) {
var sas_search=Name+"=";
var sas_returnvalue="";
if(sas_d.cookie.length>0){
sas_offset=sas_d.cookie.indexOf(sas_search);
if(sas_offset!=-1){
sas_offset+=sas_search.length;
end=sas_d.cookie.indexOf(";",sas_offset);
if(end==-1)end=sas_d.cookie.length;
sas_returnvalue=unescape(sas_d.cookie.substring(sas_offset,end));
}}
return sas_returnvalue;
}

function sas_popUp(x,y,w,h,cid,text,bgcolor,textcolor,fontstyleset,title,url_iframe,titlecolor,titletextcolor,bordercolor,scrollcolor,shadowcolor,showonstart,isdrag,isresize,oldOK,isExt,popOnce,minImg,maxImg,clsImg,rsImg){
var sas_okPopUp=false;
if (popOnce){
if (sas_get_cookie(cid)==""){
sas_okPopUp=true;
sas_d.cookie=cid+"=yes"
}}
else sas_okPopUp=true;
if(sas_okPopUp){
if(sas_w3c){
sas_cidlist[sas_cidlist.length]=cid;
w=Math.max(w,100);
h=Math.max(h,80);
var rdiv=new sas_subBox(w-((sas_ie5)?12:8),h-((sas_ie5)?12:8),7,7,'',cid+'_rs');
if(isresize){
rdiv.innerHTML='<img src="'+rsImg+'" width="7" height="7">';
rdiv.style.cursor='move';
}
rdiv.rsEnable=isresize;
var sas_tw=(sas_ie5)?w:w+4;
var sas_th=(sas_ie5)?h:h+6;
var shadow=new sas_subBox(x+8,y+8,sas_tw,sas_th,shadowcolor,cid+'_s');
if(sas_ie5)shadow.style.filter="alpha(opacity=50)";
else shadow.style.MozOpacity=.5;
shadow.style.zIndex=++sas_zdx;
var outerdiv=new sas_subBox(x,y,w,h,bordercolor,cid+'_b');
outerdiv.style.display="block";
outerdiv.style.borderStyle="outset";
outerdiv.style.borderWidth="2px";
outerdiv.style.borderColor=bordercolor;
outerdiv.style.zIndex=++sas_zdx;
sas_tw=(sas_ie5)?w-8:w-5;
sas_th=(sas_ie5)?h+4:h-4;
var titlebar=new sas_subBox(2,2,sas_tw,20,titlecolor,cid+'_t');
titlebar.style.overflow="hidden";
titlebar.style.cursor="default";
var tmp=(isresize)?'<img src="'+minImg+'" width="16" height="16" id="'+cid+'_min"><img src="'+maxImg+'" width="16" height="16"  id="'+cid+'_max">':'';
titlebar.innerHTML='<span style="position:absolute; left:3px; top:1px; font:bold 10pt sans-serif; color:'+titletextcolor+'; height:18px; overflow:hidden; clip-height:16px;">'+title+'</span><div id="'+cid+'_btt" style="position:absolute; width:48px; height:16px; left:'+(sas_tw-48)+'px; top:2px; text-align:right">'+tmp+'<img src="'+clsImg+'" width="16" height="16" id="'+cid+'_cls"></div>';
sas_tw=(sas_ie5)?w-7:w-13;
var content=new sas_subBox(2,24,sas_tw,h-36,bgcolor,cid+'_c');
content.style.borderColor=bordercolor;
content.style.borderWidth="2px";
if(isExt){
content.innerHTML='<iframe id="a960c9b2" name="a960c9b2" src="'+url_iframe+'</iframe>';
content.style.overflow="hidden";
}else{
if(sas_ie5)content.style.scrollbarBaseColor=scrollcolor;
content.style.borderStyle="inset";
content.style.overflow="auto";
content.style.padding="0px 2px 0px 4px";
content.innerHTML=text;
content.style.font=fontstyleset;
content.style.color=textcolor;
}
var sas_extWA=new sas_subBox(2,24,0,0,'',cid+'_extWA');
sas_extWA.style.display="none";
sas_extWA.style.width='100%';
sas_extWA.style.height='100%';
outerdiv.appendChild(titlebar);
outerdiv.appendChild(content);
outerdiv.appendChild(sas_extWA);
outerdiv.appendChild(rdiv);
sas_d.body.appendChild(shadow);
sas_d.body.appendChild(outerdiv);
sas_d.gEl=sas_d.getElementById;
if(!showonstart)sas_hidebox(cid);
var sas_wB=sas_d.gEl(cid+'_b');
sas_wB.cid=cid;
sas_wB.isExt=(isExt)?true:false;
var sas_wT=sas_d.gEl(cid+'_t');
sas_wT.cid=cid;
if(isresize){
var sas_wRS=sas_d.gEl(cid+'_rs');
sas_wRS.cid=cid;
var sas_wMIN=sas_d.gEl(cid+'_min');
sas_wMIN.cid=cid;
var sas_wMAX=sas_d.gEl(cid+'_max');
sas_wMAX.h=h;
sas_wMAX.cid=cid;
sas_wMIN.onclick=sas_minimize;
sas_wMAX.onclick=sas_restore;
sas_wRS.onmousedown=sas_startRS;
sas_wRS.onmouseup=sas_stopRS;
}
var sas_wCLS=sas_d.gEl(cid+'_cls');
var sas_wEXTWA=sas_d.gEl(cid+'_extWA');
sas_wB.activecolor=titlecolor;
sas_wB.inactivecolor=scrollcolor;
if(sas_oldac!=null)sas_d.gEl(sas_oldac.cid+"_t").style.backgroundColor=sas_oldac.inactivecolor;
sas_oldac=sas_wB;
sas_wCLS.onclick=new Function("sas_hidebox('"+cid+"');");
sas_wB.onmousedown=function(){ sas_changez(this) }
if(isdrag){
sas_wT.onmousedown=sas_grab_id;
sas_wT.onmouseup=sas_stopdrag;
}
}else{
if(sas_oldOK){
var sas_ctr=new Date();
sas_ctr=sas_ctr.getTime();
var t=(isExt)?text:'';
var posn=(sas_ns4)? 'screenX='+x+',screenY='+y: 'left='+x+',top='+y;
var win=window.open(t , "abc"+sas_ctr , "status=no,menubar=no,width="+w+",height="+h+",resizable="+((isresize)?"yes":"no")+",scrollbars=yes,"+posn);
if(!isExt){
t='<ht'+'ml><he'+'ad><ti'+'tle>'+title+'</ti'+'tle></he'+'ad><bo'+'dy bgcolor="'+bgcolor+'"><font style="font:'+fontstyleset+'; color:'+textcolor+'">'+text+'</font></body></html>';
win.document.write(t);
win.document.close();
}}}}
}



function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return "NE";
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
 
var today = new Date();
var expires = new Date(today.getTime() + 86400000 );
 
function set() 
{
    Set_Cookie("welcome_new_site","done",expires);
}

function show_welcome_message()
{
		var rep = Get_Cookie('welcome_new_site');
		if (rep=='NE')
		{
			if(sas_ns6)setInterval('sas_movepopup()',40);

			if(sas_w3c){
				sas_d.onmousemove=sas_trackmouse;
				sas_d.onmouseup=new Function("sas_currRS=null");
			}
			
			sas_addLoadEvent(sas_opstick);
			new sas_popUp(0, 0, 300+12, 250+40, "sas_pop", "", "#FFFFFF", "#000000", "16pt serif", "Nouveau site !", 'http://www.francetransactions.com/php/pub/newsletter_souscription.php" framespacing="0" frameborder="no" scrolling="no" width="300" height="250"', "#00385c", "white", "lightgrey", "#00568c", "black", true, true, true, true, true, false,'http://www.francetransactions.com/images/min.gif','http://www.francetransactions.com/images/max.gif','http://www.francetransactions.com/images/close.gif','http://www.francetransactions.com/images/resize.gif');
		}
		set();
}

function sas_addLoadEvent(sas_func) {
  var sas_oldonload = window.onload;
  if (typeof window.onload != 'function') { window.onload=sas_func; } else { window.onload=function() {sas_oldonload();sas_func();} }
}

function sas_opstick() {
		var rep = Get_Cookie('offres_epargne');
		if (rep=='NE')
		{
			if(sas_ns6)setInterval('sas_movepopup()',40);

			if(sas_w3c){
				sas_d.onmousemove=sas_trackmouse;
				sas_d.onmouseup=new Function("sas_currRS=null");
			}

			sas_addLoadEvent(sas_opstick);
			new sas_popUp(0, 0, 300+12, 250+40, "sas_pop", "", "#FFFFFF", "#000000", "16pt serif", "Offre à ne pas manquer...", 'http://www.francetransactions.com/ads/adframe.php?n=a960c9b2&amp;what=<?php echo $search_st."@300x250|zone:30"; ?>" framespacing="0" frameborder="no" scrolling="no" width="300" height="250"><a href="http://www.francetransactions.com/ads/adclick.php?n=a960c9b2" target="_blank"><img src="http://www.francetransactions.com/ads/adview.php?what=<?php echo $search_st."@300x250|zone:30"; ?>&amp;n=a960c9b2" border="0" alt="">', "#00385c", "white", "lightgrey", "#00568c", "black", true, true, true, true, true, false,'http://www.francetransactions.com/images/min.gif','http://www.francetransactions.com/images/max.gif','http://www.francetransactions.com/images/close.gif','http://www.francetransactions.com/images/resize.gif');
		}
		Set_Cookie("offres_epargne","done",expires);
}

//* Appel de la crea dans le popup */
//window.onload=
//setTimeout("sas_opstick()",500);

