﻿function GetRandomImage(imageId)
{	
	var pix = new Array;
	pix[0]="Images/picture1.jpg";
	pix[1]="Images/picture2.jpg";
	pix[2]="Images/picture3.jpg";
	pix[3]="Images/picture4.jpg";

	var rand = Math.floor(Math.random() * 4);
	
	if(document.getElementById(imageId) != null)
	{
		document.getElementById(imageId).src = pix[rand];
	}
}

function ShowOver(imageId)
{
	if(document.getElementById(imageId) != null)
	{
		document.getElementById(imageId).src = 'Images/' + imageId + '_over.jpg';
	}
}

function ShowRegular(imageId)
{
	if(document.getElementById(imageId) != null)
	{
		document.getElementById(imageId).src = 'Images/' + imageId + '.jpg';
	}
}

function PreloadImages() 
{  
	var d=document; 
	
	if(d.images)
	{ 
		if(!d.MM_p) 
		{
			d.MM_p=new Array();
		}
		
	    var i;
	    var j = d.MM_p.length;
	    var a = PreloadImages.arguments; 
	    
	    for(i=0; i<a.length; i++)
	    {
	    	if (a[i].indexOf("#")!=0)
	    	{ 
	    		d.MM_p[j]=new Image; 
	    		d.MM_p[j++].src=a[i];
	    	}
	    }
	}
}
