function submitToggle() {
	if ($('#submit').css('display') == 'none') {
		$('#submit').slideDown();
	} else {
		$('#submit').slideUp();
	}
}

function plusToggle(id) {
	if ($('#plus'+id).css('display') == 'none') {
		$('#plus'+id).slideDown();
	} else {
		$('#plus'+id).slideUp();
	}
}

$(document).ready(function() { 

	// flag photo
	$('a.flag').live("click", function(){ 
		var pid = $(this).attr('PID');
		var flags = $(this).attr('flags');
		var $this = $(this);
		$.ajax({
		type: "POST",
		url: "include/ajax.php?request=flagImage&pid="+pid+"&flags="+flags,
		success: function(response) {
			$this.next('span').html('('+response+')');
			
			}
		});
	});

	$('img[hover]').hover(function() {  // image hover
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    }, function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    });

	$('.piss').hover(function() {  
		$('.monkey').attr('src', 'images/angrybs2.png');
    }, function() {
        $('.monkey').attr('src', 'images/angrybs1.png');
    });

	$('a.add_photo').click(function() {
		$('div.photo_url').toggle();
	});

	$('a.url_photo').click(function() {
		$('div.photo_url').show();
		$('div.photo').hide();
		$('input#photo').val('');
	});

	$('a.upload_photo').click(function() {
		$('div.photo_url').hide();
		$('div.photo').show();
		$('input#photo_url').val('');
	});

	$('a.add_video').click(function() {
		$('div.youtube_video').toggle();
	});

});