/*
simple image carousel

Created 15.07.2009 by H.Matthias 
	http://www.molooga.de
	http://www.3format.de
	
Last modified: 15.07.2009

based on (modified) javascript libraries
 -	tools.js
 -	sprite.js
 -	sprite3d.js

 available at
	http://www.molooga.de
*/

var op=0;
var preload=new Array();
var preloadFlag = false;
var tid;

function newImage(arg) {
	if (document.images){
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function preloadImage(image){
	if (document.images){
		preload.push(newImage(image));
		preloadFlag = true;
	}
	return preload.length-1
}

function rotate(){
	w = getWindowWidth();
	h = getWindowHeight();
	
	rx = w;
	rz = 3;
		
	for(i=0;i<num;i++){
		x = rx*Math.sin(a+2*Math.PI/num*i);
		y = (getMouseY()-h/2)/20;
		z = rz*Math.cos(a+2*Math.PI/num*i)+4;
		img[i].moveTo(x, y, z);
	}
	a -= ((w/2-getMouseX())/(20*w));
	if(a > 2*Math.PI) a -= 2*Math.PI;
	window.setTimeout("rotate()", 50);
}

