
function Rotation(name)
{
	this.name=name;
	this.speed=3;
	this.step=0;
  this.whichimage=0;
  this.imgArray=new Array();
  
  this.print=printRotation;
  this.slide=slideRotation;
  this.run=runRotation;
  this.load=preloadRotation;
  this.changeImage=changeImgRotation;
  
	}

function runRotation()
{
		//slideRotation(this);
	  if (IE4){i=this.speed*1000+3000;slideRotation(this);}
		else{i=this.speed*1000;}
	setInterval("slideRotation(rs"+this.name+")",i);
}

function preloadRotation()
{
arg=preloadRotation.arguments;
	  if (NS4 || IE4)
	  { //document.images
		for (i=0;i<arg.length;i++)
		   {
		   this.imgArray[i]=new Image();
		   this.imgArray[i].src=arg[i];
		  }//for
	 } //if
}

function printRotation()
 {
 	s_body="<a href=\"javascript:Start('document.slide_"+this.name+"')\" onMouseover=\"window.status='Click on the image to learn more about it!';return true\" onMouseout=\"window.status=''\"><img src='/pics/space.gif' name=\"slide_"+this.name+"\" border=0 class=\"slide\"></a>";
 				  if (NS4)
				  {
				  	document.write('<ILAYER LEFT="0" TOP="0" WIDTH="200" HEIGHT="200" NAME="holder1_'+this.name+'">');
				  	document.write('<LAYER LEFT="0" TOP="0" WIDTH="200" HEIGHT="200" NAME="holder2_'+this.name+'">');
				  	document.write('<FONT SIZE="1" FACE="sans-serif">Preparing to run slide show...</FONT>');
				  	document.write("</LAYER>");
				   	document.write("</ILAYER>");
				  	} //if
				   else if (IE4)
				   {
				   		document.write("<TABLE width='200' height='200' border='0' align='center'><TR><TD align='center'>")
				   		document.write(s_body);
				   		document.write("</TD></TR></TABLE>");
				   	} //if
					
					 else
					 {
					 for (i=0;i<arg.length;i++) {
					 	document.write("<IMG SRC='"+arg[i]+"' hspace='5' vspace='5'>");
					 	}// for
					 	
					 this.run=new Function("");
					} //else
}

function slideRotation(obj){
	if (!document.images) return;
	if (typeof obj!="object") {alert('Not an object'); return;}
	if (IE4)
	{
		s_img=eval("document.slide_"+obj.name);
		s_img.filters.blendTrans.apply();
	}
	obj.changeImage();
	if (IE4)
		s_img.filters.blendTrans.play();
	obj.whichimage=obj.step;
	if (obj.step<obj.imgArray.length-1)
	obj.step++
	else
		obj.step=0;
	}

function changeImgRotation()
{
	var src=this.imgArray[this.step].src;
	if(NS4)
	{
			//Fucking Netscape doesn't work normally
			s="document.holder1_"+this.name+".document.holder2_"+this.name+".document";
			//s="document.layers.holder2_"+this.name+".document";
			var d=null;
			eval("d="+s);
			d.open();
			d.write("<HTML><BODY><P align='center'><A HREF=\"javascript:Start('"+s+".slide_"+this.name+"')\" onMouseover=\"window.status='Click on the image to learn more about it!';return true\" onMouseout=\"window.status=''\"><IMG SRC='"+src+"' NAME='slide_"+this.name+"' BORDER='0'></A></P></BODY></HTML>");
			d.close();
			}
	else 
	{
		s_img=eval("document.slide_"+this.name);
		s_img.src=src;
		
		}
}


browser_version= parseInt(navigator.appVersion);
browser_type = navigator.appName;
var IE4=NS4=false;
if ((browser_type == "Microsoft Internet Explorer") && (browser_version >= 4)) {IE4=true;}
if ((browser_type == "Netscape") && (browser_version >= 4)) {NS4=true;}


var Start;
var imgWin;
var imgToShow;
var imgWinClosed=true;

if (!document.images || !(IE4 || NS4))
	{Start=new Function('alert("You need newer browser to preview images")');}
else 
{
	if((IE4 || NS4) && typeof _start!='undefined') {Start=_start;}
	else
	{	 Start=new Function('alert("Start.js required")');
	}//else
	}//if document

function ImClosed()
{
	imgWinClosed=true;
}
function _void(){}

if (window.onload==null || typeof window.onload=="undefined" || window.onload=="") window.onload=_void;
