var serverPath_e="http://www.etwinternational.fr"
var chatLayer
var chatlaystate_e=true


var nowheight
var xScroll_e
xScroll_e=document.documentElement.clientWidth-290
yScroll_e=document.documentElement.clientHeight-500


function closechatbox()
{
chatlaystate_e=true
chatLayer.innerHTML=""
chatLayer.style.cssText="width:0px;height:0px;"
thih=yScroll_e+40;
chatbox.style.cssText="position:absolute; top:"+thih+"px; left:"+xScroll_e+"px;"
showchatbox();
}

var scrollPos_e;
window.onscroll = function()
{
	xScroll_e=document.documentElement.clientWidth-290
	yScroll_e=document.documentElement.clientHeight-500

		if (typeof window.pageYOffset != 'undefined') {
	  		 scrollPos_e = window.pageYOffset;
		}else if (typeof document.compatMode != 'undefined' &&
			document.compatMode != 'BackCompat') {
		   	scrollPos_e = document.documentElement.scrollTop;
		}else if (typeof document.body != 'undefined') {
			scrollPos_e = document.body.scrollTop;
		}
		thih=scrollPos_e+yScroll_e
		chatbox.style.cssText="position:absolute; top:"+thih+"px; left:"+xScroll_e+"px;"
		if(chatlaystate_e==false){
			chatbox.style.cssText="background:none;border:none;height:0px;width:0px; display:none;"
			chatLayer_h=scrollPos_e+40
			chatLayer.style.cssText="height:440px;width:500px;position:absolute; top:"+chatLayer_h+"px;left:"+openwindow_x+"px; background:#fff;text-align:center;border:1px solid #999;filter:alpha(opacity=100);-moz-opacity:1;"
		}
}

function open_expo(ob)
{
var tempurl
tempurl=serverPath_e+"/chat_expo/feedback.html?"+ob+"&etwurl="+top.location.href
chatlaystate_e=false
openwindow_x=(xScroll_e/2)-100
nowheight=60
chatLayer=document.createElement("div")
chatLayer.style.cssText="height:440px;width:500px;position:absolute; top:"+nowheight+"px;left:"+openwindow_x+"px; background:#fff;text-align:center;border:1px solid #999;filter:alpha(opacity=90);-moz-opacity:0.9;"
var getframe=document.createElement("iframe")
getframe.setAttribute("width","460")
getframe.setAttribute("id","chatiframe")
getframe.setAttribute("height","410")
getframe.setAttribute("scrolling","no")
getframe.setAttribute("frameBorder","0")
getframe.setAttribute("src",tempurl)
var closewindow=document.createElement("div")
closewindow.innerHTML="<div id='etwchatbox_style' ><div style='float:left; width:90%; text-align:center;'>Tous les clients, qu'ils soient nouveaux ou anciens, sont les bienvenus. </div><div style='float:right; width:10%; text-align:center;'><a href='' onclick='closechatbox();return false;'><img src="+serverPath_e+"/chat_expo/close.jpg /></a></div></div>"
chatLayer.appendChild(closewindow)
chatLayer.appendChild(getframe)
document.body.appendChild(chatLayer)

}
