<!--

function check_vote(f,m,lang) {
 var cnt=0;
 for(var x=0; x<f.point_id.length; x++) cnt+=(f.point_id[x].checked)?1:0;
 if(cnt>m) {
  alert((lang=='ru')?'Можно выбрать не более '+m+' вариантов.':'You can choose not more than '+m+'variants.');
  return false;
 } else {
  return true;
 }
}

var formDiv,onDiv,timeOnDiv,timeOutDiv,lR='',sR='',sV='',hV='',sLeft='',sTop='',sClip='',winX,sz=0;
var nn4=document.layers;
var nav6 = (!document.all && document.getElementById) ? true : false;

if (nav6) {
 document.captureEvents(Event.MOUSEMOVE);
 lR="document.getElementById('";
 sR="').style";
 sV="'visible'";
 hV="'hidden'";
 sLeft='.left';
 sTop='.top';
 sClip='.clip';
} else if (nn4) {
 document.captureEvents(Event.MOUSEMOVE);
 lR="document.";
 sR="";
 sV="'show'";
 hV="'hide'";
 sLeft='.left';
 sTop='.top';
 sClip='.clip';
} else {
 lR="document.all.";
 sR=".style";
 sLeft='.posLeft';
 sTop='.posTop';
 sClip='.clip';
 sV="'visible'";
 hV="'hidden'";
}

function testdiv(divn) {
 var str;
 if (nav6) {
  str="document.getElementById('"+divn+"')"
 } else if (nn4) {
  str="document."+divn
 } else {
  str="document.all."+divn
 }
 return(eval(str)!=undefined)
}

function handlerMM(e){
 winX=nn4?e.pageX-90:(document.body.clientWidth-203)
}
document.onmousemove = handlerMM;

function turnOff(divn) {
 sz=0;
 eval(lR+'Ld'+divn+sR+'.visibility = '+hV);
 eval(lR+'Ld'+divn+sR+'.display = "none"');
 eval(lR+'Ld'+divn+sR+sLeft+' = 0');
}

function hideDiv(divn) {
 if(timeOnDiv!=null) clearTimeout(timeOnDiv);
 if(sz>10) {
  sz-=10;
  if(sz<0) sz=0;
  eval(lR+'Ld'+onDiv+sR+sClip+'="rect(auto,'+sz+',auto,auto)"');
  eval(lR+'Ld'+onDiv+sR+sLeft+' = '+(winX-sz+9));
  timeOnDiv=setTimeout("hideDiv()",10);
 } else {
  eval(lR+'Ld'+onDiv+sR+'.visibility = '+hV);
  eval(lR+'Ld'+onDiv+sR+'.display = "none"');
  eval(lR+'Ld'+onDiv+sR+sLeft+' = 0');
  onDiv=0;
 }
}

function showDiv() {
 if(timeOnDiv!=null) clearTimeout(timeOnDiv);
 if(testdiv('Ld'+onDiv)) {
  if(sz<194) {
   if(sz<=10) {
    eval(lR+'Ld'+onDiv+sR+'.display = "block"');
    eval(lR+'Ld'+onDiv+sR+'.visibility = '+sV);
   }
   sz+=10;
   if(sz>194) sz=194;
   eval(lR+'Ld'+onDiv+sR+sClip+'="rect(auto,'+sz+',auto,auto)"');
   if(sz<194) timeOnDiv=setTimeout("showDiv()",10);
  }
  eval(lR+'Ld'+onDiv+sR+sLeft+' = '+(winX-sz+9));
 }
}

function showLd(divn) {
 if(onDiv&&onDiv!=divn) turnOff(onDiv);
 onDiv=divn;
 showDiv()
}

function divTimer() {timeOnDiv=setTimeout("divOut()",800)}
function divOut() {hideDiv(onDiv)}

function hide_form(divn) {
 if(testdiv('Ld'+divn)) {
  eval(lR+'Ld'+divn+sR+sLeft+' = 0');
  if(divn=='Mail') eval(lR+'Ld'+divn+sR+sTop+' = 0');
  eval(lR+'Ld'+divn+sR+'.display = "none"');
  eval(lR+'Ld'+divn+sR+'.visibility = '+hV);
  formDiv=null
 }
}

function show_form(divn) {
 if(formDiv!=null) hide_form(formDiv);
 if(testdiv('Ld'+divn)) {
  eval(lR+'Ld'+divn+sR+'.display = "block"');
  eval(lR+'Ld'+divn+sR+sLeft+' = '+(winX-1));
  eval(lR+'Ld'+divn+sR+'.visibility = '+sV);
  formDiv=divn;
 }
}


function ancPosX(anchorPtr) {
  if (document.layers) {
    return anchorPtr.x;
  } else if (document.getElementById || document.all) {
    var pos = anchorPtr.offsetLeft;
    while (anchorPtr.offsetParent != null) {
      anchorPtr = anchorPtr.offsetParent;
      pos += anchorPtr.offsetLeft;
    } 
    return pos;
  }
}

function ancPosY(anchorPtr) {
  if (document.layers) {
    return anchorPtr.y;
  } else if (document.getElementById || document.all) {
    var pos = anchorPtr.offsetTop;
    while (anchorPtr.offsetParent != null) {
      anchorPtr = anchorPtr.offsetParent;
      pos += anchorPtr.offsetTop;
    } 
    return pos;
  }
}

function getPosition(ancName) {
  for (var i = 0; i < document.anchors.length; i++) {
    if (document.anchors[i].id == ancName) {
      this.x = ancPosX(document.anchors[i]);
      this.y = ancPosY(document.anchors[i]);
      return this;
    }
  }
}

function send_mail(user_id, anchor_id) {
 if(formDiv!=null) hide_form(formDiv);
 var pos=getPosition('smanchor'+anchor_id);
 document.sendmail.user_id.value=user_id;
 document.sendmail.back.value=location.href;
 eval(lR+'LdMail'+sR+sLeft+' = '+pos.x);
 eval(lR+'LdMail'+sR+sTop+' = '+pos.y);
 eval(lR+'LdMail'+sR+'.display = "block"');
 eval(lR+'LdMail'+sR+'.visibility = '+sV);
 formDiv='Mail';
}

function view_photo(a,b,c) {
 var par="width="+b+",height="+c+",status=no,toolbar=no,menubar=no,location=no,left=10,top=10";
 view_win=window.open("","photo",par);
 view_win.document.write("<html><head><title>Фотоархив</title></head>");
 view_win.document.write("<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 bgcolor=#ffffff>");
 view_win.document.write("<img src='"+a+"' width="+b+" height="+c+" hspace=0 vspace=0 border=0 alt=''>");
 view_win.document.write("</body></html>");
}
//-->