function ws_GetCookie(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));

}

function ws_SetCookie(name, value, expires, path, domain, secure)

{

						document.cookie= name + "=" + escape(value) +

						((expires) ? "; expires=" + expires.toGMTString() : "") +

						((path) ? "; path=" + path : "") +

						((domain) ? "; domain=" + domain : "") +

						((secure) ? "; secure" : "");

}

function ws_GetGuid()

{

						ws_guid = ws_GetCookie("wbs");

						if (ws_guid == null)

						{

												var fiveYear = new Date();

												fiveYear.setTime(fiveYear.getTime() + 365 * 24 * 60 * 60 * 1000 * 5);

												ws_guid = Math.random();

												ws_SetCookie("wbs",ws_guid,fiveYear);

						}

}

function ws_IsRecall()

{

						if (ws_GetCookie("wrc") == null)

						{

												var dtExpires = new Date();

												dtExpires.setFullYear(0,0,0);

												ws_SetCookie("wrc", 0, dtExpires);

												return 0;

						}

						return 1;

}

function ws_Center(idObj)

{

						obj = document.getElementById(idObj);

						obj.style.top = document.body.scrollTop +((document.body.clientHeight - obj.offsetHeight)/2);

						obj.style.left = (document.body.clientWidth - obj.offsetWidth)/2;

}

function ws_Fade(idObj,visibilityStatus)

{

						var browser=navigator.appName;

						obj = document.getElementById(idObj);

						if (browser.indexOf('Microsoft') >= 0)

						{

												obj.style.filter='progid:DXImageTransform.Microsoft.Fade(overlap=0.7)';

												obj.filters(0).Apply();

												obj.style.visibility = visibilityStatus;

												obj.filters(0).Play();

						}

						else

						{

												obj.style.visibility = visibilityStatus;

						}

}

function ws_MakeCall()

{

						ws_Fade('ws_invite','hidden');

						window.open(ws_urlCall,'WSAtend','width=400,height=450');

}

function ws_TraceResult()

{

						if (ws_ti.width  == 1)

												document.getElementById("ws_wsbtn").src= ws_urlOn;

						else

												document.getElementById("ws_wsbtn").src= ws_urlOff;

						document.getElementById("ws_wsbtn").style.visibility="visible";

						if (ws_ti.height == 2)

						{

												ws_Center("ws_invite");

												ws_Fade('ws_invite','visible');

						}

}

function ws_LoadTrace()

{

						ws_ti.onload = ws_TraceResult;

						ws_ti.src = ws_urlTrace;

}

var ws_guid;

var ws_ti = new Image ();

var ws_idSite = 32;

ws_GetGuid();

var ws_urlOn = 'http://www.cerbras.com.br/images/atendOnline.jpg';

var ws_urlOff = 'http://www.cerbras.com.br/images/atendOffline.jpg';

var ws_urlTrace = 'http://www.websupport.com.br/modules/Tracer/TraceImageFlag.aspx?idSession='+ws_guid+'&idWebSite='+ws_idSite+'&getCount='+ws_IsRecall()+'&killCache='+Math.random();

var ws_urlCall='http://www.websupport.com.br/modules/CtClient/?guid='+ws_guid+'&id='+ws_idSite;

ws_LoadTrace();