﻿var frmHeight = 285;
var frmWidth = 345;
var bodyfrm=(document.compatMode.toLowerCase()=="css1compat") ? document.documentElement : document.body;

var chatfrm = document.getElementById("ShowChatForm");
chatfrm.style.top = (bodyfrm.clientHeight - frmHeight) + "px";
chatfrm.style.left = (bodyfrm.clientWidth - frmWidth) + "px";
function moveFrm() {
    chatfrm.style.top = (bodyfrm.scrollTop + bodyfrm.clientHeight - frmHeight) + "px";
    chatfrm.style.left = (bodyfrm.scrollLeft + bodyfrm.clientWidth - frmWidth) + "px";
}


window.onscroll = function(){    
    setTimeout("moveFrm()",1000);
}

window.onresize = function(){    
    setTimeout("moveFrm()",200);
}

function changeFrame(fsize){
    var chatForm = document.getElementById("frmChat");
    frmHeight = fsize;
    chatForm.width = frmWidth;
    chatForm.height = frmHeight;
    moveFrm();
}

function closeFrame(){
    document.getElementById("frmChat").src = "";
    document.getElementById("ShowChatForm").style.display = "none";
}

function OpenChatForm(obj){
    document.getElementById("frmChat").src = "/newchat/customer/chatclient.html?cpurl="+window.location.href;
    //obj.parentNode.style.display = "none";
    document.getElementById("ShowChatForm").style.display = "";
}
