var thenewchaturl = "";

function initchatpopup(thenewchaturl) {
popuptransferstatus(thenewchaturl);
}

function popuptransferstatus(thenewchaturl) {
closechattransferwindow();
openpopup(thenewchaturl);
}

// Open the popup window
function openpopup(thenewchaturl) {

thenewchaturl = "http://www.dealermonster.com/chatmonster/sendurl.htm?thechatparm=" + thenewchaturl;

// Center window on screen
var w = 640, h = 480;
if (document.all) {
var w = screen.width, h = screen.height;
}
if (document.layers) {
var w = window.outerWidth, h = window.outerHeight;
}

var popW = 500, popH = 100;
var topPos = (w-popW)/2, leftPos = (h-popH)/2;
var hold01 = "chattransferwindow=window.open('" + thenewchaturl + "','chattransferwindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=500,height=100,resizable=0,top=" + leftPos + ",left=" + topPos + "')"
eval(hold01);
}

// function to close the popup window
function closechattransferwindow() {
if (!window.chattransferwindow) {
// has not yet been defined
}
else {
// has been defined
if (!chattransferwindow.closed) {
chattransferwindow.close();
}
}
}
