var sProduct="Select a product in the database"
var sDomain="Select a domain in the database in order to reduce the variables"
var sVariable="Select variables"
var sPresentation="Select one of our predefined presentations"
var sQueries="Select one of our predefined queries"
var sAccount="Select one of our predefined accounts"
var sAgreement="List of agreements and their links"
var sCountries="List of countries with data"
var sCatalog="Catalog of available data series"
var sGIS1="Presentations by country"
var sGIS2="Representation of a selected indicator"
var sGenderGloss="Glossary"

function popUp(object,sowhat,e,refObject) {
 var what=""
 switch (sowhat) {
 case "PRODUCT": what=sProduct; break;
 case "DOMAIN": what=sDomain; break;
 case "VARIABLE": what=sVariable; break;
 case "PRESENTATION": what=sPresentation; break;
 case "QUERIES": what=sQueries; break;
 case "ACCOUNT": what=sAccount; break;
 case "AGREEMENT": what=sAgreement; break; 
 case "COUNTRIES": what=sCountries; break; 
 case "GIS1": what=sGIS1; break;
 case "GIS2":  what=sGIS2; break;
 case "CATALOG": what=sCatalog; break;
 case "GLOSSARY": what=sGenderGloss; break;
 }
 if (what != "") {
   showUp (object, what,e ,"yes")
 }
 return true
}

function showUp(object,what,e,flagMove) {
//var lead = (document.layers) ? "<TABLE  BORDER='0' ID='pT'><TR><TD bgcolor=#C8FFFF  WIDTH='100%' WRAP>" : "<TABLE bgcolor=#C8FFFF ID='pT'><TR><TD WIDTH='100%' >" ;
//var tail="</TD></TR></TABLE>";
var lead = "<p style='background-color: #00FFFF' ID='pT' >"  ;
var tail="</p>";

var d = (document.layers) ? "document.layers[" + object + "]":"document.all[" + object +"]";
//what = "xPos>[" + event.x + "] yPos>[" + event.y + "]</TD></TR><TR><TD CLASS='pink'  WIDTH='100%' NOWRAP>scrollTop>[" + document.body.scrollTop + "] scrollLeft>[" + document.body.scrollLeft.y + "]";
// create document
if (document.layers){
  document.layers[object].document.open();
  document.layers[object].document.write(lead+what+tail);
  document.layers[object].document.close();
}
else if (document.all){
  document.all[object].innerHTML=lead+what+tail;
}
//alert(document.all[object].innerHTML)
//set position for NS and IE pop-up and display
if (document.layers && document.layers[object] != null) {
 xPos=e.pageX + 10;
 yPos=e.pageY - 2;
 if (yPos + document.layers[object].document.height - self.pageYOffset > self.innerHeight) {
  yPos = self.innerHeight - document.layers[object].document.height - 2
 }
 if (xPos + document.layers[object].document.width - self.pageXOffset > self.innerWidth){
  xPos = self.innerWidth - document.layers[object].document.width - 10
 }
 if (flagMove=="yes")
	document.layers[object].moveTo(xPos,yPos);
 document.layers[object].visibility = 'visible';
}
else  {
 if (document.all) {
   xPos=event.x + 20;
   yPos=event.y  - 10;
   if (yPos + document.all['pT'].clientHeight - document.body.scrollTop > document.body.offsetHeight){
     yPos = document.body.offsetHeight - document.all['pT'].clientHeight -2 }
   if (xPos + document.all['pT'].clientWidth - document.body.scrollLeft > document.body.offsetWidth){
     xPos = document.body.offsetWidth - document.all['pT'].clientWidth - 10 }
   document.all[object].style.pixelLeft = xPos + document.body.scrollLeft;
   document.all[object].style.pixelTop = yPos + document.body.scrollTop;
   document.all[object].style.visibility = 'visible';
 }
}
return true;
}

function hide(object)
{
 if (document.layers && document.layers[object] != null)
 document.layers[object].visibility = 'hidden';
 else if (document.all && document.all[object]){
  if (object == 'pU1'){document.all[object].innerHTML="";}
  document.all[object].style.visibility = 'hidden';
 }
}


