     jQuery(document).ready(function ($) {
        $('a[rel*=facebox]').facebox()
    })
	function closeDiv(){
		$.facebox.close()	
	}
messageObj = new DHTML_modalMessage();	// We only create one object of this class
messageObj.setShadowOffset(5);	// Large shadow

function displayAlert(messageContent,cssClass,width,height)
{
	messageObj.setHtmlContent('<table width="100%" border="0" cellspacing="0" cellpadding="0"> \
          <tr> \
            <td style="font-size:12px; font-family:Verdana, Geneva, sans-serif; color:#F00; padding:5px 5px 5px 5px;"><strong>Fehler!</strong></td> \
          </tr> \
          <tr> \
            <td bgcolor="#CCCCCC" height="1"></td> \
          </tr> \
          <tr> \
            <td align="center" style="padding:20px 5px 20px 5px;font-size:12px; font-family:Verdana, Geneva, sans-serif;">'+ messageContent +'</td> \
  </tr> \
          <tr> \
            <td align="center" style="padding:5px 5px 5px 5px;"><input onClick="closeAlert()" style="cursor: pointer; width: 100px; height:16px; font-family: Verdana; font-size: 9px; border: 1px solid black;" type="button" name="button" id="button" value="Schlie&szlig;en"></td> \
  </tr> \
</table>');
	messageObj.setSize(width,height);
	messageObj.setCssClassMessageBox(cssClass);
	messageObj.setSource(false);	// no html source since we want to use a static message here.
	messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	messageObj.display();
	
	
}
messageObjj = new DHTML_modalMessage();	// We only create one object of this class
messageObjj.setShadowOffset(5);	// Large shadow

function displayEinladung(messageContent,cssClass,width,height,raum)
{
	messageObjj.setHtmlContent('<table width="100%" border="0" cellspacing="0" cellpadding="0"> \
          <tr> \
            <td style="font-size:12px; font-family:Verdana, Geneva, sans-serif; color:#F90; padding:5px 5px 5px 5px;"><strong>Chateinladung!</strong></td> \
          </tr> \
          <tr> \
            <td bgcolor="#CCCCCC" height="1"></td> \
          </tr> \
          <tr> \
            <td align="center" style="padding:20px 5px 20px 5px;font-size:12px; font-family:Verdana, Geneva, sans-serif;">'+ messageContent +'</td> \
  </tr> \
          <tr> \
            <td align="center" style="padding:5px 5px 5px 5px;"><input onClick="getLiveChat(\'rm=' + raum + '&an=2\');closeEinladung();" style="background-image:url(\'/gl/images/liveChat/chatAblehnen.png\');cursor: pointer; width: 100px; height:18px; font-family: Verdana; font-size: 10px; border:solid 0px #ff0000; background-color:#FDE3B5;" type="button" name="button" id="button" value="">&nbsp;&nbsp;&nbsp;&nbsp;<input onClick="getLiveChat(\'rm=' + raum + '&an=1\');closeEinladung();" style="background-image:url(\'/gl/images/liveChat/chatAnnehmen.png\');background-repeat:repeat-x;cursor: pointer; width: 100px; height:18px; font-family: Verdana; font-size: 10px; border:solid 0px #00cc00; background-color:#CCFDBB;" type="button" name="button" id="button" value=""></td> \
  </tr> \
</table>');
	messageObjj.setSize(width,height);
	messageObjj.setCssClassMessageBox(cssClass);
	messageObjj.setSource(false);	// no html source since we want to use a static message here.
	messageObjj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	messageObjj.display();
	
	
}

messageObj = new DHTML_modalMessage();	// We only create one object of this class
messageObj.setShadowOffset(5);	// Large shadow

function displayInfo(messageContent,cssClass,width,height,header,loc)
{
	messageObj.setHtmlContent('<table width="100%" border="0" cellspacing="0" cellpadding="0"> \
          <tr> \
            <td style="font-size:12px; font-family:Verdana, Geneva, sans-serif; color:#F90; padding:5px 5px 5px 5px;"><strong>'+ header +'!</strong></td> \
          </tr> \
          <tr> \
            <td bgcolor="#CCCCCC" height="1"></td> \
          </tr> \
          <tr> \
            <td align="center" style="padding:20px 5px 20px 5px;font-size:12px; font-family:Verdana, Geneva, sans-serif;">'+ messageContent +'</td> \
  </tr> \
          <tr> \
            <td align="center" style="padding:5px 5px 5px 5px;"><input onClick="closeInfo(\''+ loc +'\')" style="cursor: pointer; width: 100px; height:16px; font-family: Verdana; font-size: 9px; border: 1px solid black;" type="button" name="button" id="button" value="Schlie&szlig;en"></td> \
  </tr> \
</table>');
	messageObj.setSize(width,height);
	messageObj.setCssClassMessageBox(cssClass);
	messageObj.setSource(false);	// no html source since we want to use a static message here.
	messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	messageObj.display();
	
	
}

messageObj = new DHTML_modalMessage();	// We only create one object of this class
messageObj.setShadowOffset(0);	// Large shadow

function displayC2P(messageContent,cssClass,width,height)
{
	messageObj.setHtmlContent('<table width="100%" border="0" cellspacing="0" cellpadding="0"> \
  <tr> \
    <td height="20" style=" background-repeat:repeat-x;background-image:url(\'/gl/images/window/headerBg.jpg\'); padding-right:5px;" align="right"> \
	<img src="/gl/images/window/close.png" onmouseover="this.src = \'/gl/images/window/closeHover.png\'" onClick="closeAlert()" onmouseout="this.src = \'/gl/images/window/close.png\'" style="cursor:pointer;" width="20" height="18"/> \
</td> \
  </tr> \
  <tr> \
    <td><iframe  src="http://www.rumix-deluxe.de/c2p/index.php?mid=<?=$glusr_id?>" frameborder="0" scrolling="no" width="100%" height="270" ></iframe></td> \
  </tr> \
</table>');
	messageObj.setSize(width,height);
	messageObj.setCssClassMessageBox(cssClass);
	messageObj.setSource(false);	// no html source since we want to use a static message here.
	messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	messageObj.display();
	
	
}

function closeAlert()
{
	messageObj.close();	
	
}
function closeEinladung()
{
	messageObjj.close();	
	
}

function closeInfo(loc)
{
	messageObj.close();	
	window.location.href = loc;
	
}
/*
window.onload = function() {
getEinladung();
setInterval(getEinladung,2000);	
}
*/

function getEinladung(){

               var url = "gl/js/einladung.php"
               http.open("GET", url, true);
               http.onreadystatechange = setMovValues; 
               http.send(null);

	     doIt();

}


function setMovValues() {
             if (http.readyState == 4)
             {
                       if (http.status == 200) { 
					   	if(http.responseXML.getElementsByTagName('txt')[0].firstChild.nodeValue != "0") {
							displayEinladung('<b>' + http.responseXML.getElementsByTagName('nck')[0].firstChild.nodeValue + '</b><br>m&ouml;chte Dich zu einem Live-Chat einladen!',false,300,150,http.responseXML.getElementsByTagName('txt')[0].firstChild.nodeValue);
						}else{
						closeEinladung();	
						}
                      }
              }
}

var http = getHTTPObject(); 

 function getHTTPObject() {
        var xmlhttp;
        try {
                    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
                 try {
                           xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                 } catch (E) { xmlhttp = false; }
        } 
       
       if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                  xmlhttp = new XMLHttpRequest();
       }
      return xmlhttp;
}


            


