var chat_width = 494;
var chat_height= 418; //400;
var ptTimeOut= 30000;
var xmlHttp = null;
var cookieGuid = "" ;
var mode = '1' ;
var strX ='20'
var strY ='30'
var DeptID = "";
var Agent = "";
v_lc_str = "";
v_lc_str = v_lc_str.toLowerCase();
idx = v_lc_str.indexOf("/?id=");
var v_lc_domain = v_lc_str.substring(0,idx);
var statsURL = v_lc_domain+"/statsupdater.aspx?Command=";
var cOrderID = v_lc_str.substring(idx+5);
var strSRC = v_lc_domain + "/images/livechat_offline.gif"+"?"+new Date();
var divImage;
var tType = "";
var documentURL =escape("");
var VolusionScriptError= "If you are getting this message, it is because\r\na) The Volusion Live Chat javascript has been modified from its original code.\r\n(You must re-copy the script from the SETTINGS screen of your live chat software, and re-paste it to your website.\r\nor\r\nb) The Volusion Live Chat javascript is pasted more than once in this page.\r\n(Remove extra copy of this script on this page)";
var divImage;
var IS_IE = false;
var is_ff = false;
var postCount=0;
var startPost = new Date();
var forceautoprompt= '';
var _vID="24342";
if(document.all) IS_IE = true;
else is_ff = true;
if(is_ff)
chat_height += 4;
if(document.getElementById("VolusionLiveChat"))
{
var basicver = 0;
strChat = document.getElementById("VolusionLiveChat").innerHTML.toLowerCase();
if(strChat.indexOf('"
+"
";
//image +="
| FREE chat by Volusion |
";
//image +="| FREE chat by Volusion |
";
image +="| FREE chat by Volusion |
";
image +="";
//henry nisce image +="
";
document.getElementById("VolusionLiveChat").innerHTML = image;
var myvar=function() {var Image = document.createElement("IMG"); Image.setAttribute("id","imgChat"); Image.style.visibility="hidden"; Image.onload=imageOnload; document.body.appendChild(Image);postTraffic(); divImage = document.createElement("DIV"); divImage.setAttribute("id","divPrompt");divImage.innerHTML = "
"; divImage.style.position="absolute"; divImage.style.top = "-300px"; divImage.style.zIndex = "2000"; document.body.appendChild(divImage); }
setTimeout('myvar()',3000);
}
}
else
alert(VolusionScriptError);
if(0==1 && 0 > 0)
{
setTimeout("AutoPrompt()", 0*1000);
}
function LaunchVolusionChat(auto)
{
DeptID = '0';
var today = new Date();
var request_url = v_lc_domain+"/livechat.aspx?ID="+cOrderID+"&location="+documentURL.toLowerCase()+"&auto="+auto+"&cookieGuid="+cookieGuid+"&DeptID="+DeptID+"&Agent="+Agent+"&tType="+tType;
/*if(cOrderID==ConfigurationManager.AppSettings["VolusionID"] && auto==0)
{
request_url = v_lc_domain+"/livechat_volusion.aspx?&location="+documentURL.toLowerCase()+"&auto="+auto+"&cookieGuid="+cookieGuid+"&DeptID="+DeptID+"&Agent="+Agent+"&tType="+tType;
if(IS_IE) chat_height+=10;
}
*/
window.open( request_url, today.getTime(), 'scroll=yes,scrollbars=yes,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=' + chat_width + ',height='+chat_height ) ;
//if(auto==1)
// RefuseChat();
}
function AutoPrompt()
{
DeptID = '0';
url = statsURL + "ISPROMPTOK&OrderID="+cOrderID+"&DeptID="+DeptID+"&Do=Approve&dt="+new Date()+"&cookieGuid="+cookieGuid+'&ForceAutoPrompt=';
document.getElementById("imgChat").src = url;
}
function imageOnload()
{
postTrafficHandler();
setTimeout("postTraffic()", ptTimeOut);
}
function postTraffic()
{
var now = new Date();
var diff = now.getTime() - startPost.getTime();
var secdiff = Math.floor(diff / 1000);
var min=Math.floor(secdiff%3600/60);
if(min > 2 && min <5 )
ptTimeOut= 30000;
else if(min >=5 && min <15 )
ptTimeOut= 60000;
else if(min >=15 && min <30 )
ptTimeOut= 120000;
else if(min>=30)
return;
postCount++;
var url = statsURL + "TRAFFIC&OrderID="+cOrderID+"&location="+documentURL+"&dt="+new Date()+"&cookieGuid="+cookieGuid+"&StartPost=1";
if(postCount>1)
url = statsURL + "TRAFFIC&OrderID="+cOrderID+"&location="+documentURL+"&dt="+new Date()+"&cookieGuid="+cookieGuid;
document.getElementById("imgChat").src = url;
}
function postTrafficHandler()
{
//window.status = new Date() + "(" + document.getElementById("imgChat").width +":" + document.getElementById("imgChat").height +")"+ptTimeOut;
//hln
//alert(document.getElementById("imgChat").width);
//!!!!!!
//AnimatePrompt();
if(document.getElementById("imgChat").width == 2) //chat
{
tType="F";
LaunchVolusionChat(1);
}
else
if(document.getElementById("imgChat").width == 3 ) //prompt
{
tType="P";
ShowPrompt();
}
else
if(document.getElementById("imgChat").width == 4 ) //autoprompt ok
{
AnimatePrompt();
url = statsURL + "ISPROMPTOK&OrderID="+cOrderID+"&Do=Post&dt="+new Date()+"&cookieGuid="+cookieGuid+'&ForceAutoPrompt='+forceautoprompt;
document.getElementById("imgChat").src = url;
}
}
function getVolusionClick(e) {
if (IS_IE) {
if (!(event.offsetX > 330 && event.offsetY < 85)) {
LaunchVolusionChat(1);
}
}
else {
//alert(e.layerX + ":" + e.layerY);
if (!(e.layerX > 330 && e.layerY < 85)) {
LaunchVolusionChat(1);
}
}
}
function getClick(e) {
divImage.style.left = "0px";
divImage.style.top = "-300px";
if (cOrderID == _vID) {
getVolusionClick(e);
}
else {
if (IS_IE) { //232
if (!(event.offsetX > 217 && event.offsetY > 144 )) {
LaunchVolusionChat(1);
}
}
else {
if (!(e.layerX > 217 && e.layerY > 144)) {
LaunchVolusionChat(1);
}
}
}
RefuseChat();
}
var x=0,y=0;
var bx = false, by = false;;
var opacity = 0;
function AnimatePrompt()
{
if(mode == "1")
{
divImage.style.left = strX+"%";
divImage.style.top= strY +"%";
if(IS_IE)
{
if(cOrderID==_vID) opacity=100;
else divImage.style.filter = 'alpha(opacity='+opacity+')';
}
else
if(is_ff)
{
divImage.style.opacity = opacity/100;
}
opacity +=3;
if(opacity<100)
{
setTimeout("AnimatePrompt();", 70);
}
else
{
opacity = 5;
if(!(IS_IE && cOrderID==234193)) //temp becuase of autoprompt issues, dont apply code below for that LC id in IE
divImage.style.position="fixed";
}
return;
}
if(x < 36)
x+=2;
else
{
bx = true;
y+=3;
if(y > 36)
by = true;
}
xperc = x + "%";
divImage.style.left =xperc;
yperc = y + "%";
divImage.style.top=yperc;
if(bx && by )
{
divImage.style.position="fixed";
return;
}
else
setTimeout("AnimatePrompt();", 70);
}
function ShowPrompt()
{
window.focus();
setTimeout("AnimatePrompt();", 70);
}
function RefuseChat()
{
var url = statsURL + "REFUSECHAT&OrderID="+cOrderID+"&location="+documentURL +"&dt="+new Date();
document.getElementById("imgChat").src = url;
}