function imgClickHandler(lz,fu,fa,ez)
{if(window.event)
   {fa.value=window.event.offsetX;ez.value=window.event.offsetY;}
 else if(lz.target)
   {fa.value=lz.layerX;ez.value=lz.layerY;};
fa.value=fa.value-4;
if(fa.value<0)fa.value=0;
ez.value=ez.value-4;
if(ez.value<0)ez.value=0;coloredRectangle(fu,fa.value,ez.value);
};



function coloredRectangle(fu,hr,jh)
{if(!fu)return 0;
if(jh>75)jh=75;
if(hr>=75)hr=75;
if(jh==0)jh=1;
if(hr==0)hr=1;
var r="DIV"+fu.id,
   aj=document.getElementById(r),
    r="DOT"+fu.id,
   ma=document.getElementById(r);

if(typeof aj!='object')
  {alert("run1");return 0;};
aj.innerHTML='<img id="DOT'+fu.name+'"  src="site\\main\\images\\reddotpfo.gif" border="0" width="9" height="9" alt="dot" >';
var nk=aj.style;
if(typeof aj.style!='object')
  {alert("run3");return 0;};
if(hr>0&&jh>0&hr<=75&&jh<=75)
  {aj.style.zIndex=2;
   aj.style.left=(hr+'px');
   aj.style.top=(jh+'px');
   aj.style.display='block';
   aj.innerHTML='<img id="DOT'+fu.name+'"  src="site\\main\\images\\reddotpfo.gif" border="0" width="9" height="9" alt="dot" >';

  }
else
  {aj.style.display='none';
   }
;};


function getImageCoords(fu)
{var bz=0,
     pm=0,
     cu=fu;
 do{bz+=cu.offsetLeft; pm+=cu.offsetTop;}
 while((cu=cu.offsetParent));
 return{bz:bz,pm:pm};};
 
 
 function imgCountry(gi,bb,fw,form)
 {al=gi.value.split(";");
  aq="";
  for(c=0;c<al.length;c++)
     {hc=al[c].split("#");
      if(hc[0]==bb)
        {aq=hc[3];break;};
     };
  if(aq=="")
    aq="blank-80x80.gif";
  if(aq==""||aq=="blank-80x80.gif")
    {fw.src="/site/main/images/spacer.gif";
     if(form=='productform')
       {setMyElementByIdStyleDisplay('imgMapXYShow','none');
        setMyElementByIdValue('frmMapX',-1);
        setMyElementByIdValue('frmMapY',-1);
       };
    }
  else
    {if(form=='productform')
       setMyElementByIdStyleDisplay('imgMapXYShow','block');
     fw.src="/site/main/images/maps/"+aq;
     fw.style.zIndex=1;
    };
  };
  
  
  function imgMapClick(t,hi,fr,oc,bh)
  {var gx=document.searchform,
       le=oc.split("#"),
       ch=parseInt(le[0]),
       bb=parseInt(le[0]),
       qi=parseInt(le[1]);
       bb=parseInt(le[0]);
       ch=1000;
       cj=t.value.split(";");
       al=hi.value.split(";");
   var eq=false;
   for(c=0;c<al.length;c++)
     {hc=al[c].split("#");
      if(hc[0]==bb)
        {bh.value=bb;
         if(hc[2].length<1)
            hc[2]="blank-330x300.jpg";
         if(hc[2]!="blank-330x300.jpg")
            eq=true;break;
        };
     };
   var ij;
   if(eq)
     {var qw=0;
          fr=gx.elements['jsRegions_'+bb];
          ij=fr.value.split(";");
     };
   au="";
   fi="";
   ft="";
   fi="";
   if(ch==0)
     {au="<map name=\"myClickmap\">";
     for(c=0;c<cj.length;c++)
        {af=cj[c].split("#");
         if(af[0]==ch)
           {ft="<img border=0 src=\"/site/main/images/maps/"+af[2]+"\" usemap=\"\#myClickmap\" width=330 height=300>";
            fi="<br><b>"+af[1]+"</b>";
           }
         else
           {au+="<area href=\"javascript:void(0);\" onClick=\"javascript:";
            au+="imgMapClick (document."+t.form.name+"."+t.name+",";
            au+=" document."+t.form.name+".jsContinents_"+af[0]+",";
            au+=" 'notused',";
            au+=" '"+af[0]+"#0', document."+t.form.name+"."+bh.name+");";
            au+="\" target=\"_self\" title=\""+af[1]+"\" shape=\"polygon\" coords=\""+af[3]+"\"></map>";
           };
        };
     bh.value=0;
     }
   else
     {if(ch>0&&(bb==0||!eq))
        {au="<map name=\"myClickmap\">";
         for(c=0;c<cj.length;c++)
           {af=cj[c].split("#");
            if(af[0]==ch)
              {ft="<img border=0 src=\"/site/main/images/maps/"+af[2]+"\" usemap=\"\#myClickmap\" width=330 height=300>";
               fi="<br><b>"+af[1]+"</b>";
              };
           };
         for(c=0;c<al.length;c++)
           {hc=al[c].split("#");
            hh=hc[3].split("|");
            for(p=0;p<hh.length;p++)
              {lx=hh[p];
               if(hc[4]>0)
                 {au+="<area href=\"javascript:void(0);\" ";
                  au+=" onClick=\"javascript: ";
                  au+="document."+t.form.name+"."+bh.name+".value="+hc[0]+";";
                  au+="renderActRegions(document."+t.form.name+"."+bh.name+", 'frmRegion_ID', '0');";
                  au+="imgMapClick (document."+t.form.name+"."+t.name+",";
                  au+=" document."+t.form.name+".jsContinents_"+ch+",";
                  au+=" document."+t.form.name+".jsRegions_"+hc[0]+",";
                  au+=" '"+hc[0]+"#0', document."+t.form.name+"."+bh.name+");";
                  au+="\" target=\"_self\" title=\""+hc[1]+"\" shape=\"polygon\" coords=\""+lx+"\">";
                 }
               else
                 {au+="<area target=\"_self\" title=\""+hc[1]+"\" shape=\"polygon\" coords=\""+lx+"\">";
                 };
              };
           };
         au+="</map>";bh.value=bb;
        }
      else
        {au="<map name=\"myClickmap\">";
         for(c=0;c<al.length;c++)
            {hc=al[c].split("#");
             if(hc[0]==bb)
               {ft="<img border=0 src=\"/site/main/images/maps/"+hc[2]+"\" usemap=\"\#myClickmap\" width=330 height=300>";
                for(mx=0;mx<cj.length;mx++)
                   {af=cj[mx].split("#");
                    if(af[0]==ch)
                      {fi="<br><b><a href=\"javascript:void(0);\" onClick=\"javascript: initForm();return false;\">"+af[1]+"</a> - "+hc[1]+"</b>";
                      };
                   };
               };
            };
         for(c=0;c<ij.length;c++)
            {bn=ij[c].split("#");
             if(bn[3]>0)
               {au+="<area href=\"javascript:void(0);\" onClick=\"javascript: renderActRegions(document."
                    +t.form.name+"."+bh.name+", 'frmRegion_ID', '"+bn[0]+"');"
                    +"\" target=\"_self\" title=\""+bn[1]+"\" shape=\"polygon\" coords=\""+bn[2]+"\">";
               }
             else
               {au+="<area target=\"_self\" title=\""+bn[1]+"\" shape=\"polygon\" coords=\""+bn[2]+"\">";
               };
            };
         au+="</map>";
         bh.value=bb;
        };
     };
     setPText('imgMapClickable',au+ft+fi);
 };

