var Speed = 3000;

var Pic = new Array();
Pic[0]	= 'images/Webdomain.jpg';
Pic[1]	=  'images/webhosting.jpg';
Pic[2]	=  'images/webdesign.jpg';

var a = Pic.length;
var preLoad = new Array();

for (num = 0; num < a; num++)
{
	preLoad[num] = new Image();
	preLoad[num].src = Pic[num];
}

run = 0;
kind = 1;

function show()
{

	if (document.all)
	{
		document.images.pic.style.filter="revealTrans(duration=0)";
		document.images.pic.style.filter="revealTrans(transition = kind)";
		document.images.pic.filters.revealTrans.apply();
	}

	document.images.pic.src = preLoad[run].src;

	if (document.all)
	{
		document.images.pic.filters.revealTrans.Play();
	}

	run++;
	if (run > (a - 1)) run = 0;
	
	kind++;
	if (kind > 22 ) kind = 0;
	
	setTimeout('show()', Speed);
}

/*************************************************************************
  CREATE mm
*************************************************************************/


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_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_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];}
}
/*************************************************************************
  CREATE ROLLTIP
*************************************************************************/

var RollTip = {
  offX: 12,
  offY: 12,
  ID: "rolltipDiv",
  aniLen: 300,  // duration of clipping animation
  ready: false,
  t1: null,
  t2: null,
  tip: null,
  
  init: function() {
    if ( document.createElement && document.body && 
        typeof document.body.appendChild != "undefined" && !window.opera ) {
      var el = document.createElement("DIV");
      el.className = "rolltip"; el.id = this.ID;
      document.body.appendChild(el);
      this.mult = el.offsetWidth/this.aniLen/this.aniLen;	
      el.style.clip = "rect(0, 0, 0, 0)";
      el.style.visibility = "visible";
      this.ready = true;
    }
  },

  reveal: function(msg, e) {
    if (this.t1) clearTimeout(this.t1);	if (this.t2) clearTimeout(this.t2); 
    this.tip = document.getElementById( this.ID );
    this.writeTip(msg);
    viewport.getAll();
    this.w = this.tip.offsetWidth; this.h = this.tip.offsetHeight;
    this.startTime = (new Date()).getTime();
    this.positionTip(e);
    this.t1 = setInterval("RollTip.rollOut()", 10);
  },
  
  rollOut: function() {
    var elapsed = (new Date()).getTime() - this.startTime;
  	if (elapsed < this.aniLen) {
  		var cv = this.w - Math.round( Math.pow(this.aniLen - elapsed, 2) * this.mult );
  		this.clipTo(0, cv, this.h, 0);
  	} else {
      this.clipTo(0, this.w, this.h,0);
      clearInterval(this.t1);
    }
  },
  
  conceal: function() {
  	if (this.t1) clearInterval(this.t1);	if (this.t2) clearInterval(this.t2);
  	this.startTime = (new Date()).getTime();
  	this.t2 = setInterval("RollTip.rollUp()", 10);
  },
  
  rollUp: function() {
  	var elapsed = (new Date()).getTime() - this.startTime;
  	if ( elapsed < this.aniLen ) {
  		var cv = Math.round( Math.pow(this.aniLen - elapsed, 2) * this.mult );
  		this.clipTo(0, cv, this.h, 0);
  	} else {
      this.clipTo(0, 0, this.h, 0);
      clearInterval(this.t2);
      this.tip = null;
    }  
  },
  
  writeTip: function(msg) {
    if ( this.tip && typeof this.tip.innerHTML != "undefined" ) this.tip.innerHTML = msg;
  },
  
  clipTo: function(top, rt, btm, lft) {
    this.tip.style.clip = "rect("+top+"px, "+rt+"px, "+btm+"px, "+lft+"px)";
  },
  
  positionTip: function(e) {
    var x = e.pageX? e.pageX: e.clientX + viewport.scrollX;
    var y = e.pageY? e.pageY: e.clientY + viewport.scrollY;
    if ( x + this.tip.offsetWidth + this.offX > viewport.width + viewport.scrollX )
      x = x - this.tip.offsetWidth - this.offX;
    else x = x + this.offX;
  
    if ( y + this.tip.offsetHeight + this.offY > viewport.height + viewport.scrollY )
      y = ( y - this.tip.offsetHeight - this.offY > viewport.scrollY )? y - this.tip.offsetHeight - this.offY : viewport.height + viewport.scrollY - this.tip.offsetHeight;
    else y = y + this.offY;

    this.tip.style.left = x + "px"; this.tip.style.top = y + "px";
  }

}

var imageHandler = { 
  imgs:[], path:"", preload:function() { for(var i=0;arguments[i];i++) {
    var img=new Image(); img.src=this.path+arguments[i]; this.imgs[this.imgs.length]=img;}}
}
//-----------
function showRollTip(msg, e) {
  if ( typeof RollTip == "undefined" || !RollTip.ready ) return;
  RollTip.reveal(msg, e);
}

function hideRollTip() {
  if ( typeof RollTip == "undefined" || !RollTip.ready ) return;
  RollTip.conceal();
}