Type.registerNamespace('MySpace.PhotoAlbums.Pages');

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos = function(element){
	MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.initializeBase(this, [element]);
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.prototype = {
	initialize: function(){
	    //Setup handlers
		this.AttachEvents();
	},

	AttachEvents: function(){
    },
    
   	dispose: function(){
	  
	}
};
    
var Captions = new Array();

//Static Functions - Start

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.CloseAllCaptionEdits = function(editingBoxId){
       var CaptionCount = Captions.length;	
	    for	(var i=0; i<CaptionCount; i++){
		    if (Captions[i].get_textBox().id !== editingBoxId)
			    Captions[i].ResetToDefault();
	    }
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaption = function(args){	
	    //Make Web Service call
	    MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.SaveCaption(parseInt(args.imageId), args.text, MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaptionSuccess, MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaptionFailure);	
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaptionSuccess = function(result){
        //show and fade success message
	    var CaptionCount = Captions.length;	
	    for	(var i=0; i<CaptionCount; i++){
		    if (Captions[i].get_imageId() === result){
			    Captions[i].ShowCompleteMessage();
			    break;	
		    }
	    }
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaptionFailure = function(){
   	    alert(MySpaceRes.ViewMorePicsPage.ErrorAjaxAction);
}
//Static Functions - End

/*
MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.registerClass('MySpace.PhotoAlbums.Pages.EditAlbumsPhotos', Sys.UI.Behavior);

var ClientCodeBehind;

Sys.Application.add_init(setupPage);

function setupPage(){
	ClientCodeBehind = $create(MySpace.PhotoAlbums.Pages.EditAlbumsPhotos, null, null, null, $get("content"));
};
*/






