var map;var bounds=null;var fbhtml="";var fbUserId=0;var fbGuestName="";var fbloading=true;var thumbObj=null;var fbJob=0;var wallPost=false;function gLoad(){if(GBrowserIsCompatible()){bounds=new GLatLngBounds();map=new GMap2(document.getElementById("profileMap"));map.setMapType(G_NORMAL_MAP);map.setCenter(new GLatLng(0,0),0);map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());initShowLocations()}}function closeInvite(){$("inviteFriendsLayer").update("");new Effect.Fade("transWrapper",{duration:0.8})}function giveThumbsUp(c,b){thumbObj=$(c);fbJob=b;var a=$(c).positionedOffset();var d=a[1];if(fbUserId==0||fbUserId==null||fbUserId.length<1){FB.Connect.requireSession(giveThumbsUpAL,true)}else{if(fbloading){alert("The page is still loading. Please try again in 10 seconds.\nIf the problem persists, please click the refresh button in your browser.");return}$("thumbsLayer").setStyle({top:d+"px"});if($("thumberComments")){$("thumberComments").value=""}$("thumbsLayer").show();FB.Facebook.apiClient.users_hasAppPermission("publish_stream",function(e){if(e==0){permPrompt()}})}}function giveThumbsUpAL(){var b=FB.Facebook.apiClient;fbUserId=b.get_session().uid;var a=thumbObj.positionedOffset();var c=a[1];$("thumbsLayer").setStyle({top:c+"px"});if($("thumberComments")){$("thumberComments").value=""}$("thumbsLayer").show();FB.Facebook.apiClient.users_hasAppPermission("publish_stream",function(d){if(d==0){permPrompt()}})}function permPrompt(){FB.Connect.showPermissionDialog("publish_stream",function(a){if(a!=""){var b=FB.Connect._singleton;b._userInfo.shortStorySetting=FB.FeedStorySetting.autoaccept}else{}})}function setFBUid(){try{FB.ensureInit(function(){var b=FB.Facebook.apiClient;fbUserId=b.get_session().uid;b.users_getInfo(fbUserId,["name","hometown_location"],getInfo)})}catch(a){}}function getInfo(b,c){fbloading=false;fbGuestName=b[0]["name"];var a='<fb:profile-pic uid="'+fbUserId+'" size="small" width="100" linked="false"/>';$("thumber").update(a);FB.XFBML.Host.parseDomTree();a="<div><b>Your Name:</b> "+fbGuestName+'</div><div><b>Job Title:</b> <input type="text" class="formField" style="width:170px" id="thumberJobtitle"></div><div><b>Relationship:</b> <select id="thumberRelation" style="width:155px"><option value="Peer">Peer</option><option value="Supervisor">Supervisor</option><option value="Subordinate">Subordinate</option><option value="External Contact">External Contact</option></select></div><div><b>Email: (optional)</b> <input type="text" class="formField" style="width:130px" id="thumberEmail"></div>';$("thumberInfo").update(a)}function closeThumbs(){$("thumbsLayer").hide()}function setFBHtml(){fbhtml='<span id="inviteLoading"><b>Loading Facebook Invite Table, Please Wait....</b></span><br><fb:serverfbml style="width:755px;"><script type="text/fbml"><fb:fbml><fb:request-form action="http://www.resuwe.com/'+fbUsername+'"method="POST" invite="true" type="ResuWe" content="'+fbFullName+" has Reved up their resume with ResuWe.com and is inviting you to share a comment, reference, or thumbs up Rev about your experience working with "+fbFirstName+". Click the button below to visit their online Profile Resume. <fb:req-choice url='http://www.resuwe.com/account/fbcomments?pm="+gMapKLayer+"-"+fbUserId+'\' label=\'Ok, View Resume\' />"><fb:multi-friend-selector showborder="false" actiontext="Invite co-workers & colleagues to Rev up your Resume!"></fb:request-form></fb:fbml><\/script></fb:serverfbml>';document.getElementById("inviteFriendsLayer").innerHTML=fbhtml;FB.XFBML.Host.parseDomTree();new Effect.Appear("transWrapper",{duration:0.8});setTimeout("closeInviteLoading()",5000)}function setFBLogin(){FB.Connect.requireSession(setFBHtml,true)}function postThumbsUp(){var c=$("thumberJobtitle").value;var b=$("thumberRelation").value;var a=$("thumberEmail").value;var e="";if($("thumberComments")){e=$("thumberComments").value;if(e.length>0){e=removeHTMLTags(e);e=e.replace(/[^a-zA-Z0-9\s\"\,\'\-\.\=\/\\\&\;\$\%\)\(\:\!]+/g,"")}}if(c.blank()){alert("Your Job Title is Required");return}$("fbPleaseWait").show();var d=new RegExp("success");new Ajax.Request("/account/saveThumbsUp",{method:"post",requestHeaders:["Cache-Control","no-cache","Expires","0","If-Modified-Since","0"],parameters:{jobTitle:c,relationship:b,primaryEmail:a,workId:fbJob,fbName:fbGuestName,fbUserId:fbUserId,comments:e,username:fbUsername},onSuccess:function(k){var h=k.responseText;if(d.test(h)){if($("thumbCount")){try{var f=$("thumbCount").innerHTML;var j=parseInt(f);j=j+1;$("thumbCount").innerHTML=j}catch(g){}}new Ajax.Request("/account/socialResume?username="+fbUsername,{method:"get",requestHeaders:["Cache-Control","no-cache","Expires","0","If-Modified-Since","0"],evalScript:true,onSuccess:function(o){var n=o.responseText;$("socialResumeLayer").update(n);FB.XFBML.Host.parseDomTree();closeThumbs();$("fbPleaseWait").hide();if(!wallPost){wallPost=true;try{var l={name:"ResuWe Thumbs-Up, View "+fbFullName+"'s Resume",caption:"A thumbs-up was given to "+fbFullName+"'s ResuWe.com resume.",href:"http://www.resuwe.com/"+fbUsername+""};if(!fbResumeId.blank()){FB.Connect.streamPublish(null,l,null,fbResumeId,false,null,true,null)}else{FB.Connect.streamPublish(null,l,null,fbUserId,false,null,true,null)}}catch(m){}}}})}else{closeThumbs()}},onFailure:function(){alert("An internal error has occurred. Please try again.");$("fbPleaseWait").hide()}})}function fbDeleteComment(a){if(a==null){return}if(confirm("Please confirm you want to delete this thumbs-up?")){new Ajax.Request("/account/deleteComment",{method:"post",parameters:{commentId:a},requestHeaders:["Cache-Control","no-cache","Expires","0","If-Modified-Since","0"],onSuccess:function(b){location="/"+fbUsername},onFailure:function(){alert("An internal error has occurred. Please try again.")}})}}function closeInviteLoading(){$("inviteLoading").hide()}function showInvite(){FB.Connect.ifUserConnected("javascript:setFBHtml()","javascript:setFBLogin()")}function closeMap(){$("mapWrapper").style.visibility="hidden"}function selectSearchWhat(a){if(a.value=="Job Titles, Keywords or Company Name"){a.value=""}}function selectSearchWhere(a){if(a.value=="City, State or Zip Code (optional)"){a.value=""}}function sendEmail(a){location="mailto:"+a}function profileTabSelect(b){if($("resumePreview").visible()&&b=="centerTabOne"){return}if($("socialTab").visible()&&b=="centerTabTwo"){return}$("centerContentLoading").hide();$("jobSearchResults").hide();var c=$("centerTabBarProfile");var a=c.getElementsByTagName("div");for(i=0;i<a.length;i++){if(a[i].getAttribute("isbutton")){a[i].className="centerTab"}}$(b).className="centerTabActive";$("resumePreview").hide();$("socialTab").hide();if(b=="centerTabOne"){new Effect.Appear("resumePreview",{duration:0.5})}else{new Effect.Appear("socialTab",{duration:0.5})}}function jobSearch(){var c=$("searchWhatText").value;var a=$("searchWhereText").value;if(c.length<2){return}if(c=="Job Titles, Keywords or Company Name"){return}if(a=="City, State or Zip Code (optional)"){a=""}var d=$("centerTabBarProfile");var b=d.getElementsByTagName("div");for(i=0;i<b.length;i++){if(b[i].getAttribute("isbutton")){b[i].className="centerTab"}}$("resumePreview").hide();$("socialTab").hide();$("centerContentLoading").show();new Ajax.Request("/account/jobSearch",{method:"post",requestHeaders:["Cache-Control","no-cache","Expires","0","If-Modified-Since","0"],parameters:{what:c,where:a},onSuccess:function(f){var e=f.responseText;$("jobSearchResults").update(e);$("centerContentLoading").hide();new Effect.Appear("jobSearchResults",{duration:0.5})},onFailure:function(){alert("An internal error has occurred. Please try again.");$("centerContentLoading").hide()}})}function removeHTMLTags(b){if(b){var a=document.createElement("div");a.innerHTML=b;if(document.all){return a.innerText}else{return a.textContent}}}function downloadResume(a){location="/account/publicDownloadResume?key="+a};