
function slideX(){
	if(document.getElementById){
		if(parseInt(lyr2.style.left) < 100){
			lyr2.style.left = parseInt(lyr2.style.left) - 10 + "px";
			setTimeout("slideX()",30);
		}
	}
}

function slideY(){
	if(document.getElementById){
		if(parseInt(lyr2.style.top) < 200){
			lyr2.style.top = parseInt(lyr2.style.top) + 10 + "px";
			setTimeout("slideY()",30);
		}
	}
}
function cancelTrigger() {
    init();
	g_popup.hide()
}

function init2(){
	if(document.getElementById){
		//lyr1 = document.getElementById("myDiv1");
		lyr2 = document.getElementById("myDiv2");
		lyr2.style.left = 30;
		lyr2.style.top = -10;
		//lyr2.style.left = -140;
		//lyr2.style.top = -90;
     }
}
<!-- This function will detect the visibility of Icons //-->
function visibilityToggle(id) {
 init2();  

  var el = document.getElementById(id).style; 
  if(el.visibility == "hidden") {
  
  }
  else if(el.visibility == "visible") {
   slideY();
  }
} 


if (document.layers) {
  window.captureEvents(Event.onKeyDown);
}

window.onKeyDown = resetTimer;

var tID = '';

function resetTimer(e) {
  clearTimeout(tID); // reset the timer
 // tID = setTimeout('executeTimer()',30);
  slideX();
}

function executeTimer() { // this should be the timer
visibilityToggle('ssChatIconAvail')
}


//  End -->
