function initbookmark(){		
	$('#add_rm_bookmark').click( bookmarking );					
}
function noteHead( memo ){
	return memo + '[' + new Date().toFormatedString('d.m.Y') + '] ';
}
function bookmarking(){
	var memo 	= '';
	var objForm = $('#bookmark_div');	
	if($('#personal_memo textarea[@name=note]').html()){
		memo = $('#personal_memo textarea[@name=note]').html();
		if( memo == tr_create_memo){
			memo = '';
		}else{
			memo += '\n';
		}	
	}else{
		memo = $('#personal_memo').children().next().html();
		if( memo == tr_create_memo){
			memo = '';
		}else{
			memo += '\n';
		}
	}
	$.extend( $.blockUI.defaults.overlayCSS, { backgroundColor:'#000000', filter:'alpha(opacity=80)', opacity:'0.8'});					
	$.blockUI( objForm.clone() , {width:'300px' });		
	$('button.bookmark_cancel').bind('click', function(){ $.unblockUI() });	
	$('button.bookmark_action').bind('click', function(){ $('#bookmark_form').submit() });			
	$('textarea.bookmark_memo').val( noteHead(memo) ); 			
}
$(initbookmark);


var xp_win_report_profile	= '#cancel_report';

function initReportProfile(){
	$('#report_profile').click( showReport );		
	//$.extend( $.blockUI.defaults.overlayCSS, { backgroundColor:'#000000', filter:'alpha(opacity=80)', opacity:'0.8'});
	//$( xp_btn_report_profile ).click ( showReport );
}

function closeDialog(sender){
	$.unblockUI();
}

function showReport( sender, dialog ){
	
	$.extend($.blockUI.defaults.overlayCSS, { backgroundColor: '#000000', backgroundAttachment: 'scroll' , filter:'alpha(opacity=80)', opacity:'0.8' } );
	$.blockUI( $('#report').clone(), { width: 'auto',position:'absolute', border: 'none',backgroundAttachment: 'scroll' , padding: '10px',marginLeft:'0px',marginTop:'0px',left:'40%',top:'40%' } );

	$('button[@name=dialog_cancel_report]').bind( 'click', function() { closeDialog( sender );  } );
	$('button[@name=dialog_ok_report]').bind( 'click', function() {
		$.unblockUI();
		$('#action').submit();
		} );
	
	//$.blockUI( $(xp_win_report_profile).clone(), { width: '300px', border: 'none', padding: '10px' });
	//$('button.dialog_no').bind( 'click', function() { closeDialog( sender ); } );
}

$(initReportProfile);