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.OpenPrintPreview = function(url) {
        _proxy_jslib_handle(window, 'open', '', 1, 0)(url,'AlbumPrintPreview'); 
       return false;
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.CloseAllCaptionEdits = function(editingBoxId) {
       var CaptionCount = Captions.length;	
	    for	(var i=0; i<CaptionCount; i++){
		    if ( _proxy_jslib_handle(Captions, (i), 0, 0).get_control().id !== editingBoxId)
			     _proxy_jslib_handle(Captions, (i), 0, 0).ResetToDefault();
	    }
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaption = function() {	
   //Make Web Service call
   if(arguments.length > 0)
	    MySpace.Web.Modules.PhotoAlbums.Services.PhotoAlbums.SaveCaption(parseInt(arguments[1].imageId), arguments[1].text, MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaptionSuccess(parseInt(arguments[1].imageId)), 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 ( _proxy_jslib_handle(Captions, (i), 0, 0).get_imageId() === result){
			     _proxy_jslib_handle(Captions, (i), 0, 0).ShowCompleteMessage();
			    break;	
		    }
	    }
}

MySpace.PhotoAlbums.Pages.EditAlbumsPhotos.SaveCaptionFailure = function() {
   	    alert(MySpaceRes.ViewMorePicsPage.ErrorAjaxAction);
}
//Static Functions - End








 ;
_proxy_jslib_flush_write_buffers() ;