var x = xOrg; //Starting Location - left
var y = yOrg; //Starting Location - top
var dest_x = xEnd;  //Ending Location - left
var dest_y = yEnd;  //Ending Location - top
var divIn = 0;

function moveDiv() {
	//Keep on moving the Div till the target is achieved
	if(x>dest_x) x = x - interval; 
	if(y<dest_y) y = y + interval;
	
	//Move the Div to the new location
	document.getElementById(divName).style.top  = y+'px';
	document.getElementById(divName).style.left = x+'px';

	if ((x+interval <= dest_x) || (y+interval <= dest_y)) {
		//Keep on calling this function every 50 microsecond 
		//	till the target location is reached
		window.setTimeout('moveDiv()',50);
	}
	
}

function moveRDiv() {
	//Keep on moving the Div till the target is achieved
	if(x<xOrg) x = x + interval; 
	if(y>yOrg) y = y - interval;
	
	//Move the Div to the new location
	document.getElementById(divName).style.top  = y+'px';
	document.getElementById(divName).style.left = x+'px';

	if ((x-interval >= xOrg) || (y-interval >= yOrg)) {
		//Keep on calling this function every 100 microsecond 
		//	till the target location is reached
		window.setTimeout('moveRDiv()',100);
	}
	
}

function toggleDiv() {
	if(divIn == 0)
	{
		moveDiv();
    divIn = 1;
		
	}
	else
	{
    moveRDiv();
    divIn = 0;
	}
}

function HideDiv() {
// Hide the layer "divName"
	if(divName.length < 1) { return; }
	document.getElementById(divName).style.display = "none";
  document.getElementById(divName).style.top  = '-600px';

}

function ShowDiv() {
// Show the layer "divName"
	if(divName.length < 1) { return; }
	document.getElementById(divName).style.display = "block";
}


function WriteYear(){
   	var now  = new Date();
   	var year = now.getYear();
  	if(year < 2000) { year = year + 1900; }
	document.write(year);
}

