/** dhtml javascript-routinen  (c) 2000 code-x gmbh  alle rechte vorbehalten **/

var cxd_timer     = 0;
var cxd_cons      = false;
var cxd_cleft     = 0;
var cxd_ctop      = 0;
var cxd_cright    = 0;
var cxd_cbottom   = 0;

/********************/
/** BROWSERPRÜFUNG **/
/********************/

/** aufruf: cxd_msie() **/
/** ???   : prueft den browser **/
/**         rueckgabe true wenn explorer, ansonsten false **/

function cxd_msie()
{
  code = navigator.appName;
  return(code.indexOf("Microsoft")!=-1);
};

/*****************/
/** X-POSITION **/
/****************/

/** aufruf: cxd_show(layer) **/
/** ???   : blendet einen layer ein **/
/**         lay  := name des layers (in "") **/

function cxd_x(lay)
{
  x = -1;
  
  if(cxd_msie())
    x = document.all[lay].style.pixelLeft;
  else
    x = document.eval(lay).left;
    
  return x;
};

/*****************/
/** Y-POSITION **/
/****************/

/** aufruf: cxd_show(layer) **/
/** ???   : blendet einen layer ein **/
/**         lay  := name des layers (in "") **/

function cxd_y(lay)
{
  y = -1;
  
  if(cxd_msie())
    y = document.all[lay].style.pixelTop;
  else
    y = document.eval(lay).top;
    
  return y;
};

/**********************************/
/** X,Y INNERHALB EINES RAHMENS? **/
/**********************************/

function cxd_within(lay,w,h,x,y)
{
	 if(cxd_msie())
  {
    x1 = document.all[lay].style.pixelLeft;
    y1 = document.all[lay].style.pixelTop;
    x2 = x1 + w;
    y2 = y1 + h;
  }
  else
  {
    x1 = document.eval(lay).left;
    y1 = document.eval(lay).top;
    x2 = x1+w;
    y2 = y1+h;
  };
  
	return (x>=x1 && x<=x2 && y>=y1 && y<=y2);
};


/*****************/
/** EINBLENDEN **/
/****************/

/** aufruf: cxd_show(layer) **/
/** ???   : blendet einen layer ein **/
/**         lay  := name des layers (in "") **/

function cxd_show(lay)
{
  if(cxd_msie())
    document.all[lay].style.visibility = "visible";
  else
    document.eval(lay).visibility = "visible";
};

/*****************/
/** AUSBLENDEN **/
/****************/

/** aufruf: cxd_hide(layer) **/ 
/** ???   : blendet einen layer aus **/
/**         lay  := name des layers (in "") **/

function cxd_hide(lay)
{
  if(cxd_msie())
    document.all[lay].style.visibility = "hidden";
  else
    document.eval(lay).visibility = "hidden";
};

/**********************/
/** EIN-/AUSBLENDEN **/
/*********************/

/** aufruf: cxd_toggle(layer) **/
/** ???   : blendet einen layer ein/aus, je nachdem was 'er' gerade ist **/
/**         lay  := name des layers (in "") **/

function cxd_toggle(lay)
{
  if(cxd_msie())
  {
    if(document.all[lay].style.visibility == "hidden")
      document.all[lay].style.visibility = "visible";
    else
      document.all[lay].style.visibility = "hidden";
   }else
   {
    if(document.eval(lay).visibility == "hidden")
      document.eval(lay).visibility = "visible";
    else
      document.eval(lay).visibility = "hidden";
   }
};

/**************************/
/** BEWEGUNG BESCHRÄNKEN **/
/**************************/

/** aufruf: cxd_constrain(lf,tp,rg,bo) **/
/** ???   : beschraenkt bewegungen in einen bestimmten rahmen **/
/**         lf := linke kante des rahmens **/
/**         tp := obere kante des rahmens **/
/**         rg := rechte kante des rahmens **/
/**         bo := linke kante des rahmens **/

function cxd_constrain(lf,tp,rg,bo)
{
  cxd_cons    = true;
  cxd_cleft   = lf;
  cxd_ctop    = tp;
  cxd_cright  = rg;
  cxd_cbottom = bo;
};


/*********************/
/** EINMAL BEWEGEN **/
/********************/

/** aufruf: cxd_move(lay,xv,yv,time) **/
/** ???   : bewegt einen layer **/
/**         lay  := name des layers (in "")
            xv   := horizontale entfernung in pixel (z.b. 1 = 1 pixel nach links)
            yv   := vertikale   entfernung in pixel (z.b. 1 = 1 pixel nach oben) **/

function cxd_move(lay,xv,yv)
{
  if(cxd_msie())
  {
    xo = document.all[lay].style.pixelLeft+xv;
    yo  = document.all[lay].style.pixelTop+yv;
  }else
  {
    xo = document.eval(lay).left+xv;
    yo  = document.eval(lay).top+yv;
  }
  
  if(cxd_cons)
  {
  	if(xo<cxd_cleft)   xo=cxd_cleft;
	  if(xo>cxd_cright)  xo=cxd_cright;
	  if(yo<cxd_ctop)    yo=cxd_ctop;
	  if(yo>cxd_cbottom) yo=cxd_cbottom;
	};
  
  if(cxd_msie())
  {
    document.all[lay].style.pixelLeft = xo;
    document.all[lay].style.pixelTop  = yo;
  }else
  {
    document.eval(lay).left = xo;
    document.eval(lay).top  = yo;
  }
};

/*********************/
/** ABSOLUT BEWEGEN **/
/*********************/

/** aufruf: cxd_moveto(lay,x,y) **/
/** ???   : bewegt einen layer **/
/**         lay  := name des layers (in "")
            x    := horizontale position in pixel (z.b. 1 = 1 pixel nach links)
            y    := vertikale   position in pixel (z.b. 1 = 1 pixel nach oben) **/

function cxd_moveto(lay,x,y)
{
  if(cxd_msie())
  {
    document.all[lay].style.pixelLeft = x;
    document.all[lay].style.pixelTop  = y;
  }else
  {
    document.eval(lay).left = x;
    document.eval(lay).top  = y;
  }
};

/*************************/
/** IN BEWEGUNG BLEIBEN **/
/*************************/

/** aufruf: cxd_keepmoving(lay,xv,yv,time) **/
/** ???   : bewegt einen layer kontinuierlich **/
/**         lay  := name des layers (in "")
            xv   := horizontale entfernung in pixel (z.b. 1 = 1 pixel nach links)
            yv   := vertikale   entfernung in pixel (z.b. 1 = 1 pixel nach oben)
            time := zeit zwischen bewegungen in 1/1000 sekunden **/            
            
function cxd_keepmoving(lay,xv,yv,time)
{
  if (cxd_timer)window.clearTimeout(cxd_timer);
  
  cxd_move(lay,xv,yv);
  cxd_timer = window.setTimeout("cxd_keepmoving_sup('"+lay+"',"+xv+","+yv+","+time+")",time);
};

function cxd_keepmoving_sup(lay,xv,yv,time)
{
  cxd_move(lay,xv,yv);
  cxd_timer = window.setTimeout("cxd_keepmoving_sup('"+lay+"',"+xv+","+yv+","+time+")",time);
};

/**********************/
/** BEWEGUNG STOPPEN **/
/**********************/

/** aufruf: cxd_stopmoving() **/

function cxd_stopmoving()
{
  if (cxd_timer)window.clearTimeout(cxd_timer);
};







/*****************/



/** TEXT ÄNDERN **/



/*****************/







/** aufruf: cxd_text(lay,txt) **/



/** ???   : ändert den html-code in einem layer **/



/**         lay  := name des layers (in "")



            txt  := neuer html-code **/



            



function cxd_text(lay,txt)



{



	if(cxd_msie())



	{



		document.all[lay].innerHTML=txt;



	}else



	{



		document.eval(lay).document.write(txt);



		document.eval(lay).document.close();



	}; 



};


