<!--
delay = 3000; imageNum=0;
artist = new Array(4);
artist[0] = new Image()
artist[0].src = "image/image0.jpg" 
artist[1] = new Image()
artist[1].src = "image/image1.jpg" 
artist[2] = new Image()
artist[2].src = "image/image2.jpg"
artist[3] = new Image()
artist[3].src = "image/image3.jpg"
 


for (i=0; i<4; i++) {
artist[i] = new Image();
artist[i].src = "image/image" + i + ".jpg";}

function animate() {
document.animation.src = artist[imageNum].src;
imageNum++;
if (imageNum > 3) {
imageNum = 0;
}
}
function slower() {
delay = delay + 200;
if (delay > 4000) delay =4000;
}

function faster() {
delay = delay - 100;
if (delay < 0) delay = 0;
}
//----------------------------------------------------------------

var animateSpeed = 5; // Higher Number = Faster Animation
var object = null;
var fX = null; //Final x position
var fY = null; //Final y position
var cX = null; //Current x position
var cY = null; //Current y position
var dX = null;
var dY = null;
var stepX = null;
var stepY = null;
var slope = null;

function initAnimate(objectID,x,y) {
	object = document.getElementById(objectID);
	fX = x;
	fY = y;
	cX = object.offsetLeft;
	cY = object.offsetTop;
	dX = Math.abs(fX-cX);
	dY = Math.abs(fY-cY);
	if ((dX == 0) || (dY == 0)) slope = 0;
	else slope= dY/dX;
		if (dX>=dY) {
			if (cX<fX) stepX =  animateSpeed;
			else if (cX>fX) stepX = - animateSpeed;
			if (cY<fY) stepY = animateSpeed*slope;
			else if (cY>fY) stepY =  -animateSpeed*slope;
		}
		else if (dX<dY)  {
			if (cY<fY) stepY= animateSpeed;
			else if (cY>fY) stepY=  - animateSpeed;
			if (cX<fX) stepX = animateSpeed/slope;
			else if (cX>fX) stepX =  -animateSpeed/slope;
		}
	animateObject()
}

function animateObject()  {
	if (( dX > 0  ) || (dY > 0)) {
		object.style.left = Math.round(cX) + 'px';
		object.style.top = Math.round(cY) + 'px';
		cX = cX + stepX;
		cY = cY + stepY;
		dX = dX - Math.abs(stepX);
		dY = dY - Math.abs(stepY);
		setTimeout ('animateObject()',0);
	}
  else {
	object.style.left = fX + 'px';
	object.style.top = fY + 'px';
}
	return;
}
function hideMe()
{
	
object.style.visibility = 'hidden';
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var previewP;

function popup(file, w, h, scrll)
{
	var xleft = (window.screen.width/2)-(w/2);
	var xtop = (window.screen.height/2)-(h/2);
	if (previewP) previewP.close();
	previewP = window.open(file, 'popup1','left='+xleft+',top='+xtop+',width='+w+',height='+h+',location=1,resizable=1,status=1,toolbar=0,scrollbars='+scrll);
	previewP.focus();
}

var msg;
initMessage();

function initMessage(){
	msg='The Following Errors occurred:\n----------------------------------------------';
}

function checkEmail(val, thisMsg){
	if (val)
	{
		var strPattern = /^[A-Za-z0-9][A-Za-z\-_0-9\.]+@[A-Za-z\-_0-9\.]+\.[A-Za-z]{2,3}$/;
		if (!strPattern.test(val))
		{
			msg+='\n - '+thisMsg;
			return true;
		}
	}	
}

function checkSelect(el, thisMsg)
{	
	if (!el.options[el.selectedIndex].value)
	{
		msg+='\n - '+thisMsg;
	 	return true;
	}
	else return null;
}

function checkText(val, thisMsg)
{
	if (!val)
	{
		msg+='\n - '+thisMsg;
	 	return true;
	}
	else return null;
}

function checkTextLength(val, minL, maxL, thisMsg)
{
	if ((val<minL)||(val>maxL))
	{
		msg+='\n - '+thisMsg;
	 	return true;
	}
	else return null;
}
function animate() {
document.animation.src = artist[imageNum].src;
imageNum++;
if (imageNum > 4) {
imageNum = 0;
}
}
function slower() {
delay = delay + 100;
if (delay > 4000) delay =4000;
}

function faster() {
delay = delay - 100;
if (delay < 0) delay = 0;
} 

function initSelect(el,val)
{	
	
	for (var i=0; i<el.length; i++)
	{
		if (el.options[i].value == val)
		{
			el.options[i].selected = true;
			break;
		}
	}
}
//-->