/*************** Script functions in this file **************
Filename: news_clipping.js; as of Donnerstag,
  FUNCTION:                                               LINE:
  addId()                                                  74   
  delId()                                                  87   
  existId(which)                                           101  
  hide()                                                   58   
  myClipping(name)                                         18   
  show()                                                   42   
************ (end Script functions in this file) ***********/

var isIE = (document.all)?(true):(false);
var isNS = (document.layers)?(true):(false);
var isW3C = (document.getElementById)?(true):(false);

function myClipping(name)
{
/*** variables ***/
/*** private *****/
 this.name = name
 this.visible = true;
/*** methodes ****/
/*** public ******/
 this.show = show;
 this.hide = hide;
 this.addId = addId;
 this.delId = delId;
/*** private *****/
 this.existId = existId;
 
/*** constructor */
 if (existId(this.name))
 {
  this.hide();
 }
}
function show()
{
 if (isNS)
 {
  document.layers[this.name].visibility = "show";
 }
 else if (isIE)
 {
  document.all(this.name).style.visibility = "visible";
 }
 else if (isW3C)
 {
  document.getElementById(this.name).style.visibility = "visible";
 }
}
function hide()
{
 if (isNS)
 {
  document.layers[this.name].visibility = "hide";
 }
 else if (isIE)
 {
  document.all(this.name).style.visibility = "hidden";
 }
 else if (isW3C)
 {
  document.getElementById(this.name).style.visibility = "hidden";
 }
}
function addId()
{
 if (!this.existId(this.name))
 {
  var len = top.newsIds.length;
  top.newsIds[len] = this.name;
  /* track the klick */
  var pid = ecrm.getPageId();
  pid = pid.substr(pid.lastIndexOf('/'),pid.length);
  pid = 'http://www.maxblue.de/max/trackingframes/clipping' + pid;

  ecrm.setPageId(pid);
  ecrm.setPixel();

  move(this.name);
  return true;
 }
 else return false;
}
function delId()
{
 for (i=0;i<=top.newsIds.length-1;i++)
 {
  if (top.newsIds[i].indexOf(this.name) != -1)
  {
   top.newsIds[i] = "";
   top.newsIds.sort();
   return true;
  }
 }
 return false;
}
function existId(which)
{
 for (i=0;i<=top.newsIds.length-1;i++)
 {
  if (top.newsIds[i].indexOf(which) != -1)
  {
   return true;
  }
 }
 return false;
}