 (function () {

 NC.widget.ResumeUploadManager = function() {
	/* private variables and methods */
 	var uploadDialog = null;
 	var showScore = true;
 	var updateUrl = '';
 	var uploadIFrameName ='';
 	var resultsDivName = '';
 	var extraPagesFunc = null; // called to add extra pages for custom wizards
 	var validationFunc = null;
 	var docRoot= null;
 	var domDocument = null;
 	var onInfoAvailable = null;
 	var wizardDialog = null;
 	var oWizard = null;
 	var onUploadEditFinish = null;
 	var onUploadEditCancel = null;
 	var resumeId = -1;
 	var showPublicProfile = false;
 	var certificateDivId = 'largencbadge';
	var evalDivId = 'membereval';
	var scoreDivId = 'smallncbadge';
 	var InviteErrorMessage = 'This invite code is invalid or no longer available. To request an invite code, please click Don\'t have one? below.'
 	
 	 	return {
 	 		/* public methods */
			setupResumeUploadPopup: function( sourceUrl, sourceParameters, targetDiv, targetFormName, iFrameName, 
				progressDivName, progressMessage, resultsDivName, showAsPopup, _showScore, _updateUrl, _onInfoAvailable, 
				_onUploadEditFinish, _onUploadEditCancel) {
				uploadDialog = new NC.widget.UploadDialog (
					sourceUrl, 
					sourceParameters,
					targetDiv, 
					targetFormName, 
					iFrameName,
					progressDivName,
					progressMessage,
					function(){
						NC.widget.ResumeUploadManager.onResumeResultLoad(this.iFrameName, resultsDivName);
					},
					function() { // validation function
						var fileNameValue = '';
						var fileNameEl = document.getElementById( 'ResumeFileName');
						if (fileNameEl != null) {
							fileNameValue = NC.util.Dom.getValue( fileNameEl);
						}
						var link = '';
						var linkEl = document.getElementById( 'ResumeFileLink');
						if (linkEl != null) {
							link = NC.util.Dom.getValue( linkEl);
						}
						var textResumeValue = '';
						var textResumeEl = document.getElementById( 'PlainTextResume');
						if (textResumeEl != null) {
							textResumeValue = NC.util.Dom.getValue( textResumeEl);
						}
						if ( fileNameValue.length == 0 && link.length == 0 && textResumeValue.length == 0) {
							NC.widget.ResumeUploadManager.showError( "Please provide a resume to upload.");
							return false;
						}
						else {
							NC.widget.ResumeUploadManager.clearError();
							return true;
						}
					},   
					'',		// error div name - ignored if blank
					showAsPopup
					);	
				showScore = _showScore;	
				updateUrl = _updateUrl;
				onInfoAvailable = _onInfoAvailable;
				onUploadEditFinish = _onUploadEditFinish;
				onUploadEditCancel = _onUploadEditCancel;
			},
			
			showResumeUploadPopup: function( left, top, width) {
				uploadDialog.show( left, top, width);
			},
			

 	 		getUploadDialog: function( ) { 
 	 			return uploadDialog;
 	 		},
 	 		
 	 		
 	 		showResumeWizard: function( targetName, resultsDivName, onFinish, onCancel, enableAllPageFinish) {
					oWizard = NC.widget.ResumeWizard.create(  resultsDivName, domDocument, updateUrl, onFinish, onCancel, enableAllPageFinish);
					if (showScore) {
						var scorePage = new NC.widget.ResumeScorePage( domDocument);
						NC.widget.ResumeWizard.addPageToBeginning( scorePage);
					}
					if (validationFunc != null) {
						validationFunc();
					}
					if (extraPagesFunc != null) {
						extraPagesFunc( domDocument);
						/*
						for (var i = 0; i < extraPages.length; i++) {
							NC.widget.ResumeWizard.addPageToEnd( extraPages[i]);
						}
						* */
					}
					NC.widget.ResumeWizard.display();
 	 		},
 	 		
			onResumeResultLoad: function(targetName, resultsDivName) {
				var encodedContent = window.frames[targetName].document.body.innerHTML;
				if (encodedContent.length > 0) {
					iframeContent = decode64( encodedContent);
					this.parseDocument( iframeContent);
					var errorCode = NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrErrorcode);
					if (errorCode == 0) {
						NC.widget.MemberManager.updateMemberEvalAndBadgePublic( resumeId, evalDivId, certificateDivId)
						/*
						this.refreshBadge( resumeId, 2, certificateDivId);
						this.updateEval();
						*/
						NC.widget.StateManager.setUploadedResumeFlag(); // set ui state flag for resume uploaded
						if (onInfoAvailable == null) { /* default action */
							this.showResumeWizard( targetName, resultsDivName, onUploadEditFinish, onUploadEditCancel, false);
						}
						else {
							onInfoAvailable( targetName, resultsDivName, docRoot);
						}
						// hide the dialog box
						uploadDialog.hide();
					}
					else {
						var message = NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrErrormessage);
						NC.widget.ResumeUploadManager.showError( message);
					}
				}
				else { // no content received
						NC.widget.ResumeUploadManager.showError( "There was a system problem(1).");
				}
			},
			
			onFinishUploadResumeInfo: function() {
				NC.widget.ResumeUploadManager.onFinishEditResumeInfo();
//				this.refreshBadge( resumeId, style, divId);
			},
			
			onCancelUploadResumeInfo: function() {
				NC.widget.ResumeUploadManager.onCancelEditResumeInfo();
			},
			
			onFinishEditResumeInfo: function() {
				NC.widget.ResumeWizard.updateResumeInfo(
					function() {
						NC.util.AjaxManager.showCurrentMainFrameContent();
					}
				);
				if (wizardDialog != null) {
					wizardDialog.hide();
					wizardDialog = null;
				}
				NC.widget.StateManager.setViewedProfileFlag();
				return false;
			},
			
			onCancelEditResumeInfo: function() {
				if (wizardDialog != null) {
					wizardDialog.hide();
					wizardDialog = null;
				}
				NC.util.AjaxManager.showCurrentMainFrameContent();
				return false;
				
			},
			
			test: function() {
				var center = document.getElementById( 'centercontent');
				center.innerHTML = "center content";
			},
			
			editResumeInfo: function( event, getResultsUrl, resultsDivName) {
						var callback =
						{
			  				success:function( o) {
			  					var xmlContent = decode64( o.responseText);
			  					this.parseDocument( xmlContent);
			  					var showAsPopup = false;
			  					if (resultsDivName == null) {
			  						resultsDivName = NC.util.AjaxDialogDisplay.DialogWrapper;
			  						showAsPopup = true;
			  					}
			  					wizardDialog = new NC.widget.ModalDialog("", "", resultsDivName, "", showAsPopup);
						 		// position
						 		var widthX = 510;
						 		var heightY = 400; // estimated
						 		var leftX = (NC.util.Dom.getViewportWidth() - widthX)/2 ;
						 		var topY = Math.max(20,(NC.util.Dom.getViewportHeight() - heightY)/2);
			  					wizardDialog.show( leftX, topY, widthX);
			  					showScore = false;
			  					updateUrl = './updateEditedResumeInfo.php';
			  					if (resultsDivName == null || resultsDivName.length == 0) {
			  						resultsDivName = NC.util.AjaxDialogDisplay.DialogWrapper;
			  					}
			  					this.showResumeWizard( "", resultsDivName, 
			  					this.onFinishEditResumeInfo, this.onCancelEditResumeInfo, true );
			  				},
			  				failure:function( o) {
			  				},
							scope: this    				
						};
						var connection = new NC.util.AjaxConnection( 'GET', getResultsUrl, null);
						connection.addUnprecedentedParameter();
						connection.executeMethod( callback);
				
			},
			
			showResumeInfoWithHistory: function( resultsDivName) {
				this.showResumeInfo(resultsDivName);
				NC.util.AjaxManager.addMainFrameHistory(NC.util.AjaxManager.getNcFuncFlag() + ':showscore');
			},
			
			showResumeInfo: function( resultsDivName) {
				if (docRoot == null) {
					var getResultsUrl = './getResumeInfo.php?Profile=1';
					var callback =
					{
		  				success:function( o) {
		  					var xmlContent = decode64( o.responseText);
		  					this.parseDocument( xmlContent);
		  					this.formatResults( docRoot, resultsDivName);
		  				},
		  				failure:function( o) {
		  				},
						scope: this    				
					};
					var connection = new NC.util.AjaxConnection( 'GET', getResultsUrl, null);
					connection.addUnprecedentedParameter();
					connection.executeMethod( callback);
				}
				else {
					this.formatResults( docRoot, resultsDivName);
				}
			},
			
			getResumeInfo: function( successFunc) {
				if (docRoot == null) {
					var getResultsUrl = './getResumeInfo.php?Profile=1';
					var callback =
					{
		  				success:function( o) {
		  					var xmlContent = decode64( o.responseText);
		  					this.parseDocument( xmlContent);
		  					successFunc();
		  				},
		  				failure:function( o) {
		  				},
						scope: this    				
					};
					var connection = new NC.util.AjaxConnection( 'GET', getResultsUrl, null);
					connection.addUnprecedentedParameter();
					connection.executeMethod( callback);
				}
				else {
					successFunc();
				}
			},
			
			getResumeInfoByMd5Id: function( md5Id, targetName, resultsDivName, successFunc) {
				if (docRoot == null) {
					var getResultsUrl = './getResumeInfo.php?Profile=1&ResumeId=' + md5Id;
					var callback =
					{
		  				success:function( o) {
		  					var xmlContent = decode64( o.responseText);
		  					this.parseDocument( xmlContent);
		  					successFunc(targetName, resultsDivName, docRoot);
		  				},
		  				failure:function( o) {
		  				},
						scope: this    				
					};
					var connection = new NC.util.AjaxConnection( 'GET', getResultsUrl, null);
					connection.addUnprecedentedParameter();
					connection.executeMethod( callback);
				}
				else {
					successFunc();
				}
			},
			
			getResumeInfoByResumeId: function( resumeId, targetName, resultsDivName, successFunc, promo) {
				if (docRoot == null) {
					var getResultsUrl = './getResumeInfo.php?Profile=1&ResumeId=' + resumeId;
					var callback =
					{
		  				success:function( o) {
		  					var xmlContent = decode64( o.responseText);
		  					this.parseDocument( xmlContent);
		  					successFunc(targetName, resultsDivName, docRoot, promo);
		  				},
		  				failure:function( o) {
		  				},
						scope: this    				
					};
					var connection = new NC.util.AjaxConnection( 'GET', getResultsUrl, null);
					connection.addUnprecedentedParameter();
					connection.executeMethod( callback);
				}
				else {
					successFunc();
				}
			},
			
			processEncodedProfile: function(encodedXml) {
				var xmlContent = decode64( encodedXml);
				this.parseDocument( xmlContent);
			},
			
			
			parseDocument: function( xml) {
				try {
					//instantiate the W3C DOM Parser
					var parser = new DOMImplementation();
					//load the XML into the parser and get the DOMDocument
					domDocument = parser.loadXML(xml);
					//get the root node 
					docRoot = domDocument.getDocumentElement();
					resumeId = NC.util.Dom.extractField(docRoot,NC.widget.ResumeWizard.StrResumeid);
				} catch (e) {
					alert( "There was a system problem. Please contact NimbleCat Customer Support.");
					docRoot = null;
					domDocument = null;
				}
			},
			
			getDomRoot: function( ) {
				return docRoot;
			},
			
			getDomDocument: function() {
				return domDocument;
			}, 
			
			formatResults: function( docRoot, resultsDivName) {
//				var scoreInfo = this.formatScore( docRoot);
//				var resumeId = NC.util.Dom.extractField(docRoot,NC.widget.ResumeWizard.StrResumeid);
				var resultsDiv = document.getElementById( resultsDivName);
				var template = 
				/*
							   '<div id="ContentContainer"> ' +
							   '	<div class="leftcolumn"> ' + 
							   '		<div> ' + 
							   '		</div>' + 
							   '		<div class="highlights"> ' + 
							   '			<h3>Your Profile</h3>' + 
							   '    	</div>' +
							   '	</div> ' + 
							   '	<div class="contentbody" id="centercontent"> ' +
				*/
							   '        <div id="LeftSpacer">' +
							   '             <img src="../imagesv2/1X500_spacer.gif">' +
							   '        </div>' + 
							   '		<div class="publicprofile" id="publicprofile"></div>  ' +
							   '		<div class="privateprofile" id="privateprofile"></div>  ' +
							   '		<p><input type="button" class="ncbutton"  onclick="NC.util.AjaxManager.showCurrentMainFrameContent();" name="ChangeProfileButton" id="ChangeProfileButton" value="Cancel"></p>'
				/*
						       '	</div>  ' + 
							   '	<div class="rightcolumn"> ' + 
							   '		<div id="Promo" class="promo"> ' + 
							   '		</div> ' + 
							   '		<div id ="Links"class="links"> ' + 
							   '		</div> ' + 
							   '	</div> ' + 
							   '</div> '
				*/
							   ;
				if (resultsDiv != null) {
					resultsDiv.innerHTML = template;
					this.showProfile();
					/*
					// call to action
					updater = new NC.util.AjaxUpdate( 'GET', 'showPromo.php', 'Promo',  'Promo', null);
					updater.doUpdate( true);
					// links
					var updater = new NC.util.AjaxUpdate( 'GET', 'showLinks.php', 'Links',  'Links', null);
					updater.doUpdate( true);
					*/
				}
			},
			
			setShowPublicProfile: function( val) {
				showPublicProfile = val;
				this.showProfile();
			},
			
			showProfile: function() {
				if (showPublicProfile) {
					var publicProfile = NC.util.Dom.extractEncodedField(docRoot,NC.widget.ResumeWizard.StrPublicProfile);
					var publicProfileDiv = document.getElementById( "publicprofile");
					publicProfile =  '		<h2>Your Public Profile (<a href="#"  onclick="NC.widget.ResumeUploadManager.setShowPublicProfile(false);">show confidential profile</a>)</h2> ' + 
										publicProfile;
					
					publicProfileDiv.innerHTML = publicProfile;
					var privateProfileDiv = document.getElementById( "privateprofile");
					privateProfileDiv.innerHTML = '';
				}
				else {
					var privateProfileDiv = document.getElementById( "privateprofile");
				    var content =  '<h2>Your Confidential Profile (<a href="#"  onclick="NC.widget.ResumeUploadManager.setShowPublicProfile(true);">show public profile</a>)</h2> ' + 
							       '		<div class="workhistory" id="workhistorypriv">' +
							   				this.formatWorkHistory( docRoot) +
							       '        </div>  ' + 
							       '		<div class="educationhistory" id="educationhistorypriv"> ' + 
							   				this.formatEducationHistory( docRoot) +
							       '        </div>  ';
					privateProfileDiv.innerHTML = content;
					var publicProfileDiv = document.getElementById( "publicprofile");
					publicProfileDiv.innerHTML = '';
				}
			},
			
			makeAbsoluteBadgeUrl: function( resumeId, style, refresh) {
				return 'http://www.nimblecat.com/alerts/' + this.makeRelativeBadgeUrl( resumeId, style, refresh);
			},

			makeRelativeBadgeUrl: function( resumeId, style, refresh) {
				var url = 'getbadge.php?rid=' + resumeId + '&style=' + style;
				if (refresh == 1) {
					url += '&nc='+ new Date().getTime();
				}
				return  url;
				
			},
			
			wrapWithValidation: function( tag) {
				tag = '<a target="_blank" title="NimbleCat Score. Click to validate this." href="validatescore.php?mid=' + this.getMd5id() + 
					'">' + tag + '</a>';
				return tag;
				
			},
			
			makeBadgeImageTag: function( badgeUrl) {
				return '<img border="0" src="' + badgeUrl + '" />';
			},
			
			makeScoreTextTag: function() {
				return 'NC' + this.getNCScore();
			},
			
			showBadge: function( resumeId, style, divId) {
				var largeBadgeDiv = document.getElementById( divId);
				var explainLink = '<br><a href="#" onclick="xmlHttpGet(\'./sc.php?ct=20&cd=55&cl=nc_explainscore\', true)">What is this?</a>';
//				var validateLink = this.wrapWithValidation('Validate this');
				if (largeBadgeDiv != null) {
					var url = this.makeRelativeBadgeUrl(resumeId, style, 0);
					url = NC.util.AjaxManager.addUnprecedentedParameter( 'nc081', url);
					largeBadgeDiv.innerHTML = this.wrapWithValidation(this.makeBadgeImageTag(url)) 
					+ explainLink;
				}
			},
			
			refreshBadge: function( resumeId, style, divId) {
				this.showBadge( resumeId, style, divId);
				/*
				var largeBadgeDiv = document.getElementById( divId);
				var url = this.makeRelativeBadgeUrl(resumeId, style, 0);
				url = NC.util.AjaxManager.addUnprecedentedParameter( 'nc081', url);
				if (largeBadgeDiv != null) {
					largeBadgeDiv.innerHTML = this.makeBadgeImageTag( url);
				}
				*/
			},

/*			
			updateEval: function() {
				var evalDiv = document.getElementById(evalDivId);
				if (evalDiv != null) {
					evalDiv.innerHTML = '<p>' + this.getNCScoreExplanation() + '</p>' +
										'				<p>' +
							   			'Click on your score to see the validation certificate others will see when they click on it. ' +
							   			'<a href="#" onclick="xmlHttpGet(\'./sc.php?ct=20&cd=55&cl=nc_explaincertificate\', true)">Read more about the validation certificate</a>.' +
							   			'				</p>';
				}
			},
*/			
			formatEducationHistory: function( docRoot) {
				var educationList = docRoot.getElementsByTagName(NC.widget.ResumeWizard.StrEducationexperience);
				var content = '<h3>Education Credentials</h3>';
				for (var i = 0; i < educationList.getLength(); i++) {
					var children = educationList.item(i).getChildNodes();
					var degree = '';
					var school = '';
					var degreeDate = '';
					var show = true;
					for (var ci = 0; ci < children.getLength(); ci++) {
						var item = children.item(ci);
						var fieldName = null;
						if (item.getFirstChild() != null) {
							var value = item.getFirstChild().getNodeValue();
							switch( item.getNodeName()) {
								case NC.widget.ResumeWizard.StrSchool:
								school = value;
								break;
								
								case NC.widget.ResumeWizard.StrDegreecode:
								degree = (value.charAt(0).toUpperCase()+value.substr(1).toLowerCase());
								break;
								
								case NC.widget.ResumeWizard.StrDegreeDate:
								degreeDate = (value.charAt(0).toUpperCase()+value.substr(1).toLowerCase());
								break;
								
								case NC.widget.ResumeWizard.StrFlags:
								if (value == NC.widget.ResumeWizard.DeletedRow) {
									show = false;
								}
								break;
								
							}
						}
					}
					if (show) {
						content += '<p>';
						content += school + ',&nbsp;' + degree + '(' + degreeDate + ')'
						content += '</p>';
					}
				}
				return content;
			},
			
			formatWorkHistory: function( docRoot) {
				var worklist = docRoot.getElementsByTagName(NC.widget.ResumeWizard.StrWorkexperience);
				var content = '';
				content += '<h3>Work History</h3>';
				for (var i = 0; i < worklist.getLength(); i++) {
					var children = worklist.item(i).getChildNodes();
					var show = true;
					var startdate = '';
					var enddate = '';
					var companyAndTitle = '';
					for (var ci = 0; ci < children.getLength(); ci++) {
						var item = children.item(ci);
						if (item.getFirstChild() != null) {
							var value = item.getFirstChild().getNodeValue();
							switch( item.getNodeName()) {
								case NC.widget.ResumeWizard.StrStartdate:
								startdate = value;
								break;
								
								case NC.widget.ResumeWizard.StrEnddate:
								enddate = value;
								break;
								
								case NC.widget.ResumeWizard.StrCompanyandtitle:
								companyAndTitle = value;
								break;
								
								case NC.widget.ResumeWizard.StrFlags:
								if (value == NC.widget.ResumeWizard.DeletedRow) {
									show = false;
								}
								break;
								
							}
						}
					}
					if (show) {
						content += '<p>';
						content += startdate + '&nbsp;-&nbsp;' + enddate + ', ' + companyAndTitle
						content += '</p>';
					}
				}
				return content;
			},
			
			formatScore: function( docRoot) {
				var scoreContent = '';
				var sumOfWeights = 0;
				var categories = docRoot.getElementsByTagName("category");
					for (ci = 0; ci < categories.getLength(); ci++) {
						var category = categories.item(ci);
						var categoryWeight = category.getElementsByTagName( "categoryweight").item(0);
						var categoryWeightValue = categoryWeight.getFirstChild().getNodeValue()
						sumOfWeights += parseInt(categoryWeightValue);
					}
				
				if (categories.getLength() > 0) {
				// add categories and scores
					scoreContent += '<font color="#0b3d91">NimbleCat Score:</font>&nbsp;';
					scoreContent += sumOfWeights + '<br>';
					for (ci = 0; ci < categories.getLength(); ci++) {
						if (ci > 0) {
							scoreContent += '<br>';
						}
						var category = categories.item(ci);
						var categoryName = category.getElementsByTagName( "categoryname").item(0);
						var categoryNameValue = categoryName.getFirstChild().getNodeValue();
						var categoryWeight = category.getElementsByTagName( "categoryweight").item(0);
						var categoryWeightValue = categoryWeight.getFirstChild().getNodeValue()
						scoreContent += categoryNameValue +  '&nbsp;&nbsp;' + categoryWeightValue;
					}
				}
				return scoreContent;
			},
			
			setExtraPagesFunc: function( func) {
				extraPagesFunc = func;
			},
			
			setValidationFunc: function( func) {
				validationFunc = func;
			},

		  	clearError: function() {
		  		var errorDiv = document.getElementById( "NCError");
		  		errorDiv.style.display="none";
		  		errorDiv.innerHTML = ""; //  hide it and remove the error message
		  	},
		  	
		  	showError: function( message) {
		  		var errorDiv = document.getElementById( "NCError");
		  		errorDiv.style.display="block";
				message += NC.messages.MsgCallSupport;
		  		errorDiv.innerHTML = message; //  show the error message
		  	},
		  	
		  	getResumeId: function() {
		  		return resumeId;
		  	},
		  	
		  	deletePreviousResumeInfo: function() {
		  		docRoot = null;
		  		resumeId = -1;
		  	},
		  	
		  	getMd5id: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrMd5id);
		  		
		  	},
		  	
		  	getFirstName: function() {
				return NC.util.Dom.extractEncodedField( docRoot, NC.widget.ResumeWizard.StrFirstname);
		  		
		  	},
		  	
		  	getTopCategoryName: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrTopCategoryName);
		  	},
					
		  	getTopCategoryScore: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrTopCategoryScore);
		  	},
					
		  	getTopCategoryId: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrTopCategoryId);
		  	},
		  	
		  	getManagerCategory: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrManagerCategory);
		  	},
		  	
		  	getManagerScore: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrManagerScore);
		  	},
		  	
		  	getNCScore: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrNCScore);
		  		
		  	},
		  	
		  	getNCScoreExplanation: function() {
		  		if (docRoot != null) {
					return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrExplanation);
		  		}
		  		else {
		  			return '';
		  		}
		  		
		  	},
			
			getZipCode: function() {
				return NC.util.Dom.extractEncodedField( docRoot, NC.widget.ResumeWizard.StrZipcode);
			},
		  	
			getEmploymentCount: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrEmploymentCount);
			},
		  	
			getAverageEmpDescLength: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrAverageEmpDescLength);
			},
		  	
			getEducationCount: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrEducationCount);
			},
		  	
			getResumeLength: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrResumeLength);
			},
		  	
			getResumeTextLength: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrResumeTextLength);
			},
		  	
			getTotalJobAlerts: function() {
				return NC.util.Dom.extractField( docRoot, NC.widget.ResumeWizard.StrTotalJobAlerts);
			},
		  	
		  	doFileUploadCheckInvite: function() {
				var inviteCodeEl = document.getElementById('InviteCode');
				var inviteCode = NC.util.Dom.getValue( inviteCodeEl);
				var callback =
				{
	  				success:function( o) {
	  					if (o.responseText.substr(0,1) == '1') {
							var callbackInner =
							{
				  				success:function( o) {
				  				},
				
				  				failure:function( o) {
				  				},
				
								scope: this    				
							};
							var url = './incrementInviteCode.php?InviteCode=' + inviteCode;
							var connection = new NC.util.AjaxConnection( 'GET', url, '');
							connection.executeMethod( callbackInner);
					  		this.getUploadDialog().doFileUpload();
	  					}
	  					else {
							NC.widget.ResumeUploadManager.showError( InviteErrorMessage);
	  					}
	  				},
	
	  				failure:function( o) {
	  				},
	
					scope: this    				
				};
				var url = './checkInviteCode.php?InviteCode=' + inviteCode;
				var connection = new NC.util.AjaxConnection( 'GET', url, '');
				connection.executeMethod( callback);
		  	}
		  	
 	 	// end public methods	
 	 	}
  }	
();

})(); 	
