// JavaScript Document


function initializeDisplay()
{
	var url = document.URL;
	var url = url.substring(url.lastIndexOf('/') + 1);
	if (url == "" || url == "index.php" || url == "index-save.php") {
//		var e = document.getElementById('top-image-container');
//		e.style.backgroundImage = "url(/images/website/banner-top-two-dog-index.jpg)";
//		var e = document.getElementById('panel-container');
//		e.style.backgroundImage = "url(/images/website/border-index.gif)";
//		var e = document.getElementById('panel-right');
//		e.style.backgroundImage = "url(/images/website/side-panel-right-index.jpg)";
//		var e = document.getElementById('footer');
//		e.style.backgroundImage = "url(/images/website/footer-index.jpg)";
	}
}


var the_timeout;

function startDiv()
{
  var the_style = getStyleObject("myDiv");
  the_style.display = "block";
  the_timeout=setTimeout('moveDiv();',200);
}


function resetDiv()
{
  var the_style = getStyleObject("myDiv");
  the_style.top = 150 + "px";
  the_style.left = 100 + "px";
}

function moveDiv()
{
  // get the stylesheet
  //
  var the_style = getStyleObject("myDiv");
  if (the_style)
  {
    // get the current coordinate and add 5
    //
    var current_left = parseInt(the_style.left);
    var new_left = current_left + 5;

    // set the left property of the DIV, add px at the
    // end unless this is NN4
    //
    if (document.layers) 
    {
      the_style.left = new_left;
    }
    else 
    {  
      the_style.left = new_left + "px";
    }
    
    // if we haven't gone to far, call moveDiv() again in a bit
    // 
    if (new_left < 900)
    {
      the_timeout = setTimeout('moveDiv();',10);
    }
	else {
	  the_style.top = 150 + "px";
      the_style.left = 100 + "px";
      the_style.display = "none";
	}
  }
}


function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

