

function hideImages(pList, pResult) {
	if(pList) {
		for (var i=0; i < pList.length; i++) {
            pList[i].visible = pResult;
        }
	}
}

function deleteImages(pList) {
    if(pList) {
        for (var i=0; i< pList.length; i++) {
            if(pList[i]) {
                pList[i].destroy();
            }
        }
    }
}


function createHelpScreen(list) {

    if(list != undefined) {
        hideImages(list, false);    
    }
    
    var scrollChk = "Down";
    var bg = Crafty.e("2D, Canvas, Image, Mouse").attr({x:0, y:0, w:480, h:280}).image("images/menuBg.png");
  
    var helpText = Crafty.e("2D, Canvas, Image, Mouse,Tween").image("images/help_text.png");
    helpText.x = bg._x+50; helpText.y = bg._y+10;

    var backBtnHover = Crafty.e("2D, Canvas, Image, Mouse").image("images/back_image1.png");
    backBtnHover.x = bg._x+428; backBtnHover.y = bg._y+232;    
    
    var backBtn = Crafty.e("2D, Canvas, Image, Mouse").image("images/back_image.png");
    backBtn.x = bg._x+428; backBtn.y = bg._y+232;    

        
    backBtn.bind("MouseDown", function(e) { 
        backBtn.alpha = 0.01;
    });
    
    backBtn.bind("MouseUp", function(e) { 
        backBtn.alpha = 1;
        playSfxAudio("BtnClick");
        deleteImages([bg, helpText,backBtn, backBtnHover]);
    });
    
        
    bg.bind("MouseUp", function(e) { 
        backBtn.alpha = 1;
    });
    
    helpText.bind("MouseUp", function(e) { 
        backBtn.alpha = 1;
    });

   
}

