function showTBaction(name, number, xx, yy) {
    var ipb = '<a href="/sms-senden.php?go=insert&smsnumber=' + number + '">Sms an ' + name + ' senden</a><br /><a href="/sms-senden.php?go=insert&smsnumber=' + number + '&smstext=Hey, ' + name + ' komm jetzt zu sms16.de und melde dich an.">' + name + ' einladen</a>';
    show_hidePopBox(ipb,xx,yy);
}

function showtext(text, xx, yy) {
    var ipb = text;
    show_hidePopBox(ipb,xx,yy);
}

function applyPoints(xx, yy) {
    var ipb = '<iframe src="/account/applypoints.php" style="width:200px;height:150px;overflow:hidden;border:0px"></iframe>';
    show_hidePopBox(ipb,xx,yy);
}

function show_hidePopBox(ipb,xx,yy){
    getById('popBox').innerHTML = ipb; 
    getById('popBox').style.left = xx+'px';
    getById('popBoxShadow').style.left = (xx + 15)+'px';
    getById('popBox').style.top = (yy + 15)+'px';
    getById('popBoxShadow').style.top = (yy + 15)+'px';
    showDiv('popBox');
    showDiv('popBoxShadow');  
}

function show_hidePopBoxV(ipb,xx,yy,did){
    getById(did).innerHTML = ipb; 
    getById(did).style.left = '30%';
    getById(did).style.top = '180px';
    showDiv(did);  
}

    function getProgramCodeAffiliate(programId, programName) {
        var html = getById('programBoxCodeAffiliate').innerHTML;
        html = replace(html,"%PROGRAM_ID", programId);
        html = replace(html,"%PROGRAM_NAME", programName);
        return html;
    }

function replace(a, b, c) {
    while (a.indexOf(b) > -1) {
        pos = a.indexOf(b);
        a = '' + (a.substring(0, pos) + c + a.substring((pos + b.length), a.length));
    }
    return a;
}

function showDiv(id) {
    getById(id).style.visibility = "visible";
    getById(id).style.display = "inline";
}

function hideDiv(id) {
    getById(id).style.visibility = "invisible";
    getById(id).style.display = "hidden";
}

function getById(id) {
    return document.getElementById ? document.getElementById(id) : (document.all ? document.all(id) : null);
}

function getScroll() {
    if (document.all) {
        var ieBox = document.compatMode != "CSS1Compat";
        var cont = ieBox ? document.body : document.documentElement;
        return {x:cont.scrollLeft, y:cont.scrollTop};
    } else {
        return {x:window.pageXOffset, y:window.pageYOffset};
    }
}

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0;}
  if (tempY < 0){tempY = 0;}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  return true;
}