var winw = "360";
var winh = "250";
var ie=(document.all);
var ns=(document.layers);
var ns6=(document.getElementById && !ie);
var postfix=ns? "" : "px";
var cm_seconds = 0;
var cm_threshold = 120;
var cm_timerID;
function scrollPopup() {
  var agent=navigator.userAgent.toLowerCase();
  if (ie){
    documentWidth = (centerPopup().offsetWidth)/2+centerPopup().scrollLeft-(winw/2)-fixw;
    documentHeight = (centerPopup().offsetHeight)/2+centerPopup().scrollTop-(winh/2)-fixh;
  }
  else if (ns){
    documentWidth=window.innerWidth/2+window.pageXOffset-(winw/2)-fixw;
    documentHeight=window.innerHeight/2+window.pageYOffset-(winh/2)-fixh;
  }
  else if (ns6){
    documentWidth=self.innerWidth/2+window.pageXOffset-(winw/2)-fixw;
    documentHeight=self.innerHeight/2+window.pageYOffset-(winh/2)-fixh;
  }
  popup.left = documentWidth+postfix;
  popup.top = documentHeight+postfix;
  setTimeout("scrollPopup()",100);
}
function centerPopup() {
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function hideCallMe() {
  if (ie||ns6) { popup.display="none"; }
	else { popup.visibility ="hide"; }
}
function showCallMe() {
  if(!ns && !ie && !ns6) return;
  if(ie) popup=eval('document.all.callpopshdw.style');
  else if(ns) popup=eval('document.layers["callpopshdw"]');
  else if(ns6) popup=eval('document.getElementById("callpopshdw").style');
  if (ie||ns6) popup.visibility="visible";
  else popup.visibility ="show";
  scrollPopup();

  // Make sure it will not be show again
  if (cm_timerID) {
    clearInterval(cm_timerID);
    cm_timerID = 0;
    cm_seconds = 0;
  }
}
function callMeTimer() {
  cm_seconds++;
  if (cm_seconds > cm_threshold) {
    showCallMe();
  }
}
function callMeReset() {
  cm_seconds = 0;
}
function callMeInit(threshold) {
  cm_threshold = threshold;
  cm_timerID = setInterval("callMeTimer()", 1000);
}

