var dashTabs;var cid;window.addEvent('domready',function(){updateProfileCompletion();configureDashTabs();refreshSpotlight();var rotateAnnouncement=function(){var complete=0;$$('span.announcement').each(function(announcement){if(announcement.getStyle('display')!='none'){var _next=announcement.nextSibling;if(!complete){if(!$chk(_next)||$type(_next)!="element"){_next=announcement.parentNode.firstChild;}
announcement.get('tween',{property:'opacity',duration:500}).start(1,0).chain(function(){announcement.setStyle('display','none');if($chk(_next)&&$chk(_next.setStyle)&&$type(_next.setStyle)=='function'){_next.setStyle('opacity',0);_next.setStyle('display','block');_next.get('tween',{property:'opacity',duration:1500}).start(0,1);}});complete=1;}}});};rotateAnnouncement.periodical(10000);var sendRecommend=$('sendRecommend');var recommendText=$('recommendText');var recommendList=$(MESSAGE_FOLDER_RECOMMEND+'_messages_list');if($chk(sendRecommend)){sendRecommend.addEvent('click',function(){if($chk(recommendText)&&$chk(recommendText.style)){if(recommendText.getStyle('display')=="block"){recommendText.setStyle('display',"none");}
else{recommendText.setStyle('display',"block");}}
if($chk(recommendList)){if(recommendList.hasClass('recommend')){recommendList.removeClass('recommend');}
else{recommendList.addClass('recommend');}}});}
checkURLParameters();configureTinyMCEs();hide_working_dialog();});function configureDashTabs(){$('dashtab_inbox').addEvent('click',function(){new Fx.Reveal($('inboxMenu')).toggle();});$('dashtab_sent').addEvent('click',function(){new Fx.Reveal($('sentMenu')).toggle();});$('dashtab_profile').addEvent('click',function(){new Fx.Reveal($('profileMenu')).toggle();});$('dashtab_mynetwork').addEvent('click',function(){new Fx.Reveal($('networkMenu')).toggle();});$('dashtab_mypostings').addEvent('click',function(){new Fx.Reveal($('postingsMenu')).toggle();});if($('dashtab_mygroups')){$('dashtab_mygroups').addEvent('click',function(){new Fx.Reveal($('groupsMenu')).toggle();});}
$('dashtab_mysyndication').addEvent('click',function(){new Fx.Reveal($('syndicationMenu')).toggle();});$('dashtab_myaccount').addEvent('click',function(){new Fx.Reveal($('accountMenu')).toggle();});dashTabs=new slideTabs();dashTabs.addTab($('dashtab_home'),$('dash_home'),function(){dashSectionReload('recent_activity');});dashTabs.addTab($('dashtab_inbox'),$('dash_inbox'),function(){dashInboxTabs.clickFirst(true);});dashTabs.addTab($('dashtab_sent'),$('dash_sent'),function(){dashSentTabs.clickFirst(true);});dashTabs.addTab($('dashtab_profile'),$('dash_profile'),function(){dashProfileTabs.clickFirst(true);});dashTabs.addTab($('dashtab_mynetwork'),$('dash_mynetwork'),function(){dashMyNetworkTabs.clickFirst(true);});dashTabs.addTab($('dashtab_mypostings'),$('dash_mypostings'),function(){dashMyPostingsTabs.clickFirst(true);});dashTabs.addTab($('dashtab_mygroups'),$('dash_mygroups'),function(){dashMyGroupsTabs.clickFirst(true);});dashTabs.addTab($('dashtab_mysyndication'),$('dash_mysyndication'),function(){dashMySyndicationTabs.clickFirst(true);});dashTabs.addTab($('dashtab_myaccount'),$('dash_myaccount'),function(){dashMyAccountTabs.clickFirst(true);});dashTabs.addTab($('dashtab_view'),$('dash_view'));dashTabs.clickTab($('dashtab_home'));dashInboxTabs=new slideTabs();dashInboxTabs.tabSelectClass='active';dashInboxTabs.addTab($('subnav_inbox_messages'),$('inbox_messages'),function(){getFolder(MESSAGE_FOLDER_INBOX);});dashInboxTabs.addTab($('subnav_inbox_invitations'),$('inbox_invitations'),function(){getFolder(MESSAGE_FOLDER_INVITES);});dashInboxTabs.addTab($('subnav_inbox_recommendation'),$('inbox_recommendation'),function(){getFolder(MESSAGE_FOLDER_RECOMMEND);});dashInboxTabs.addTab($('subnav_inbox_requests'),$('inbox_requests'),function(){getFolder(MESSAGE_FOLDER_REQUEST);});dashInboxTabs.addTab($('subnav_inbox_compose'),$('inbox_compose'),function(){resetCompose();});dashInboxTabs.addTab($('subnav_inbox_transfer'),$('inbox_transfer'),function(){});dashSentTabs=new slideTabs();dashSentTabs.tabSelectClass='active';dashSentTabs.addTab($('subnav_sent_messages'),$('sent_messages'),function(){getFolder(MESSAGE_FOLDER_SENT);});dashSentTabs.addTab($('subnav_sent_invitations'),$('sent_invitations'),function(){getFolder(MESSAGE_FOLDER_SENT_INVITES);});dashSentTabs.addTab($('subnav_sent_recommendations'),$('sent_recommendations'),function(){getFolder(MESSAGE_FOLDER_SENT_RECOMMENDATIONS);});dashSentTabs.addTab($('subnav_sent_requests'),$('sent_requests'),function(){getFolder(MESSAGE_FOLDER_SENT_REQUEST);});dashProfileTabs=new slideTabs();dashProfileTabs.tabBaseClass='';dashProfileTabs.tabSelectClass='active';dashProfileTabs.addTab($('subnav_profile_personal'),$('profile_personal'));dashProfileTabs.addTab($('subnav_profile_professional'),$('profile_professional'),function(){show_working_dialog('Loading professional tab ...',false,true);$('work_history_results').empty();$('work_history_results').set('load',{evalScripts:true,onSuccess:function(){$('business_directory_results').empty();$('business_directory_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('business_directory_results').load('/w/dashboard_section_profile_business_directory/');}});$('work_history_results').load('/w/dashboard_section_profile_work_history/');});dashProfileTabs.addTab($('subnav_profile_education'),$('profile_education'),function(){show_working_dialog('Loading education tab ...',false,true);$('school_history_results').empty();$('school_history_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('school_history_results').load('/w/dashboard_section_profile_school_history/');});dashProfileTabs.addTab($('subnav_profile_contact'),$('profile_contact'));dashProfileTabs.addTab($('subnav_profile_rss'),$('profile_rss'),function(){show_working_dialog('Loading RSS tab ...',false,true);$('rss_results').empty();$('rss_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('rss_results').load('/w/dashboard_section_profile_rss/');});dashProfileTabs.addTab($('subnav_profile_import'),$('profile_import'));dashMyNetworkTabs=new slideTabs();dashMyNetworkTabs.tabSelectClass='active';dashMyNetworkTabs.addTab($('subnav_mynetwork_network'),$('mynetwork_network'),function(){$('mynetwork_import_list').hide();$('subnav_mynetwork_import').removeClass('active');dash_myNetworkReload();});dashMyNetworkTabs.addTab($('subnav_mynetwork_search'),$('mynetwork_search'),function(){$('mynetwork_import_list').hide();$('subnav_mynetwork_import').removeClass('active');dash_networkSearchReload();});dashMyNetworkTabs.addTab($('subnav_mynetwork_import'),$('mynetwork_import'),function(){});dashMyNetworkTabs.addTab($('subnav_mynetwork_invites_history'),$('mynetwork_invites_history'),function(){$('mynetwork_import_list').hide();$('subnav_mynetwork_import').removeClass('active');getInvitesHistory();});dashMyPostingsTabs=new slideTabs();dashMyPostingsTabs.tabSelectClass='active';dashMyPostingsTabs.addTab($('subnav_mypostings_videos'),$('mypostings_videos'),function(){$('video_results').empty();$('video_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();SqueezeBox.assign($('video_results').getElements('a[rel=boxed]'),{parse:'rev'});}});$('video_results').load('/w/dashboard_section_mypostings_videos/');});dashMyPostingsTabs.addTab($('subnav_mypostings_blogs'),$('mypostings_blogs'),function(){$('blog_results').empty();$('blog_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('blog_results').load('/w/dashboard_section_mypostings_blogs/');});dashMyPostingsTabs.addTab($('subnav_mypostings_documents'),$('mypostings_documents'),function(){$('documents_results').empty();$('documents_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('documents_results').load('/w/dashboard_section_mypostings_documents/');});dashMyPostingsTabs.addTab($('subnav_mypostings_events'),$('mypostings_events'),function(){$('event_results').empty();$('event_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('event_results').load('/w/dashboard_section_mypostings_events/');});dashMyPostingsTabs.addTab($('subnav_mypostings_funding'),$('mypostings_funding'),function(){$('funding_requests').empty();$('funding_requests').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('funding_requests').load('/w/dashboard_section_mypostings_funding_requests/');});dashMyPostingsTabs.addTab($('subnav_mypostings_jobs'),$('mypostings_jobs'),function(){$('job_posting_results').empty();$('job_posting_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('job_posting_results').load('/w/dashboard_section_mypostings_jobs/');});dashMyPostingsTabs.addTab($('subnav_mypostings_rfps'),$('mypostings_rfps'),function(){$('rfp_results').empty();$('rfp_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();configureDatePickers(true);},onFailure:function(){hide_working_dialog();}});$('rfp_results').load('/w/dashboard_section_mypostings_rfps/');});dashMyPostingsTabs.addTab($('subnav_mypostings_marketplace'),$('mypostings_marketplace'),function(){show_working_dialog('Loading marketplace postings tab ...',false,true);$('m2m_results').empty();$('m2m_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('m2m_results').load('/w/dashboard_section_mypostings_m2m/');});dashMyGroupsTabs=new slideTabs();dashMyGroupsTabs.tabSelectClass='active';dashMyGroupsTabs.addTab($('subnav_mygroups_groups'),$('mygroups_groups'),function(){$('group_results').empty();$('group_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('group_results').load('/w/dashboard_section_mygroups_groups/');});dashMySyndicationTabs=new slideTabs();dashMySyndicationTabs.tabSelectClass='active';dashMySyndicationTabs.addTab($('subnav_mysyndication_profile'),$('mysyndication_profile'));dashMySyndicationTabs.addTab($('subnav_mysyndication_blogs'),$('mysyndication_blogs'));dashMyAccountTabs=new slideTabs();dashMyAccountTabs.tabSelectClass='active';dashMyAccountTabs.addTab($('subnav_myaccount_essentials'),$('myaccount_essentials'));dashMyAccountTabs.addTab($('subnav_myaccount_contact'),$('myaccount_contact'));dashMyAccountTabs.addTab($('subnav_myaccount_login'),$('myaccount_login'));dashMyAccountTabs.addTab($('subnav_myaccount_notifications'),$('myaccount_notifications'),function(){rpc_loadCountries($$('.country_dropdown'));rpc_loadStates($$('.state_dropdown'));rpc_loadCities($$('.city_dropdown'));rpc_loadBlogCategories($$('.blog_category_dropdown'));rpc_loadM2MCategories($$('.m2m_category_dropdown'));});dashMyAccountTabs.addTab($('subnav_myaccount_order_history'),$('myaccount_order_history'),function(){show_working_dialog('Loading purchases tab ...',false,true);$('order_history').empty();$('order_history').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('order_history').load('/w/dashboard_section_myaccount_order_history/');});}
function checkURLParameters(){var URLvars_str=window.location.href.substring(window.location.href.indexOf('p/dashboard/')+12);var URLvars=URLvars_str.parseQueryString();if($chk(URLvars.dashtab)){dashTabs.clickTab($(URLvars.dashtab),true);if($chk(URLvars.subtabs)&&$chk(URLvars.subtab)){eval(URLvars.subtabs).clickTab($(URLvars.subtab),true);}
hide_working_dialog();}
if($chk(URLvars.add_to_invite)){loadInviteList(URLvars.add_to_invite);}
if($chk(URLvars.new_message_id)||$chk(URLvars.new_message_name)||$chk(URLvars.new_message_request)){var req_message=function(){newMessage(((URLvars.new_message_subject)?URLvars.new_message_subject:''),((URLvars.new_message_body)?URLvars.new_message_body:''),{'to_account_id':URLvars.new_message_id,'to_account_name':URLvars.new_message_name,'is_request':(URLvars.new_message_request)?1:0});};req_message.delay(1500);}
if($chk(URLvars.cid)){cid=URLvars.cid;}}
function updateProfileCompletion(){new Request.JSON({method:"get",url:"/",onComplete:function(r){var _complete=0;var _incomplete='<ul>';var dash_home_complete_prompt=$('completion_prompt');if($chk(dash_home_complete_prompt)){dash_home_complete_prompt.setStyle('display',"none");$each(r,function(stage,_link){if(stage.status){_complete+=stage.weight;if($chk($('subnav_'+_link))){$('subnav_'+_link).getElement('a').addClass('complete');}}
else{if($chk($('subnav_'+_link))){$('subnav_'+_link).getElement('a').removeClass('complete');}
_incomplete+='<li>Complete your <a href="/p/dashboard/dashtab=dashtab_profile&subtabs=dashProfileTabs&subtab=subnav_profile_'+stage.tab+'">'+stage.desc+'</a></li>';dash_home_complete_prompt.style.display='inline';}});_incomplete+='</ul>';$('completion_text').set('html','Profile '+_complete+'% Complete');$('completion_bar').setStyle('width',_complete+'%');dash_home_complete_prompt.removeEvents('click');dash_home_complete_prompt.addEvent('click',function(){efalert('Profile Completion',_incomplete);});}}}).get({'rpc_method':'getProfileCompletion'});}
function colWidth(amt){var left=$$('.dash_home_left');var right=$$('.dash_home_right');var lwidth=amt+'px';var rwidth=(704-amt)+'px';left.each(function(_item){_item.setStyle('width',lwidth);});right.each(function(_item){_item.setStyle('width',rwidth);});}
function refreshSpotlight(){var fadeItems=$$('.spotlight_item');var fadeLength=fadeItems.length;fadeItems.each(function(element,index){if(index!=0){element.fade('out');}});function startFade(){var fadeNum=0;nextFade.periodical(10000,this);function nextFade(){fadeItems.each(function(element,index){element.fade('out');});fadeItems[fadeNum].fade('in');if(fadeNum<(fadeLength-1)){fadeNum++;}
else{fadeNum=0;}}}
startFade();}
function hideUsernameStatuses(){$$('.customname').each(function(i){i.setStyle('display',"none");});}
function checkExistingUsername(username){if(!username){username=$('profile_username').value;}
if(username!=""&&username!=checkExistingUsername.usernameChecked){checkExistingUsername.usernameChecked=username;if(typeof(checkExistingUsername.usernameCheck)!='undefined'&&$type(checkExistingUsername.usernameCheck.cancel)=='function'&&checkExistingUsername.usernameCheck.running){checkExistingUsername.usernameCheck.cancel();}
checkExistingUsername.usernameCheck=new Request.JSON({method:"get",url:"/",onRequest:function(){hideUsernameStatuses();$('profile_username_checking').setStyle('display',"block");},onComplete:function(rJ){hideUsernameStatuses();if(!rJ){$('profile_username_good').setStyle('display',"block");}
else{if(rJ==-1){$('profile_username_bad').setStyle('display',"block");}
else if(rJ==-2){$('profile_username_bad_format').setStyle('display',"block");}}}}).get({'rpc_method':"checkExistingUsername",'username':username});}
else if(!username){hideUsernameStatuses();}}
function saveUsername(username){if(!username){username=$('profile_username').value;}
new Request.JSON({method:"get",url:"/",onRequest:function(){hideUsernameStatuses();},onComplete:function(rJ){hideUsernameStatuses();if(!rJ){var link_container=$('profile_username_link_container');var link_container_a=link_container.getElement('a');$('profile_username_input_container').setStyle('display',"none");$('profile_username_good').set('html',"Your username has been saved!");$('profile_username_good').setStyle('display',"block");link_container_a.set('href',link_container_a.innerHTML+'/'+username);if(!Browser.Engine.trident){link_container_a.innerHTML+='/<strong>'+username+'</strong>';}
link_container.setStyle('display',"block");}
else{if(rJ==-1){$('profile_username_bad').setStyle('display',"block");}
else if(rJ==-2){$('profile_username_bad_format').setStyle('display',"block");}}}}).get({'rpc_method':"saveUsername",'username':username});}
function getFolder(folder,offset,limit){if(!limit){limit=500;}
new Request.JSON({url:"/",method:"get",onComplete:function(folder_items){var folder_list_id=folder+"_messages_list";if($chk($(folder_list_id))&&$chk(folder_items)){var folder_list=$(folder_list_id);var message_count=0;folder_list.empty();$each(folder_items,function(message_data){message_count++;if($chk(message_data)&&message_data.message_id){message_data.folder=folder;var message=new EFMessage(message_data);var messageEl=new Element('li').inject(folder_list);var checkbox=new Element('input',{'type':'checkbox','value':message.message_id,'class':'left'}).inject(messageEl);var profileLink=new Element('a',{'href':'javascript:void(0);','class':'view'}).inject(messageEl);profileLink.addEvent('click',function(){showMessage(message);});var _from_account_id;var _from_account_name;if($chk(message.passing_account_id)&&$chk(message.passing_account_name)){_from_account_id=message.passing_account_id;_from_account_name=message.passing_account_name;}
else{_from_account_id=message.account_id;_from_account_name=message.account_name;}
var profileLinkDetails=new Element('div',{'class':'profile_info','html':'<img class="left" src="'
+WS_UPLOAD+'images/accounts/'+_from_account_id+'/tiny" />'
+'<div class="name">'+_from_account_name+'</div>'+'<div class="date">'
+message.date_created+'</div>'}).inject(profileLink);var messageView=new Element('div',{'class':'message_item','html':'<span class="message_title">'
+strip_tags(message.subject).substring(0,50)
+'</span><br /><span class="message_preview">'
+strip_tags(message.body).substring(0,60)+'...</span>'}).inject(profileLink);var clear=new Element('div',{'class':'clear'}).inject(messageEl);switch(folder){case MESSAGE_FOLDER_INBOX:if(message.unread==1){messageEl.addClass('messages_unread');}
break;case MESSAGE_FOLDER_INVITES:if(message.unread==1){messageEl.addClass('messages_unread');}
break;case MESSAGE_FOLDER_NOTIFICATIONS:if(message.unread==1){messageEl.addClass('messages_unread');}
break;case MESSAGE_FOLDER_REQUEST:if(message.unread==1){messageEl.addClass('messages_unread');}
break;default:break;}
if(typeof showMessageID.show_msgid!='undefined'&&showMessageID.show_msgid==message_data.message_id){showMessageID.show_msgid=null;profileLink.fireEvent('click');}}});if(message_count==0){folder_list.set('html','<li class="nomessages">You have no items in this folder.</li>');}
assignSqueezeBox();}}}).get({'rpc_method':'getMyMessageFolder','folder':folder,'offset':offset,'limit':limit});}
function showMessageID(msgid,msgtype){showMessageID.show_msgid=msgid;msgstack=$(msgtype+'_messages_list').getElements('li');$each(msgstack,function(stackitem,idx){var stackitem_id=stackitem.getElement('input').value;var stackitem_a=stackitem.getElement('a.view');if(msgid==stackitem_id){stackitem_a.fireEvent('click');}});}
function showMessage(message){var messageitem=new Element('div',{'class':'full_view'});var _passing_account_id=null;var _passing_account_name=null;if($chk(message.passing_account_id)&&$chk(message.passing_account_name)){_passing_account_id=message.passing_account_id;_passing_account_name=message.passing_account_name;}
var profilelink=new Element('div',{'class':'profile_link','html':'<a href="/p/profile/id='
+message.account_id+'" target="_new">'+message.account_name+'</a><div class="date">'
+message.date_created+'</div><img src="'+WS_UPLOAD+'images/accounts/'+message.account_id
+'/medium" />'}).inject(messageitem);if($chk(_passing_account_id)&&$chk(_passing_account_name)){var originalsender=new Element('div',{'class':'originalsender_link','html':'Passed along by:<br />'
+'<img src="'+WS_UPLOAD+'images/accounts/'+_passing_account_id
+'/tiny" /><a href="/p/profile/id='+_passing_account_id+'" target="_new">'
+_passing_account_name+'</a>'}).inject(profilelink);}
var buttonlist=new Element('ul',{'class':'message_buttons'}).inject(messageitem);new Element('div',{'class':'message_body','html':message.body}).inject(messageitem);switch(message.folder){case MESSAGE_FOLDER_INBOX:new Element('li',{'class':'circle_arrow','html':'Reply'}).addEvent('click',function(){message.reply();}).inject(buttonlist);new Element('li',{'class':'circle_arrow','html':'Forward'}).addEvent('click',function(){message.forward();}).inject(buttonlist);new Element('li',{'class':'circle_arrow','html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);new Element('li',{'html':'<a class="circle_alert" href="/w/reportthis/report_type=message&item_id='+message.message_id+'&about='+message.account_id+'" rel="boxed">Report</a>'}).inject(buttonlist);break;case MESSAGE_FOLDER_SENT:new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_INVITES:new Element('li',{'class':'circle_arrow','html':'Send Message'}).addEvent('click',function(){newMessage('Pending Invite','',{'to_account_id':message.account_id,'to_account_name':message.account_name});}).inject(buttonlist);new Element('li',{'class':'circle_arrow','html':'Accept'}).addEvent('click',function(){message.acceptInvite();}).inject(buttonlist);new Element('li',{'html':'Decline'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_SENT_INVITES:new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_NOTIFICATIONS:new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_REQUEST:new Element('li',{'class':'circle_arrow','html':'Reply'}).addEvent('click',function(){message.reply();}).inject(buttonlist);new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);var passAlongLi=new Element('li',{'style':'display:none','id':'passAlongLi','class':'pass_along'}).inject(buttonlist,'bottom');var passAlongSearch=new Element('input',{'type':'text','id':'passAlongSearch'}).inject(passAlongLi);passAlongSearch.addEvent('keyup',function(){EFMessage.lookupRecipient(passAlongSearch,{'message':message});});new Element('li',{'class':'circle_arrow','html':'Pass Along'}).addEvent('click',function(e){e=new Event(e);if(passAlongLi.style.display=="block")
passAlongLi.style.display="none";else
passAlongLi.style.display="block";e.stop();}).inject(buttonlist);break;case MESSAGE_FOLDER_SENT_REQUEST:new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_RECOMMEND:new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_SENT_RECOMMENDATIONS:new Element('li',{'html':'Delete'}).addEvent('click',function(){message.del();}).inject(buttonlist);break;case MESSAGE_FOLDER_FUNDING_REQUESTS:new Element('li',{'html':'Edit'}).addEvent('click',function(){window.location="/p/newfinancerequest/id="+message.message_id;}).inject(buttonlist);new Element('li',{'html':'View'}).addEvent('click',function(){window.location="/p/viewfinancerequestdetail/id="+message.message_id;}).inject(buttonlist);break;case MESSAGE_FOLDER_PURCHASES:return openPurchase(message.message_id);break;case MESSAGE_FOLDER_CLASSIFIEDS_OFFERING:new Element('li',{'html':'View'}).addEvent('click',function(){window.location="/p/classifiedsdetail/t=offering&id="+message.message_id;}).inject(buttonlist);break;case MESSAGE_FOLDER_CLASSIFIEDS_SEEKING:new Element('li',{'html':'View'}).addEvent('click',function(){window.location="/p/classifiedsdetail/t=seeking&id="+message.message_id;}).inject(buttonlist);break;default:break;}
var clear=new Element('div',{'class':'clear'}).inject(messageitem);var shortSubject=message.subject.substring(0,80);$('dash_message_subject').set('html',shortSubject);$('dash_message_view').empty();messageitem.inject($('dash_message_view'));dashTabs.clickTab($('dashtab_view'));message.markAsRead();assignSqueezeBox();}
function newMessage(subject,body,options){var to_account_id;var to_network=0;var _is_request;if(options){if(options.is_request){is_request=1;}
else{is_request=0;}
if(options.to_account_id){to_account_id=options.to_account_id;}
else{to_account_id=null;}
if(options.to_account_name){to_account_name=options.to_account_name;}
else{to_account_name='Member';}
if(options.to_network){to_network=1;}
else{to_network=0;}}
dashTabs.clickTab($('dashtab_inbox'));dashInboxTabs.clickTab($('subnav_inbox_compose'));var _form=document.forms.dash_message_compose;_form.subject.value=subject;_form.dash_compose_body.value=body;tinyMCE.get('dash_compose_body').load();if(to_account_id){var _to_types=_form.to_type;$each(_to_types,function(type_el){if(type_el.value=="account"){type_el.click();}});_form.to_account_id.value=to_account_id;_form.to_member_search.value=to_account_name;}
else if(to_network){var _to_types=_form.to_type;$each(_to_types,function(type_el){if(type_el.value=="network"){type_el.click();}});}
if(is_request){_form.is_request.checked=true;}
else{_form.is_request.checked=false;}
_form.to_account_id.value=to_account_id;}
function resetCompose(){var _form=document.forms.dash_message_compose;_form.subject.value='';_form.dash_compose_body.value='';_form.is_request.checked=false;$each(document.forms.dash_message_compose.to_type,function(type_el){if(type_el.value!="account"){type_el.checked=false;}
else{type_el.checked=true;}});_form.to_member_search.value='';_form.to_account_id.value='';loadCompose();}
function loadCompose(){new Request.JSON({method:"get",url:"/",onComplete:function(result){$('compose_network_count').set('html',result.network_count);}}).get({'rpc_method':'getMessageCenterInfo'});}
function sendMessage(_form){tinyMCE.get('dash_compose_body').save();if(_form.dash_compose_body.value==""){eferror('Error sending message','You must specify a message body');return false;}
if(_form.subject.value==""){eferror('Error sending message','You must specify a message subject');return false;}
if(!_form.to_type=="network"&&!(_form.to_type=="account"&&_form.to_account_id.value>0)){eferror('Error sending message','You must specify a message recipient');return false;}
new Request.JSON({url:"/",method:"post",onComplete:function(result){if(result==1){efalert('Success',"Your message has been sent",function(){resetCompose();updateMessageCounts();dashTabs.clickTab($('dashtab_sent'),true);});}
else{eferror('Error sending message',"Sorry, there was an error sending this message. Please try again later.");}}}).post(_form);}
function addSchoolHistory(){var school_history_form=$('school_history_form').clone();school_history_form.inject('school_history_results','top');school_history_form.getElement('ul').reveal();}
function addWorkHistory(){var work_history_form=$('work_history_form').clone();work_history_form.inject('work_history_results','top');work_history_form.getElement('ul').reveal();}
function addJobPosting(){var job_posting_form=$('job_posting_form').clone();job_posting_form.inject('job_posting_results','top');job_posting_form.getElement('ul').reveal();}
function addBusinessDirectory(){var business_directory_form=$('business_directory_form').clone();var bd_form_item_uid=uniqid();business_directory_form.getElement('input[name^=bd_form_item_uid]').value=bd_form_item_uid;business_directory_form.inject('business_directory_results','top');business_directory_form.getElement('ul').reveal();}
function addDocuments(){var documents_form=$('documents_form').clone();var documents_form_uid=uniqid();documents_form.getElement('input[name^=form_item_uid]').value=documents_form_uid;documents_form.inject('documents_results','top');documents_form.getElement('ul').reveal();}
function addRSS(){var rss_form=$('rss_form').clone();rss_form.inject('rss_results','top');rss_form.getElement('ul').reveal();}
function addVideoPosting(){var video_form=$('video_form').clone();var video_form_uid=uniqid();video_form.getElement('input[name^=form_item_uid]').value=video_form_uid;video_form.inject('video_results','top');video_form.getElement('ul').reveal();}
function addBlog(){var blog_form=$('blog_form').clone();var blog_data_uid='blog_data_'+uniqid();blog_form.inject('blog_results','top');blog_form.getElement('textarea[name^=blog_data]').id=blog_data_uid;configureTinyMCEs($(blog_data_uid));blog_form.getElement('ul').reveal();}
function addEventPosting(){var event_form=$('event_form').clone();event_form.inject('event_results','top');event_form.getElement('ul').reveal();configureDatePickers();}
function addRFPPosting(){var rfp_form=$('rfp_form').clone();var rfp_form_uid=uniqid();rfp_form.getElement('input[name^=form_item_uid]').value=rfp_form_uid;rfp_form.inject('rfp_results','top');rfp_form.getElement('ul').reveal();configureDatePickers(true);}
function addM2MPosting(){var m2m_form=$('m2m_form').clone();m2m_form.inject('m2m_results','top');m2m_form.getElement('ul').reveal();}
function addGroupPosting(){$('btnAddGrp').hide();$('group_form').getElement('form').setProperty('id','frmnewgroup');$('group_form').setStyle('display',"block");$('group_form').getElement('ul').reveal();}
function deleteDashHistory(history_type,history_type_id){efconfirm('Confirm',"Are you sure you wish to delete this? There is no undo!",function(cnf){if(cnf){new Request.JSON({url:'/',onComplete:function(success){var _history=$(history_type+"_"+history_type_id);var _parent=_history.getParent().getParent();_parent.destroy();}}).get({rpc_method:"deleteDashboardHistory",history_type:history_type,history_type_id:history_type_id});}});}
function autoAssignTwitterCheck(){var twit_option=readCookie('twit_option');if(twit_option=='true'){$('twit_option').set('checked',true);}}
function EFtoTwitterStatus(){var twit_option=readCookie('twit_option');if(twit_option!='true'){if($('twit_option').get('checked')==true){createCookie('twit_option','true',7);}}
else{if($('twit_option').get('checked')==false){eraseCookie('twit_option');}}}
function dashHomeStatusUpdateSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($chk(rJ.success)){$('account_current_status').set('html',rJ.new_status);$('account_current_status_duration').set('html',rJ.new_status_duration);hide_working_dialog();efalert('Success',"Updated status successfully!");scroll(0,0);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}},onFailure:function(){hide_working_dialog();}}).post(f);}
function showDashHomeSectionFilter(section,root_el){$('dashSectionFilterDiv').empty();$('dashSectionFilterDiv').set('load',{evalScripts:true,onSuccess:function(){var xy=findPos(root_el);$('dashSectionFilterDiv').setStyle('left',xy.x+'px');$('dashSectionFilterDiv').setStyle('top',xy.y+'px');new Fx.Reveal($('dashSectionFilterDiv'),{duration:'normal'}).reveal();}});$('dashSectionFilterDiv').load('/w/dashboard_home_edit_options/section='+section);}
function dashSectionSaveSettings(section,f){new Request.JSON({url:"/",method:"post",onComplete:function(success){dashSectionReload(section,function(){new Fx.Reveal($('dashSectionFilterDiv'),{duration:'normal'}).dissolve();});}}).post(f);}
function dashSectionAddWallPost(section,f){if(f.wall_post_content.value!=""){addWallPost(f,function(){dashSectionReload(section);});}
else{return false;}}
function dashSectionReload(section,success_cb,complete_cb){$('dashboard_section_'+section).empty();$('dashboard_section_'+section).set('html','<li>Loading ...</li>');$('dashboard_section_'+section).set('load',{evalScripts:true,onFailure:function(){efalert('Error',"There was a problem loading the content!");},onComplete:function(){if($chk(complete_cb)&&$type(complete_cb)=='function'){complete_cb();}},onSuccess:function(){if($chk(success_cb)&&$type(success_cb)=='function'){success_cb();}}});$('dashboard_section_'+section).load('/w/dashboard_section_'+section+'/');}
function dashProfilePersonalFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.photo_path.value){FileFormSubmitPseudoForm('profile_personal_photo_frm',f.photo_path,'saveDashboardSection','submit_profile_personal_photo',function(text){var temp_ts=new Date().getTime();f.profile_personal_image_thumb.src=f.profile_personal_image_thumb.src+'/'+temp_ts;$('dash_home_main_photo').src=$('dash_home_main_photo').src+'/'+temp_ts;hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);showDashTab('profile','personal',true);});}
else{hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);showDashTab('profile','personal',true);}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashProfileProfessionalFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.resume_path.value){FileFormSubmitPseudoForm('profile_professional_resume_frm',f.resume_path,'saveDashboardSection','submit_profile_professional_resume',function(text){$('current_resume_link').set('href',text);$('current_resume_path').show();$('resume_path').set('value','');hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);});}
else{hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);showDashTab('profile','professional',true);}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashProfileProfessionalWorkHistoryFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_profile_work_history/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashProfileProfessionalBusinessDirectoryFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.bd_logo_path.value||f.bd_company_attach_1.value||f.bd_company_attach_2.value||f.bd_company_attach_3.value){bdFileUploadQueue=new IFrameFileUploadQueue();var bd_files=new Array(f.bd_logo_path,f.bd_company_attach_1,f.bd_company_attach_2,f.bd_company_attach_3);$each(bd_files,function(bdf){if(bdf.value){bdFileUploadQueue.chain(function(){var o=new Hash();o.set('lastItem',this.isLastItem()?true:false);o.set('f',f);FileFormSubmitPseudoForm('profile_profile_professional_bd_file_frm',bdf,'saveDashboardSection','submit_profile_professional_bd_files',function(text,_o){if(_o.lastItem){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);if($chk(_o.f)){_o.f.empty();_o.f.parentNode.load('/w/dashboard_section_profile_business_directory/id='+rJ.id);}}},[new Element('input',{type:"hidden",name:"bd_form_item_uid",value:f.bd_form_item_uid.value})],o);});}});var chainStackLen=bdFileUploadQueue.$chain.length;for(var x=0;x<chainStackLen;x++){bdFileUploadQueue.callChain();}}
else{hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_profile_business_directory/id='+rJ.id);}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashProfileEducationFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashProfileEducationSchoolHistoryFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_profile_school_history/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyPostingsDocumentsFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.file_path.value){FileFormSubmitPseudoForm('profile_personal_library_file_frm',f.file_path,'saveDashboardSection','submit_profile_personal_library_file',function(){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_mypostings_documents/id='+rJ.id);},[new Element('input',{type:"hidden",name:"form_item_uid",value:f.form_item_uid.value})]);}
else{hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_mypostings_documents/id='+rJ.id);}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashProfileRSSFormFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_profile_rss/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function ImportResultsConfirmDialog(imported_contacts,f){if($type(imported_contacts)=='hash'){var sb;var importer_div=new Element('div',{'id':"OpenInvite_Import_Results",'html':"<h1>Select Contacts You Want to Import</h1>",'styles':{'display':"none"}});var importer_select_all=new Element('a',{'href':"#",'html':"Select All",'class':"right circle_arrow",'events':{'click':function(){var import_checkboxes=importer_div.getElements('input[type=checkbox]');$each(import_checkboxes,function(i){i.checked=true;});return false;}}}).inject(importer_div,'top');var importer_invitelist_div=new Element('div').inject(importer_div);var importer_invite_list=new Element('ul',{'class':'rounded_list'}).inject(importer_invitelist_div);var c=0;$each(imported_contacts,function(name,email){var email_row=new Element('li');new Element('input',{'id':"import_email_"+c,'name':"import_selections",'type':"checkbox",'value':email}).inject(email_row);new Element('span',{'html':"<label for='import_email_"+c+"'>"+email+"</label>"}).inject(email_row);new Element('span',{'html':name}).inject(email_row);email_row.inject(importer_invite_list);c++;});var selected_imported_contacts=new Array();new Element('button',{'value':"Add Contacts to Invite List",'class':"clear submit_button right",'events':{'click':function(){var import_selections=importer_div.getElements('input[type=checkbox]');$each(import_selections,function(import_selection){if(import_selection.checked){selected_imported_contacts.push(import_selection.value);}});if(selected_imported_contacts.length>=1){$('invite_list').empty();loadInviteList(selected_imported_contacts);}
sb.close();if($chk(f)){f.reset();}}}}).inject(importer_div);importer_div.inject(document.body);sb=SqueezeBox.open($('OpenInvite_Import_Results'),{handler:'adopt',size:{x:550,y:550}});importer_div.setStyle('display',"block");return true;}
else{return false;}}
function dashMyNetworkImportSocialFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Retrieving contacts from source ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();if(rJ.count===0){efalert('No contacts','No contacts were found in your account for importing.');return;}
$('import_list').empty();$('import_list').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('import_list').load('/w/dashboard_section_mynetwork_import_list/');$('mynetwork_import').hide();$('mynetwork_import_list').show();efalert('Instructions',"<p>Add Selected Contacts to your Invitation List:</p><ul><li>Un-select contacts you do not wish to invite, then click 'Add Selected To List.'</li><li>Repeat this for each page of your contacts, then click 'Next Step.'</li></ul>");}else{if(rJ.errors.internal||rJ.errors.login||rJ.errors.contacts){var errmsg="";$each(rJ.errors,function(reason,e){errmsg+='<strong>Error '+e+'</strong>: '+reason+'<br/>';});efalert('Sorry!',"Errors found, please try again later!<br/><br/>"+errmsg);hide_working_dialog();}
else{hide_working_dialog();FormSubmitErrorHandler(f,rJ);}}}}}).post(f);}
function dashMyNetworkImportCSVFormSubmit(f){if(f.csv_file.value){show_working_dialog("Analyzing CSV file ...",false,true);FileFormSubmitPseudoForm('profile_mynetwork_import_csv_file_frm',f.csv_file,'saveDashboardSection','submit_mynetwork_import_csv_file',function(res){var rJ=eval('('+res+')');if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){var imported_contacts=$H(rJ.contacts);hide_working_dialog();ImportResultsConfirmDialog(imported_contacts,f);}
else{if(rJ.errors.internal||rJ.errors.login||rJ.errors.contacts){var errmsg="";$each(rJ.errors,function(reason,e){errmsg+='<strong>Error '+e+'</strong>: '+reason+'<br/>';});efalert('Errors',"Critical error, please try again later!<br/><br/>"+errmsg);hide_working_dialog();}
else{hide_working_dialog();FormSubmitErrorHandler(f,rJ);}}}});}}
function dashMyPostingsVideoFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.video_file.value){hide_working_dialog();show_working_dialog("Uploading and converting video, please be patient ...",false,true);var progress_meter=f.getElement('.video_upload_converting');progress_meter.setStyle('display',"block");FileFormSubmitPseudoForm('profile_mypostings_video_file_frm',f.video_file,'saveDashboardSection','submit_mypostings_videos_files',function(){progress_meter.setStyle('display',"none");hide_working_dialog();efalert('Success',"Video uploaded and converted successfully!");scroll(0,0);f.parentNode.set('load',{pNode:f.parentNode,evalScripts:true,onSuccess:function(){SqueezeBox.assign(this.options.pNode.getElements('a[rel=boxed]'),{parse:'rev'});}});f.empty();f.parentNode.load('/w/dashboard_section_mypostings_videos/id='+rJ.id);},[new Element('input',{type:"hidden",name:"form_item_uid",value:f.form_item_uid.value})]);}
else{hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_mypostings_videos/id='+rJ.id);}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyPostingsBlogFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_mypostings_blogs/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyPostingsEventFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.parentNode.set('load',{evalScripts:true,onSuccess:function(){configureDatePickers();}});f.empty();f.parentNode.load('/w/dashboard_section_mypostings_events/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyPostingsJobFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_mypostings_jobs/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyPostingsRFPFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.rfp_logo.value||f.rfp_file_attach_1.value||f.rfp_file_attach_2.value||f.rfp_file_attach_3.value){rfpFileUploadQueue=new IFrameFileUploadQueue();var rfp_files=new Array(f.rfp_logo,f.rfp_file_attach_1,f.rfp_file_attach_2,f.rfp_file_attach_3);$each(rfp_files,function(rfpf){if(rfpf.value){rfpFileUploadQueue.chain(function(){var o=new Hash();o.set('lastItem',this.isLastItem()?true:false);o.set('f',f);FileFormSubmitPseudoForm('profile_mypostings_rfp_file_frm',rfpf,'saveDashboardSection','submit_mypostings_rfps_files',function(text,_o){if(_o.lastItem){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);if($chk(_o.f)){_o.f.empty();_o.f.parentNode.set('load',{evalScripts:true,onSuccess:function(){configureDatePickers(true);}});_o.f.parentNode.load('/w/dashboard_section_mypostings_rfps/id='+rJ.id);}}},[new Element('input',{type:"hidden",name:"form_item_uid",value:f.form_item_uid.value})],o);});}});var chainStackLen=rfpFileUploadQueue.$chain.length;for(var x=0;x<chainStackLen;x++){rfpFileUploadQueue.callChain();}}
else{hide_working_dialog();efalert('Success',"Saved successfully!<br />Your listing will be reviewed<br />for approval as soon as possible.");scroll(0,0);f.empty();f.parentNode.set('load',{evalScripts:true,onSuccess:function(){configureDatePickers(true);}});f.parentNode.load('/w/dashboard_section_mypostings_rfps/id='+rJ.id);}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyPostingsM2MFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.empty();f.parentNode.load('/w/dashboard_section_mypostings_m2m/id='+rJ.id);}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function loadGroupResults(){$('group_results').empty();$('group_results').set('load',{evalScripts:true,onSuccess:function(){scroll(0,0);hide_working_dialog();}});$('group_results').load('/w/dashboard_section_mygroups_groups/')
$('btnAddGrp').show();}
function dashMyGroupsGroupFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){if(f.group_photo_path.value){FileFormSubmitPseudoForm('profile_mygroups_group_file_frm',f.group_photo_path,'saveDashboardSection','submit_mygroups_groups_files',function(){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);loadGroupResults();},[new Element('input',{type:"hidden",name:"form_item_uid",value:f.form_item_uid.value})]);}
else{myf=f;hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);loadGroupResults();}}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyAccountContactFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);showDashTab('myaccount','contact');}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dashMyAccountLoginFormSubmit(f){new Request.JSON({url:"/",method:"post",onRequest:function(){show_working_dialog("Saving ...",false,true);FormSubmitErrorHandler(f);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.success)&&rJ.success===true){hide_working_dialog();efalert('Success',"Saved successfully!");scroll(0,0);f.reset();}
else{FormSubmitErrorHandler(f,rJ);hide_working_dialog();}}}}).post(f);}
function dash_myAccountSaveNotifications(f){parentDiv=$('myaccount_notifications');new Request.JSON({url:'/rpc/dashboard/myaccount/notifications/save.php',method:"post",onRequest:function(){showOverlayLoadingImg(parentDiv.id);},onComplete:function(rJ,rT){if($type(rJ)=='object'){if($chk(rJ.result_code)&&rJ.result_code==0){efalert('Success',"Settings saved successfully!");hideOverlayLoadingImg(parentDiv.id);}
else{efalert('Error',"There was an error. We could not save your settings at this time. Please Try again.");hideOverlayLoadingImg(parentDiv.id);}}else{efalert('Error',"There was an error. We could not save your settings at this time. Please Try again.");hideOverlayLoadingImg(parentDiv.id);}},onFailure:function(){hideOverlayLoadingImg(parentDiv.id);}}).post(f);}
function dash_myNetworkReload(form_id){parentDiv=$('mynetwork_network');networkList=parentDiv.getElement('.network_list');networkListTemplate=parentDiv.getElement('.network_list_template').getFirst('li');if($chk($(form_id))){myform=$(form_id);}else{myform=null;}
showOverlayLoadingImg(parentDiv.id);new Request.JSON({url:'/rpc/dashboard/network/myNetwork.php',onRequest:function(){networkList.empty();},onSuccess:function(rJ){hide_working_dialog();if($chk(rJ.mynetwork)){if(rJ.mynetwork.length>0){rJ.mynetwork.each(function(e){var copy=networkListTemplate.clone();copy.getElements('.view_profile_link').each(function(l){l.set('href','/p/profile/id='+e.id);});copy.getElement('.send_message_link').set('href','/p/dashboard/dashtab=dashtab_inbox&subtabs=dashInboxTabs&subtab=subnav_inbox_compose&new_message_id='+e.id+'&new_message_name='+e.fullname);copy.getElement('.fullname').set('html',e.fullname);copy.getElement('.profile_image').set('src',WS_UPLOAD+'images/accounts/'+e.id+'/small');if(e.pending_invite){copy.addClass('pending');copy.getElement('.network_status').hide();}else{copy.getElement('.remove_from_network_link').set('onclick',"removeFromNetwork('"+e.id+"', function(){dash_myNetworkReload('frm_searchMyNetwork');});");}
if(e.why_here.length>80){copy.getElement('.why_here').set('html',e.why_here.substr(0,80)+'...');}else{copy.getElement('.why_here').set('html',e.why_here);}
if($chk(e.shared_contacts_count)&&e.shared_contacts_count>0){copy.getElement('.shared_contacts_link').set('href','/popups/network/sharedContacts.php?id='+e.id);copy.getElement('.shared_contacts_count').set('html',e.shared_contacts_count);}else{copy.getElement('.shared_contacts_link').hide();}
if(e.city.length>0&&(e.state.length>0||e.country.length>0)){copy.getElement('.city').set('html',e.city+', ');}else{copy.getElement('.city').set('html',e.city);}
if(e.state.length>0){copy.getElement('.state').set('html',e.state);}else if(e.country.length>0){copy.getElement('.country').set('html',e.country);}
var i=0;var industry_string='';var count=e.industries.length;while(i<(count-1)){industry_string=industry_string+e.industries[i]+', ';i++;}
if(typeof e.industries[i]!='undefined'){industry_string=industry_string+e.industries[i];copy.getElement('.industry').set('html',industry_string);}else{copy.getElement('.industry').hide();}
copy.inject(networkList);});var count=rJ.mynetwork.length;if(count>0){var _page_start=1+(parseInt(rJ.query.page)*parseInt(rJ.query.limit))
if(count<rJ.query.limit){var _page_end=count+(parseInt(rJ.query.page)*parseInt(rJ.query.limit));}else{var _page_end=parseInt(rJ.query.limit)+(parseInt(rJ.query.page)*parseInt(rJ.query.limit));}
parentDiv.getElements('.pagination').each(function(e){if(rJ.query.page>0){$(e).getElement('.left').getElement('.enabled').show();$(e).getElement('.left').getElement('.disabled').hide();}else{$(e).getElement('.left').getElement('.enabled').hide();$(e).getElement('.left').getElement('.disabled').show();}
if(_page_end>=rJ.query.total_results){$(e).getElement('.right').getElement('.enabled').hide();$(e).getElement('.right').getElement('.disabled').show();}else{$(e).getElement('.right').getElement('.enabled').show();$(e).getElement('.right').getElement('.disabled').hide();}
$(e).getElement('.page_total').set('html',rJ.query.total_results);$(e).getElement('.page_start').set('html',_page_start);$(e).getElement('.page_end').set('html',_page_end);$(e).show();});}
if($chk(rJ.query.txt)){parentDiv.getElement('.querytxt').set('value',rJ.query.txt);}
parentDiv.getElement('.page').set('value',rJ.query.page);parentDiv.getElement('.network_list_empty').hide();assignSqueezeBox();}else{parentDiv.getElement('.network_list_empty').show();parentDiv.getElements('.pagination').each(function(e){e.hide();});}}else{parentDiv.getElement('.network_list_empty').show();parentDiv.getElements('.pagination').each(function(e){e.hide();});}
hideOverlayLoadingImg(parentDiv.id);},onFailure:function(){hide_working_dialog();hideOverlayLoadingImg(parentDiv.id);parentDiv.getElement('.network_list_empty').show();parentDiv.getElements('.pagination').each(function(e){e.hide();});efalert('Notice','There was a loading error, please try again.');}}).get(myform);}
function dash_networkSearchReload(form_id){parentDiv=$('mynetwork_search');networkList=parentDiv.getElement('.network_list');networkListTemplate=parentDiv.getElement('.network_list_template').getFirst('li');if($chk($(form_id))){myform=$(form_id);}else{myform=null;}
showOverlayLoadingImg(parentDiv.id);new Request.JSON({url:'/rpc/dashboard/network/search.php',onRequest:function(){networkList.empty();},onSuccess:function(rJ){hide_working_dialog();if($chk(rJ.network)){if(rJ.network.length>0){rJ.network.each(function(e){var copy=networkListTemplate.clone();copy.getElements('.view_profile_link').each(function(l){l.set('href','/p/profile/id='+e.id);});copy.getElement('.send_message_link').set('href','/p/dashboard/dashtab=dashtab_inbox&subtabs=dashInboxTabs&subtab=subnav_inbox_compose&new_message_id='+e.id+'&new_message_name='+e.fullname);copy.getElement('.fullname').set('html',e.fullname);copy.getElement('.profile_image').set('src',WS_UPLOAD+'images/accounts/'+e.id+'/small');if(e.pending_invite){copy.getElement('.network_status').set('html','Invite Pending');}else if(e.in_my_network){copy.getElement('.network_status').set('html','In My Network');}else{copy.getElement('.add_to_network_link').set('href','/p/dashboard/dashtab=dashtab_mynetwork&subtabs=dashMyNetworkTabs&subtab=subnav_mynetwork_import&add_to_invite='+e.id);}
if(e.why_here.length>80){copy.getElement('.why_here').set('html',e.why_here.substr(0,80)+'...');}else{copy.getElement('.why_here').set('html',e.why_here);}
if($chk(e.shared_contacts_count)&&e.shared_contacts_count>0){copy.getElement('.shared_contacts_link').set('href','/popups/network/sharedContacts.php?id='+e.id);copy.getElement('.shared_contacts_count').set('html',e.shared_contacts_count);}else{copy.getElement('.shared_contacts_link').hide();}
if(e.city.length>0&&(e.state.length>0||e.country.length>0)){copy.getElement('.city').set('html',e.city+', ');}else{copy.getElement('.city').set('html',e.city);}
if(e.state.length>0){copy.getElement('.state').set('html',e.state);}else if(e.country.length>0){copy.getElement('.country').set('html',e.country);}
var i=0;var industry_string='';var count=e.industries.length;while(i<(count-1)){industry_string=industry_string+e.industries[i]+', ';i++;}
if(typeof e.industries[i]!='undefined'){industry_string=industry_string+e.industries[i];copy.getElement('.industry').set('html',industry_string);}else{copy.getElement('.industry').hide();}
copy.inject(networkList);});var count=rJ.network.length;if(count>0){var _page_start=1+(parseInt(rJ.query.page)*parseInt(rJ.query.limit))
if(count<rJ.query.limit){var _page_end=count+(parseInt(rJ.query.page)*parseInt(rJ.query.limit));}else{var _page_end=parseInt(rJ.query.limit)+(parseInt(rJ.query.page)*parseInt(rJ.query.limit));}
parentDiv.getElements('.pagination').each(function(e){if(rJ.query.page>0){$(e).getElement('.left').getElement('.enabled').show();$(e).getElement('.left').getElement('.disabled').hide();}else{$(e).getElement('.left').getElement('.enabled').hide();$(e).getElement('.left').getElement('.disabled').show();}
if(_page_end>=rJ.query.total_results){$(e).getElement('.right').getElement('.enabled').hide();$(e).getElement('.right').getElement('.disabled').show();}else{$(e).getElement('.right').getElement('.enabled').show();$(e).getElement('.right').getElement('.disabled').hide();}
$(e).getElement('.page_total').set('html',rJ.query.total_results);$(e).getElement('.page_start').set('html',_page_start);$(e).getElement('.page_end').set('html',_page_end);$(e).show();});}
if($chk(rJ.query.txt)){parentDiv.getElement('.querytxt').set('value',rJ.query.txt);}
parentDiv.getElement('.page').set('value',rJ.query.page);var controls=parentDiv.getElement('.dash_content_controls');if($chk(rJ.query.txt)){if($chk(rJ.query.location)){controls.getElement('.location').set('value',rJ.query.location);}
if($chk(rJ.query.industries)){var _ind_list=controls.getElement('.industry_select');_ind_list.empty();new Element('option',{'value':'','html':'All'}).inject(_ind_list);if(rJ.query.industries.length>0){for(var key in rJ.query.industries){if(typeof rJ.query.industries[key]!='string'){continue;}else{var opt=new Element('option',{'value':rJ.query.industries[key],'html':rJ.query.industries[key]});if(rJ.query.industries[key]==rJ.query.selected_industry){opt.set('selected','selected');}
opt.inject(_ind_list);}}}}
controls.show();}else{controls.hide();}
parentDiv.getElement('.network_list_empty').hide();assignSqueezeBox();}else{parentDiv.getElement('.network_list_empty').show();parentDiv.getElement('.dash_content_controls').hide();parentDiv.getElements('.pagination').each(function(e){e.hide();});}}else{parentDiv.getElement('.network_list_empty').show();parentDiv.getElement('.dash_content_controls').hide();parentDiv.getElements('.pagination').each(function(e){e.hide();});}
hideOverlayLoadingImg(parentDiv.id);},onFailure:function(){hide_working_dialog();hideOverlayLoadingImg(parentDiv.id);parentDiv.getElement('.network_list_empty').show();parentDiv.getElement('.dash_content_controls').hide();parentDiv.getElements('.pagination').each(function(e){e.hide();});efalert('Notice','There was a loading error, please try again.');}}).get(myform);}
function dashNetworkImport(_form){$('sendInvites').disabled="disabled";$('sendInvites_loading').style.display="block";new Request.JSON({url:"/",method:"post",onComplete:function(result){$('sendInvites').disabled="";$('sendInvites_loading').setStyle('display',"none");if($chk(result)&&result===1){$('invite_list').empty();$$('textarea.customgreeting').set('value','')
efalert("Processing","Your invitations are processing.  You will receive a message in your inbox when they have completed sending.");}
else{eferror("Not Complete","Your invitations could not be sent. Please try again");}}}).post(_form);}
function addCustomAlert(alert_type){switch(alert_type){case'event':var new_alert=$('notification_event_template').clone();new_alert.inject($('notification_event_template'),'after');break;case'blog':var new_alert=$('notification_blog_template').clone();new_alert.inject($('notification_blog_template'),'after');break;case'm2m':var new_alert=$('notification_m2m_template').clone();new_alert.inject($('notification_m2m_template'),'after');break;}}
function toggleCustomAlertDrop(alert_type,el){switch(alert_type){case'event':$(el.parentNode.parentNode).getElements('div[class$=_dropdown_div]').each(function(_el){new Fx.Reveal(_el).dissolve();});switch(el.options[el.selectedIndex].value){case'country':new Fx.Reveal($(el.parentNode.parentNode).getElement('.country_dropdown_div')).reveal();break;case'state':new Fx.Reveal($(el.parentNode.parentNode).getElement('.state_dropdown_div')).reveal();break;case'city':new Fx.Reveal($(el.parentNode.parentNode).getElement('.city_dropdown_div')).reveal();break;}
break;case'blog':$(el.parentNode.parentNode).getElements('div[class$=_dropdown_div]').each(function(_el){new Fx.Reveal(_el).dissolve();});switch(el.options[el.selectedIndex].value){case'accounts_blog_category_id':new Fx.Reveal($(el.parentNode.parentNode).getElement('.blog_category_dropdown_div')).reveal();break;}
break;case'm2m':$(el.parentNode.parentNode).getElements('div[class$=_dropdown_div]').each(function(_el){new Fx.Reveal(_el).dissolve();});switch(el.options[el.selectedIndex].value){case'accounts_m2m_category_id':new Fx.Reveal($(el.parentNode.parentNode).getElement('.m2m_category_dropdown_div')).reveal();break;}
break;}}
function startVideoUploadCallback(unique_id){VideoUploadForm=document.forms["VideoUploaderForm"];if(VideoUploadForm.video_title.value==""){eferror("Error:","Your video needs a title!");VideoUploadForm.video_title.focus();return false;}
VideoUploadForm.video_upload_submit.disabled=true;$('video_upload_converting').setStyle('visibility',"visible");return true;}
function completeVideoUploadCallback(r){r=eval('('+r+')');VideoUploadForm=document.forms["VideoUploaderForm"];VideoUploadForm.reset();VideoUploadForm.video_upload_submit.disabled=false;$('video_upload_converting').setStyle('visibility',"hidden");if(r==0){efalert("Conversion Complete!","Your video will be reviewed within the next 2 or 3 business days.");return true;}
else{eferror("Error:",r);return false;}}
function unlinkFB(accID){if(!confirm("Are you sure?")){return;}
new Request.JSON({url:"/rpc/account/login.php",method:"post",onComplete:function(result){if(result==true){showDashTab('myaccount','login',true);}}}).post({'method':'unlinkFB','accID':accID});}
function loadInviteList(userinfo){show_working_dialog('Retrieving information...',false,true);new Request.JSON({'url':'/','onComplete':function(result){if($chk(result)){$each(result,function(email_detail){if($chk(email_detail)){addToInviteList(email_detail);}});}
hide_working_dialog();}}).post({'rpc_method':'getImportDetails','userinfo':userinfo});}
function addToInviteList(email_detail,invite_list,skip_images){var invite_list;if($chk(invite_list)){invite_list=$(invite_list);}
else{invite_list=$('invite_list');}
if($chk(email_detail)){var account_id;var email;if($chk(email_detail.account_id)){account_id=email_detail.account_id;}
if($chk(email_detail.email)){email=email_detail.email;}
if(email>''||account_id>0){var is_member=email_detail.is_member;var is_mynetwork=email_detail.is_mynetwork;var is_invited=email_detail.is_invited;var display_name=email;if($chk(email_detail.display_name)){display_name=email_detail.display_name;}
var _list=new Element('li',{'html':display_name}).inject(invite_list);var _checked='checked';if(!skip_images){if(is_invited){_checked='';new Element('img',{'src':'/images/invite_invited.gif','style':'width:25px;height:25px;'}).injectTop(_list);}
else if(is_mynetwork){_checked='';new Element('img',{'src':'/images/invite_mynetwork.gif','style':'width:25px;height:25px;'}).injectTop(_list);}
else if(is_member){new Element('img',{'src':'/images/invite_member.gif','style':'width:25px;height:25px;'}).injectTop(_list);}
else{new Element('img',{'src':'/images/invite_nonmember.gif','style':'width:25px;height:25px;'}).injectTop(_list);}}
var check_value;if(account_id){check_value=account_id;}
else{check_value=email;}
if(is_invited||is_mynetwork){new Element('input',{'type':'checkbox','name':'recipients[]','value':check_value,'checked':_checked,'disabled':'disabled'}).injectTop(_list);}else{new Element('input',{'type':'checkbox','name':'recipients[]','value':check_value,'checked':_checked}).injectTop(_list);}}}}
function removeFromNetwork(account_id,onSuccesCallback){new Request.JSON({url:'/rpc/network/remove.php',onSuccess:function(rJ){if($chk(rJ.status)){if(rJ.status){efalert('Success',rJ.account.fullname+' was successfully removed from your network.');if(typeof onSuccesCallback=='function'){onSuccesCallback();}}else{efalert('Error','There was an error. Please try again.');}}else{efalert('Error','There was an error. Please try again.');}},onFailure:function(){efalert('Error','There was an error. Please try again.');}}).get({id:account_id});}
function getImportListPage(page){$('import_list').empty();$('import_list').load('/w/dashboard_section_mynetwork_import_list/pagenum='+page);}
function addImportListItems(){}
function addImportToQueue(){var found;var exceeded=false;show_working_dialog('Adding to queue...',false,true);$each($('OpenInvite_Import_Results').getElements('input[type=checkbox]:checked'),function(i){found=false;$each($('selected_queue').getElements('li'),function(j){if(i.value==j.get('text')){found=true;}});if(!found){if($('selected_queue').getElements('li').length<500){$$('#selected_queue ul').grab(new Element('li',{text:i.value}));$('divInviteCount').set('html',Number($('divInviteCount').get('html'))+1);}else{exceeded=true;}}});hide_working_dialog();if(exceeded){efalert('Queue Limit','Limit of 500 invites exceeded.<br />Submit this queue, then start another.');}}
function clearQueue(){efconfirm('Clear Queue','Are you sure you wish to clear your queue?',function(confirm){if(confirm){$('selected_queue').empty();$('selected_queue').grab(new Element('ul'));$('divInviteCount').set('html','0');}});}
function submitQueue(){efconfirm('Submit Import List','Are you sure you wish to invite these contacts?',function(confirm){if(confirm){show_working_dialog('Submitting list...',false,true);var recipient_list=[];$each($('selected_queue').getElements('li'),function(j){recipient_list.push(j.get('text'));});new Request.JSON({url:'/rpc/dashboard/network/import.php',onSuccess:function(json){if(json.status==true){$('selected_queue').empty();$('selected_queue').grab(new Element('ul'));$('divInviteCount').set('html','0');$('txaGreeting').value='';$each($('OpenInvite_Import_Results').getElements('input[type=checkbox]'),function(i){i.checked=false;});hide_working_dialog();efalert("Processing","Your invitations are processing.  You will receive a message in your inbox when they have completed sending.");resetInvites();}else{efalert('Not Complete','There was an error submitting your invitations. Please try later.');hide_working_dialog();}}}).post({method:'import',greeting:$('txaGreeting').value,recipients:recipient_list});}});}
function clearImportList(){efconfirm('Clear Import List','Are you sure you wish to clear your import list and queue?',function(confirm){if(confirm){show_working_dialog('Clearing list...',false,true);new Request.JSON({url:'/rpc/dashboard/network/import.php',onSuccess:function(json){if(json.status==true){$('import_list').empty();$('import_list').load('/w/dashboard_section_mynetwork_import_list/');$('selected_queue').empty();$('selected_queue').grab(new Element('ul'));$('divInviteCount').set('html','0');$('txaGreeting').value='';hide_working_dialog();efalert('Cleared!','Import list cleared successfully.');}else{efalert('Error','An error has occured. Please try later.');hide_working_dialog();}}}).post({method:'clear'});}});}
function toggleGreeting(){if($('divGreeting').getStyle('display')=='none'){$('divGreeting').show();$('lnkToggleGreeting').set('text','Remove Greeting');}else{$('divGreeting').hide();$('txaGreeting').value='';$('lnkToggleGreeting').set('text','Add Greeting');}}
function invitesGreeting(){if($('divInviteCount').get('html')=='0'){efalert('No Invites','You must add contacts to your Invitation List first');return;}
$('import_list_queue').getElement('div.buttons').hide();$('mynetwork_import_list').getElement('div.listhead').hide();$('import_greeting').show();$('lnkNextStep').hide();$('lnkSubQueue').show();$('lnkInstructions').setProperty('onclick','');$('lnkInstructions').removeEvents();$('lnkInstructions').addEvent('click',function(){efalert('Instructions',"Add a custom greeting if desired, then click 'Send Invites.'");});}
function cancelInvites(){efconfirm('Cancel Invites','Are you sure you wish to cancel?',function(confirm){if(confirm){new Request.JSON({url:'/rpc/dashboard/network/import.php'}).post({method:'clear'});resetInvites();}});}
function resetInvites(){$('import_list_queue').getElement('div.buttons').show();$('mynetwork_import_list').getElement('div.listhead').show();$('import_greeting').hide();$('lnkNextStep').show();$('lnkSubQueue').hide();$('lnkInstructions').setProperty('onclick','');$('lnkInstructions').removeEvents();$('lnkInstructions').addEvent('click',function(){efalert('Instructions',"<p>Add Selected Contacts to your Invitation List:</p><ul><li>Un-select contacts you do not wish to invite, then click 'Add Selected To List.'</li><li>Repeat this for each page of your contacts, then click 'Next Step.'</li></ul>");});$('mynetwork_import_list').hide();$('mynetwork_import').show();$('import_list').empty();$('selected_queue').empty();$('selected_queue').grab(new Element('ul'));$('divInviteCount').set('html','0');$('txaGreeting').value='';}
function getInvitesHistory(){new Request.JSON({url:'/rpc/dashboard/network/import.php',onSuccess:function(json){if(json.status===true){var tdate;var efEl=$('mynetwork_invites_history').getElement('div.ef');efEl.getElement('ul').empty();if(json.history.ef.length>0){json.history.ef.each(function(item){tdate=new Date(item.sent_date.slice(0,10));efEl.getElement('ul').grab(new Element('li',{text:item.first_name+' '+item.last_name+' - '+Number(tdate.getMonth()+1)+'/'+tdate.getDate()+'/'+Number(tdate.getYear()-100)}));});}else{efEl.getElement('ul').grab(new Element('li',{text:'No invites sent.'}));}
var nonEl=$('mynetwork_invites_history').getElement('div.non');nonEl.getElement('ul').empty()
if(json.history.non.length>0){json.history.non.each(function(item){tdate=new Date(item.sent_date.slice(0,10));nonEl.getElement('ul').grab(new Element('li',{text:item.email+' - '+Number(tdate.getMonth()+1)+'/'+tdate.getDate()+'/'+Number(tdate.getYear()-100)}));});}else{nonEl.getElement('ul').grab(new Element('li',{text:'(No invites sent.)'}));}}else{efalert('Error','An error has occured. Please try later.');hide_working_dialog();}}}).post({method:'history',accID:USER_ACCOUNT_ID});}
function inbox_lookupMembers(query,list_id,select_function_name){if(query==''){$(list_id).hide();return 0;}
$(list_id).empty();$(list_id).show();var _li=new Element('li').inject($(list_id));new Element('img',{'src':'/images/loading.gif'}).inject(_li);if(typeof inbox_lookupMembers.req!='undefined'){inbox_lookupMembers.req.cancel();}
inbox_lookupMembers.req=new Request.JSON({url:'/rpc/dashboard/inbox/lookupMembers.php',onSuccess:function(json){if(json.status==1){$(list_id).empty();for(mem in json.result){if($chk(json.result[mem].id)){var _item=new Element('li').inject($(list_id));var _item_a=new Element('a',{'href':'#','onclick':select_function_name+"('"+json.result[mem].id+"', '"+json.result[mem].fullname+"');return false;",'html':json.result[mem].fullname}).inject(_item);new Element('img',{'src':WS_UPLOAD+'images/accounts/'+json.result[mem].id+'/tiny','width':25,'height':25}).inject(_item_a,'top');new Element('span',{'class':'extra','html':json.result[mem].country}).inject(_item_a,'top');}}}else{efalert('Error','An error has occured. Please try later.');}}}).get({'q':query});}
var inbox_lookupMembersBuffer={bufferText:false,bufferTime:300,list_id:false,select_function_name:false,modified:function(strId,list_id,select_function_name)
{this.list_id=list_id;this.select_function_name=select_function_name;setTimeout('inbox_lookupMembersBuffer.compareBuffer("'+strId+'","'+$(strId).value+'");',this.bufferTime);},compareBuffer:function(strId,strText)
{if(strText==$(strId).value&&strText!=this.bufferText)
{this.bufferText=strText;inbox_lookupMembersBuffer.makeRequest(strId);}},makeRequest:function(strId)
{inbox_lookupMembers($(strId).value,this.list_id,this.select_function_name);}}