var stok;$(document).ready(function(){stok=$('#token').val();var welcomeBox=$('#welcomeBox');welcomeBox.find('.customize .pseudolink').click(function(){Profile.initCustomizer()});welcomeBox.find('.close').click(function(){welcomeBox.hide('medium',function(){$(this).remove()});$.ajax({data:'token='+$('#token').val(),url:'/ajax/profile/welcomeBox.php',type:'POST'})});$('#divVideo .noContentMsg .add').click(function(){$('#divVideo .noContentMsg').hide('slow');return false});$('#picbox .noPhoto #quickUpdatePhoto').bind('change',quickUpdatePhoto);function quickUpdatePhoto(e){$(this).unbind('change');$('#picbox .fileUploaderStatus').remove();var uploadForm=$(this).parent('form');$.fileUploader(uploadForm,'image',function(resultObj){$('#picbox .fileUploaderStatus').remove();if(resultObj&&resultObj.success=='true'){$('#picbox .noPhoto').hide();$('#picbox .photo').show();$('#picbox .photo img').attr('src',PHOTO_URL+'/'+resultObj.path)}else{$('#picbox .noPhoto #quickUpdatePhoto').show().val('');$('<div class="fileUploaderStatus">An error occurred while uploading your file. Please try again.</div>').appendTo('#picbox .noPhoto form');$('#picbox .noPhoto #quickUpdatePhoto').bind('change',quickUpdatePhoto)}})};ProfileQuickUpdate_init();$('#linkPhotos').click(function(){Profile.showProfile('Photos');Profile.loadUserImages($('#userid').val(),1);return false});$('#linkAutographs').click(function(){Profile.showProfile('Autographs');Profile.loadAutographs($('#userid').val(),1);$(this).html('Autographs');return false});$('#profileAutographs textarea').one('focus',function(){$(this).text('').css('color','#000')});$('#profileAutographs img.submit').click(function(){Profile.submitAutograph($('#userid').val(),$('#profileAutographs textarea').val())});anchorScroll.init();$('a').bind('click.checkUnsaved',function(){var link=this.getAttribute('href');var clickEvent=this.getAttribute('onclick');if($('#profileBasic #fieldsChanged').val()==1){saveAlert('Basic',link,clickEvent);return false}else if($('#profilePersonal #divFavorites #fieldsChanged').val()==1||$('#profilePersonal #divWIUT #fieldsChanged').val()==1||$('#profilePersonal #divBasic #fieldsChanged').val()==1||$('#profilePersonal #divMore #fieldsChanged').val()==1||$('#profilePersonal #divImportant #fieldsChanged').val()==1){saveAlert('Personal',link,clickEvent);return false}});$('#wiutToggle').click(function(){$(this).addClass('noHoverLink')}).hover(function(){$(this).removeClass('noHoverLink').addClass('hoverLink')},function(){$(this).removeClass('hoverLink').addClass('noHoverLink')});$('#profileBlocks a, #profileTabMenu a').unbind('click.checkUnsaved');var memberId=$('#userid').val();var comp=$('#BlindDate-compatibility').attr('data-memberId',memberId);BlindDate.compatibility.get([comp],true);if($('#editYearbooks').val()=='yes'){userBasic.edit();userBasic.editYearbooks();scroll(400,700)}$('#divWhatever img.deleteWidget').click(function(){var link=$(this);$.dragonConfirm('Are you sure you want to remove this widget?',{width:350,title:'Remove Widget',confirmCallback:function(){Profile.deleteWidget(link.attr('data-wid'))}})});$('#locationSelectorLink').click(function(){$.getScript(IMAGE_URL+'JavaScript/apps/LocationSelector.js',function(){LocationSelector.init($(this))});return false});$('body').bind('locationSelector.update',function(e,result){if(result.locationDisplay){$('#editLocationText').text(result.locationDisplay);if(result.cityName){$('#divCity').text(result.cityName+((result.stateName||result.countryName)?', ':'')).show()}if(result.stateName){$('#divState').text(result.stateName+((result.countryName)?', ':'')).show()}if(result.countryName){$('#divCountry').text(result.countryName).show()}$('div.noLocation','#profileBasic').hide()}else{}});Profile.init()});function toggleWIUT(){a=new Array('wiutWheream','wiutListening','wiutWatching','wiutThinking','wiutPlaying','wiutReading','wiutDating','wiutLusting','wiutAnnoyed','wiutLove','wiutHate','wiutMissing','wiutLooking','wiutIming','wiutEating','wiutDrinking','wiutCraving','wiutWearing','wiutShopping');if(document.getElementById('wiutToggle').innerHTML=='less'){var display='none';$('#wiutToggle').html('more...')}else{var display='';$('#wiutToggle').html('less')}for(var x in a){if(document.getElementById(a[x])!=null){if(display=='none'){if($('#'+a[x]).hasClass('hasVal')&&x>4){$('#'+a[x]).addClass('hideWIUT')}}else{if($('#'+a[x]).hasClass('hideWIUT')){$('#'+a[x]).removeClass('hideWIUT')}}}}}function saveAlert(changedSection,link,clickEvent){$.dragonCurtain();cancelPopup=DD.createDraggable({width:300,height:120,title:'Edit Profile',color:'white',disable_drag:1,curtain:false});$('#'+cancelPopup.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><div style="padding-bottom: 11px;"><span class="alertMessage">Some of your changes have not been saved.<br />Would you like to save your changes now?</span></div><div style="padding: 0 0 5px 0;"><a href="#top" class="save"><img src="'+IMAGE_URL+'/btn_save.gif" width="76" height="21" alt="Save"></a> &nbsp; <a href="#top" class="dontsave"><img src="'+IMAGE_URL+'/buttons/btn_dont_save.gif" width="96" height="21" alt="Don\'t Save"></a> &nbsp; <a href="#top" class="cancel"><img src="'+IMAGE_URL+'/buttons/btn_cancel.gif" width="76" height="21" alt="Cancel"></a></div></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove()});if(changedSection=='Basic'){$('#'+cancelPopup.attr('content_id')+' .dontsave').bind('click.cancelClick',function(){userBasic.revert(true);$('#profileBasic #fieldsChanged').val('0');DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove();afterSaved(link,clickEvent)});$('#'+cancelPopup.attr('content_id')+' .save').click(function(){DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove();userBasic.save();afterSaved(link,clickEvent)});$('#'+cancelPopup.attr('content_id')+' .cancel').click(function(){DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()})}else{$('#'+cancelPopup.attr('content_id')+' .dontsave').bind('click.cancelClick',function(){userPersonal.revert('Favorites','CancelConfirm',false,true);userPersonal.revert('WIUT','CancelConfirm',false,true);userPersonal.revert('Basic','CancelConfirm',false,true);userPersonal.revert('More','CancelConfirm',false,true);userPersonal.revert('Important','CancelConfirm',false,true);userPersonal.getEditDiv('Favorites','#fieldsChanged').val('0');userPersonal.getEditDiv('WIUT','#fieldsChanged').val('0');userPersonal.getEditDiv('Basic','#fieldsChanged').val('0');userPersonal.getEditDiv('More','#fieldsChanged').val('0');userPersonal.getEditDiv('Important','#fieldsChanged').val('0');DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove();afterSaved(link,clickEvent)});$('#'+cancelPopup.attr('content_id')+' .save').click(function(){if(userPersonal.getEditDiv('Favorites','#fieldsChanged').val()==1){userPersonal.save('Favorites');userPersonal.getEditDiv('Favorites','#fieldsChanged').val('0')}if(userPersonal.getEditDiv('WIUT','#fieldsChanged').val()==1){userPersonal.save('WIUT');userPersonal.getEditDiv('WIUT','#fieldsChanged').val('0')}if(userPersonal.getEditDiv('Basic','#fieldsChanged').val()==1){userPersonal.save('Basic');userPersonal.getEditDiv('Basic','#fieldsChanged').val('0')}if(userPersonal.getEditDiv('More','#fieldsChanged').val()==1){userPersonal.save('More');userPersonal.getEditDiv('More','#fieldsChanged').val('0')}if(userPersonal.getEditDiv('Important','#fieldsChanged').val()==1){userPersonal.save('Important');userPersonal.getEditDiv('Important','#fieldsChanged').val('0')}DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove();afterSaved(link,clickEvent)})}$('#'+cancelPopup.attr('content_id')+' .cancel').click(function(){DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});return false}function afterSaved(link,clickEvent){if(clickEvent!=null&&clickEvent!=''){clickEvent}else{window.location=link}return false}function resetForm(form,secondPass){$('#'+form+' :input').each(function(){var type=this.type;if(type!='hidden'&&!$(this).hasClass('hide')){var tag=this.tagName.toLowerCase();var fieldName=this.name;if(type=='checkbox'){fieldName=fieldName.replace('[]','')}var hiddenVal=$('#orig_'+fieldName).val();if(type=='text'||type=='textarea'){$(this).val(hiddenVal)}else if(type=='radio'){if(this.value==hiddenVal){$(this).attr('checked','checked')}else{$(this).attr('checked',false)}}else if(type=='checkbox'){var fieldArray=hiddenVal.split(',');if($.inArray(this.value,fieldArray)!==-1){$(this).attr('checked','checked')}else{$(this).attr('checked',false)}}else if(tag=='select'){if(hiddenVal==''){$(this).attr('selectedIndex',0)}else{$(this).find('option[value='+hiddenVal+']').attr('selected','selected')}}}})};function ProfileQuickUpdate_init(){var profileMood=$('#profileMoodStatus div.profileMoodBlock');var profileMoodStatus=profileMood.find('div.status');$('a.clear','#profileMoodStatus').click(userStatus.clear);$('#moodSelector').bind('change keyup',function(){$('#moodPreview').attr('src',IMAGE_URL+'mood/mood_'+$(this).val().replace(' ','_')+'.gif?'+cachebuster)});$('#saveMood').click(function(){var mood=$('#moodSelector').val();$('#moodResult').remove();$('#moodSelector').parent().after($('<span id="moodResult" style="position:absolute;top:25px;right:5px;">Saving...</span>'));ProfileAJAX('HALMe',{type:'saveMood',mood:mood,token:stok},function(d){$('#moodImg').attr('src',IMAGE_URL+'mood/mood_'+mood.replace(' ','_')+'.gif');$('#moodResult').remove();var resultString='There was an error setting your mood.';if(d.success){resultString='Your new mood has been set.'}$('#moodSelector').parent().after($('<span id="moodResult" style="position:absolute;top:25px;right:5px;">'+resultString+'</span>').animate({opacity:1},5000,'linear',function(){$(this).fadeOut()}))});return false});$('#linkBasic').click(function(){var link='';var clickEvent='Profile.showProfile( \'Basic\' )';if(userPersonal.getEditDiv('Favorites','#fieldsChanged').val()==1||userPersonal.getEditDiv('WIUT','#fieldsChanged').val()==1||userPersonal.getEditDiv('Basic','#fieldsChanged').val()==1||userPersonal.getEditDiv('More','#fieldsChanged').val()==1||userPersonal.getEditDiv('Important','#fieldsChanged').val()==1){saveAlert('Personal',link,clickEvent);return false}else{Profile.showProfile('Basic');return false}});$('#linkPersonal').click(function(){var link='';var clickEvent='Profile.showProfile( \'Personal\' )';if($('#profileBasic #fieldsChanged').val()==1){saveAlert('Basic',link,clickEvent);return false}else{Profile.showProfile('Personal');return false}});var profileBasic=$('#profileBasic div.profileContent');profileBasic.find('a.edit').click(function(){userBasic.edit();return false});profileBasic.find('a.editYearbooks').click(function(){userBasic.editYearbooks();return false});$('#welcomeBox a.edit').click(function(){Profile.showProfile('Basic');userBasic.edit();return false});profileBasic.find('a.cancel').click(function(){if(profileBasic.find('.profileBasicContent ').hasClass('hide')){userBasic.revert(true)}});profileBasic.find('a.save').click(function(){userBasic.save();$(this).show();return false});profileBasic.find('#highschoolCountry').change(function(){updateState(this.value,'highschoolState','highschoolCity','highschoolSchoolSelect',true)});profileBasic.find('#highschoolState').change(function(){updateCity(this.value,'highschoolCity','highschoolSchoolSelect')});profileBasic.find('#highschoolCity').change(function(){listSchools(this.value,'highschool','highschoolSchoolSelect')});profileBasic.find('#collegeCountry').change(function(){updateState(this.value,'collegeState','collegeCity','collegeSchoolSelect',true)});profileBasic.find('#collegeState').change(function(){updateCity(this.value,'collegeCity','collegeSchoolSelect')});profileBasic.find('#collegeCity').change(function(){listSchools(this.value,'college','collegeSchoolSelect')});profileBasic.find('#gradCountry').change(function(){updateState(this.value,'gradState','gradCity','gradSchoolSelect',true)});profileBasic.find('#gradState').change(function(){updateCity(this.value,'gradCity','gradSchoolSelect')});profileBasic.find('#gradCity').change(function(){listSchools(this.value,'grad','gradSchoolSelect')});profileBasic.find('#yearbookHighSchool .delete').click(function(){userBasic.deleteYearbook('HighSchool')});profileBasic.find('#yearbookCollege .delete').click(function(){userBasic.deleteYearbook('College')});profileBasic.find('#yearbookGradSchool .delete').click(function(){userBasic.deleteYearbook('GradSchool')});userPersonal.getEditDiv(null,'.editAll').click(function(){userPersonal.editAll('Favorites','')});userPersonal.getEditDiv('Alert','a.doneEditing').click(function(){if(userPersonal.getEditDiv('Favorites','#fieldsChanged').val()==1||userPersonal.getEditDiv('WIUT','#fieldsChanged').val()==1||userPersonal.getEditDiv('Basic','#fieldsChanged').val()==1||userPersonal.getEditDiv('More','#fieldsChanged').val()==1||userPersonal.getEditDiv('Important','#fieldsChanged').val()==1){var editSection=$('#editSection').val();$.dragonCurtain();cancelPopup=DD.createDraggable({width:300,height:127,title:'Edit Profile',color:'white',disable_drag:1,curtain:false});$('#'+cancelPopup.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><div style="padding-bottom: 11px;"><span class="alertMessage">Some of your changes have not been saved.<br />Would you like to save your changes now?</span></div><div style="padding: 0 0 5px 0;"><a href="#top" class="alertSave"><img src="'+IMAGE_URL+'/btn_save.gif" width="76" height="21" alt="Save"></a> &nbsp; <a href="#top" class="alertDontsave"><img src="'+IMAGE_URL+'/buttons/btn_dont_save.gif" width="96" height="21" alt="Don\'t Save"></a> &nbsp; <a href="#top" class="alertCancel"><img src="'+IMAGE_URL+'/buttons/btn_cancel.gif" width="76" height="21" alt="Cancel"></a></div></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove()});$('#dd_win'+(DD.win_cnt-1)+' .alertDontsave').unbind().bind('click.cancelClick',function(){userPersonal.getEditDiv(editSection,'#fieldsChanged').val('0');userPersonal.revert('Favorites','revertAll',false,true);userPersonal.revert('WIUT','revertAll',false,true);userPersonal.revert('Basic','revertAll',false,true);userPersonal.revert('More','revertAll',false,true);userPersonal.revert('Important','revertAll',false,true);DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});$('#dd_win'+(DD.win_cnt-1)+' .alertSave').click(function(){userPersonal.save(editSection);userPersonal.getEditDiv('Alert','.alertMessage').text('Saving '+editSection+'...');userPersonal.getEditDiv('Favorites','#fieldsChanged').val('0');userPersonal.getEditDiv('WIUT','#fieldsChanged').val('0');userPersonal.getEditDiv('Basic','#fieldsChanged').val('0');userPersonal.getEditDiv('More','#fieldsChanged').val('0');userPersonal.getEditDiv('Important','#fieldsChanged').val('0');userPersonal.revert('Favorites','revertAll',true);userPersonal.revert('WIUT','revertAll',true);userPersonal.revert('Basic','revertAll',true);userPersonal.revert('More','revertAll',true);userPersonal.revert('Important','revertAll',true);DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});$('#dd_win'+(DD.win_cnt-1)+' .alertCancel').click(function(){DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});return false}$('#divFavorites, #divFavorites .header').unbind('click').css('cursor','auto');$('#divWIUT, #divWIUT .header').unbind('click').css('cursor','auto');$('#divBasic, #divBasic .header').unbind('click').css('cursor','auto');$('#divMore, #divMore .header').unbind('click').css('cursor','auto');$('#divImportant, #divImportant .header').unbind('click').css('cursor','auto');userPersonal.revert('Favorites','revertAll',false,false);userPersonal.revert('WIUT','revertAll',false,false);userPersonal.revert('Basic','revertAll',false,false);userPersonal.revert('More','revertAll',false,false);userPersonal.revert('Important','revertAll',false,false)});userPersonal.getEditDiv('Favorites','.edit').click(function(){if(userPersonal.getEditDiv('Favorites','.editMode ').hasClass('hide')){userPersonal.edit('Favorites',1)}});userPersonal.getEditDiv('Favorites','.cancel').bind('click.cancelClick',function(){if(userPersonal.getEditDiv('Favorites','.editMode ').hasClass('hide')==false){userPersonal.revert('Favorites','CancelConfirm',false,true)}});userPersonal.getEditDiv('Favorites','.save').click(function(){userPersonal.getEditDiv('Alert','.alertMessage').text('Saving Favorites...');userPersonal.save('Favorites');return false});userPersonal.getEditDiv('WIUT','.edit').click(function(){if(userPersonal.getEditDiv('WIUT','.editMode ').hasClass('hide')){userPersonal.getEditDiv('WIUT','#wiutToggle').addClass('hide');userPersonal.edit('WIUT',1)}});userPersonal.getEditDiv('WIUT','.cancel').bind('click.cancelClick',function(){if(userPersonal.getEditDiv('WIUT','.editMode ').hasClass('hide')==false){userPersonal.revert('WIUT','CancelConfirm',false,true)}});userPersonal.getEditDiv('WIUT','.save').click(function(){userPersonal.getEditDiv('Alert','.alertMessage').text('Saving What I\'m Up To...');userPersonal.save('WIUT');return false});userPersonal.getEditDiv('Basic','.edit').click(function(){if(userPersonal.getEditDiv('Basic','.editMode ').hasClass('hide')){userPersonal.edit('Basic',1)}});userPersonal.getEditDiv('Basic','.cancel').bind('click.cancelClick',function(){if(userPersonal.getEditDiv('Basic','.editMode ').hasClass('hide')==false){userPersonal.revert('Basic','CancelConfirm',false,true)}});userPersonal.getEditDiv('Basic','.save').click(function(){userPersonal.getEditDiv('Alert','.alertMessage').text('Saving The Basic Stuff...');userPersonal.save('Basic');return false});userPersonal.getEditDiv('More','.edit').click(function(){if(userPersonal.getEditDiv('More','.editMode ').hasClass('hide')){userPersonal.edit('More',1)}});userPersonal.getEditDiv('More','.cancel').bind('click.cancelClick',function(){if(userPersonal.getEditDiv('More','.editMode ').hasClass('hide')==false){userPersonal.revert('More','CancelConfirm',false,true)}});userPersonal.getEditDiv('More','.save').click(function(){userPersonal.getEditDiv('Alert','.alertMessage').text('Saving A Little Something More...');userPersonal.save('More');return false});userPersonal.getEditDiv('Important','.edit').click(function(){if(userPersonal.getEditDiv('Important','.editMode ').hasClass('hide')){userPersonal.edit('Important',1)}});userPersonal.getEditDiv('Important','.cancel').bind('click.cancelClick',function(){if(userPersonal.getEditDiv('Important','.editMode ').hasClass('hide')==false){userPersonal.revert('Important','CancelConfirm',false,true)}});userPersonal.getEditDiv('Important','.save').click(function(){userPersonal.getEditDiv('Alert','.alertMessage').text('Saving Important Things...');userPersonal.save('Important');return false})};anchorScroll={init:function(){$('.anchorLink').click(function(){elementClick=$(this).attr('href');destination=$(elementClick).offset().top;$('html,body').animate({scrollTop:destination},100);return false})}};userStatus={moodElement:null,getMoodElement:function(){if(userStatus.moodElement==null){userStatus.moodElement=$('#profileMoodStatus')}return userStatus.moodElement},save:function(){var profileMood=userStatus.getMoodElement();var status=profileMood.find('div.status');status.find('a.save').hide();status.find('div.saving').show();var statusInput=profileMood.find('div.profileMoodBlock div.status input');var newStatus=$.trim(statusInput.val());newStatus=='is'?newStatus='':null;var punc=newStatus.charAt(newStatus.length-1);punc!='.'&&punc!='!'&&punc!='?'&&newStatus!=''?newStatus+='.':null;var currentStatus=profileMood.find('div.currentStatus');currentStatus.find('span.statusText').text(newStatus);status.find('div.statusInputWrapper input').val(newStatus);status.find('span.originalStatus').text(newStatus);var dataObj={status:newStatus,token:stok};ProfileAJAX('HALQuickUpdateSaveStatus',dataObj,function(){status.find('div.saving').hide();status.find('div.defaultStatus').removeClass('hide')});if(jQuery.trim(newStatus)==''||jQuery.trim(newStatus)=='is'){currentStatus.find('span.statusText').text('Your status has been cleared.');currentStatus.find('.clear').addClass('hide');$('#profileMoodStatus div.shareContent.shareStatus').hide()}else{profileMood.find('div.profileHeader span.time').text(' just updated');currentStatus.find('span.statusText').removeClass('profileLink');currentStatus.find('a.clear').removeClass('hide');currentStatus.find('span.time, .clear').removeClass('hide');currentStatus.find('span.time').show();$('#profileMoodStatus div.shareContent.shareStatus').show()}userStatus.revert();return false},clear:function(){var profileMood=userStatus.getMoodElement();profileMood.find('div.profileMoodBlock div.status input').val('');profileMood.find('div.profileHeader span.time').text('');userStatus.save();return false},edit:function(){var profileMood=userStatus.getMoodElement();var profileMoodStatus=profileMood.find('div.status ');profileMoodStatus.find('div.defaultStatus').addClass('hide');profileMoodStatus.find('div.edit').removeClass('hide');profileMoodStatus.find('a.save').show();var input=profileMoodStatus.find('div.statusInputWrapper input');input.show().focus();if($.trim(input.val())==''||$.trim(input.val())=='is'){input.val('is ');var start=input.val().length;var end=start;setInputSelection(input,start,end)}else if(input.val().substring(0,3)=='is '){var start=3;var end=input.val().length;setInputSelection(input,start,end)}else{setInputSelection(input,0,(input.val().length))}return false},isDefault:function(){var profileMoodStatus=userStatus.getMoodElement().find('div.status');var input=profileMoodStatus.find('div.statusInputWrapper input');return(jQuery.trim(input.val())=='is'||jQuery.trim(input.val())==''||input.val()==profileMoodStatus.find('span.originalStatus').text())},revert:function(){var moodStatus=userStatus.getMoodElement();moodStatus.find('div.defaultStatus').removeClass('hide');moodStatus.find('div.edit').addClass('hide');return false}};userBasic={save:function(){if($('#profileBasic #fieldsChanged').val()==1){if($.trim($('#profileBasic #firstName').val())==''){$.dragonCurtain();deletedConfirm=DD.createDraggable({width:300,height:90,title:'Yearbook Error',color:'white',disable_drag:1,curtain:false});$('#'+deletedConfirm.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><span class="alertMessage">Please enter your first name.</span></div><div style="padding: 0 0 5px 0;"><a href="#" class="okFirstName"><img src="'+IMAGE_URL+'/btn_ok.gif" width="56" height="21" alt="Ok"></a></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove();$('#profileBasic #firstName').focus()});$('#'+deletedConfirm.attr('content_id')+' .okFirstName').click(function(){DD.destroy(deletedConfirm.attr('id'));$.dragonCurtainRemove();$('#profileBasic #firstName').focus()});return false}if($.trim($('#profileBasic #lastName').val())==''){$.dragonCurtain();deletedConfirm=DD.createDraggable({width:300,height:90,title:'Yearbook Error',color:'white',disable_drag:1,curtain:false});$('#'+deletedConfirm.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><span class="alertMessage">Please enter your last name.</span></div><div style="padding: 0 0 5px 0;"><a href="#" class="okLastName"><img src="'+IMAGE_URL+'/btn_ok.gif" width="56" height="21" alt="Ok"></a></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove();$('#profileBasic #lastName').focus()});$('#'+deletedConfirm.attr('content_id')+' .okLastName').click(function(){DD.destroy(deletedConfirm.attr('id'));$.dragonCurtainRemove();$('#profileBasic #lastName').focus()});return false}if(($('#profileBasic #highschoolSchool').val()!=''&&$('#profileBasic #highschoolSchool').val()!=0)||($('#profileBasic #highschoolCountry').val()!=''&&$('#profileBasic #highschoolCountry').val()!=0)||($('#profileBasic #highschoolState').val()!=''&&$('#profileBasic #highschoolState').val()!=0)||($('#profileBasic #highschoolCity').val()!=''&&$('#profileBasic #highschoolCity').val()!=0)||$('#profileBasic #highschoolGradYear').val()!=''||$('#profileBasic #highschoolStatus').val()!=''){if(($('#profileBasic #highschoolSchool').val()==''||$('#profileBasic #highschoolSchool').val()==0)||$('#profileBasic #highschoolCountry').val()==''||$('#profileBasic #highschoolCountry').val()==0||$('#profileBasic #highschoolState').val()==''||$('#profileBasic #highschoolState').val()==0||$('#profileBasic #highschoolCity').val()==''||$('#profileBasic #highschoolCity').val()==0||$('#profileBasic #highschoolGradYear').val()==''||$('#profileBasic #highschoolStatus').val()==''){$.dragonCurtain();deletedConfirm=DD.createDraggable({width:300,height:120,title:'Yearbook Error',color:'white',disable_drag:1,curtain:false});$('#'+deletedConfirm.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><span class="alertMessage">You must select a value for all of the fields for your highschool yearbook in order to save it.</span></div><div style="padding: 0 0 5px 0;"><a href="#yearbookAnchor" class="okYearbookInfo"><img src="'+IMAGE_URL+'/btn_ok.gif" width="56" height="21" alt="Ok"></a></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove()});$('#'+deletedConfirm.attr('content_id')+' .okYearbookInfo').click(function(){DD.destroy(deletedConfirm.attr('id'));$.dragonCurtainRemove()});return false}}if(($('#profileBasic #collegeSchool').val()!=''&&$('#profileBasic #collegeSchool').val()!=0)||($('#profileBasic #collegeCountry').val()!=''&&$('#profileBasic #collegeCountry').val()!=0)||($('#profileBasic #collegeState').val()!=''&&$('#profileBasic #collegeState').val()!=0)||($('#profileBasic #collegeCity').val()!=''&&$('#profileBasic #collegeCity').val()!=0)||$('#profileBasic #collegeGradYear').val()!=''||$('#profileBasic #collegeStatus').val()!=''){if(($('#profileBasic #collegeSchool').val()==''||$('#profileBasic #collegeSchool').val()==0)||$('#profileBasic #collegeCountry').val()==''||$('#profileBasic #collegeCountry').val()==0||$('#profileBasic #collegeState').val()==''||$('#profileBasic #collegeState').val()==0||$('#profileBasic #collegeCity').val()==''||$('#profileBasic #collegeCity').val()==0||$('#profileBasic #collegeGradYear').val()==''||$('#profileBasic #collegeStatus').val()==''){$.dragonCurtain();deletedConfirm=DD.createDraggable({width:300,height:120,title:'Yearbook Error',color:'white',disable_drag:1,curtain:false});$('#'+deletedConfirm.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><span class="alertMessage">You must select a value for all of the fields for your College yearbook in order to save it.</span></div><div style="padding: 0 0 5px 0;"><a href="#yearbookAnchor" class="okYearbookInfo"><img src="'+IMAGE_URL+'/btn_ok.gif" width="56" height="21" alt="Ok"></a></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove()});$('#'+deletedConfirm.attr('content_id')+' .okYearbookInfo').click(function(){DD.destroy(deletedConfirm.attr('id'));$.dragonCurtainRemove()});return false}}if(($('#profileBasic #gradSchool').val()!=''&&$('#profileBasic #gradSchool').val()!=0)||($('#profileBasic #gradCountry').val()!=''&&$('#profileBasic #gradCountry').val()!=0)||($('#profileBasic #gradState').val()!=''&&$('#profileBasic #gradState').val()!=0)||($('#profileBasic #gradCity').val()!=''&&$('#profileBasic #gradCity').val()!=0)||$('#profileBasic #gradGradYear').val()!=''||$('#profileBasic #gradStatus').val()!=''){if(($('#profileBasic #gradSchool').val()==''||$('#profileBasic #gradSchool').val()==0)||$('#profileBasic #gradCountry').val()==''||$('#profileBasic #gradCountry').val()==0||$('#profileBasic #gradState').val()==''||$('#profileBasic #gradState').val()==0||$('#profileBasic #gradCity').val()==''||$('#profileBasic #gradCity').val()==0||$('#profileBasic #gradGradYear').val()==''||$('#profileBasic #gradStatus').val()==''){$.dragonCurtain();deletedConfirm=DD.createDraggable({width:300,height:120,title:'Yearbook Error',color:'white',disable_drag:1,curtain:false});$('#'+deletedConfirm.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><span class="alertMessage">You must select a value for all of the fields for your Grad School yearbook in order to save it.</span></div><div style="padding: 0 0 5px 0;"><a href="#yearbookAnchor" class="okYearbookInfo"><img src="'+IMAGE_URL+'/btn_ok.gif" width="56" height="21" alt="Ok"></a></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove()});$('#'+deletedConfirm.attr('content_id')+' .okYearbookInfo').click(function(){DD.destroy(deletedConfirm.attr('id'));$.dragonCurtainRemove()});return false}}var destination=$('#top').offset().top;$('html,body').animate({scrollTop:destination},100);$('#basicAlertDiv').removeClass('hide');$('#basicAlertMessage').text('Saving your information...');$('#basicProfileEdit').addClass('hide');$('#profileYearbooksEdit').addClass('hide');$.ajax({type:'POST',url:'/ajax/profile/updateProfile.php',data:$('#basicForm :input').serialize()+'&action=updateBasic&token='+stok,dataType:'json',success:function(str){showDebug(str);if(str.error==true){if(str.forceLogout==true){window.location=str.forceURL;return false}else{$('<div><div style="text-align:center;font-size:12px;padding:10px;"><div style="padding-bottom: 11px;"><span class="alertMessage">'+str.errorMessage+'</span></div></div></div>').appendTo('body').dragonDrop({width:300,height:120,title:'Edit Profile',draggable:false,curtain:false,type:'window'});userBasic.revert(true);return false}}if(str.ppe_aboutme!=''){$('#divAboutMeText').removeClass('aboutMeEmpty').html(str.ppe_aboutmeDisplay);$('#divAboutMeTitle').removeClass('hide')}else{$('#divAboutMeTitle').addClass('hide');$('#divAboutMeText').addClass('aboutMeEmpty').html('You haven\'t filled out your "About Me" yet. <a href="#Edit" class="normaltextlink edit anchorLink">What makes you -- you?</a>');$('#profileBasic .edit').click(function(){userBasic.edit()})}$('#orig_gender').val(str.gender);$('#orig_relationship').val(str.relationship);$('#firstName').val(str.firstName);$('#orig_firstName').val(str.firstName);$('#lastName').val(str.lastName);$('#orig_lastName').val(str.lastName);$('#ppe_aboutme').text(str.ppe_aboutme);$('#orig_ppe_aboutme').val(str.ppe_aboutme);$('#aboutme').val(str.ppe_aboutme);$('#orig_highschoolCountry').val(str.highschoolCountry);$('#orig_highschoolStatus').val(str.highschoolStatus);$('#orig_highschoolGradYear').val(str.highschoolGradYear);$('#orig_collegeCountry').val(str.collegeCountry);$('#orig_collegeStatus').val(str.collegeStatus);$('#orig_collegeGradYear').val(str.collegeGradYear);$('#orig_gradCountry').val(str.gradCountry);$('#orig_gradStatus').val(str.gradStatus);$('#orig_gradGradYear').val(str.gradGradYear);if($('#orig_highschoolState').val()!=str.highschoolState){$('#orig_highschoolState').val(str.highschoolState);$('#highschoolState option[value='+str.highschoolState+']').attr('selected','selected');$('#highschoolStateHidden').remove();$('#highschoolState').clone().attr('id','highschoolStateHidden').attr('name','highschoolStateHidden').addClass('hide').appendTo('#highschoolStateSelect')}if($('#orig_highschoolCity').val()!=str.highschoolCity){$('#orig_highschoolCity').val(str.highschoolCity);$('#highschoolCity option[value='+str.highschoolCity+']').attr('selected','selected');$('#highschoolCityHidden').remove();$('#highschoolCity').clone().attr('id','highschoolCityHidden').attr('name','highschoolCityHidden').addClass('hide').appendTo('#highschoolCitySelect')}if($('#orig_highschoolSchool').val()!=str.highschoolSchool){$('#orig_highschoolSchool').val(str.highschoolSchool);$('#highschoolSchool option[value='+str.highschoolSchool+']').attr('selected','selected');$('#highschoolSchoolHidden').remove();$('#highschoolSchool').clone().attr('id','highschoolSchoolHidden').attr('name','highschoolSchoolHidden').addClass('hide').appendTo('#highschoolSchoolSelect')}if($('#orig_collegeState').val()!=str.collegeState){$('#orig_collegeState').val(str.collegeState);$('#collegeState option[value='+str.collegeState+']').attr('selected','selected');$('#collegeStateHidden').remove();$('#collegeState').clone().attr('id','collegeStateHidden').attr('name','collegeStateHidden').addClass('hide').appendTo('#collegeStateSelect')}if($('#orig_collegeCity').val()!=str.collegeCity){$('#orig_collegeCity').val(str.collegeCity);$('#collegeCity option[value='+str.collegeCity+']').attr('selected','selected');$('#collegeCityHidden').remove();$('#collegeCity').clone().attr('id','collegeCityHidden').attr('name','collegeCityHidden').addClass('hide').appendTo('#collegeCitySelect')}if($('#orig_collegeSchool').val()!=str.collegeSchool){$('#orig_collegeSchool').val(str.collegeSchool);$('#collegeSchool option[value='+str.collegeSchool+']').attr('selected','selected');$('#collegeSchoolHidden').remove();$('#collegeSchool').clone().attr('id','collegeSchoolHidden').attr('name','collegeSchoolHidden').addClass('hide').appendTo('#collegeSchoolSelect')}if($('#orig_gradState').val()!=str.gradState){$('#orig_gradState').val(str.gradState);$('#gradState option[value='+str.gradState+']').attr('selected','selected');$('#gradStateHidden').remove();$('#gradState').clone().attr('id','gradStateHidden').attr('name','gradStateHidden').addClass('hide').appendTo('#gradStateSelect')}if($('#orig_gradCity').val()!=str.gradCity){$('#orig_gradCity').val(str.gradCity);$('#gradCity option[value='+str.gradCity+']').attr('selected','selected');$('#gradCityHidden').remove();$('#gradCity').clone().attr('id','gradCityHidden').attr('name','gradCityHidden').addClass('hide').appendTo('#gradCitySelect')}if($('#orig_gradSchool').val()!=str.gradSchool){$('#orig_gradSchool').val(str.gradSchool);$('#gradSchool option[value='+str.gradSchool+']').attr('selected','selected');$('#gradSchoolHidden').remove();$('#gradSchool').clone().attr('id','gradSchoolHidden').attr('name','gradSchoolHidden').addClass('hide').appendTo('#gradSchoolSelect')}document.title='myYearbook | '+str.firstName+' '+str.lastName;$('#profileMoodStatus .profileName').text(str.firstName+' '+str.lastName);$('#profileMoodStatus .firstName').text(str.firstName);if(str.newRelationship!=''){$('#divGender').text(str.genderText+', ')}else{$('#divGender').text(str.genderText)}$('#divRelationshipStatus').text(str.newRelationship);$('#yearbookDisplayhighschool').remove();$('#yearbookDisplaycollege').remove();$('#yearbookDisplaygcollege').remove();$('#divYearbooksList').empty();$('#currentHighSchool').val(str.highschoolSchool);$('#currentCollege').val(str.collegeSchool);$('#currentGradSchool').val(str.gradSchool);if(str.gradLink!=''&&str.gradLink!=null){$('#yearbookGradSchool #divDeleteLink').removeClass('hide');$('#divNewYearbooks').append('<div id="yearbookDisplaygcollege">'+str.gradLink+'</div>');$('#divYearbooksList').append('<div id="yearbookListgcollege"><span class="normaltextbold">Grad School: </span><span class="normaltext">'+str.gradName+'</span><br></div>')}else{$('#yearbookGradSchool #divDeleteLink').addClass('hide')}if(str.collegeLink!=''&&str.collegeLink!=null){$('#yearbookCollege #divDeleteLink').removeClass('hide');$('#divNewYearbooks').append('<div id="yearbookDisplaycollege">'+str.collegeLink+'</div>');$('#divYearbooksList').append('<div id="yearbookListcollege"><span class="normaltextbold">College: </span><span class="normaltext">'+str.collegeName+'</span><br></div>')}else{$('#yearbookCollege #divDeleteLink').addClass('hide')}if(str.highschoolLink!=''&&str.highschoolLink!=null){$('#yearbookHighSchool #divDeleteLink').removeClass('hide');$('#divNewYearbooks').append('<div id="yearbookDisplayhighschool">'+str.highschoolLink+'</div>');$('#divYearbooksList').append('<div id="yearbookListhighschool"><span class="normaltextbold">High School: </span><span class="normaltext">'+str.highschoolName+'</span><br></div>')}else{$('#yearbookHighSchool #divDeleteLink').addClass('hide')}userBasic.revert(true)}})}else{userBasic.revert(false)}return false},deleteYearbook:function(yearbook){$.ajax({type:'POST',url:'/ajax/profile/updateProfile.php',data:$('#divYearbooks :input').serialize()+'&action=deleteYearbook&yearbook='+yearbook+'&token='+$('#token').val(),dataType:'json',success:function(str){var yearbookDelete=str.yearbookDelete;var yearbookDeleteID=str.yearbookDeleteID;var yearbookContainer=str.yearbookContainer;$('#'+yearbookDelete+'Status').attr('selectedIndex',0);$('#'+yearbookDelete+'Country').attr('selectedIndex',0);$('#'+yearbookDelete+'GradYear').attr('selectedIndex',0);$('#orig_'+yearbookDelete+'Status').val('');$('#orig_'+yearbookDelete+'Country').val('');$('#orig_'+yearbookDelete+'State').val('');$('#orig_'+yearbookDelete+'City').val('');$('#orig_'+yearbookDelete+'School').val('');$('#orig_'+yearbookDelete+'GradYear').val('');$('#current'+yearbookDeleteID).val('');$('#'+yearbookDelete+'State').empty();$('#'+yearbookDelete+'City').empty();$('#'+yearbookDelete+'School').empty();$('#'+yearbookDelete+'State').html('<option value="" label="--Select State--">--Select State--</option>');$('#'+yearbookDelete+'City').html('<option value="" label="--Select City--">--Select City--</option>');$('#'+yearbookDelete+'School').html('<option value="" label="--Select School--">--Select School--</option>');$('#'+yearbookDelete+'StateHidden').html('<option value="" label="--Select State--">--Select State--</option>');$('#'+yearbookDelete+'CityHidden').html('<option value="" label="--Select City--">--Select City--</option>');$('#'+yearbookDelete+'SchoolHidden').html('<option value="" label="--Select School--">--Select School--</option>');if($('#yearbookDisplay'+yearbookContainer).length>0){$('#yearbookDisplay'+yearbookContainer).addClass('hide')}if($('#yearbookList'+yearbookContainer).length>0){$('#yearbookList'+yearbookContainer).addClass('hide')}$('#yearbook'+yearbookDeleteID+' .deleteLink').addClass('hide');deletedConfirm=DD.createDraggable({width:320,height:120,title:'Yearbook Deleted',color:'white',disable_drag:1,curtain:false});$('#'+deletedConfirm.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><span class="alertMessage">The Yearbook has been successfully deleted.</span></div><div style="padding: 0 0 5px 0;"><a href="#top" class="deleteOk"><img src="'+IMAGE_URL+'/btn_ok.gif" width="56" height="21" alt="Ok"></a></div>');$('#'+deletedConfirm.attr('content_id')+' .deleteOk').click(function(){DD.destroy(deletedConfirm.attr('id'))});return false}});return false},edit:function(){var profileBasic=$('#profileBasic');profileBasic.find('input, textarea, select, radio, checkbox').bind('keyup change',function(){profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')});var profileContent=profileBasic.find('.profileContent');profileContent.find('.profileBasicContent').addClass('hide');profileContent.find('.profileRankings').addClass('hide');profileContent.find('#basicProfileEdit').removeClass('hide');profileContent.find('#profileYearbooksDisplay').removeClass('hide');profileBasic.find('#profileYearbooksEdit').addClass('hide');$('#editLocationSelectorLink').click(function(){$.getScript(IMAGE_URL+'JavaScript/apps/LocationSelector.js',function(){LocationSelector.init({save:{type:'profile'}})});return false});return false},editYearbooks:function(){var profileBasic=$('#profileBasic');if($('#highschoolCountry').val()==''||$('#highschoolCountry').val()===undefined){listCountries(profileBasic.find('#orig_highschoolCountry').val(),'highschool',true)}if(trim(profileBasic.find('#highschoolStateSelect').html())==''){listStates(profileBasic.find('#orig_highschoolCountry').val(),$('#orig_highschoolState').val(),'highschool',true)}if(trim(profileBasic.find('#highschoolCitySelect').html())==''){listCities(profileBasic.find('#orig_highschoolState').val(),$('#orig_highschoolCity').val(),'highschool',true)}if(trim(profileBasic.find('#highschoolSchoolSelect').html())==''){listSchools(profileBasic.find('#orig_highschoolCity').val(),'highschool','highschoolSchoolSelect',profileBasic.find('#orig_highschoolSchool').val())}if($('#collegeCountry').val()==''||$('#collegeCountry').val()===undefined){listCountries(profileBasic.find('#orig_collegeCountry').val(),'college',true)}if(trim(profileBasic.find('#collegeStateSelect').html())==''){listStates(profileBasic.find('#orig_collegeCountry').val(),$('#orig_collegeState').val(),'college',true)}if(trim(profileBasic.find('#collegeCitySelect').html())==''){listCities(profileBasic.find('#orig_collegeState').val(),$('#orig_collegeCity').val(),'college',true)}if(trim(profileBasic.find('#collegeSchoolSelect').html())==''){listSchools(profileBasic.find('#orig_collegeCity').val(),'college','collegeSchoolSelect',profileBasic.find('#orig_collegeSchool').val())}if($('#gradCountry').val()==''||$('#gradCountry').val()===undefined){listCountries(profileBasic.find('#orig_gradCountry').val(),'grad',true)}if(trim(profileBasic.find('#gradStateSelect').html())==''){listStates(profileBasic.find('#orig_gradCountry').val(),$('#orig_gradState').val(),'grad',true)}if(trim(profileBasic.find('#gradCitySelect').html())==''){listCities(profileBasic.find('#orig_gradState').val(),$('#orig_gradCity').val(),'grad',true)}if(trim(profileBasic.find('#gradSchoolSelect').html())==''){listSchools(profileBasic.find('#orig_gradCity').val(),'grad','gradSchoolSelect',profileBasic.find('#orig_gradSchool').val())}profileBasic.find('select').bind('keyup change',function(){profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')});profileBasic.find('#profileYearbooksDisplay').addClass('hide');profileBasic.find('#profileYearbooksEdit').removeClass('hide');return false},revert:function(resetFields){var profileBasic=$('#profileBasic');profileBasic.find('div.profileBasicContent, div.profileRankings').removeClass('hide');profileBasic.find('.profileEdit').addClass('hide');if(resetFields==true&&profileBasic.find('#fieldsChanged').val()==1){var yearbooksArray=['highschool','college','grad'];for(var i=0;i<yearbooksArray.length;i++){if($('#'+yearbooksArray[i]+'State').val()!=$('#orig_'+yearbooksArray[i]+'State').val()){$('#'+yearbooksArray[i]+'State').remove();$('#'+yearbooksArray[i]+'StateHidden').clone().attr('id',yearbooksArray[i]+'State').attr('name',yearbooksArray[i]+'State').removeClass('hide').appendTo('#'+yearbooksArray[i]+'StateSelect');$('#'+yearbooksArray[i]+'State').change(function(){updateCity(this.value,yearbooksArray[i]+'City',yearbooksArray[i]+'SchoolSelect')})}if($('#'+yearbooksArray[i]+'City').val()!=$('#orig_'+yearbooksArray[i]+'City').val()){$('#'+yearbooksArray[i]+'City').remove();$('#'+yearbooksArray[i]+'CityHidden').clone().attr('id',yearbooksArray[i]+'City').attr('name',yearbooksArray[i]+'City').removeClass('hide').appendTo('#'+yearbooksArray[i]+'CitySelect');$('#'+yearbooksArray[i]+'City').change(function(){listSchools(this.value,yearbooksArray[i]+'',yearbooksArray[i]+'SchoolSelect')})}if($('#'+yearbooksArray[i]+'School').val()!=$('#orig_'+yearbooksArray[i]+'School').val()){$('#'+yearbooksArray[i]+'School').remove();$('#'+yearbooksArray[i]+'SchoolHidden').clone().attr('id',yearbooksArray[i]+'School').attr('name',yearbooksArray[i]+'School').removeClass('hide').appendTo('#'+yearbooksArray[i]+'SchoolSelect');$('#'+yearbooksArray[i]+'School').change(function(){listSchools(this.value,yearbooksArray[i]+'',yearbooksArray[i]+'SchoolSelect')})}}resetForm('basicForm');profileBasic.find('#fieldsChanged').val('0');profileBasic.find('#basicAlertDiv').addClass('hide')}return false}};userPersonal={save:function(saveDiv,saveMode){if(this.getEditDiv(saveDiv,'#fieldsChanged',false).val()==1){this.getEditDiv('Alert',null).removeClass('hide');this.getEditDiv(saveDiv,'fieldset').hide();this.getEditDiv(saveDiv,'div.btnpos').addClass('hide');$.ajax({type:'POST',url:'/ajax/profile/updateProfile.php',data:$('#'+saveDiv).serialize()+'&action=updatePersonal&section='+saveDiv+'&token='+$('#token').val(),dataType:'json',success:function(str){showDebug(str);if(str.error==true){if(str.forceLogout==true){window.location=str.forceURL;return false}else{errorPopup=DD.createDraggable({width:300,height:120,title:'Edit Profile',color:'white',disable_drag:1,curtain:false});$('#'+errorPopup.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><div style="padding-bottom: 11px;"><span class="alertMessage">'+str.errorMessage+'</span></div></div>')}}if(str.wiutUpdate==true){var wiutUpdate=true;var wiutCount=0}$.each(str,function(field,newValue){if(field.match('SearchText')!=null){if(newValue!=''&&newValue!='null'){var field=field.replace('SearchText','');userPersonal.getEditDiv(null,'.'+field+' .displayMode').html(newValue);if(field=='pba_quoteDisplay'){userPersonal.getEditDiv(null,'.pba_quote .displayMode').html('"'+newValue+'"')}if(userPersonal.getEditDiv(null,'.'+field,false).hasClass('hideRow')){userPersonal.getEditDiv(null,'.'+field).removeClass('hideRow');userPersonal.getEditDiv(null,'.'+field).removeClass('hide');userPersonal.getEditDiv(null,'.'+field).addClass('showRow')}if(wiutUpdate){wiutCount++;if(wiutCount>5){userPersonal.getEditDiv('WIUT','.'+field).addClass('hasVal').addClass('hideWIUT')}else{userPersonal.getEditDiv('WIUT','.'+field).removeClass('hasVal').removeClass('hideWIUT')}}}else{var field=field.replace('SearchText','');if(userPersonal.getEditDiv(null,'.'+field,false).hasClass('showRow')){userPersonal.getEditDiv(null,'.'+field).removeClass('showRow');userPersonal.getEditDiv(null,'.'+field).addClass('hideRow hide')}if(wiutUpdate){userPersonal.getEditDiv('WIUT','.'+field).removeClass('hasVal').removeClass('hideWIUT')}}}else if(field!='wiutUpdate'&&field!='pin_hangout'){userPersonal.getEditDiv(null,'#'+saveDiv+' #orig_'+field).attr('value',newValue);if(field=='pba_quote'){userPersonal.getEditDiv(null,'#'+field).text(newValue)}if(newValue!=''&&newValue!=null){if(field=='pba_quoteDisplay'){userPersonal.getEditDiv(null,'.pba_quote .displayMode').html('"'+newValue+'"')}if(userPersonal.getEditDiv(null,'.'+field,false).hasClass('hideRow')){userPersonal.getEditDiv(null,'.'+field).removeClass('hideRow');userPersonal.getEditDiv(null,'.'+field).removeClass('hide');userPersonal.getEditDiv(null,'.'+field).addClass('showRow')}else if(userPersonal.getEditDiv(null,'.'+field,false).hasClass('hideWIUT')&&!(userPersonal.getEditDiv(null,'.'+field,false).hasClass('hasVal'))){userPersonal.getEditDiv(null,'.'+field).addClass('hasVal')}}else{if(userPersonal.getEditDiv(null,'.'+field,false).hasClass('showRow')){userPersonal.getEditDiv(null,'.'+field).removeClass('showRow');userPersonal.getEditDiv(null,'.'+field).addClass('hideRow hide')}}}});if(wiutUpdate){userPersonal.getEditDiv('WIUT','#wiutCount').val(wiutCount);if(wiutCount>5){userPersonal.getEditDiv('WIUT','#wiutToggle').html('more...');userPersonal.getEditDiv('WIUT','#wiutToggle').removeClass('hide')}else{userPersonal.getEditDiv('WIUT','#wiutToggle').addClass('hide')}}if(userPersonal.getEditDiv(null,'#editAllMode').val()!=1){userPersonal.getEditDiv('Alert','a.close').removeClass('hide');if(saveDiv=='Favorites'){var alertMessage='You\'ve successfully edited Favorites'}else if(saveDiv=='WIUT'){var alertMessage='You\'ve successfully edited What I\'m Up To'}else if(saveDiv=='Basic'){var alertMessage='You\'ve successfully edited The Basic Stuff'}else if(saveDiv=='More'){var alertMessage='You\'ve successfully edited A Little Something More'}else if(saveDiv=='Important'){var alertMessage='You\'ve successfully edited your Important Things'}userPersonal.getEditDiv('Alert','div.alertMessage').text(alertMessage);userPersonal.getEditDiv('Alert','a.close').click(function(){userPersonal.getEditDiv('Alert','div.alertMessage').text('');userPersonal.getEditDiv('Alert','a.close').addClass('hide');userPersonal.getEditDiv('Alert',null).addClass('hide');return false})}userPersonal.getEditDiv(saveDiv,'#fieldsChanged').val('0');var dataSaved=true;if(saveMode!='doneEditing'){if(userPersonal.getEditDiv(null,'#editAllMode').val()==1&&saveMode!='doneEditing'){if(saveMode=='goToSection'){userPersonal.revert(saveDiv,'editAllSaved',dataSaved,true,false)}else{userPersonal.revert(saveDiv,'editAllSaved',dataSaved,true)}}else{userPersonal.revert(saveDiv,'Saved',dataSaved,true)}}}})}else{var dataSaved=false;this.getEditDiv('Alert',null).addClass('hide');this.getEditDiv('Alert','a.close').addClass('hide');if(saveMode!='doneEditing'){if($('#editAllMode').val()==1&&saveMode!='doneEditing'){userPersonal.revert(saveDiv,'editAllSaved',dataSaved,true)}else{userPersonal.revert(saveDiv,'Saved',dataSaved,true)}}}return false},editAll:function(editDiv,saveMessage){var editSection=$('#editSection').val();if($('#profilePersonal #div'+editSection+' #fieldsChanged').val()==1){$.dragonCurtain();cancelPopup=DD.createDraggable({width:300,height:127,title:'Edit Profile',color:'white',disable_drag:1,curtain:false});$('#'+cancelPopup.attr('content_id')).html('<div style="text-align:center;font-size:12px;padding:10px;"><div style="padding-bottom: 11px;"><span class="alertMessage">Some of your changes have not been saved.<br />Would you like to save your changes now?</span></div><div style="padding: 0 0 5px 0;"><a href="#top" class="save"><img src="'+IMAGE_URL+'/btn_save.gif" width="76" height="21" alt="Save"></a> &nbsp; <a href="#top" class="dontsave"><img src="'+IMAGE_URL+'/buttons/btn_dont_save.gif" width="96" height="21" alt="Don\'t Save"></a> &nbsp; <a href="#top" class="cancel"><img src="'+IMAGE_URL+'/buttons/btn_cancel.gif" width="76" height="21" alt="Cancel"></a></div></div>');$('#dd_win'+(DD.win_cnt-1)+'close img').click(function(){$.dragonCurtainRemove()});$('#'+cancelPopup.attr('content_id')+' .dontsave').bind('click.cancelClick',function(){$('#profilePersonal #div'+editSection+' #fieldsChanged').val('0');userPersonal.revert(editSection,'revertAll',false,true,false);userPersonal.editAll(editDiv,'');DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});$('#'+cancelPopup.attr('content_id')+' .save').click(function(){$('#profileBlocks .alertDiv .alertMessage').text('Saving '+editSection+'...');userPersonal.save(editSection,'goToSection');$('#profilePersonal #div'+editSection+' #fieldsChanged').val('0');userPersonal.editAll(editDiv,'');DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});$('#'+cancelPopup.attr('content_id')+' .cancel').click(function(){DD.destroy(cancelPopup.attr('id'));$.dragonCurtainRemove()});return false}this.getEditDiv('Alert',null).removeClass('hide');this.getEditDiv('Alert','a.doneEditing').removeClass('hide');this.getEditDiv(null,'div.profileDivider').removeClass('hide');this.getEditDiv('Alert','a.close').addClass('hide');if(saveMessage!=''){this.getEditDiv(null,'div.alertMessage').text(saveMessage)}else{this.getEditDiv(null,'div.alertMessage').text('Click on a profile section below to edit it.')}this.getEditDiv(editDiv,'span.title').addClass('cancelAll');this.getEditDiv(editDiv,'span.arrowToggle').addClass('cancelAll');this.getEditDiv(null,'a.cancel').addClass('cancelAll');this.getEditDiv(null,'a.cancel').unbind('click.cancelClick');this.getEditDiv(null,'a.cancel').removeClass('cancel');this.getEditDiv(editDiv,'a.cancelAll').click(function(){userPersonal.revert(editDiv,'editAllCancel',false,true)});this.getEditDiv('WIUT',' #wiutToggle').addClass('hide');this.getEditDiv(null,'#editAllMode').val('1');this.getEditDiv(null,'#editSection').val(editDiv);this.getEditDiv(null,'a.save').attr('href','#topPersonal');this.getEditDiv(null,'a.cancelAll').attr('href','#topPersonal');var divsArray=['Favorites','WIUT','Basic','More','Important'];for(var i=0;i<divsArray.length;i++){if(editDiv==divsArray[i]){userPersonal.edit(divsArray[i],2)}else{userPersonal.edit(divsArray[i],0)}}return false},nodeMap:{},getEditDiv:function(divName,divSelector,cache){if(divName==null){divName='profilePersonal';if(this.nodeMap[divName]==undefined){this.nodeMap[divName]={};this.nodeMap[divName]['root']=$('#profilePersonal')}}if(this.nodeMap[divName]==undefined){this.nodeMap[divName]={};this.nodeMap[divName]['root']=$('#profilePersonal #div'+divName)}if(divSelector==null){divSelector='root'}if(this.nodeMap[divName][divSelector]==undefined||cache==false){var root=this.nodeMap[divName]['root'];this.nodeMap[divName][divSelector]=root.find(divSelector)}return this.nodeMap[divName][divSelector]},edit:function(divName,showEdit){this.getEditDiv(divName,'span.editLink').addClass('hide');this.getEditDiv('Favorites','a.editAll').addClass('hide');if(this.getEditDiv(divName,'label',false).hasClass('wrapDisplay')){this.getEditDiv(divName,'label').addClass('wrapEdit');this.getEditDiv(divName,'label').removeClass('wrapDisplay')}if(divName=='WIUT'){this.getEditDiv('WIUT','#wiutToggle').html('more...');this.getEditDiv('WIUT','div.field').removeClass('hideWIUT')}if(showEdit==0){this.getEditDiv(divName,'#'+divName+' #fields'+divName+'').hide();this.getEditDiv(divName,'div.btnpos').addClass('hide');this.getEditDiv(divName,'span.title').addClass('arrowRight');this.getEditDiv(divName,'#'+divName+' .header').unbind('click').click(function(){userPersonal.editAll(divName,'')});this.getEditDiv(divName,'#'+divName+' .header').css('cursor','pointer')}else if(showEdit==2){this.getEditDiv(divName,'input').bind('keyup change',function(){userPersonal.getEditDiv(divName,' #fieldsChanged').val('1')});this.getEditDiv(divName,'textarea').bind('keyup change',function(){userPersonal.getEditDiv(divName,' #fieldsChanged').val('1')});this.getEditDiv(divName,'select').bind('keyup change',function(){userPersonal.getEditDiv(divName,' #fieldsChanged').val('1')});this.getEditDiv(divName,'radio').bind('keyup change',function(){userPersonal.getEditDiv(divName,' #fieldsChanged').val('1')});this.getEditDiv(divName,'checkbox').bind('keyup change',function(){userPersonal.getEditDiv(divName,' #fieldsChanged').val('1')});this.getEditDiv(divName,'div.displayMode').addClass('hide');this.getEditDiv(divName,'div.editMode').removeClass('hide');this.getEditDiv(divName,'div.btnpos').removeClass('hide');this.getEditDiv(divName,'span.arrowToggle').removeClass('hide');this.getEditDiv(divName,'div.hideRow',false).removeClass('hide');this.getEditDiv(divName,'span.title').removeClass('arrowRight').addClass('arrowDown');this.getEditDiv(divName,'fieldset').show();this.getEditDiv(divName,'span.arrowToggle').unbind('click');this.getEditDiv(divName,'span.title').unbind('click')}else{this.getEditDiv(divName,'input, textarea, select, radio, checkbox').bind('keyup change',function(){userPersonal.getEditDiv(divName,'#fieldsChanged').val('1')});this.getEditDiv(divName,'div.displayMode').addClass('hide');this.getEditDiv(divName,'div.editMode').removeClass('hide');this.getEditDiv(divName,'div.btnpos').removeClass('hide');this.getEditDiv(divName,'span.arrowToggle').removeClass('hide');this.getEditDiv(divName,'div.hideRow',false).removeClass('hide');this.getEditDiv(divName,'span.title').removeClass('arrowRight','arrowDown').addClass('arrowDownNoCursor');this.getEditDiv(divName,'fieldset').show();this.getEditDiv(divName,'span.arrowToggle').unbind('click');this.getEditDiv(divName,'span.title').unbind('click');this.getEditDiv(divName,'span.arrowToggle').css('cursor','default');this.getEditDiv(divName,'span.title').css('cursor','default')}this.getEditDiv(divName,null).addClass('tabfrmdotbrd sectbg1');this.getEditDiv(divName,'div.header').removeClass('boxbrdtop pad10');this.getEditDiv(divName,'div.header').addClass('secthead');this.getEditDiv(divName,'span.arrowToggle').addClass('anchorLink');this.getEditDiv(divName,'span.title').addClass('anchorLink');return false},revert:function(divName,mode,dataSaved,resetFields,goToSection){this.getEditDiv(divName,'#fieldsChanged').val('0');if(resetFields==true){resetForm(divName)}if(this.getEditDiv(divName,'label',false).hasClass('wrapEdit')){this.getEditDiv(divName,'label').addClass('wrapDisplay');this.getEditDiv(divName,'label').removeClass('wrapEdit')}if(mode!='editAll'&&mode!='editAllSaved'&&mode!='editAllCancel'){$('#profilePersonal a.cancelAll').addClass('cancel');$('#profilePersonal a.cancelAll').removeClass('cancelAll');this.getEditDiv(divName,'a.cancel').attr('href','#edit'+divName);this.getEditDiv(divName,'a.cancelAll').unbind();this.getEditDiv(divName,'a.cancel').unbind().bind('click.cancelClick',function(){userPersonal.revert(divName,'CancelConfirm',false,true)});$('#profilePersonal a.doneEditing, #profilePersonal div.profileDivider').addClass('hide');$('#profilePersonal #editAllMode').val('0');$('#profilePersonal #editSection').val('none');this.getEditDiv(divName,'fieldset').show();this.getEditDiv(divName,'span.editLink').removeClass('hide');this.getEditDiv('Favorites','a.editAll').removeClass('hide');this.getEditDiv(divName,'div.displayMode').removeClass('hide');this.getEditDiv(divName,'div.editMode').addClass('hide');this.getEditDiv(divName,'div.btnpos').addClass('hide');this.getEditDiv(divName,'span.arrowToggle').addClass('hide');this.getEditDiv(divName,'div.hideRow',false).addClass('hide');this.getEditDiv(divName,'div.profileDivider').addClass('hide');this.getEditDiv(divName,'span.title').removeClass('arrowDown');this.getEditDiv(divName,'span.title').removeClass('arrowDownNoCursor');this.getEditDiv(divName,'span.title').removeClass('arrowRight');this.getEditDiv(divName,'span.title').removeClass('cancelAll');this.getEditDiv(divName,'span.title').unbind('click');this.getEditDiv(divName,'span.title').css('cursor','default');if(mode!='Saved'){$('#profilePersonal div.alertDiv').addClass('hide')}if(divName=='WIUT'){$('.hasVal').addClass('hideWIUT');if($('#wiutCount').val()>5){$('#wiutToggle').removeClass('hide')}}this.getEditDiv(divName,null).removeClass('tabfrmdotbrd sectbg1');this.getEditDiv(divName,'div.header').addClass('boxbrdtop pad10');this.getEditDiv(divName,'div.header').removeClass('secthead')}else{this.getEditDiv(divName,'fieldset').hide();this.getEditDiv(divName,'div.btnpos').addClass('hide');this.getEditDiv(divName,'span.title').removeClass('arrowDown');this.getEditDiv(divName,'span.title').addClass('arrowRight');this.getEditDiv('Favorites','a.save').attr('href','#editFavorites');this.getEditDiv('Favorites','a.cancelAll').attr('href','#editWIUT');this.getEditDiv('WIUT','a.save').attr('href','#editWIUT');this.getEditDiv('WIUT','a.cancelAll').attr('href','#editBasic');this.getEditDiv('Basic','a.save').attr('href','#editBasic');this.getEditDiv('Basic','a.cancelAll').attr('href','#editMore');this.getEditDiv('More','a.save').attr('href','#editMore');this.getEditDiv('More','a.cancelAll').attr('href','#editImportant');this.getEditDiv('Important','a.save').attr('href','#editImportant');this.getEditDiv('Important','a.cancelAll').attr('href','#topPersonal');if($('#editAllMode').val()==1&&mode=='editAllSaved'){if(divName=='Favorites'){if(mode=='editAllSaved'&&dataSaved==true){var alertMessage='You\'ve successfully edited Favorites'}var nextSection='WIUT'}else if(divName=='WIUT'){if(mode=='editAllSaved'&&dataSaved==true){var alertMessage='You\'ve successfully edited What I\'m Up To'}var nextSection='Basic'}else if(divName=='Basic'){if(mode=='editAllSaved'&&dataSaved==true){var alertMessage='You\'ve successfully edited The Basic Stuff'}var nextSection='More'}else if(divName=='More'){if(mode=='editAllSaved'&&dataSaved==true){var alertMessage='You\'ve successfully edited A Little Something More'}var nextSection='Important'}else if(divName=='Important'){if(mode=='editAllSaved'&&dataSaved==true){var alertMessage='You\'ve successfully edited your Important Things'}var nextSection=''}if(alertMessage==''){var alertMessage='Click on a profile section below to edit it'}$('#profilePersonal div.alertMessage').text(alertMessage);if(goToSection!=false){userPersonal.editAll(nextSection,alertMessage)}}}return false}};function ProfileAJAX(fn,dataObj,successFunction){if(fn&&fn!=''){if(typeof window.BASE_URL=='undefined'){window.BASE_URL='/apps/'}$.ajax({url:BASE_URL+'home/ajax/'+fn,data:dataObj,type:'post',dataType:'json',success:function(data){if(data.success==true&&successFunction){successFunction(data)}}})}}function setInputSelection(jqInput,start,end){var tmpInput=jqInput.get(0);if($.browser.msie){var r=tmpInput.createTextRange();r.collapse(true);r.moveStart("character",start);r.moveEnd("character",end-start);r.select()}else if($.browser.mozilla){tmpInput.setSelectionRange(start,end)}}function updateState(countryId,elementID,cityID,schoolID,changeCity){var selBox=document.getElementById(elementID);selBox.options.length=0;selBox.options[selBox.options.length]=new Option('--Select State--','');countryRequest=new AJAX(0,'updateCallbackState');countryRequest.makeRequest(SITEURL+'/ajax/ajax_dropdown2.php?type=state&name='+elementID+'&id='+countryId);if(changeCity==true){setTimeout("updateCity(999999, '"+cityID+"', '"+schoolID+"')",500)}}function submitUpdateState(countryId){countryRequest=new AJAX(0,'updateCallback');countryRequest.makeRequest(SITEURL+'/ajax/ajax_dropdown2.php?type=state&name=submitState&id='+countryId)}function updateCity(stateId,elementID,schoolID){if(stateId==''){stateId=999999}cityRequest=new AJAX(0,'updateCallbackCity');cityRequest.makeRequest(SITEURL+'/ajax/ajax_dropdown2.php?type=city&name='+elementID+'&id='+stateId);if(schoolID!=''){var schoolType=elementID.replace('City','');setTimeout("listSchools(0, '"+schoolType+"', '"+schoolID+"')",500)}}function submitUpdateCity(stateId){cityRequest=new AJAX(0,'updateCallback');cityRequest.makeRequest(SITEURL+'/ajax/ajax_dropdown2.php?type=city&name=submitCity&id='+stateId)}function updateCallbackState(str){eval(str);if(str!=''){selBox.options[0].text='--Select State--'}}function updateCallbackCity(str){eval(str);if(str==''){return}selBox.options[0].text='--Select City--'}function listCountries(countryId,fieldName,cloneHidden){var profileBasic=$('#profileBasic');profileBasic.find('#'+fieldName+'CountrySelect').html('Loading...');$.ajax({type:'POST',url:'/ajax/ajax_selectlist.php',data:'list=country&selectedId='+countryId+'&fieldName='+fieldName,success:function(str){if(fieldName=='highschool'||fieldName=='college'||fieldName=='grad'){profileBasic.find('#'+fieldName+'CountrySelect').html(str);profileBasic.find('#'+fieldName+'Country').change(function(){updateState(profileBasic.find('#'+fieldName+'Country').val(),fieldName+'State',fieldName+'City',fieldName+'SchoolSelect',true);profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')})}else{profileBasic.find('#'+fieldName+'CountrySelect').html(str);profileBasic.find('#'+fieldName+'Country').change(function(){updateState(profileBasic.find('#'+fieldName+'Country').val(),fieldName+'State',fieldName+'City','',true);profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')})}if(cloneHidden==true){profileBasic.find('#'+fieldName+'State').clone().attr('id',fieldName+'StateHidden').attr('name',fieldName+'StateHidden').addClass('hide').appendTo('#'+fieldName+'StateSelect')}}})}function listStates(countryId,stateId,fieldName,cloneHidden){var profileBasic=$('#profileBasic');profileBasic.find('#'+fieldName+'StateSelect').html('Loading...');$.ajax({type:'POST',url:'/ajax/ajax_selectlist.php',data:'list=state&country='+countryId+'&selectedId='+stateId+'&fieldName='+fieldName,success:function(str){if(fieldName=='highschool'||fieldName=='college'||fieldName=='grad'){profileBasic.find('#'+fieldName+'StateSelect').html(str);profileBasic.find('#'+fieldName+'State').change(function(){updateCity(profileBasic.find('#'+fieldName+'State').val(),fieldName+'City',fieldName+'SchoolSelect');profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')})}else{profileBasic.find('#'+fieldName+'StateSelect').html(str);profileBasic.find('#'+fieldName+'State').change(function(){updateCity(profileBasic.find('#'+fieldName+'State').val(),fieldName+'City','');profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')})}if(cloneHidden==true){profileBasic.find('#'+fieldName+'State').clone().attr('id',fieldName+'StateHidden').attr('name',fieldName+'StateHidden').addClass('hide').appendTo('#'+fieldName+'StateSelect')}}})}function listCities(stateId,cityId,fieldName,cloneHidden){var profileBasic=$('#profileBasic');profileBasic.find('#'+fieldName+'CitySelect').html('Loading...');$.ajax({type:'POST',url:'/ajax/ajax_selectlist.php',data:'list=city&state='+stateId+'&selectedId='+cityId+'&fieldName='+fieldName,success:function(str){if(fieldName=='highschool'||fieldName=='college'||fieldName=='grad'){profileBasic.find('#'+fieldName+'CitySelect').html(str);profileBasic.find('#'+fieldName+'City').change(function(){listSchools(profileBasic.find('#'+fieldName+'City').val(),fieldName,fieldName+'SchoolSelect');profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')})}else{profileBasic.find('#'+fieldName+'CitySelect').html(str);profileBasic.find('#'+fieldName+'City').change(function(){profileBasic.find('#fieldsChanged').val('1');profileBasic.find('#divChanged').val('profileBasic')})}if(cloneHidden==true){profileBasic.find('#'+fieldName+'City').clone().attr('id',fieldName+'CityHidden').attr('name',fieldName+'CityHidden').addClass('hide').appendTo('#'+fieldName+'CitySelect')}}})}function listSchools(cityId,schoolType,div,schoolId){var profileBasic=$('#profileBasic');if(cityId!=''){profileBasic.find('#'+schoolType+'SchoolSelect').html('Loading...')}$.ajax({type:'POST',url:'/ajax/ajax_selectlist.php',data:'list='+schoolType+'&city='+cityId+'&selectName='+div+'&selectedId='+schoolId,success:function(str){$('#'+div).html(str);profileBasic.find('#'+div+'School').clone().attr('id',div+'SchoolHidden').attr('name',div+'SchoolHidden').addClass('hide').appendTo('#'+div+'SchoolSelect')}})}function check(){var frmObject=document.profile_contact;if(frmObject.profileCountry.value==1){var str="";str=str+'<a href="javascript:winpopus();" class="normaltextlinkbold">Request new City!</a>';document.getElementById('state_oth').innerHTML=str}else{var str="";str=str+'<input type="text" name="new_city" class="textbox">';document.getElementById('state_oth').innerHTML=str}}function winpopus(){var frmObject=document.profile_contact;var win=window.open('?mysession='+encodeBase64('registration_request_newcity&country='+frmObject.profileCountry.value),'newcity','width=520 ,height=250, scrollbars=yes, maximize=yes')}function setcity1(jNewValue){parent.frames[1].location='?mysession='+encodeBase64('registration_reg_prof_city&state='+jNewValue)}function setschool(jNewValue){var frmObject=document.profile_contact;frmObject.profileCity.value=jNewValue}function showYearbook(sec){var sections=new Array('HighSchool','College','GradSchool');var x=0;while(sections[x]){document.getElementById('yearbook'+sections[x]).style.display='none';if(x!=0){document.getElementById('tab'+sections[x]).className='tabThat tabfrmbrd sectbg1 tabAfter'}else{document.getElementById('tab'+sections[x]).className='tabThat tabfrmbrd sectbg1'}document.getElementById('link'+sections[x]).className='normaltextlinkbold';x++}if(sec=='HighSchool'){x=0}if(sec=='College'){x=1}if(sec=='GradSchool'){x=2}document.getElementById('yearbook'+sec).style.display='';if(x!=0){document.getElementById('tab'+sec).className='tabThis tabfrmbrd sectbg2 tabAfter'}else{document.getElementById('tab'+sec).className='tabThis tabfrmbrd sectbg2'}document.getElementById('link'+sec).className='normaltextbold'}function showDebug(dataObject){if(dataObject.debug){$("div#debug").html(dataObject.debug)}}function initRemoveEntryLinks(){$('#divFeed .content .feed .entry').unbind().bind('mouseenter',function(){$(this).children().children('.edit').show();$(this).one('mouseleave',function(){$(this).children().children('.edit').hide()})});$('#divFeed .content .feed .entry .edit').unbind().click(function(){var feedEntry=$(this).parent().parent();$.ajax({url:'/ajax/profile/feed.php',type:'post',dataType:'json',data:{'hide':$(this).attr('key')},success:function(data){if(data.success){dayContainer=feedEntry.parent();feedEntry.slideUp('normal',function(){$(this).remove();if(dayContainer.children('.entry').length==0){dayContainer.slideUp('normal',function(){$(this).remove()})}})}}})})}function initShowHiddenUpdatesLinks(){$('#divFeed .content .feed .entry a.showHiddenUpdates').unbind().click(function(){$(this).siblings('.hiddenUpdates').toggle('normal');return false})}function initMenuLinks(){$('#divFeed .menu .additionalTypes').bind('mouseenter',function(){$(this).one('mouseleave',function(){$(this).hide()})});$('#divFeed .menu a.pseudoLink').each(function(){$(this).click(function(){loadFeed($(this).attr('type'),0,function(data){$('#divFeed .feed').replaceWith($(data.html).find('.feed'))});return false})});$('#divFeed .menu a.more').click(function(){$('#divFeed .menu .additionalTypes').toggle();return false})}function initTypeSpecificLinks(){$('#divFeed .entry .Gifts .feedUnwrapPG').click(premiumGiftUnwrapPopUp);$('#divFeed .entry .Gifts .vipGiftOpen').click(openVIPGiftFeed);$('#divFeed div.entry .description a').click(function(){$.ajax({data:{page:'profile',type:$(this).parents('div.description').attr('class')},url:'/apps/feedStats',type:'POST'})})}function openVIPGiftFeed(){var vipGiftID=$(this).parents('.entry').find('.vipImageArea span').text();var popup=new VIPGiftOpen(vipGiftID);return false}var VIPGiftProfile={initBanner:function(){VIPGiftProfile.loadGifts(1)},initFunct:function(){$('#vipBanner #vipAbout').click(VIPGiftProfile.clickAbout);$('#vipBanner div.arrowLeft img').click(VIPGiftProfile.clickLeftArw);$('#vipBanner div.arrowRight img').click(VIPGiftProfile.clickRightArw);$('#vipBanner .giftImage').click(VIPGiftProfile.clickViewGift);$('#vipBanner .viewVIPGift').click(VIPGiftProfile.clickViewGift);$('#vipBanner .sendVIPGift').click(VIPGiftProfile.clickSendGift);$('#vipBanner .giveGiftLink').click(VIPGiftProfile.clickSendGift);$('#vipBanner .hasNoVIPGiftLink').click(VIPGiftProfile.clickSendGift);$('#vipBanner .sendVIPMsg').each(function(){var theOtherID=$(this).parents('.giftEachBox').find('.giftRightGive span').text();var data={userid:theOtherID};$(this).mybActionIcons(data,{doMsg:true,token:tok,bindOnly:true,preCallback:function(){return{"aiPrompt":"Thanks for the VIP Gift!","aiTextbox":"Thanks"}}})});if($('#vipBanner').data('open-last-gift')){$('#vipBanner .giftImage:last').trigger('click')}$('#vipBanner').data('open-last-gift',false);if($('#vipBanner').data('open-first-gift')){$('#vipBanner .giftImage:first').trigger('click')}$('#vipBanner').data('open-first-gift',false)},refreshProfile:function(receiverID,senderID){var profileMemberId=$('#userid').val();var sessionMemberId=$('#sessuserid').val();if(receiverID==senderID||profileMemberId==receiverID){VIPGiftProfile.loadGifts(1)}},loadGifts:function(page){var profileMemberId=$('#userid').val();var dataObj={profileMemberId:profileMemberId,page:page};VIPGiftProfile.ajax('GetNextPage',dataObj,VIPGiftProfile.displayGifts);return false},clickLeftArw:function(){var page=parseInt($('#vipBanner input.pageNum').val())-1;VIPGiftProfile.loadGifts(page)},clickRightArw:function(){var page=parseInt($('#vipBanner input.pageNum').val())+1;VIPGiftProfile.loadGifts(page)},clickViewGift:function(){var giftEachBox=$(this).parents('.giftEachBox');var vipGiftID=giftEachBox.find('.viewImg span').text();var prevGiftFunc;if(giftEachBox.prev('.giftEachBox').length>0){prevGiftFunc=function(){giftEachBox.prev('.giftEachBox').find('.giftImage').trigger('click')}}else if($('#vipBanner div.arrowLeft img').length>0){prevGiftFunc=function(){$('#vipBanner').data('open-last-gift',true);$('#vipBanner div.arrowLeft img').trigger('click')}}var nextGiftFunc;if(giftEachBox.next('.giftEachBox').length>0){nextGiftFunc=function(){giftEachBox.next('.giftEachBox').find('.giftImage').trigger('click')}}else if($('#vipBanner div.arrowRight img').length>0){nextGiftFunc=function(){$('#vipBanner').data('open-first-gift',true);$('#vipBanner div.arrowRight img').trigger('click')}}var popup=new VIPGiftOpen(vipGiftID,prevGiftFunc,nextGiftFunc);var imgPath=$(this).parents('.giftEachBox').find('img.giftImage').attr('src');$(this).parents('.giftEachBox').find('img.giftImage').attr('src',imgPath.replace('click_to_open_80','80'));return false},clickSendGift:function(){var theOtherID=$(this).find('span').text();var popup=new VIPGiftGive(theOtherID,VIPGiftProfile.refreshProfile);return false},aboutContent:function(){var about='<div class="textBox">'+'<div class="items">VIP Gifts are the <b>ultimate way</b> to show how much '+'you care on myYearbook. They differ from other gifts in:</div>'+'<div class="items"><b>1.</b> Eye-catching placement on Profile and prominent '+'notification of new gift. No one can miss a VIP Gift. :-)</div>'+'<div class="items"><b>2.</b> VIP Gifts are unique and provide the ultimate in '+'customization.</div>'+'<div class="items"><b>3.</b> The recipient knows you care about them the most. </div>'+'<div class="closeLine"><a class="close normaltextlink" href="#">Close</a></div>'+'</div>';return about},clickAbout:function(){if($('#vipAboutPopup').length>0){return false}if($.browser.msie&&$.browser.version<7){$('select:visible').addClass('curtainHide').hide()}var about=VIPGiftProfile.aboutContent();var offset=$('#vipBanner').offset();offset.left_ab=offset.left;offset.left=offset.left-$.getBodyMarginLeft();$('<div id="vipAboutPopup" class="loading" />').appendTo('body').dragonDrop({type:'window',title:'What\'s Special About VIP Gifts',enableMinMax:false,enableClose:true,curtain:false,width:300,top:120,left:offset.left_ab+630,content:about});if(jQuery.browser.msie){$('#vipAboutPopup').appendTo('body')}$('#vipAboutPopup .closeLine .close').click(VIPGiftProfile.clickCloseAbout);$('#vipAboutPopup .close').click(VIPGiftProfile.clickCloseAbout);return false},clickCloseAbout:function(){$('#vipAboutPopup').slayDragon();if($.browser.msie&&$.browser.version<7){$('select.curtainHide').show()}return false},displayGifts:function(obj){$('#vipBanner div.giftBox').html(obj.str);VIPGiftProfile.initFunct()},ajax:function(fn,dataObj,successFunction){if(fn&&fn!=''){$.ajax({url:'/apps/VIPGiftProfileAJAX/'+fn,data:dataObj,type:'post',dataType:'json',success:function(data){if(data.isInMaintenance){$('#vipBanner .giftBox').html('<div class="maintenance">VIP Gifts is currently undergoing maintenance.<br />Please check back soon!</div>')}else if(data.success==true&&successFunction){successFunction(data)}}})}}};$(function(){initRemoveEntryLinks();initShowHiddenUpdatesLinks();initTypeSpecificLinks();initMenuLinks();$('#divFeed .autograph textarea').focus(quickAutograph.focus);$('#divFeed .autograph textarea').blur(quickAutograph.blur);$('#divFeed .autograph .postAutograph').click(quickAutograph.send);$('#divFeed .newer').click(function(){prevPage=$('#divFeed .feed .day:visible:last').attr('page')-1;$('#divFeed .feed').children(':visible').hide();$('#divFeed .feed').children('[page='+prevPage+']').show();if(prevPage==0){$('#divFeed .newer').hide()};$('#divFeed .older').show();window.location='#recentActivity';return false});$('#divFeed .older').click(function(){currentPage=$('#divFeed .feed .day:visible:last').attr('page');if($('#divFeed .feed').children('[page='+(parseInt(currentPage)+1)+']').length){$('#divFeed .feed').children(':visible').hide();$('#divFeed .feed').children('[page='+(parseInt(currentPage)+1)+']').show();$('#divFeed .newer').show();if($('#divFeed .feed .day:visible .entry:last').attr('lastEntry')==1){$('#divFeed .older').hide()}window.location='#recentActivity';return false}oldestEntry=$('#divFeed .feed .entry:last').attr('time');currentType=$('#divFeed .menu .active').attr('type');loadFeed(currentType,oldestEntry,function(data){currentPage=$('#divFeed .feed .day:visible:last').attr('page');if(typeof currentPage=='undefined'){currentPage=0}else{currentPage++}if($('#divFeed .feed .entry').length<=10){$(data.html).find('.feed .day').each(function(){if($('#divFeed .feed div.day'+$(this).attr('day')).length){$(this).children('.entry').each(function(){$(this).appendTo($('#divFeed .feed div.day'+$(this).attr('day')))})}else{$(this).appendTo('#divFeed .feed')}})}else{$('#divFeed .feed').children().hide();$(data.html).find('.day').each(function(){$(this).appendTo('#divFeed .feed')});$('#divFeed .newer').show()}$('#divFeed .feed').children(':not([page])').each(function(){$(this).attr('page',currentPage)});window.location='#recentActivity'});return false});$('#divFeed .feed .icon img[type]').click(function(){loadFeed($(this).attr('type'),0,function(data){$('#divFeed .feed').replaceWith($(data.html).find('.feed'));$('#divFeed .feed').children().each(function(){$(this).attr('page',0)});$('#divFeed .newer').hide()})})});function fanPagesInit(){if(Profile.isOwnProfile){MemberInterest.addUnlikeCallbackByType('member',function(data){if(data.result===true){var objectSkeleton=$('div.fanCell[data-memberId='+data.item+']','#divFanPages').clone(true);$('div.fanCell[data-memberId='+data.item+']','#divFanPages').remove();for(var index in data.data){if($('div.fanCell[data-memberId='+data.data[index].memberId+']','#divFanPages').length===0){var newObject=objectSkeleton.clone(true);newObject.find('div.removeFan').remove();newObject.attr('data-memberId',data.data[index].memberId);newObject.find('a').attr('title','').attr('href',data.data[index].profileLink);newObject.find('img').attr('title','').attr('src',data.data[index].photo);newObject.find('a.normaltextlinkbold').html(data.data[index].name);newObject.insertAfter('#divFanPages div.fanContainer div.fanCell:last')}}if($('div.fanCell','#divFanPages').length===0){$('#divFanPages').remove()}}});bindRemoveFans()}$('span.more','#divFanPages').one('click',function(){$.ajax({data:{memberId:Profile.profileOwner},url:'/ajax/fanPagesDisplay.php',dataType:'json',success:function(data){$('.reloadArea','#divFanPages').html(data);if(Profile.isOwnProfile){bindRemoveFans()}}})})}function bindRemoveFans(){$('div.fanCell','#divFanPages').bind('mouseenter',function(){$(this).append($('<div class="removeFan">X</div>').click(function(){var fanCell=$(this).parent();$.dragonConfirm('Are you sure you want to stop being a fan of this member?',{width:350,title:'Remove Fan Pages',confirmCallback:function(){MemberInterest.unlikeAndGetObjects('member',fanCell.attr('data-memberId'),$('div.fanCell','#divFanPages').length,0,function(result){$('div.memberInterestError','#divFanPages').remove();fanCell.prepend($('<div class="memberInterestError">'+result.error+'</div>').animate({opacity:1},3000).fadeOut())})}})}))}).bind('mouseleave',function(){$('div.removeFan',$(this)).remove()});$('#FanPages_RemoveAll').click(function(){$.dragonConfirm('Are you sure you want to remove all of your Fan Pages?',{width:350,title:'Remove Fan Pages',confirmCallback:function(){$.ajax({url:SITE_URL+'apps/memberinterests/unlikeAll',data:{interestType:'member',token:stok},dataType:'jsonp',success:function(result){var fanPagesDiv=$('#divFanPages');if(fanPagesDiv.next().is('span')){fanPagesDiv.next().remove()}fanPagesDiv.remove()}})}})})}function loadFeed(feedType,earlierThan,callback){$.ajax({url:'/ajax/profile/feed.php',type:'post',dataType:'json',data:{userId:quickAutograph.getRecipient(),type:feedType,earlierThan:earlierThan,limit:($('#divFeed .feed .entry').length<=10)?10:20},success:function(data){callback(data);$('#divFeed img.loading').hide();if(data.olderEntries==false){$('#divFeed .older').hide();$('#divFeed .feed .day:visible .entry:last').attr('lastEntry',1)}else{$('#divFeed .older').show()}$('#divFeed .feed .icon img[type]').click(function(){loadFeed($(this).attr('type'),0,function(data){$('#divFeed .feed').replaceWith($(data.html).find('.feed'));$('#divFeed .feed').children().each(function(){$(this).attr('page',0)});$('#divFeed .newer').hide()})});initRemoveEntryLinks();initShowHiddenUpdatesLinks();initTypeSpecificLinks()}});$('#divFeed img.loading').show();$('#divFeed .menu a.pseudoLink.active').each(function(){$(this).removeClass('active')});$('#divFeed .menu .additionalTypes').hide();if($('#divFeed .menu a.pseudoLink[type='+feedType+']').addClass('active').length==0){$('#divFeed .menu a.pseudoLink:not([type])').addClass('active')}if($('#divFeed .menu .additionalTypes a[type][type='+feedType+']').length){$('#divFeed .menu a.more').addClass('active').attr('type',feedType)}else{$('#divFeed .menu a.more').removeClass('active')}return false}quickAutograph={captchaToken:null,getTextBox:function(){return $('#divFeed .autograph textarea')},isEmpty:function(){return quickAutograph.getTextBox().val()==''},isDefault:function(){return quickAutograph.getTextBox().val()=='Write something...'},setDefault:function(){quickAutograph.getTextBox().addClass('default').val('Write something...')},blur:function(){if(quickAutograph.isEmpty()){quickAutograph.setDefault()}},setEmpty:function(){quickAutograph.getTextBox().val('').removeClass('default')},focus:function(){if(quickAutograph.isDefault()){quickAutograph.setEmpty()}},getRecipient:function(){return $('#divFeed .autograph .recipientUserId').val()},send:function(){if(quickAutograph.isDefault()){quickAutograph.getTextBox().focus();return false}var data={token:stok,user:quickAutograph.getRecipient(),content:quickAutograph.getTextBox().val(),returnAutograph:false,returnCheckBox:false};if(quickAutograph.captchaToken){data.aiToken=quickAutograph.captchaToken}if(typeof Recaptcha!='undefined'&&quickAutograph.captchaToken){data.recaptcha_response_field=Recaptcha.get_response();data.recaptcha_challenge_field=Recaptcha.get_challenge()}$.ajax({url:'/ajax/profile/autograph.php',type:'post',dataType:'json',data:data,success:function(result){if(result.success=='captcha'){quickAutograph.captchaToken=result.aiToken;if(result.captcha&&result.captcha.length>0){$('div#aiResultBox').remove();quickAutograph.getTextBox().after('<div id="aiResultBox" style="position:relative; margin:3px;" >'+result.captcha+'</div>');$('div#aiResultBox').show()}else{Recaptcha.reload();$('#recaptcha_instructions_error').show()}}else{$('div#aiResultBox').remove();quickAutograph.captchaToken=null;quickAutograph.setDefault();loadFeed(null,null,function(data){$('#divFeed .feed').replaceWith($(data.html).find('.feed'))})}successMessageDiv=document.createElement('div');$(successMessageDiv).html(result.msg).addClass('result').hide().appendTo($('#divFeed .autograph')).slideDown('normal',function(){var smDiv=$(successMessageDiv);setTimeout(function(){smDiv.slideUp()},2000)})}})}};Profile={isOwnProfile:false,init:function(){Profile.profileOwner=$('#userid').val();Profile.isOwnProfile=$('#userid').val()==MyYearbook.Member.id;fanPagesInit()},initFallingImage:function(){grphcs=new Array(1);Image0=new Image();Image0.src=grphcs[0]=fallimage;Image1=new Image();Amount=18;Ypos=new Array();Xpos=new Array();Speed=new Array();Step=new Array();Cstep=new Array();var htmlStr='<div style="position:relative">';for(i=0;i<Amount;i++){var P=Math.floor(Math.random()*grphcs.length);rndPic=grphcs[P];htmlStr+='<img id="si'+i+'" src="'+rndPic+'" class="fallingimage" style="position:absolute;top:0px;left:0px">'}htmlStr+='</div>';$('<div />').attr('id','fallingimagediv').css({position:'absolute',top:'0px',left:'0px'}).html(htmlStr).appendTo(document.body);WinHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;WinWidth=(window.innerWidth-70)||document.documentElement.clientWidth||document.body.clientWidth;for(i=0;i<Amount;i++){Ypos[i]=Math.round(Math.random()*WinHeight);Xpos[i]=Math.round(Math.random()*WinWidth);Speed[i]=Math.random()*5+3;Cstep[i]=0;Step[i]=Math.random()*0.1+0.05}},fall:function(bool){if(!bool){return}var WinHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var WinWidth=(window.innerWidth-70)||document.documentElement.clientWidth||document.body.clientWidth;var hscrll=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;var wscrll=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;for(i=0;i<Amount;i++){sy=Speed[i]*Math.sin(90*Math.PI/180);sx=Speed[i]*Math.cos(Cstep[i]);Ypos[i]+=sy;Xpos[i]+=sx;if(Ypos[i]>WinHeight){Ypos[i]=-60;Xpos[i]=Math.round(Math.random()*WinWidth);Speed[i]=Math.random()*5+3}document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i])+'px';document.getElementById("si"+i).style.top=Ypos[i]+hscrll+'px';Cstep[i]+=Step[i]}setTimeout('Profile.fall(fallingboolean)',20)},hideSectionPrompt:function(link){var t=link.parent().html().replace(/\<.*\>/g,'').replace(/\\\r|\\\n/g,'').replace(/^\\\s*|\\\s*$/g,'');lastHide=link.parents('.tabfrmbrd');popup=DD.createDraggable({width:260,height:167,title:'Hide Section',color:'white'}).centerOnScreen();$("#"+popup.attr("content_id")).html('<div style="text-align:center;font-size:12px;padding:10px;">Are you sure you want to remove<br>'+t+' from your profile?<br>If you want to add it back later,<br>click "Manage Profile Boxes"<br>below your photo.<br><br><img src="'+IMAGE_URL+'btn_yes.gif" class="normaltextlinkbold" style="cursor:pointer;margin-right:10px;" alt="Yes" onclick="$(\'.DD_Win\').each(function(){DD.destroy($(this).attr(\'id\'));});Profile.hideSection();"><img src="'+IMAGE_URL+'btn_no.gif" class="normaltextlinkbold" style="cursor:pointer" alt="No" onclick="$(\'.DD_Win\').each(function(){DD.destroy($(this).attr(\'id\'));});"></div>')},hideSection:function(){var d=lastHide;d.hide();d.prev().hide();$('#manageProfileBoxes :checkbox[@value='+d.attr('id')+']').attr('checked','');$.ajax({type:'POST',url:'/profilecustomizer/ajax.php',data:'action=hide&section='+d.attr('id')})},bookmarksite:function(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,"")}else if(window.opera&&window.print){var elem=document.createElement('a');elem.setAttribute('href',url);elem.setAttribute('title',title);elem.setAttribute('rel','sidebar');elem.click()}else if(document.all){window.external.AddFavorite(url,title)}},initCustomizer:function(){if($('iframe#profileAd').size()>0){$('iframe#profileAd').slideUp()}scroll(0,0);if((document.getElementById('customizer'))&&(document.getElementById('customizer').style.top=='48px')){return false}$('#navbar').hide();$('<div />').attr('id','custCurtain').css({position:'absolute',top:'0px',width:'950px',height:'205px','background-color':'#fff','text-align':'center',border:'1px solid #36c','border-top-width':'0px','z-index':'100',display:'none'}).html('<br><br><br><br><br><br><h1 style="color:#333">Loading...</h1>').appendTo('.profiletable td:first');$('#contentarea').animate({marginTop:'216px'},500,function(){$('#custCurtain').show()});$('.profiletable td:first').append('<iframe id="customizer" src="/profilecustomizer/index.php" frameborder="0" style="position:absolute;top:48px;width:950px;height:215px;z-index:501;overflow:hidden;border:1px solid #36c;border-top-width:0px;background-color:#fff;display:none;"></iframe>');$('#customizer').fadeIn(500);return false},newOwnablePhoto:function(){var data=$('div.ownablePhotoData').get(ownedIdx);$('#ownableBidPrice').val($(data).find('span.ownableNextPrice').text());$('#defaultProfilePhoto').attr('src',$(data).find('span.ownableThumbPath').text());$('#ownableBuyBtn').unbind('click').bind('click',function(){var pid=$('div.ownablePhotoData').get(ownedIdx);pid=parseInt($(pid).find('span.ownablePhotoId').text());Profile.doOwnedBid(this,pid)})},doOwnedBid:function(obj,pid){var input=$(obj).siblings('input');var amt=input.val().replace(',','');if(isNaN(amt)){input.addClass('error').focus();return false}input.removeClass('error');amt=parseInt(amt);$.ajax({url:SITEURL+'/apps/owned/ajax/bid/',dataType:'json',type:'post',data:{pid:pid,bid:amt,from:'profile',preload:'true',token:tok},success:function(data){if(data.result){$('div[@id= "ownable.'+data.data.photo_id+'"]').find('span.ownableNextPrice').text(data.data.next_price);$('div#ownedBidSuccess').hide().remove();$(obj).parents('table.divOwned').before('<div id="ownedBidSuccess" style="display:none;">Your purchase was successful!</div>').siblings('div#ownedBidSuccess').slideDown('medium');setTimeout('$("div#ownedBidSuccess").slideUp("medium", function() { $(this).remove(); });',3000);Profile.newOwnablePhoto()}else if(data.error){$('div#ownedBidSuccess').hide().remove();$(obj).parents('table.divOwned').before('<div id="ownedBidSuccess" style="display:none;">'+data.errStr+'</div>').siblings('div#ownedBidSuccess').slideDown('medium');setTimeout('$("div#ownedBidSuccess").slideUp("medium", function() { $(this).remove(); });',3000)}else{$('div#ownedBidSuccess').hide().remove();$(obj).parents('table.divOwned').before('<div id="ownedBidSuccess" style="display:none;">An error occurred!</div>').siblings('div#ownedBidSuccess').slideDown('medium');setTimeout('$("div#ownedBidSuccess").slideUp("medium", function() { $(this).remove(); });',3000)}}})},showProfile:function(selected){var sections=['Basic','Personal','Photos','Autographs'];if($('#memorableLinkBox').length<1){sections=['Basic','Photos','Autographs']}var x=0;while(sections[x]){document.getElementById('profile'+sections[x]).style.display='none';if(x!=0){document.getElementById('tab'+sections[x]).className='tabfrmbrd sectbg1'+(sections[x]!='Autographs'?' tabAfter':'')}else{document.getElementById('tab'+sections[x]).className='tabfrmbrd sectbg1'}x++}if(selected=='Basic'||selected=='Personal'){$('#profileMoodStatus').show()}else{$('#profileMoodStatus').hide()}if(selected=='Basic'){x=0;$('#updateStatusContainer').show()}if(selected=='Personal'){x=1;$('#updateStatusContainer').hide()}document.getElementById('profile'+selected).style.display='';if(x!=0){document.getElementById('tab'+selected).className='tabThis tabfrmbrd sectbg2'+(selected!='Autographs'?' tabAfter':'')}else{document.getElementById('tab'+selected).className='tabThis tabfrmbrd sectbg2'}document.getElementById('link'+selected).blur()},loadUserImages:function(memberId,page){if(typeof memberId=='undefined'){return false}if(typeof page=='undefined'){var page=1}$.ajax({url:SITE_URL+'apps/memberimage/profile/'+parseInt(page),dataType:'jsonp',data:{cb:'Profile.loadUserImagesCallback',memberid:parseInt(memberId)}});return true},loadUserImagesCallback:function(result){if(result.success==true){$('#profilePhotos').html(result.markup);$('#profilePhotos a.pagelink').click(function(){var page=1;var text=$(this).text();if(!isNaN(text)){page=parseInt(text)}else if(text=='>'){var currentPage=$('#profilePhotos span.pagelink').text();if(!isNaN(currentPage)){page=parseInt(currentPage)+1}}else if(text=='<'){var currentPage=$('#profilePhotos span.pagelink').text();if(!isNaN(currentPage)){page=parseInt(currentPage)-1}}$('#profilePhotos').html('<div style="height:100px;">&nbsp;</div><div class="loadingContent">Loading...</div><div style="height:100px;">&nbsp;</div>');Profile.loadUserImages($('#userid').val(),page);return false})}return true},loadAutographs:function(memberId,page){if(typeof memberId=='undefined'){return false}if(typeof page=='undefined'){var page=1}$.ajax({url:SITE_URL+'apps/autograph/get',dataType:'jsonp',data:{cb:'Profile.loadAutographsCallback',memberid:parseInt(memberId),page:parseInt(page)}});return true},loadAutographsCallback:function(result){if(result.success==true){$('#profileAutographs div.autographArea').html(result.markup);$('#profileAutographs div.autographArea div.paging a.pagelink').click(function(){var page=1;var text=$(this).text();if(!isNaN(text)){page=parseInt(text)}else if(text=='>'||text=='&gt;'){var currentPage=parseInt($('#profileAutographs div.autographArea div.paging span.pagelink').html());if(currentPage>=1){page=currentPage+1}}else if(text=='<'||text=='&lt;'){var currentPage=parseInt($('#profileAutographs div.autographArea div.paging span.pagelink').html());if(currentPage>=2){page=currentPage-1}}$('html,body').animate({scrollTop:80},100);$('#profileAutographs div.autographArea').html('<div style="height:100px;">&nbsp;</div><div class="loadingContent">Loading...</div><div style="height:100px;">&nbsp;</div>');Profile.loadAutographs($('#userid').val(),page);return false});$('#profileAutographs div.autographArea a.othersAutographPop').each(function(){var t=$(this);var data={userid:t.attr('data-memberId'),firstName:t.attr('data-firstName'),noShow:true,redirectPage:false,showConfirmation:true};t.mybActionIcons(data,{doAutograph:true,token:tok,bindOnly:true})});$('#profileAutographs div.autographArea a.othersMessagePop').each(function(){var t=$(this);var data={userid:t.attr('data-memberId'),firstName:t.attr('data-firstName')};t.mybActionIcons(data,{doMsg:true,token:tok,bindOnly:true})});$('#profileAutographs div.autographArea a.delete').click(function(){var link=$(this);$.dragonConfirm('Are you sure you want to remove this autograph?',{width:350,title:'Remove Autograph',confirmCallback:function(){var autographId=link.attr('data-uaid');$('#profileAutographs div.autographArea tr[data-uaid="'+autographId+'"]').fadeOut(500);Profile.deleteAutograph($('#userid').val(),autographId)}});return false});$('#profileAutographs div.autographArea a.reportAutographSpam').click(function(e){$('.DD_Win').remove();var offset=$('#maincontainer').offset();var xPos=offset.left+60;var yPos=e.pageY;if(parseInt(yPos)>500){yPos=yPos-250}var reportSpamBox=DD.createDraggable({offsetLeft:xPos,offsetTop:yPos,width:460,height:190,title:'Report Spam'});var contentId=reportSpamBox.attr('content_id');var autographId=$(this).attr('data-uaid');$('#'+contentId).html('<div id="reportimagediv"><div class="msgSpace">Is this autograph an advertisement or other SPAM? Report it to us so we can look into it!</div><br/><p><div><button onclick="Profile.reportAutograph('+autographId+','+xPos+','+yPos+');">Report Spam</button>&nbsp;<button onClick="$(\'.DD_Win\').remove();">Cancel</button></div></p></div><div class="spamNote"><strong>Note</strong>: This will remove all autographs this user has ever left on your profile.</div>');e.preventDefault()});$('#profileAutographs div.autographArea a.approve').click(function(){var autographId=$(this).siblings('a.delete').attr('data-uaid');$('#profileAutographs div.autographArea tr.approve[data-uaid="'+autographId+'"]').fadeOut(500);$.ajax({url:SITE_URL+'apps/autograph/approve',dataType:'jsonp',data:{cb:'Profile.approveAutographCallback',memberid:parseInt($('#userid').val()),autographid:parseInt(autographId)}});return false})}else if(typeof result.maintenance!='undefined'&&result.maintenance===true){$('#profileAutographs').html('<div class="noAutographs">Autographs are currently undergoing maintenance</div>')}if(typeof result.captcha!='undefined'&&$('#profileAutographs textarea').length>0){$('#autographCaptcha').html(result.captcha)}else{$('#autographCaptcha').html('')}return true},reportAutograph:function(autographId,xPos,yPos){$('.DD_Win').remove();$.ajax({type:'post',data:{autograph_id:autographId,token:$('#token').val()},dataType:'text',url:'/ajax/reportSpam.php',success:function(){var ConfrimreportSpamBox=DD.createDraggable({offsetLeft:xPos,offsetTop:yPos,width:381,height:195,title:'Confirmation'});var contentId=ConfrimreportSpamBox.attr('content_id');var curDateTime=new Date();$('#'+contentId).html('<div id="reportimagediv" style="text-align:left;width:340px;"><p><span style="color:#009;font-weight:bold;">'+curDateTime.toLocaleString()+'</span></p><p>Thank you for your report.</p><p>Anytime you receive a message containing an advertisement, a link to another website, or any other type of SPAM, please notify us just like you did here.</p><div style="text-align:center;"><button onclick="$(\'.DD_Win\').remove();$(\'#linkAutographs\').trigger(\'click\');"> OK </button></div></div>')}})},submitAutograph:function(memberId,content){if(content==''||content.match(/sign .*? yearbook/i)!=null){return false}$('#profileAutographs img.submit').hide();$('#profileAutographs span.submit').show();var sendData={cb:'Profile.submitAutographCallback',memberid:parseInt(memberId),content:content,token:tok};if(typeof Recaptcha!='undefined'){sendData.recaptcha_response_field=Recaptcha.get_response();sendData.recaptcha_challenge_field=Recaptcha.get_challenge()}$.ajax({url:SITE_URL+'apps/autograph/add',dataType:'jsonp',data:sendData})},submitAutographCallback:function(result){$('#profileAutographs span.submit').hide();$('#profileAutographs img.submit').show();if(result.success===true){$('#profileAutographs textarea').val('');if(result.approval===true){$('#profileAutographs div.autographArea div.approvalMessage').remove();$('#profileAutographs div.autographArea').prepend(result.markup)}else{Profile.loadAutographsCallback(result)}}else{$.dragonAlert('Sorry, your autograph could not be posted.')}if(typeof result.captcha!='undefined'){$('#autographCaptcha').html(result.captcha)}else{$('#autographCaptcha').html('')}},deleteAutograph:function(memberId,autographId){$.ajax({url:SITE_URL+'apps/autograph/delete',dataType:'jsonp',data:{cb:'Profile.deleteAutographCallback',memberid:parseInt(memberId),autographid:parseInt(autographId)}})},deleteAutographCallback:function(result){if(result.success===true){$('#profileAutographs div.autographArea tr[data-uaid="'+result.autographid+'"]').remove()}else{$('#profileAutographs div.autographArea tr[data-uaid="'+result.autographid+'"]').fadeIn('fast');alert('An error occurred and this autograph could not be deleted. Please try again later.')}},approveAutographCallback:function(result){if(result.success===true){$('#profileAutographs div.autographArea tr.approve[data-uaid="'+result.autographid+'"]').remove()}else{$('#profileAutographs div.autographArea tr.approve[data-uaid="'+result.autographid+'"]').fadeIn('fast');alert('An error occurred and this autograph could not be approved. Please try again later.')}},getWhateverIWant:function(memberId){$.ajax({url:SITE_URL+'apps/whateveriwant/get',dataType:'jsonp',data:{cb:'Profile.getWhateverIWantCallback',memberid:parseInt(memberId)}})},getWhateverIWantCallback:function(result){if(result.success===true){var markup=result.content;if(result.own===true&&result.content==''&&result.widgets.length==0){markup='<div class="noContentMsg sectbg2">You haven\'t added anything here :-(<br><a class="normaltextlink" href="/?mysession=cmVnaXN0cmF0aW9uX3doYXRldmVyaXdhbnQ=">Add something now!</a></div>'}else if(result.content!=''&&result.widgets.length>0){markup+='<br>'}$.each(result.widgets,function(){if(result.own===true){markup+='<img src="'+IMAGE_URL+'dragon_drop/whitew_x.gif" style="cursor:pointer;display:block;" class="deleteWidget" data-wid="'+this.widget_id+'" alt="Remove">'}markup+='<div class="w'+this.widget_id+'" style="margin-bottom:4px;">'+this.widget_code+'</div>'});$('#divWhatever div.sectcontbrd').html(markup);$('#divWhatever img.deleteWidget').click(function(){var link=$(this);$.dragonConfirm('Are you sure you want to remove this widget?',{width:350,title:'Remove Widget',confirmCallback:function(){Profile.deleteWidget(link.attr('data-wid'))}})});if(typeof result.style=='string'){$('head').append('<style class="whateveriwant_style" type="text/css">'+result.style+'</style>')}}else{$('#divWhatever div.sectcontbrd').html('<div class="noContentMsg sectbg2">Content couldn\'t be loaded :-(</div>')}},deleteWidget:function(widgetId){$.ajax({url:SITE_URL+'apps/whateveriwant/deletewidget',dataType:'jsonp',data:{cb:'Profile.deleteWidgetCallback',memberid:parseInt($('#userid').val()),wid:parseInt(widgetId)}})},deleteWidgetCallback:function(result){if(result.success===true){$('#divWhatever div.w'+result.wid).prev('img.deleteWidget').andSelf().remove()}else{alert('This widget could not be deleted.')}}};