/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function hide(element)
{
  if(document.getElementById(element) != null)
    document.getElementById(element).style.display = "none";
}

function show(element)
{
  if(document.getElementById(element) != null)
    document.getElementById(element).style.display = "block";
}
function takeANoteAppear(){
  hide('takeANoteDiv');
}

function popup(mylink, windowname,width,height,scrollbars)
{
  if (! window.focus)
      return true;
      
  var href;
  
  if (typeof(mylink) == 'string')
       href=mylink;
  else
       href=mylink.href;
       
    
    contentNote = tinyMCE.activeEditor.getContent({format : 'html'});
    window.parent.hide('takeANoteContentDiv');
	window.parent.hide('takeANoteDiv');
	
	params = "width="+width+",height="+height+",scrollbars="+scrollbars;

	window.open(href, "", params);
	
	return false;
}

function setNoteContent(id, content)
{
  editor = tinyMCE.activeEditor;
  if(id == null)
    editor = tinyMCE.getInstanceById(id);
     
  // Sets the HTML contents of the activeEditor editor
  editor.setContent(content, {format : 'html'});
}
    
function getNoteContent(id)
{
  editor = tinyMCE.activeEditor;
  if(id == null)
    editor = tinyMCE.getInstanceById(id);
    
  if(editor != null)
  	return editor.getContent({format : 'html'});
  else
    return "";
}