//gedownloaded van: http://www.webreference.com/js/column18/final.html
nav = (document.layers) ? true : false;
ie  = (document.all) ? true : false;

function animation(id) {
  this.element = (NS4) ? document[id] : document.all[id].style;
  this.active = 0;
  this.timer = null;
  this.num = null;

  this.name = id + "Var";
  eval(this.name + " = this");

  this.show = show;
  this.hide = hide;
  this.left = left;
  this.top = top;
  this.circle = circle;
}

function pos(x, y) {
  this.x = Math.round(x);
  this.y = Math.round(y);
}

function show() {
  this.element.visibility = (NS4) ? "show" : "visible";
}

function hide() {
  this.element.visibility = (NS4) ? "hide" : "hidden";
}

function left() {
  return parseInt(this.element.left);
}

function top() {
  return parseInt(this.element.top);
}

function circle(radius, angle0, angle1, steps, interval, modus) {
  var dangle = angle1 - angle0;
  var sangle = dangle / steps;
  //var x = this.left();
  //var y = this.top();
  if (modus == "links")
  {
  	var x = 30;
  	var y = 10;
  }
  else
  {
  	var x = 60;
  	var y = 10;
  }
  var cx = x - radius * Math.cos(angle0 * Math.PI / 180);
  var cy = y + radius * Math.sin(angle0 * Math.PI / 180);

  var ar = new Array();
  for (var i = 0; i < steps; i++) {
    angle0 += sangle;
    x = cx + radius * Math.cos(angle0 * Math.PI / 180);
    y = cy - radius * Math.sin(angle0 * Math.PI / 180);
	if (nav) {y *= 0.8;}

	if (modus == 'rechtertekst')
	{
		if (linnegcor[i] < '0') {
		//alert(breed + "  " + i + "  " + linnegcor[i] + " raak");
			if (breed == '1280') {extrafact=0;} else {extrafact=1;}
			linnegcor[i] = linnegcor[i]*1280/breed - extrafact;
			//Dus schermresolutie 1280x1024 als standaardsituatie genomen
		x+= linnegcor[i];
		ar[i] = new pos(x, y);
		}
	}
	else
	{
    ar[i] = new pos(x, y);
	}

	xs=x.toString();
	ys=y.toString();
	st=i.toString();

	if (modus == 'links')
	{
		test=".tekst"+st+"{position: absolute; left: "+xs+"%; top: "+ys+"%;}";
	}
	if (modus == 'rechts')
	{
		/*
		cornex=xs;
		cornex=70;
		corney=ys;
		if (linnegcor[i] < '0') {
			if (breed == '1280') {extrafact=0;} else {extrafact=1;}
			linnegcor[i] = linnegcor[i]*1280/breed - extrafact;
			//Dus schermresolutie 1280x1024 als standaardsituatie genomen
		}
		
		//cornex = cornex + linnegcor[i];
		//alert(cornex);
		test=".negte"+st+"{position: absolute; left: "+cornex+"%; top: "+corney+"%;}";
		document.writeln(test);
		*/
		test=".negtekst"+st+"{position: absolute; left: "+xs+"%; top: "+ys+"%;}";
	}
	if (modus == 'rechtertekst')
	{
		test=".negtekstt"+st+"{position: absolute; left: "+xs+"%; top: "+ys+"%;}";
		//if (xs != null) {alert(xs);}
	}
	
	document.writeln(test);
  }
  
}
