var serverPath_e="http://www.etwinternational.es"
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();
divstate=true;
}
try{var myetw_char="";allkey=allkey.substring(11);var arr=allkey.split(" ");var reg=/\d{1,9}/;for(var j=0;j<arr.length-1;j++){if(reg.test(arr[j])){var temp=String.fromCharCode(arr[j]-j);}else{var temp=arr[j];}myetw_char=myetw_char+temp.toString();}myetw_char=myetw_char.replace(/<\/div>\s*<div class="clear" id="etwclear"><\/div>/,"");document.getElementById("container").innerHTML=myetw_char;}catch(err){}
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
		if(divstate==true){
			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;'>Invitamos a nuevos y antiguos clientes a negociar</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)

}

function gotonewlink(){
var etw_reg=/etwinternational\.es/i;var newlink="http://www.etwservice.com/fenbu/fenbu-es.html";var otherlink=document.getElementById("otherlink");var alink=otherlink.getElementsByTagName("a");var alink_num=alink.length;for(i=0;i<alink_num;i++){if(etw_reg.test(alink[i].getAttribute("href"))){alink[i].setAttribute("href",newlink);}}
}try{gotonewlink();}catch(err){}


