
function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function addvote()
{ 
    elementid='#poll';  
    var data = $("#poll_form").serialize();
    var ur = '/poll/inner.php?'+data;
    $(elementid).load(ur);
}

function digest_post_bug(type,user_id,entry_id ) {
    elementid='#post_bug';
    ur = '/digest_bug.php?user_id='+user_id+'&entry_id='+entry_id+'&type='+type;
    $(elementid).load(ur);
}


function digest_rate( value,type,entry_id ) {
    elementid='#rate_post_'+entry_id;
    if(type==0){
        ur = '/digest_rate.php?entry_id='+entry_id+'&v='+value;
        $(elementid).load(ur);
    }
    else if(type==1){
        alert('Извините, но вы уже голосовали');
    }
    else if(type==2){
        alert('Извините, но нельзя голосовать за свою запись');
    }
    else if(type==3){
        alert('Только члены клуба могут голосовать');
    }
}

function rate_comment( value,entry_id,comment_id,type ) {
    elementid='#comment_raiting_'+comment_id;
    if(type==0){
        ur = '/digest_coment_rate.php?comment_id='+comment_id+'&v='+value+'&entry_id='+entry_id;
        $(elementid).load(ur);
    }
    else if(type==1){
        alert('Извините, но вы уже голосовали');
    }
    else if(type==2){
        alert('Извините, но нельзя голосовать за свой комментарий');
    }
    else if(type==3){
        alert('Только члены клуба могут голосовать');
    }
    
}


function blog_rate( value,type,entry_id ) {
    elementid='#rate_post_'+entry_id;
    if(type==0){
        ur = '/include/blog_rate.php?entry_id='+entry_id+'&v='+value;
        $(elementid).load(ur);
    }
    else if(type==1){
        alert('Извините, но вы уже голосовали');
    }
    else if(type==2){
        alert('Извините, но нельзя голосовать за свою запись');
    }
    else if(type==3){
        alert('Только члены клуба могут голосовать');
    }
}

function blog_rate_comment( value,comment_id,type ) {
    elementid='#comment_raiting_'+comment_id;
    if(type==0){
        ur = '/include/blog_rate_c.php?comment_id='+comment_id+'&v='+value;
        $(elementid).load(ur);
    }
    else if(type==1){
        alert('Извините, но вы уже голосовали за этот комментарий');
    }
    else if(type==2){
        alert('Извините, но нельзя голосовать за свой комментарий');
    }
    else if(type==3){
        alert('Только члены клуба могут голосовать');
    }
}

$(document).ready(function() {
    $("a.single_image").fancybox({ 
            'zoomSpeedIn': 600, 
            'zoomSpeedOut': 500, 
            'overlayShow': true, 
            'overlayOpacity': 0.1 ,
            'centerOnScroll' : true,
            'easingIn' : 'easeOutBack',
            'easingOut': 'easeInBack'

    });  
});