/*
##############################################################################
# UCC User Created Content Version
# 2007 (c) J3S Jan Sass	und Sven Sass GbR, info@j3s.de
# $Revision: 1.3 $ - $Author: jic3s\stan $ - $Date: 2007/05/18 09:30:42 $
##############################################################################
# copying prohibited, do not use without written permission of j3s GbR
##############################################################################
*/

function lite(o) {o.style.backgroundColor = '#dAe4eC'; if(document.all)o.style.cursor='hand';o.style.cursor='pointer';}
function dark(o) {o.style.backgroundColor = '';}

function openlink(link, name, width, height,toolbar) {
 if (typeof (name)   =='undefined') { name='popup';}
 if (typeof (width)  =='undefined') { width=800;}
 if (typeof (height) =='undefined') { height=600;}

 // pass additional hoverwidth information =)
 if(typeof(current_hover_width) != 'undefined' && current_hover_width != -1) {
   var hoverwidth= current_hover_width;
   link+= "&hoverwidth="+hoverwidth;
 }
 if (typeof (toolbar)=='undefined') { toolbar='status=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height;}
 var posx= Math.round((screen.availWidth -width )/2);
 var posy= Math.round((screen.availHeight-height)/2);
 toolbar += ",left="+posx+",top="+posy;
 var popup = window.open(link,name,toolbar);
 popup.focus();
 return false;
}

function Demystify(data) {
  var chars=data.split(",");
  for (var c in chars){
    document.write(String.fromCharCode(chars[c]-37));
  }
}

/*****************************************************************************
 * getHeight
 * retrieves inner height of the body
 ****************************************************************************/

function getHeight() {
  var y;
  if (self.innerHeight) // all except Explorer
  {
  	y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
  	// Explorer 6 Strict Mode
  {
  	y = document.documentElement.clientHeight;
  }
  else if (document.body) // other Explorers
  {
  	y = document.body.clientHeight;
  }
  return y;
}

/*****************************************************************************
 * getWidth
 * retrieves inner width of the body
 ****************************************************************************/

function getWidth() {
  var x;
  if (self.innerHeight) // all except Explorer
  {
  	y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
  	// Explorer 6 Strict Mode
  {
  	x = document.documentElement.clientWidth;
  }
  else if (document.body) // other Explorers
  {
  	x = document.body.clientWidth;
  }
  return x;
}

/*****************************************************************************
 * getScrollX
 * retrieves x scroll position
 ****************************************************************************/

function getScrollX() {
  var x;
  if (self.pageXOffset) // all except Explorer
  {
  	x = self.pageXOffset;
  }
  else if (document.documentElement && document.documentElement.scrollLeft)
  	// Explorer 6 Strict
  {
  	x = document.documentElement.scrollLeft;
  }
  else if (document.body) // all other Explorers
  {
  	x = document.body.scrollLeft;
  }
  return x;
}

/*****************************************************************************
 * getScrollY
 * retrieves y scroll position
 ****************************************************************************/

function getScrollY() {
  var y;
  if (self.pageYOffset) // all except Explorer
  {
  	y = self.pageYOffset;
  }
  else if (document.documentElement && document.documentElement.scrollTop)
  	// Explorer 6 Strict
  {
  	y = document.documentElement.scrollTop;
  }
  else if (document.body) // all other Explorers
  {
  	y = document.body.scrollTop;
  }
  return y;
}

/*****************************************************************************
 * getx
 * retrieves x position of element specified by id
 * NOTE: the object has to be rendered *before* this function is called
 *
 * Parameters
 *   id:     id of object
 *
 * returns x position
 ****************************************************************************/

function getx(imgID,node) {
 var tempEl;
  if (imgID!='') tempEl = document.getElementById(imgID);
  else           tempEl = node;

  var xPos = tempEl.offsetLeft;
  tempEl = tempEl.offsetParent;
  while (tempEl != null) {
    xPos += tempEl.offsetLeft;
    tempEl = tempEl.offsetParent;
  }
  return xPos;
}

/*****************************************************************************
 * gety
 * retrieves y position of element specified by id
 * NOTE: the object has to be rendered *before* this function is called
 *
 * Parameters
 *   id:     id of object
 *
 * returns y position
 ****************************************************************************/

function gety(imgID,node) {
  var tempEl;
  if (imgID!='') tempEl = document.getElementById(imgID);
  else           tempEl = node;

  var yPos = tempEl.offsetTop;
  tempEl = tempEl.offsetParent;
  while (tempEl != null) {
    yPos += tempEl.offsetTop;
    tempEl = tempEl.offsetParent;
  }
  return yPos;
}





