var emptyReportMessage	= '';
var reportAjaxCall		= '';

function checkReport()
{
	if( jQuery( '#report-message' ).val() == '' )
	{
		jQuery( '#report-message-error' ).html( emptyReportMessage );
		jQuery( '#report-message-error' ).css( 'color' , 'red' );
		return false;
	}
	return true;
}

function showReportWindow( reportFunc, arguments )
{
	var ajaxCall	= 'jax.call("community" , "system,ajaxReport" , "' + reportFunc + '","' + location.href + '" ,' + arguments + ');';
	cWindowShow(ajaxCall, '', 450, 300);
}

function submitReport( reportFunc , pageLink , arguments )
{
	if( checkReport() )
	{
		var message	= escape( jQuery('#report-message').val() );
		var ajaxcall='jax.call("community", "system,ajaxSendReport","' + reportFunc + '","' + pageLink + '","' + message + '" , ' + arguments + ')';
		cWindowShow(ajaxcall, '', 450, 300);
	}
}

function cAppBoxToggle($id){
	jQuery($id).slideToggle('fast', 
		function(){
			if(jQuery($id).css('display') == 'none')
				jQuery($id).prev().children().addClass('app-box-r-collapse').removeClass('app-box-r-expand');
			else
				jQuery($id).prev().children().addClass('app-box-r-expand').removeClass('app-box-r-collapse');
		}
	);
}


