$(document).ready(function(){ 
  $("a[rel^='prettyPhoto']").prettyPhoto();
  $(".hidenext").each(function() {
   $(this).click(function() {
	 if($(this).hasClass("accord"))
	 {
	  if(!$(this).next().is(":visible")) {
	  $(".accord").next().slideUp();
	  $(this).next().slideToggle();
	  }
	 }
	 else
	 {
	 $(this).next().slideToggle();
	 }
    });
  });  
  $(".hidenext").not(".startopen").next().hide();
  
  $(".poll_vote").click(function() {
   option_id = $(this).attr("data-option");
   poll_id = $(this).attr("data-poll");
   $.ajax({
	  url: 'http://www.edgeofafrica.com/r/vote.php?poll_id=' + poll_id + '&vote=' + option_id,
		type: 'GET',
		success: function(response){
		  $(".poll_image").each(function() {
		  oldsrc = ($(this).attr("src"));
		  newsrc = oldsrc + "&t=" + Math.random(1);
		  $(this).attr("src",newsrc);
		  });
		  
		}
	});  
  });
  
  $(".feedback_readmore").click(function() {
   f_id = $(this).attr("data-feedback_id");
   $("#feedback_readmore_link_" + f_id).hide();
   $("#feedback_more_" + f_id).fadeIn();
  });
  
// ADDS SOCIAL MOUSEOVER LINKS 
//
/*  $(".social").each(function() {
    $(this).html('<div class="mouseover">' + $(this).attr("title") + '</div>');
  }); */

});

