function showIFrameWorkflow()
{	
	var cfwindowname = 'WFQueue';
	try {
		ColdFusion.Window.destroy(cfwindowname,true);
	} catch(e) { }
	ColdFusion.Window.create(cfwindowname,'Entwurfsübersicht','/commoncfm/workflow/workflowQueueIframe.cfm',
	{x:100,y:100,height:685,width:910,modal:false,closable:true,draggable:true,resizable:true,center:true,initshow:false,minheight:200,minwidth:200 });			
	ColdFusion.Window.show(cfwindowname);
	ColdFusion.Window.onHide(cfwindowname,closeIFrameWorkflow);	
}

function closeIFrameWorkflow() {
	ColdFusion.Window.destroy('WFQueue',true);			
}

function workflowHistoryClosed(cfwindowname) {
	ColdFusion.Window.destroy(cfwindowname,true);			
}

function showWorkflowHistory(draftid) {
	var cfwindowname = 'WFHistory_'+draftid;
	try {
		ColdFusion.Window.destroy(cfwindowname,true);
	} catch(e) { }
	ColdFusion.Window.create(cfwindowname,'Workflow History: Entwurf ID '+draftid,'/webservices/workflowMessaging.cfc?method=showWorkflowHistory&draftid='+draftid,
	{ height:400,width:400,modal:false,closable:true,draggable:true,resizable:true,center:true,initshow:false,minheight:200,minwidth:200 });			
	ColdFusion.Window.show(cfwindowname);
	ColdFusion.Window.onHide(cfwindowname,workflowHistoryClosed);
}

// tracker settings popup
function MM_edittracker(pk) {
	window.open('/static/community/tracker/editTracker.cfm?pk=' + pk, 'EditTracker', 'width=490,height=450,resizable=no,scrollbars=yes');
}

// community settings from social.xxx/user-settings/, with lower width for both windows, higher height for chat/lower height for usersettings
function openUserSettings() {
	var url = '/commoncfm/community/bpUserSettingsShow.cfm';
	var setWin = window.open(url, "User_Settings", "width=425,height=610,status=no,scrollbars=yes,resizable=no");
	setWin.focus();
}
function openChatSettings() {
	var url = '/commoncfm/community/bpChatPasswordShow.cfm';
	var setWin = window.open(url, "Chat_Password", "width=425,height=360,status=no,scrollbars=yes,resizable=no");
	setWin.focus();
} 

/* for community sidebar only */
$(document).ready( function() {
	$("div#community_status_container a.open_close_button").click(
		function() {
			community_box_toggle(
					'community_status_content', 
					'community_status_opentext', 
					'community_status_closetext'
			);
			return false;
		}
	);

	$("div#community_activity_container a.open_close_button").click(
		function() {
			community_box_toggle(
					'community_activity_content', 
					'community_activity_opentext', 
					'community_activity_closetext'
			);
			return false;
		}
	);}
)

function community_box_toggle( obj_box, link_open, link_close ) {
	$('#'+obj_box).slideToggle('normal');
	$('#'+link_open).toggle();
	$('#'+link_close).toggle();
}	
	
