


function WebChat(objName){
this.baseURL = "http://say-on.com/webchat/";
this.staticURL = "http://www0.say-on.com/webchat/";


this.roomid = null;
this.user = "";
this.language = "";
this.winTitle = "";
this.minText = unescape("%u4E0E%u540C%u65F6%u8BBF%u95EE%u6B64%u9875%u7684%u7F51%u53CB%u4EA4%u6D41");
this.bgColor = "#2a60ac";
this.position = ""
this.barWidth = "200px";
this.barHeight = "40px";
this.miniWidth = "320px";
this.miniHeight = "220px";
this.width = "600px";
this.height = "400px";
this.barBG = "";
this.previewBG = this.staticURL+"images/prvbg_172x100.png";
this.bminiMode = false;
this.bstatic = true;
this.bopen = false;
this.bPreview = false;
this.canDrag = true;
this.lastLoad = false;
this.previewMode = "";
this.ChatRoomStatus = "";


this.URL = null;
this.closeHint = unescape("%u5373%u5C06%u5173%u95ED%u5728%u7EBF%u4EA4%u8C08%u9762%u677F%uFF0C%u5237%u65B0%u9875%u9762%u53EF%u91CD%u65B0%u663E%u793A");
this.minTitle = unescape("%u6700%u5C0F%u5316%u4EA4%u8C08%u7A97%u53E3");
this.maxTitle = unescape("%u5728%u76F8%u540C%u7A97%u53E3%u6253%u5F00");
this.openTitle = unescape("%u5728%u65B0%u7A97%u53E3%u6253%u5F00");
this.inTitle = unescape("%u5728%u9875%u9762%u4E2D%u6253%u5F00");
this.closeTitle = unescape("%u5173%u95ED%u4EA4%u8C08%u7A97%u53E3");

this.color = "#000000";
this.objName = objName;
this.zIndex = 5000;
this.staticTime = 5;
this.bHidden = false;
this.roomURL = "";
this.minButton = this.staticURL+"images/min_btn.gif";
this.maxButton = this.staticURL+"images/max_btn.gif";
this.openButton = this.staticURL+"images/open_btn.gif";
this.closeButton = this.staticURL+"images/close_btn.gif";
this.inButton = this.staticURL+"images/in_btn.gif";

this.odiv = null;
this.popMode = true;
this.top = "";
this.left = "";
this.Ypos = 0;
this.Xpos = 0;
this.mwin = null;
this.staticTimer = null;
this.tbwidth = 0;
this.tbheight = 0;
this.winStatus = "";
this.barBGStr = "";
this.oldInit = null;

this.show = function(){
if(!this.odiv) return false;
var tHTML = "";
if(this.bminiMode){
this.odiv.style.width = this.miniWidth;
this.odiv.style.height = this.miniHeight;
}else if(!this.bstatic){
this.odiv.style.width = this.width;
this.odiv.style.height = this.height;
} else {
if(this.width.search("%")!=-1){
this.odiv.style.width = Math.floor(this.tbwidth* Number(this.width.replace("%",""))/100 )+"px";
}else{
this.odiv.style.width = this.width;
	}
if(this.height.search("%")!=-1){
this.odiv.style.height = Math.floor(this.tbheight* Number(this.height.replace("%",""))/100 )+"px";
}else{
this.odiv.style.height = this.height;
	}
}
if( !(!this.bstatic && this.bopen) ){
tHTML += '<table border="0" cellpadding="0" style="border-collapse: collapse; font-size: 12px; ';
tHTML += this.barBGStr;
tHTML += '" width="100%" height="20px"><tr>';
tHTML += '<td nowrap width="80%"><div onmouseover="__oWC.drag(this);" style="position:relative;'+(this.canDrag?'cursor:move;':'')+'font-size:9pt;margin-left:4px;margin-top:4px;margin-right:4px;">'+this.minText+'</div></td>';
tHTML += '<td nowrap align=right><div style="position:relative;margin-right:4px;padding:0px; cursor:hand;">';
tHTML += '<img onclick="'+this.objName+'.setStatus(\'min\');return false;"  border="0" title="'+this.minTitle+'" src="'+this.minButton+'">';
tHTML += '<img border="0" onclick="'+this.objName+'.swch();return false;" title="'+this.inTitle+'" src="'+this.inButton+'">';
tHTML += '<img border="0" onclick="'+this.objName+'.open();return false;" title="'+this.openTitle+'" src="'+this.openButton+'">';
tHTML += '<img border="0" onclick="'+this.objName+'.full();return false;" title="'+this.maxTitle+'" src="'+this.maxButton+'">';
tHTML += '<img onclick="'+this.objName+'.close();return false;"  border="0" title="'+this.closeTitle+'" src="'+this.closeButton+'">';
tHTML += '</div></td>';
tHTML += '</tr></table>';
}
tHTML += '<iframe  id="iframeWebChat" width="100%" height="100%" name="iframeWebChat" src="'+this.roomURL+'" frameborder="0" scrolling="no" allowtransparency="true" ></iframe>';
this.odiv.innerHTML = tHTML;
this.winStatus = "show";
return true;
};

this.preview = function(){
var tHTML = "";
var sbd = this.odiv.style;
var prvHTML = "";
prvHTML += '<iframe style="position:relative;cursor:default;" width="100%" height="100%" scrolling="no" allowTransparency="true" border="0" frameborder="0" ';
prvHTML += 'src="'+this.baseURL+'preview.jsp';
prvHTML += '?title='+escape(this.winTitle);
if(this.user && this.user!="")
prvHTML += ("&user=" + escape(this.user));
if(this.INT_sha && this.INT_sha !=""){
prvHTML += ("&INT_time="+this.INT_time+"&INT_email=" + this.user + "&INT_sha=" + this.INT_sha + "&INT_id="+this.INT_id);
}
prvHTML += ('&color='+this.bgColor.replace("#","")+'&roomid='+this.roomid);
prvHTML += '" ></iframe>';
var prvBtns = '<div style="position:relative;margin-right:4px;padding:0px; cursor:hand;">'
+ '<img border="0" onclick="'+this.objName+'.show();return false;" title="'+this.inTitle+'" src="'+this.inButton+'">'
+ '<img border="0" onclick="'+this.objName+'.open();return false;" title="'+this.openTitle+'" src="'+this.openButton+'">'
+ '<img border="0" onclick="'+this.objName+'.full();return false;" title="'+this.maxTitle+'" src="'+this.maxButton+'">'
+ '<img onclick="'+this.objName+'.close();return false;"  border="0" title="'+this.closeTitle+'" src="'+this.closeButton+'">'
+ '</div>';
var prvSt = '';
if( (typeof(document.body.style.filter)!="undefined") ){
prvSt += ' background:transparent; filter:'
+'progid:DXImageTransform.Microsoft.gradient(GradientType =1,enabled=true,startColorstr=#AAFFFFFF, endColorstr=#AAFFFFFF);';
}else{
prvSt += ' background-color:white;'
}
prvSt += 'overflow:hidden;position:relative;cursor:default;width:100%;'
switch(this.previewMode){
case "block":
sbd.width = '48';
sbd.height = '22';
tHTML += '<table border="0" cellpadding="2" style="border-collapse: collapse; font-size: 12px; ';
tHTML += this.barBGStr;
tHTML += '" width="100%" height="22px"><tr>';
tHTML += '<td nowrap><div onmouseover="__oWC.drag(this);" style="padding-left:6px;position:relative;'+(this.canDrag?'cursor:move;':'')+'font-size:9pt;margin-left:4px;margin-top:4px;margin-right:4px;"><span onclick="'+this.objName+'.show()" style="cursor:default;position:relative;" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" >'+this.minText+'</span></div></td>';
tHTML += '<td nowrap align=right>'+prvBtns+'</td>';
tHTML += '</tr>';
if(this.bPreview)
tHTML += '<tr><td colspan=2><div style="'+prvSt+'height:42px;">'+prvHTML+'</div></td></tr>';
tHTML += '</table>';
break;
case "bar":
sbd.width = (this.bstatic ? this.tbwidth : "100%");
sbd.height = '22px';
tHTML += '<table border="0" cellpadding="2" style="border-collapse: collapse; font-size: 12px; ';
tHTML += this.barBGStr;
tHTML += '" width="100%" height="22px"><tr>';
tHTML += '<td nowrap><div onmouseover="__oWC.drag(this);" style="padding-left:6px;position:relative;'+(this.canDrag?'cursor:move;':'')+'font-size:9pt;margin-left:4px;margin-top:4px;margin-right:4px;"><span onclick="'+this.objName+'.show()" style="cursor:default;position:relative;" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" >'+this.minText+'</span></div></td>';
if(this.bPreview)
tHTML += '<td width="80%"><div style="'+prvSt+'height:18px;">'+prvHTML+'</div></td>';
tHTML += '<td nowrap align=right>'+prvBtns+'</td>';
tHTML += '</tr></table>';
break;
default:
sbd.width = '172px';
sbd.height = '100px';
tHTML += '<div style="font-size: 12px; width:172px; height:100px;';
tHTML += "background-image:url('"+this.previewBG+"');background-repeat:no-repeat;"
tHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+this.previewBG+"');_background-image:none;";
tHTML += '" >';
tHTML += '<div onmouseover="__oWC.drag(this);" style="position:relative;'+(this.canDrag?'cursor:move;':'')+'height:14px;width:100%" ></div>';
tHTML += '<div align=center style="margin-left:14px;overflow:hidden;position:relative;cursor:default;width:140px;height:46px;">'+prvHTML+'</div>';
tHTML += '<div onmouseover="__oWC.drag(this);" style="position:relative;'+(this.canDrag?'cursor:move;':'')+'height:22px;width:100%" ></div>';
tHTML += '<center><span onclick="'+this.objName+'.show()" style="cursor:default;position:relative;" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" ><b>'+this.minText+'</b></span></center>';
tHTML += '</div>';
break;
}
this.odiv.innerHTML = tHTML;
this.winStatus = "preview";
if(this.previewMode=="block"){
var el = this.odiv.firstChild;
this.odiv.style.width = el.clientWidth+"px";
this.odiv.style.height = el.clientHeight+"px";
}
return true;
};
this.min = function(){
if(!this.odiv) return false;
if(this.previewMode == "" && !this.bPreview){
this.previewMode = "block";
}
return this.preview();
};
this.makeWindowName = function(wn) {
wn = wn.replace(/@/,"at");
wn = wn.replace(/\./g,"dot");
wn = wn.replace(/\//g,"slash");
wn = wn.replace(/&/g,"amp");
wn = wn.replace(/\'/g,"tick");
wn = wn.replace(/=/g,"equals");
wn = wn.replace(/#/g,"pound");
wn = wn.replace(/:/g,"colon");	
wn = wn.replace(/%/g,"percent");
wn = wn.replace(/-/g,"dash");
wn = wn.replace(/ /g,"blank");
wn = wn.replace(/\?/g,"mk");
return wn;
};
this.open = function(){
if(!this.popMode){
this.show();
return;
}
this.mwin = window.open(this.roomURL,"WebChat_"+this.makeWindowName(this.roomURL.substr(this.roomURL.length-10)),"width=640px,height=480px,resizable=yes");
this.min();
var oif = document.getElementById("iframeWebChat");
if(!oif){
return;
} else {
document.location.href = oif.src;
}
};

this.swch = function(){
if(!this.odiv) return false;
var oif = document.getElementById("iframeWebChat");
if(!oif) return;
	
if(this.odiv.clientWidth > 320 && this.odiv.clientHeight > 220){
this.odiv.style.width = this.miniWidth;
this.odiv.style.height = this.miniHeight;
this.bminiMode = true;
}else {
if(this.width.search("%")!=-1){
this.odiv.style.width = Math.floor(this.tbwidth* Number(this.width.replace("%",""))/100 )+"px";
}else{
this.odiv.style.width = this.width;
	}
	
if(this.height.search("%")!=-1){
this.odiv.style.height = Math.floor(this.tbheight* Number(this.height.replace("%",""))/100 )+"px";
}else{
this.odiv.style.height = this.height;
	}
this.bminiMode = false;
}
	
};

this.close = function(){
if(!this.odiv) return false;
if(this.closeHint && this.closeHint!="" && !confirm(this.closeHint))
return;
this.odiv.innerHTML = "";
this.winStatus = "";
var oif = document.getElementById("iframeWebChat");
if(!oif) return;
document.location.href = oif.src;
};

this.create = function(){
	
if(!this.bstatic){
this.canDrag = false;
}else{
if(this.position.search(/(left|right)/ig)==-1)
this.position = this.position + ";right:16px;";
if(this.position.search(/(top|bottom)/ig)==-1)
this.position = this.position + ";bottom:16px;";
}

if(this.user && this.user != "")
this.user = this.user.replace(/<.*>(.*)<.*>/g,"$1").replace(/(\s|&nbsp;)/ig,"");
		
if(!this.URL || this.URL=="" ){
this.URL = escape(location.host+location.pathname);
}else{
this.URL = this.URL.replace(/^(http|https):\/\//i,"");
}
this.roomURL = this.baseURL;
if(this.roomid && this.roomid.match(/^\d{3,}$/)){
this.roomURL += "?roomid=" + this.roomid;
if(this.user && this.user!="")
this.roomURL += "&user=" + escape(this.user);
if(this.INT_sha && this.INT_sha !=""){
this.roomURL += ("&INT_time="+this.INT_time+"&INT_email=" + this.user + "&INT_sha=" + this.INT_sha + "&INT_id="+this.INT_id);
	}
if(this.language && this.language!="")
this.roomURL += ("&language=" + this.language);
}else{
this.roomid = escape(this.URL);
this.roomURL += "?color="+this.bgColor.replace("#","");
this.roomURL += (this.winTitle?("&title="+escape(this.winTitle)):"");
if(this.user && this.user!="")
this.roomURL += "&user=" + escape(this.user);
if(this.INT_sha && this.INT_sha !=""){
this.roomURL += ("&INT_time="+this.INT_time+"&INT_email=" + this.user + "&INT_sha=" + this.INT_sha + "&INT_id="+this.INT_id);
	}
if(this.language && this.language!="")
this.roomURL += ("&language=" + this.language);
this.roomURL += "&roomid=" + this.roomid;
}

this.barBGStr = "";
if( (typeof(document.body.style.filter)!="undefined") ){
if( this.barBG == ""){
var colstr = this.bgColor.replace(/#/g,"");
this.barBGStr += ' background:transparent; filter:';
this.barBGStr += 'progid:DXImageTransform.Microsoft.gradient(GradientType =1,enabled=true,startColorstr=#88'+colstr+', endColorstr=#88'+colstr+')';
}else{
if(this.barBG.search(/\.png$/i)!=-1){
this.barBGStr += ' background:transparent; filter:';
this.barBGStr += "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='scale', src='"+this.barBG+"'); ";
}else{
this.barBGStr += " background:transparent url('"+this.barBG+"'); ";
	}
	}
}else{
if( this.barBG == ""){
this.barBGStr += ' background-color:'+this.bgColor+'; ';
}else{
this.barBGStr += " background:transparent url('"+this.barBG+"'); ";
	}
}
var tHTML= '';
if(this.bstatic){
tHTML += '<div id="divWebChat" style="font-size:12px;cursor:default;position:absolute;'+this.position + '; width:' + this.barWidth + ';height:' + this.barHeight + ';z-index:' + this.zIndex+';"></div>';
}else{
tHTML += '<div id="divWebChat" style="font-size:12px;cursor:default;position:relative;"></div>';
}

if(!this.lastLoad){
document.write(tHTML);
this.load();
}else{
if(!this.bstatic)
document.write(tHTML);
if(typeof(document.body.onload)=="function")
this.oldInit = document.body.onload;
document.body.onload = function(){ 
if(__oWC.oldInit)
__oWC.oldInit();
__oWC.load();
};
}
};

this.load = function(){
var tb = (document.compatMode!="BackCompat")? document.documentElement : document.body;
if(tb){
this.tbwidth = tb.clientWidth;
this.tbheigh = tb.clientHeight;
}

this.odiv = document.getElementById("divWebChat");
if(!this.odiv){
var el;
el = document.createElement("DIV");
el.id = "divWebChat";
el.style.cssText = 'font-size:12px;cursor:default;position:absolute;'+this.position + '; width: ' + this.barWidth + ';height:' + this.barHeight + ';z-index:' + this.zIndex + '; ';
this.odiv = document.body.appendChild(el);
}
var st = this.getCookie("ChatRoomStatus");
st = st ? st : this.ChatRoomStatus;
if(st==""){
st = (this.bHidden? "hidden" : (this.bopen ? "show" : "min"));
}
this.bHidden = (st == "hidden");
this.setStatus(st);
var m,tn;
this.position = this.position.toLowerCase().replace(/\s/g,"");
if(this.Ypos==0){
m = this.position.match(/(bottom|top):(\d*)px/i)
if(m && m[1] && m[2]){
tn = Number(m[2]);
if(m[1]=='bottom')
this.Ypos = tn;
else
this.Ypos = tb.clientHeight - tn - this.odiv.clientHeight;
	}
}
if(this.Xpos==0){
m = this.position.match(/(left|right):(\d*)px/i)
if(m && m[1] && m[2]){
tn = Number(m[2]);
if(m[1]=='right')
this.Xpos = tn;
else
this.Xpos = tb.clientWidth - tn - this.odiv.clientWidth;
	}
}
this.makeStatic();
};
this.setStatus = function(st,expday){
if(!this.odiv){
this.load();
}
if(!st || st=="")	st=(this.bopen ? "show" : "min");
if(st == "hidden"){
if(this.odiv.style.display != "none"){this.odiv.style.display = "none";}
this.bHidden = true;
}else{
if(this.odiv.style.display == "none"){this.odiv.style.display = "";}
this.bHidden = false;
}
switch(st){
case "hidden":
if(this.winStatus != ""){
this.odiv.innerHTML = "";
this.winStatus = "";
	}
break;
case "show":
if(this.winStatus != "show"){
this.show();
}else{
this.swch();
	}
break;
case "open":
this.open();
break;
default :
if(this.winStatus != "preview"){
this.min();
	}
break;
}
this.ChatRoomStatus = st;
if(typeof(expday)!='undefined'){
var d;
if(expday == 0 ){
d = null;
}else{
d = new Date();
d.setTime(d.getTime() + (expday*24*60*60*1000)); 
	}
this.setCookie("ChatRoomStatus",st,d,'/');
}
};
this.getStatus = function(){
return this.ChatRoomStatus;
};
this.makeStatic = function(){
if(!this.odiv) return false;
if(!this.bstatic) return false;
var tb = (document.compatMode!="BackCompat")? document.documentElement : document.body;
if(this.tbheight != tb.clientHeight){
this.tbheight = tb.clientHeight;
if(!this.bminiMode && this.height.search("%")!=-1 && this.winStatus == "show" ){
this.odiv.style.height = Math.floor(this.tbheight* Number(this.height.replace("%",""))/100 )+"px";
	}
if(this.tbheight < this.odiv.clientHeight)
this.odiv.style.height = Math.floor(this.tbheight*.8)+"px";
}

if(this.tbwidth != tb.clientWidth){
this.tbwidth = tb.clientWidth;
switch(this.winStatus){
case "show":
if(!this.bminiMode && this.width.search("%")!=-1) 
this.odiv.style.width = Math.floor(this.tbwidth* Number(this.width.replace("%",""))/100 )+"px";
break;
case "preview":
if(this.previewMode== "bar")
this.odiv.style.width = this.tbwidth+"px";
break;
default:
break;
	}
if(this.tbwidth < this.odiv.clientWidth)
this.odiv.style.width = Math.floor(this.tbwidth*.8)+"px"; 
}
	
var staticYOffset = tb.clientHeight;
var YOffset = this.odiv.clientHeight;
var winY = document.all?tb.scrollTop:window.pageYOffset;
var newtop = (winY+staticYOffset-YOffset-this.Ypos);
newtop  = (newtop < winY ? winY : newtop )+"px";
if(this.top != newtop){
this.odiv.style.top= newtop;
this.top = newtop;
}
var staticXOffset = tb.clientWidth;
var XOffset = this.odiv.clientWidth;
var winX = document.all?tb.scrollLeft:window.pageXOffset;
var newleft = (winX+staticXOffset-XOffset-this.Xpos)
newleft = (newleft < winX ? winX : newleft)+"px"; 
if(this.left != newleft){
this.odiv.style.left= newleft;
this.left = newleft;
}
this.staticTimer = setTimeout(this.objName+'.makeStatic()', this.staticTime);
};

this.moveTo = function(left,top){
var tb = (document.compatMode!="BackCompat")? document.documentElement : document.body;
this.Ypos = tb.clientHeight - this.odiv.clientHeight - top ;
this.Xpos = tb.clientWidth - this.odiv.clientWidth - left ;
if(this.staticTimer)
clearTimeout(this.staticTimer);
this.makeStatic();
};

this.full = function(){
location.href = this.roomURL;
};

this.init = function(){

var ojs = document.getElementById('WebChatScript');
var bcreate = true;
try{
if(typeof("zoomsun_wc_cfg")!= "undefined"){
for(var i in zoomsun_wc_cfg){
eval("this."+i+"=zoomsun_wc_cfg."+i);
	}
if(zoomsun_wc_cfg.roomid)
this.URL = zoomsun_wc_cfg.roomid;
	}
}catch(err){}
if(ojs){
var tstr;
tstr = ojs.getAttribute("website")
if(tstr) this.URL = tstr.replace(/\s/g,"");
tstr = ojs.getAttribute("roomid");
if(tstr) this.roomid = tstr;

tstr = ojs.getAttribute("minText");
if(tstr) this.minText = unescape(tstr);
tstr = ojs.getAttribute("bgColor");
if(tstr) this.bgColor = tstr;
tstr = ojs.getAttribute("winTitle");
if(tstr) this.winTitle = unescape(tstr);
tstr = ojs.getAttribute("position");
if(tstr) this.position = tstr;
tstr = ojs.getAttribute("bStatic");
if(tstr) this.bstatic = (tstr.match(/false/i)?false:true);
tstr = ojs.getAttribute("popMode");
if(tstr) this.popMode = (tstr.match(/false/i)?false:true);
tstr = ojs.getAttribute("bminiMode");
if(tstr) this.bminiMode = (tstr.match(/false/i)?false:true);
tstr = ojs.getAttribute("create");
if(tstr) bcreate = (tstr.match(/false/i)?false:true);
tstr = ojs.getAttribute("bPreview");
if(tstr) this.bPreview = (tstr.match(/true/i)?true:false);
tstr = ojs.getAttribute("bOpen");
if(tstr) this.bopen = (tstr.match(/true/i)?true:false);

tstr = ojs.getAttribute("user");
if(tstr){
tstr = tstr.replace(/(\s|&nbsp;)/ig,"");
if(tstr.length > 0) this.user = tstr;
	}
}

if(typeof(zoomsun_wc_cfg)=="undefined")
zoomsun_wc_cfg = new Object();
if(!zoomsun_wc_cfg.setStatus){
eval( 'zoomsun_wc_cfg.setStatus = function(st,expday){ '+this.objName+'.setStatus(st,expday); };');
}
if(!zoomsun_wc_cfg.getStatus){
eval( 'zoomsun_wc_cfg.getStatus = function(){ return '+this.objName+'.getStatus(); };');
}

if(bcreate)
this.create();
	
};

this.drag = function(o,did){
if(!this.canDrag)
return;
odiv = this.odiv;
//		o.firstChild.onmousedown=function(){return false;};
o.onmousedown=function(a){
var d=document;
if(!a)a=window.event;
var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
if(o.setCapture)
o.setCapture();
else if(window.captureEvents)
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
o.style.cursor = 'move';
document.onmousemove = o.onmouseout = o.onmouseleave =function(a){
if(!a)a=window.event;
var tx=(a.pageX?a.pageX - window.pageXOffset:a.clientX)-x
var ty=(a.pageY?a.pageY - window.pageYOffset:a.clientY)-y;
var tb = (document.compatMode!="BackCompat")? document.documentElement : document.body;
var twx = tb.clientWidth - odiv.clientWidth -2;
var twy = tb.clientHeight - odiv.clientHeight -2;
if(!document.all){
twx -= 16;
twy -= 16;
	}
tx = twx < tx ? twx : tx;
tx = tx < 0 ? 0 : tx;
ty = twy < ty ? twy : ty;
ty = ty < 0 ? 0 : ty;
__oWC.moveTo(tx,ty);
};

document.onmouseup=function(){
if(o.releaseCapture)
o.releaseCapture();
else if(window.captureEvents)
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
document.onmousemove = o.onmouseout = o.onmouseleave =null;
document.onmouseup=null;
};
};
};

this.setCookie = function (name, value, expires, path, domain, secure){
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
};

this.getCookie = function(name){
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1){
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1){
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
};

this.deleteCookie = function(name, path, domain){
if (this.getCookie(name))
{
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
};


}

var __oWC = new WebChat("__oWC");

__oWC.init();
