var goGameOverMenu = function (game, options, api) {
	var self = {};
    self.name = "GOMenu";
    var button = null;
	var pausetext = null;
	var menuBG = null;
	var menuTitle = null;
	var menuHelp = null;
	var menuCredits = null;
	var menuBtnMenu = null;
	var onCredits = null;
	var onHelp = null;
	var alive = false;

	var startGame = false;
	
	
	self.getObject = function () {
        return enemy;
    }
	self.setInitialPosition = function (point) {
		startPos = point;
	}
	self.preload = function () {
	    game.load.image('GOMenuBG', 'resources/images/GameOver/game over backround.png');
		game.load.image('GOMenuTitle', 'resources/images/GameOver/gameover.png');
		fishdanceSfx = game.add.audio('fishdance');

		//spritesheets
		game.load.spritesheet('GOMenuBtnPlay', 'resources/images/MainMenu/button_play.png',316,316,2);
		game.load.spritesheet('GOMenuBtnMenu', 'resources/images/MainMenu/button_menu.png',316,316,2);
		
    }
	
	self.create = function () {
	    alive = true;
		onCredits=false;
		onHelp=false;
		GOMenuBG = game.add.sprite(0, 0, 'GOMenuBG' );
		GOenuTitle = game.add.sprite(0, 0, 'GOMenuTitle' );
		
		
		///////////////////////////
		//Buttons functionalities//
		///////////////////////////

		//play-button
		GOMenuBtnPlay = game.add.button(63, 380, 'GOMenuBtnPlay', self.actionOnClick);
		GOMenuBtnPlay.frame = 0;
		GOMenuBtnPlay.onInputOver.add(self.over, this);
		GOMenuBtnPlay.onInputOut.add(self.out, this);
		//GOMenuBtnMenu-button
		GOMenuBtnMenu = game.add.button(898, 380, 'GOMenuBtnMenu', self.actionOnClick);
		GOMenuBtnMenu.frame = 0;
		GOMenuBtnMenu.onInputOver.add(self.over, this);
		GOMenuBtnMenu.onInputOut.add(self.out, this);
		
		
	}
	self.update = function () {
	/////////////////
	//return what??//
	/////////////////
	    return startGame;
    }
	// On click action and menu management
	self.actionOnClick = function(button) {
		GOMenuBtnPlay.kill();
		GOMenuBtnMenu.kill();
		GOenuTitle.kill();
		GOMenuBG.kill();
		
		
		if(button==GOMenuBtnMenu){
			////////////////
			//restart game//
			////////////////
		}else if(button==GOMenuBtnPlay){
			//////////////////
			//goto main menu//
		    //////////////////

		} else {
		    startGame = true;
		}
	}
	self.over = function(button) {
		button.frame = 1;
	}
	self.out = function(button) {
		button.frame = 0;
	}
	return self;
}
