// Main JQuery for JCMS4
$(document).ready(function(){
	
// Funky Messages
	$(".message-green").delay(0).animate({"top" : "0px"},1000);
	$(".message-green").delay(3000).animate({"top" : "-30px"},500);
	$(".message-red").delay(500).animate({"top" : "0px"},1000);
	$(".message-red").click(function(){$(this).animate({"top" : "-30px"},500)});
	
    
// Menu Popups
/*	$('.contains-balloon').hover(function(){
    	var balloonname = $(this).attr('id');
        $('#'+balloonname+'-balloon').fadeIn();
    },function(){
    	var balloonname = $(this).attr('id');
        $('#'+balloonname+'-balloon').fadeOut();
        });
    	
// Newsflash
	$('.newsflash').delay(2000).fadeIn(1000);
	$('#newsflashfade').delay(2000).slideUp();
*/
// END OF JQUERY! ////////////////////////////////////////////////////////////////////
});	


// Change Names to textboxes
function renameobject(target){
	$("#name-"+target).fadeOut(function(){
		$("#rename-"+target).fadeIn();
		});
	}
// Change Back
	function unrenameobject(target){
	$("#rename-"+target).css({'display':'none'});
	$("#name-"+target).fadeIn();
	}
	
// Delete stuff
	function deleteobject(target){
	if(confirm("Are you sure you want to delete this object? This action is irreversable.")){
	$("#tablerow-"+target).fadeOut().delay(500);
	setTimeout("deleteconfirmed("+target+")",550);
	} else { alert("Object not deleted") }
	}
	
	function thumbobject(target){
		document.forms["thumb-"+target].submit();
	}
	
	function deleteconfirmed(target){
		document.forms["delete-"+target].submit();
	}
	function uploadstart(){
		$('#uploadify-status').animate({'height':'1px','opacity':'0'},500);
	}
	function uploadend(){
		$('#uploadify-status').after('<p>Upload Complete. Please wait...</p>');
		settimeout(location.reload(true),1000);
	}
	function gridsmall(){
		$('.image').animate({'width':'108px', 'height':'80px'});
		$('.image .thumb').animate({'width':'108px', 'height':'60px'});
		$('.image .width').animate({'width':'108px'});
		$('.image .thumb img').animate({'width':'108px'});
		$('.image span').fadeOut();
		$('#shrinklink').slideUp();
	}
