//document.oncontextmenu=new Function("return false");
// Mouse Position depent-----------
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ns6=document.getElementById && !document.all
var rightedge;
var bottomedge;
var leftedge;

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}


function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,"",-1);
}

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
  } 
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}
  return true
}

function getUnix() {
    var foo = new Date; // Generic JS date object
    var unixtime_ms = foo.getTime(); // Returns milliseconds since the epoch
    var unixtime = parseInt(unixtime_ms / 1000);
    return unixtime;
}

function scrollthis(xDIV, xHeight) {
  mq = document.getElementById(xDIV);
  mqis = parseInt(mq.style.top);
  mq.style.top = parseInt(-50)+"px";
  
}



function makebiggerinput(ID) {
	xDiv = document.getElementById(ID);
	xDiv.rows=xDiv.rows+10;  
}

function makesmallerinput(ID) {
	xDiv = document.getElementById(ID);
	if(xDiv.rows > 10){
		xDiv.rows=xDiv.rows-10;  
	}
}


function loader( xFunc ){
    if ( xFunc == 'go' ) {
        var img = document.getElementById('LoaderX');
        img.style.position = 'absolute';
        if ( tempY && tempY ) {
        img.style.top = tempY-parseInt(20);
        img.style.left = tempX+parseInt(10);
        } else {  
        img.style.top = parseInt(20);
        img.style.left = parseInt(10);
        }
        img.style.zIndex = '10000';
        img.style.display = '';
        img.innerHTML = '<img src="./grf/ajax-loader.gif">';
        document.getElementById('Body').style.backgroundposition='bottom center';
     } 
    if ( xFunc == 'stop' ) {
    var loa = document.getElementById('LoaderX');
        loa.innerHTML = '';
        loa.style.display = 'none';
    }
}

function alerts(){
   var x1 = document.getElementById('BA-t2_'); 
   var x2 = document.getElementById('BA-tcont_'); 
   var x3 = document.getElementById('BA-tr_');
       x1.style.display = '';   
       x2.style.display = '';  
       x3.style.display = ''; 
       x1.setAttribute( 'show', 'yes');
       x2.setAttribute( 'show', 'yes');
       x3.setAttribute( 'show', 'yes');
}

function showDIV( xDIV ) {
    var xdiv = document.getElementById(xDIV);
    if ( xdiv.style.display == 'none' ) {
        xdiv.style.display = '';
        createCookie(xDIV,"show=yes",100);
    } else {
        xdiv.style.display = 'none';
        createCookie(xDIV,"show=no",100);
    }
}

function showhide( xID ) {
    var xdiv = document.getElementById(xID);
    if ( xdiv.style.display == 'none' ) {
        xdiv.style.display = '';
    } else {
        xdiv.style.display = 'none';
    }
}

var xINTER;
function showDIVFUNC( xDIV, xFUNC, xRef, xOpen) {
    var xdiv = document.getElementById(xDIV);
        xATR = xdiv.getAttribute( 'refresh' );
    if ( xdiv.style.display == 'none' ) {
        GET_getStuff(xFUNC,xDIV);
        if ( xRef == 'true' && xATR == 'off') xINTER = window.setInterval("if(document.getElementById('"+xDIV+"'))GET_autoStuff( '"+xFUNC+"', '"+xDIV+"')",60000);
        xdiv.style.display = '';
        xdiv.setAttribute( 'refresh','on' );
        createCookie(xDIV,"show=yes",100);
           
    } else {
        if ( xRef == 'true' && xATR == 'on') window.clearInterval(xINTER);
        xdiv.innerHTML = '';
        xdiv.style.display = 'none';
        xdiv.setAttribute( 'refresh','off' );
        createCookie(xDIV,"show=no",100);
    }
}


function showDIVPOP( xPOP, xWidth, NOposY ) {
    
    var xMain = document.getElementById('Body');
    var xpopDiv = document.getElementById('PopInfo');
      if (xpopDiv) xpopDiv.parentNode.removeChild(xpopDiv);
      var popDiv = document.createElement('div');
      popDiv.setAttribute('id','PopInfo');
      popDiv.setAttribute('ondblClick','closeDIVPOP()');
      popDiv.style.position = 'absolute';
      popDiv.style.zIndex = parseInt(1000);
      popDiv.style.left = tempX+parseInt(10);
      popDiv.style.top = tempY+parseInt(10);
      if ( xWidth ) popDiv.style.width = xWidth;
      xMain.appendChild(popDiv);
      GET_getStuff(xPOP,'PopInfo');
      if( !NOposY ) window.scroll(parseInt(0), (parseInt(tempY)-parseInt(100)));
    
}


function closeDIVPOP() {
    var xMain = document.getElementById('Body');
    var xpopDiv = document.getElementById('PopInfo');
      if (xpopDiv) xpopDiv.parentNode.removeChild(xpopDiv);
    
}

function showDIVINFO( xINFO, xWidth ) {
    
    var xMain = document.getElementById('Body');
    var xInfoDiv = document.getElementById('XInfo');
      if (xInfoDiv) xInfoDiv.parentNode.removeChild(xInfoDiv);
      var infoDiv = document.createElement('div');
      infoDiv.setAttribute('id','XInfo');
      infoDiv.setAttribute('ondblClick','closeDIVINFO()');
      infoDiv.style.position = 'absolute';
      infoDiv.style.zIndex = parseInt(1000);
      infoDiv.style.left = tempX+parseInt(10);
      infoDiv.style.top = tempY+parseInt(10);
      if ( xWidth > '' ) infoDiv.style.width = xWidth;
     
      infoDiv.innerHTML = '<table><tr><td class="P_t_l"></td><td class="P_t_m"></td><td class="P_t_r"></td></tr><tr><td class="P_m_l"></td><td class="P_m_m">'+xINFO+'</td><td class="P_m_r"></td></tr><tr><td class="P_b_l"></td><td class="P_b_m"></td><td class="P_b_r"></td></tr></table>';
     
      xMain.appendChild(infoDiv);
      
}

function closeDIVINFO() {
    var xMain = document.getElementById('Body');
    var xInfoDiv = document.getElementById('XInfo');
      if (xInfoDiv) xInfoDiv.parentNode.removeChild(xInfoDiv);
    
}
//------------------------------------------------------
function CloseContent( xDIV ) {
    var xdiv = document.getElementById(xDIV);
    xdiv.style.display = 'none';
}
function clearDIV( xDIV ) {
    var xdiv = document.getElementById(xDIV);
    xdiv.style.innerHTML = '';
}

function remove(xchild){
          var c = document.getElementById(xchild);
          c.parentNode.removeChild(c);
}

function showBanner(xBanner) {
   var x1 = document.getElementById('BA-t2_'); 
   var x2 = document.getElementById('BA-tcont_'+xBanner); 
   var x3 = document.getElementById('BA-tr_');
   xATR1 = x1.getAttribute( 'show' );
   xATR2 = x2.getAttribute( 'show' );
   xATR3 = x3.getAttribute( 'show' );
   if (xATR1 =='no' && xATR2 =='no' && xATR3 =='no') {
       x1.style.display = '';   
       x2.style.display = '';  
       x3.style.display = ''; 
       x1.setAttribute( 'show', 'yes');
       x2.setAttribute( 'show', 'yes');
       x3.setAttribute( 'show', 'yes');
  } else {
       x1.style.display = 'none';   
       x2.style.display = 'none';  
       x3.style.display = 'none'; 
       x1.setAttribute( 'show', 'no');
       x2.setAttribute( 'show', 'no');
       x3.setAttribute( 'show', 'no'); 
    } 
}

function SetzeSmilie(xForm,xTextBox,smiliecode) {
  if(document.xForm.xTextBox.value == "message") document.xForm.xTextBox.value = " "+smiliecode+" ";
  else document.xForm.xTextBox.value += " "+smiliecode+" ";
  document.xForm.xTextBox.focus();
}