
    // RATINGS

function getParam(rel, param){
    var relArray = rel.split(',');
    
    return relArray[param];
}



$(document).ready(function() {
    
    //if($('#vertical_form')!=undefined) {
	    $('#vertical_comments').slideUp();
    //}
    
    //if($('#vertical_comments')!=undefined) {
	    $('#vertical_form').slideUp();
    //}
    
    
    //if($('#v_show_comments')!=undefined)
    $('#v_show_comments').click(function(){
	    //if($('#vertical_comments')!=undefined)
            $('#vertical_comments').slideDown();
	    //if($('#vertical_form')!=undefined)
            $('#vertical_form').slideDown();
	    window.location.hash = "CommentStartNot";
	    window.location.hash = "CommentStart"; 
    });
    
    //if($('#v_show_comments_icon')!=undefined)
    $('#v_show_comments_icon').click( function(){
	    //if($('#vertical_comments')!=undefined)
            $('#vertical_comments').show();
	    //if($('#vertical_form')!=undefined)
            $('#vertical_form').show();
	    window.location.hash = "CommentStartNot";
	    window.location.hash = "CommentStart"; 
    });
    
    //if($('#v_hide_comments')!=undefined)
    $('#v_hide_comments').click(function(){
	    //if($('#vertical_comments')!=undefined)
            $('#vertical_comments').hide();
	    //if($('#vertical_form')!=undefined)
            $('#vertical_form').hide();
	    window.location.hash = "hautPageNot";
	    window.location.hash = "hautPage"; 
    });
    
    $('.tz-ratings-vote-bar').click(function(e){
	$.ajax({
	    url:	'index.php?type=555&tx_tunizikaemission_pi2[ref]=' + getParam($(e.target).attr("rel"),0) +'&tx_tunizikaemission_pi2[rating]=' + getParam($(e.target).attr("rel"),1),
	    success: function(responseText){
		  $('#tz-ratings-' + getParam($(e.target).attr("rel"),0)).html(responseText);
	    }
	});
    });
}); 

