
 function existsDiv(div_id)
 {
   if (document.getElementById) {
      if (window.document.getElementById(div_id))
        return true;
   }

   return false;
 }

 function getStyle(div_id, attr)
 {
   if (document.getElementById) {
      style_obj = window.document.getElementById(div_id).style;
   }

   eval("val = style_obj."+attr);
   return val;
 }

 function setStyle(div_id, attr, arg)
 {
   //alert("setting "+div_id+" to "+arg);
   if (document.getElementById) {
      style_obj = window.document.getElementById(div_id).style;
   }
   else if (document.layers) {
      style_obj = eval("window.document."+div_id);
   }
   else if (document.all) {
      style_obj = eval("window.document.all."+div_id+".style");
   }
   eval("style_obj."+attr+" = arg");
 }

 function setImage(img_no, url)
 {
   if (document.getElementById) {
      img_obj = eval("document.getElementById('img"+img_no+"')");
      img_obj.src = url;
   }
   else if (document.layers) {
      img_obj = eval("window.document.pic"+img_no+".document.images[0]");
      img_obj.src = url;
   }
   else if (document.all) {
      img_obj = eval("window.document.all.img"+img_no);
      img_obj.src = url;
   }
 }

 function adjustTop(absolute, percentage)
 {
   if (window.innerHeight) {
     yMax = window.innerHeight;
     xMax = window.innerWidth;
   }
   else {
     yMax = document.body.clientHeight;
     xMax = document.body.clientWidth;
   }
   yTarget = parseInt(yMax * percentage / 100);
   if (yTarget <= absolute)
     return;
   yAdjust = yTarget - absolute;

   for (i=1; existsDiv('pic'+i); i++)
   {
      //alert("pic"+i+": "+parseInt(getStyle("pic"+i,"top")));
      setStyle('pic'+i,'top',parseInt(getStyle('pic'+i,'top'))+yAdjust);
   }
   for (i=1; existsDiv('txt'+i); i++)
   {
      //alert("pic"+i+": "+parseInt(getStyle("pic"+i,"top")));
      setStyle('txt'+i,'top',parseInt(getStyle('txt'+i,'top'))+yAdjust);
   }
 }

 //alert("script loaded!");
