function Profile() {
    // invoke these during page startup
    //this.submitImageForm();
    //this.setUploadEvent();
}

Profile.prototype = new General();

// Summary: Set the form parameters to point to proper upload server
Profile.prototype.submitImageForm = function() {
   $('#member_profile_editor').attr({ 'target' : 'iphoto',
                                      'enctype' : 'multipart/form-data',
                                      'action' : '/photoupload/' });
}


// Summary: Update image Wrapper, invoked in <iframe name='iphoto'>
Profile.prototype.updateImageWrapper = function() {
   //this.resetFormAttribute();
   this.getImgSrc();
}

// Summary: Get image source 
Profile.prototype.getImgSrc = function() {
   var dm = this.getDomain();
   var user = $('#user_img').attr('user');
   var url = dm + "/ajax/IMGUSER/" + user;
   this.ajaxCall(url, ['changeIMG']);
}

// Summary: Change Photo Image
// params: msg - Json Object
Profile.prototype.changeIMG = function(msg) {
   // user's image
   var url = msg['url'];
   $('#user_img').attr('src', url);
}


// Summary: Reset attributes to default
Profile.prototype.resetFormAttribute = function() {
   $('#member_profile_editor').removeAttr('target');
   $('#member_profile_editor').removeAttr('enctype');
   $('#member_profile_editor').attr('action', '/editprofile/'); 
}

// Summary: Active the upload link
Profile.prototype.setUploadEvent = function() {

   $('#iphoto_img').bind('click', function() {
                             $('#member_profile_editor').submit();
                          });

}

var POBJ = new Profile;



