/**
 * Copyright (c) 2006, Andreas Walm, Walm Network AB
 * All rights reserved.
 *
 * This work was created by Andreas Walm on Walm Network AB in Sweden.
 * Please visit http://www.walm.net
 *
 * Version 1.0.0 - 2007.02.13
 *
 */

Jarfallaslap.main = function() {
    return { //--start main
        
        //Main layout
        init : function(){
           
				if ($('editor'))
					Jarfallaslap.main.initEditor();
            }, //--end init

		initEditor : function(){
			var oFCKeditor = new FCKeditor( 'editor' );
			if ($('mini-editor'))
				oFCKeditor.Height = 200;
			else oFCKeditor.Height = 400;
			oFCKeditor.ReplaceTextarea();
			}, //--end initEditor
		
		deleteIt : function(){
			if (confirm("Vill du radera?")){
				$('form_action').value = "del";
				$('frm_admin').submit();
			}
		}, //--end delete
		
		cancelIt : function( in_url ){
			if (confirm("Vill du avbryta?")){
				location.href=in_url;
			}
		}, //--end delete
		
		showMap : function(){
			if ($('map-view')){
				if ($('map-view').style.visibility == 'hidden')
				{
					$('subject').style.visibility = 'hidden';
					$('map-view').style.visibility = 'visible';
				}else{
					$('map-view').style.visibility = 'hidden';
					$('subject').style.visibility = 'visible';
				} 
			}
			
		}
        }//--end main
 }();
Event.observe(window, 'load', Jarfallaslap.main.init);
