function divSt(name)
{
      if (eval(name).style.display=='none')
        { 
          eval(name).style.display='block';
         }
      else
        {
	      eval(name).style.display='none' 
	     }
}

function imgOpen(imgURL,imgWidth,imgHeight,Title) {var features;var top = (screen.height - imgHeight)/2, left = (screen.width - imgWidth)/2;if(top < 0) top = 0;if(left < 0) left = 0;features = ',top=' + top + ',left=' +left;var imgWndw=window.open('','newwin','width='+imgWidth+',height='+imgHeight+',toolbar=no,menubar=no,location=no,status=no,'+'resizable=yes,scrollbars=no'+features);var imgTitle=(Title)?Title:imgURL+": "+imgWidth+'x'+imgHeight;with (imgWndw.document){open();write('<ht'+'ml><he'+'ad><ti'+'tle>'+imgTitle+'</ti'+'tle>'+'</he'+'ad><bo'+'dy leftmargin="0" topmargin="0" '+'rightmargin="0" bottommargin="0" marginwidth="0" '+'marginheight="0"><img src="'+imgURL+'" width="'+imgWidth+'" height="'+imgHeight+'" border="0" alt="'+imgTitle+'"></bo'+'dy></ht'+'ml>');close();}return false}

function vote(id,vote) {
if(id==1) {g=get_cookie("votenum1");if(g==1) alert("Вы уже голосовали!");else {set_cookie("votenum1", id);alert('Ваш голос принят!');$.post('/static/send_mail.php',{id: id,vote: vote}, onSendOk);}}
if(id==2) {g=get_cookie("votenum2");if(g==2) alert("Вы уже голосовали!");else {set_cookie("votenum2", id);alert('Ваш голос принят!');$.post('/static/send_mail.php',{id: id,vote: vote}, onSendOk);}}
if(id==3) {g=get_cookie("votenum3");if(g==3) alert("Вы уже голосовали!");else {set_cookie("votenum3", id);alert('Ваш голос принят!');$.post('/static/send_mail.php',{id: id,vote: vote}, onSendOk);}}
if(id==4) {g=get_cookie("votenum4");if(g==4) alert("Вы уже голосовали!");else {set_cookie("votenum4", id);alert('Ваш голос принят!');$.post('/static/send_mail.php',{id: id,vote: vote}, onSendOk);}}
if(id==5) {g=get_cookie("votenum5");if(g==5) alert("Вы уже голосовали!");else {set_cookie("votenum5", id);alert('Ваш голос принят!');$.post('/static/send_mail.php',{id: id,vote: vote}, onSendOk);}}
return false;
}

 
function onSendOk(data) {if(data!='1') {alert('Ошибка отправки данных!');}}

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ) {
  var cookie_string = name + "=" + escape ( value );
 
  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }
 
  if ( path )
        cookie_string += "; path=" + escape ( path );
 
  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}
 
function get_cookie( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
 
  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}
