/**
 cor-source-editor.js
 @package      Core
 @copyright    Copyright (c) 2007 - 2009 Ragnar.cz. All rights reserved
 @license      GNU/GPL http://www.gnu.org/copyleft/gpl.html

 Albireo is free software!
*/

    function increaseFont ()
    {
    	if ( document.getElementById ( "source" ).style.fontSize ) {
    	   document.getElementById ( "source" ).style.fontSize = ( Number ( document.getElementById ( "source" ).style.fontSize.replace ( "em", "" ) )+0.1 ) + "em";
    	} else {
    	   document.getElementById ( "source" ).style.fontSize = "1.1em";
    	}
    }

    function decreaseFont ()
    {
    	if ( document.getElementById ( "source" ).style.fontSize ) {
    	   document.getElementById ( "source" ).style.fontSize = ( Number ( document.getElementById ( "source" ).style.fontSize.replace ( "em", "" ) )-0.1 ) + "em";
    	} else {
    	   document.getElementById ( "source" ).style.fontSize = "0.9em";
    	}
    }

    var isCtrl = false;

    $(document).keyup(function (e) {
        if(e.which == 17) isCtrl=false;
    }).keydown(function (e) {
        if(e.which == 17) isCtrl=true;
        if(e.which == 83 && isCtrl == true) {
            changeIdByPost('editor.xml?action=createfile','EditorForm','editorResponses');
            showAndHide('editorResponses');
            return false;
        }
    });