var _azarray=[];var cardFormat=1;var cardColor=0;var cardTemp;var edit;var _selectedBusCardId;var _selectedTabId;var _reDraw;var _countCards;var _STATE="";var _isJobsite=false;function Businesscard(C,E,A,B,D){this.id=E;this.firstname=B.firstname;this.lastname=B.lastname;this.phone=B.phone;this.email=B.email;this.cardFormat=B.cardFormat;this.cardColor=B.cardColor;this.website=B.website;this.signature=B.signature;this.company=B.company;this.city=B.city;this.country=B.country;this.isMinimized=C;this.s3ProfilePhoto=B.s3ProfilePhoto;this.filter=D;this.appuserid=B.appuserid;this.isFriend=(B.isFriend>0)?true:false;this.isVCardDropped=B.isVCardDropped;this.isTopContributor=B.isTopContributor;this.subscriptionLevel=B.subscriptionLevel;this.status=B.status;this.hasVCard=B.hasVCard;this.tabId=A;this.isViewed=B.isViewed;this.message=B.message;this.seoUrl=B.seoUrl;this.categories=B.categories}var friendCategories={};friendCategories[1]="Colleague";friendCategories[2]="Classmate";friendCategories[3]="Business Contacts";friendCategories[4]="Personal Contacts";function BusinessCardHolder(){this.ranges=[]}BusinessCardHolder.getInstance=function(){BusinessCardHolder.instance=new BusinessCardHolder();return BusinessCardHolder.instance};BusinessCardHolder.prototype={getRange:function(A){for(var B=0;B<this.ranges.length;B++){if(this.ranges[B].position==A){return this.ranges[B]}}return null},getFinalHTML:function(F,E,A,D,C){_azarray=F;_reDraw=D;_selectedBusCardId=E;_selectedTabId=A;_isJobsite=C;if(_azarray.length>0){_azarray[_selectedBusCardId].isMinimized=false}_countCards=E+1;BusinessCardHolder.instance.getRange(_selectedTabId).state="OPEN";this.businessCardHolderHTML="<div id='tabs'>";for(var B=0;B<this.ranges.length;B++){this.businessCardHolderHTML+=this.ranges[B].getInnerHTML()}this.businessCardHolderHTML+="</div>";ge("bizxcontent").innerHTML=this.businessCardHolderHTML;if(_azarray.length>0){_azarray[_selectedBusCardId].reDraw("businessCardId"+_selectedBusCardId,false)}},addRange:function(B,A){this.ranges.push(new BusinessCardRange(B,A,this.ranges.length))}};function BusinessCardRange(C,B,A,D){this.name=C;this.ranges=B;this.position=A;this.isMinimized=D}BusinessCardRange.prototype={getHeaderHTML:function(){return"<div id='tab"+this.position+"' class='tabholder'>"},getRangeTabHTML:function(C){if(C=="CLOSED"){var B=new Array();B.push("<div class='tabmarker");if(this.position==0){B.push(" first")}B.push("' style='padding-left:"+this.position*40+"px;' id='li"+this.position+"' ");if(this.ranges.length>0){B.push("onclick='toggleBusinessCards("+this.position+",&quot;TAB&quot;,&quot;OPEN&quot;);'")}B.push("><span class='tab'><span>"+this.name+"</span></span></div>");B.push("<div class='bcContainer' id='bcContainer"+this.position+"'>");if(this.ranges.length>3){if((ge("line"+this.position)==null||ge("line"+this.position)==undefined)||_reDraw||this.isMinimized){B.push("<div class='line handAnchor'  id='line"+this.position+"' onclick='toggleBusinessCards("+this.position+",&quot;TAB&quot;,&quot;OPEN&quot;);' style='height:15px;'>");B.push("</div>")}else{for(var A=0;A<this.ranges.length-3;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}}for(var A=this.ranges.length-3;A<this.ranges.length;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}}else{for(var A=0;A<this.ranges.length;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}}B.push("</div>");return B.join("")}else{if(C=="OPEN"){var B=new Array();B.push("<div class='tabmarker");if(this.position==0){B.push(" first")}B.push("' style='padding-left:"+this.position*40+"px;' id='li"+this.position+"' ");if(this.ranges.length>0){B.push("onclick='toggleBusinessCards("+this.position+",&quot;TAB&quot;,&quot;CLOSED&quot;);'")}B.push("><span class='tab'><span>"+this.name+"</span></span></div>");B.push("<div class='bcContainer' id='bcContainer"+this.position+"'>");for(var A=0;A<this.ranges.length;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}B.push("</div>");return B.join("")}else{var B=new Array();B.push("<div class='tabmarker");if(this.position==0){B.push(" first")}B.push("' style='padding-left:"+this.position*40+"px;' id='li"+this.position+"' ");if(this.ranges.length>0){B.push("onclick='toggleBusinessCards("+this.position+",&quot;TAB&quot;,&quot;OPEN&quot;);'")}B.push("><span class='tab'><span>"+this.name+"</span></span></div>");B.push("<div class='bcContainer' id='bcContainer"+this.position+"'>");if(this.ranges.length>3){if((ge("line"+this.position)==null||ge("line"+this.position)==undefined)||_reDraw||this.isMinimized){B.push("<div class='line handAnchor'  id='line"+this.position+"' onclick='toggleBusinessCards("+this.position+",&quot;TAB&quot;,&quot;OPEN&quot;);' style='height:15px;'>");B.push("</div>")}else{for(var A=0;A<this.ranges.length-3;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}}for(var A=this.ranges.length-3;A<this.ranges.length;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}}else{for(var A=0;A<this.ranges.length;A++){B.push(this.ranges[A].getInnerHTML(this.ranges[A].isMinimized))}}B.push("</div>");return B.join("")}}},getFooterHTML:function(){return"</div>"},getInnerHTML:function(){return this.getHeaderHTML()+this.getRangeTabHTML()+this.getFooterHTML()},getBusinessCard:function(A){for(i in this.ranges){if(this.ranges[i].id==A){return this.ranges[i]}}}};function toggleBusinessCards(C,A,B){_reDraw=false;if(BusinessCardHolder.instance.getRange(C).state=="OPEN"){B="CLOSED"}_azarray[_selectedBusCardId].reDraw("businessCardId"+_selectedBusCardId,true);_reDraw=true;ge("tab"+_selectedTabId).innerHTML=BusinessCardHolder.instance.getRange(_selectedTabId).getRangeTabHTML("CLOSED");ge("tab"+C).innerHTML=BusinessCardHolder.instance.getRange(C).getRangeTabHTML("OPEN");_selectedTabId=C;ge("tab"+C).scrollIntoView()}Businesscard.prototype.prepareMinMaxHTML=function(){var A=new Array();var D=new Array();var G="";var F=1;this.minHTML="<div class='smallCard' style='background:";if(this.cardFormat=="1"){this.minHTML+=colorscheme[this.cardColor].c1+";color:"+colorscheme[this.cardColor].t1}else{this.minHTML+=colorscheme[this.cardColor].c2+";color:"+colorscheme[this.cardColor].t2}if(!_azarray[this.id].isViewed){this.minHTML+=";font-weight:bold; height:20px"}this.minHTML+=";' onclick='f(&quot;businessCardId"+this.id+"&quot;,false,"+this.id+","+this.tabId+", "+this.appuserid+");return false;' id='bcMinDiv"+this.id+"'>"+this.firstname+" "+this.lastname+"&nbsp;&nbsp;("+this.company+")&nbsp;&nbsp;</div>";var H=buildCard(this);H=H.replace(/photo1__ID__/g,"");H=H.replace(/photo2__ID__/g,"");this.maxHTML="<div onclick='f(&quot;businessCardId"+this.id+"&quot;,true,"+this.id+","+this.tabId+", "+this.appuserid+");return false;' id='bcMaxDiv"+this.id+"' style='border:1px solid grey; overflow:hidden;'>"+H;this.maxHTML+="</div>";D.push("<div style='position:absolute;top:0;left:310px;width:100px'>");if((ge("currselect").innerHTML=="friends")&&(!_isJobsite)){D.push("<div style='z-index:100px; white-space:nowrap;color:gray;'><b>Category&nbsp;:&nbsp;</b>");D.push("<span id='categoryStrId"+this.appuserid+"'>");var C="";for(var E=0;E<this.categories.length;E++){C+=this.categories[E];if(E<this.categories.length-1){C+=",&nbsp;"}}D.push(C);D.push("</span>");D.push("<a class='blueText' href='javascript:void(0);' onclick='highlightCategories(&quot;"+this.appuserid+"&quot;,&quot;"+C+"&quot;, &quot;l1&quot;,&quot;"+this.id+"&quot;,&quot;"+this.tabId+"&quot; );return false;'>[edit]</a>");D.push("</div>");D.push("<textarea id='friendCategoriesDiv"+this.appuserid+"' style='display:none; float:right;padding-top:5' class='friendActivity'>	");D.push("        <div id='errorEditFriendCategory' class='error' style='display:none;'></div>");D.push("        <table>");D.push("                <tr>");D.push("                        <td align='left'>");D.push("                                <table>");for(var B=1;B<=4;B++){D.push("                                <tr><td>");D.push("                                <input type='checkbox' name='friendCategories"+this.appuserid+"' value='"+B+"' realname='"+friendCategories[B]+"'>"+friendCategories[B]);D.push("                                </td></tr>						")}D.push("                                </table>");D.push("                        </td>");D.push("                        <td valign='top'>");D.push("                                <table style='padding-top:10px;'>");D.push("                                        <tr>");D.push("                                                <td>");D.push("                                                        <a id='submit_editFriendCategory' class='main_button'>Save</a>	<br>");D.push("                                                </td>");D.push("                                        </tr>");D.push("                                        <tr><td>");D.push("                                                <a id='cancel_editFriendCategory' class='cancel_button'>");D.push("                                                        Cancel");D.push("                                                </a>");D.push("                                        </td></tr>");D.push("                                </table>");D.push("                        </td>");D.push("                </tr>");D.push("        </table>");D.push("</textarea>")}D.push("	<div id='buttonDiv"+this.id+"'>");if(this.status=="REJECTED"){A.push(getMyButton("changeVCardStatus(&quot;"+this.appuserid+"&quot;, &quot;SENT&quot;, &quot;successVCard&quot;,&quot;errorVCard&quot;)","Undo Delete",F++))}A.push("		<div class='fw_btn'><a href='profile/"+this.seoUrl+"'>View&nbsp;Profile</a></div>");if(!_isJobsite){if(this.isFriend){A.push(getMyButton("showIntroductionDiv(&quot;"+this.appuserid+"&quot;,&quot;vCardActivityDiv"+this.appuserid+"&quot;,&quot;successVCard&quot;,&quot;errorVCard&quot;)","Introduce",F++));A.push(getMyButton("showSendMessageDiv(&quot;"+this.appuserid+"&quot;,&quot;vCardActivityDiv"+this.appuserid+"&quot;, &quot;successVCard&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;errorVCard&quot;)","Send message",F++));if(!this.hasVCard&&!_azarray[this.id].hasVCard){A.push(getMyButton("sendVCard(&quot;"+this.appuserid+"&quot;,&quot;sendVCardButton"+this.id+"&quot;,&quot;successVCard&quot;,&quot;errorVCard&quot;, &quot;"+this.firstname+"&quot;,&quot;"+this.id+"&quot;)","Send Business Card",F++,"sendVCardButton"+this.id))}A.push(getMyButton("inviteToCommunity(&quot;"+this.appuserid+"&quot;,&quot;vCardActivityDiv"+this.appuserid+"&quot;,&quot;successVCard&quot;,&quot;errorVCard&quot;)","Invite to Community",F++))}else{A.push(getMyButton("","Add as Connection",F++,"","javascript:navigatePage(&quot;addAsAFriend.html?action=display&friendId="+this.appuserid+"&quot;)"));if(!this.hasVCard&&!_azarray[this.id].hasVCard){A.push(getMyButton("sendVCard(&quot;"+this.appuserid+"&quot;,&quot;sendVCardButton"+this.id+"&quot;,&quot;successVCard&quot;,&quot;errorVCard&quot;, &quot;"+this.firstname+"&quot;,&quot;"+this.id+"&quot;)","Send Business Card",F++,"sendVCardButton"+this.id))}if(!this.isVCardDropped){}else{A.push(getMyButton("showSendMessageDiv(&quot;"+this.appuserid+"&quot;,&quot;vCardActivityDiv"+this.appuserid+"&quot;, &quot;successVCard&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;errorVCard&quot;)","Send message",F++));A.push(getMyButton("showIntroductionDiv(&quot;"+this.appuserid+"&quot;,&quot;vCardActivityDiv"+this.appuserid+"&quot;,&quot;successVCard&quot;,&quot;errorVCard&quot;)","Introduce",F++));A.push(getMyButton("inviteToCommunity(&quot;"+this.appuserid+"&quot;,&quot;vCardActivityDiv"+this.appuserid+"&quot;,&quot;successVCard&quot;,&quot;errorVCard&quot;)","Invite to Community",F++))}}if(this.isTopContributor){A.push("	<div id='subscriptionDiv"+this.appuserid+"' style='border:0px;'>"+subscriptionLevelHTML(this.subscriptionLevel,this.appuserid,this.id,F++)+"</div>")}}if(this.status=="SENT"&&(ge("currselect").innerHTML!="friends")){A.push(getMyButton("changeVCardStatus(&quot;"+this.appuserid+"&quot;, &quot;REJECTED&quot;, &quot;successVCard&quot;,&quot;errorVCard&quot;)","Delete Business Card",F++))}A.push(getMyButton("","Report abuse",F++,"","javascript:callReportAbuse(&quot;reportAbuseNew.html?entityId="+this.appuserid+"&entityTypeId=1&creatorId="+this.appuserid+"&style=modal&quot;,&quot;errorVCard&quot;)"));G+="		<div id='resultDiv"+this.id+"' style='float:right;'>";G+="		</div>";G+="		<div id='vCardActivityDiv"+this.appuserid+"'>";G+="		</div>";G+="	</div>";G+="	</div>";this.maxHTML="<div style='position:relative;'>"+D.join("")+actionListButtons(A)+actionListDiv(A,this.id,this.message,this.firstname,this.hasVCard,this.isVCardDropped)+G+"<span style='float:right; position:absolute;top:0;left:280px;z-index:1;' class='close' onmouseover='this.className=&quot;close on&quot;;' onmouseout='this.className=&quot;close&quot;' onclick='f(&quot;businessCardId"+this.id+"&quot;,true,"+this.id+","+this.tabId+", "+this.appuserid+");return false;'>&nbsp;</span>"+this.maxHTML+"</div>"};function getMyButton(C,D,A,E,B){if(_isJobsite){return""}B=(B==""||B==null)?"javascript:void(0);":B;E=(E==""||E==null||E==undefined)?"":"id="+E;if(A>2){return"<div class='icon_link' "+E+"><a href='"+B+"' onclick='"+C+"'>"+D+"</a></div>"}else{return"<div class='fw_btn' "+E+"><a href='"+B+"' onclick='"+C+"'>"+D+"</a></div>"}}function actionListButtons(A){var B=A;B=B.slice(0,3);return B.join("")}function actionListDiv(B,G,D,F,A,E){if(_isJobsite){return""}var C=B;C=C.slice(3,B.length);C=C.join("");G="lowerDiv"+G;C="<div style='width:100%; padding-left:10px; width:120px;'>	<div onmouseover='showDiv(&quot;"+G+"&quot);hideDiv(&quot;message"+G+"&quot);' onmouseout='hideDiv(&quot;"+G+"&quot;);showDiv(&quot;message"+G+"&quot);'>		<a href='javascript:void(0);' >more actions >></a>		<div id='"+G+"' class='moreactions'>"+C+"</div>	</div>	<div id='message"+G+"'>";if(!isEmptyString(D)){C+="		<div class='message'><span style='font-weight:bold;'>"+F+" says:</span> "+D+"</div>"}C+=businessCardExchangeStatus(G,A,E)+" 	</div></div>";return C}function businessCardExchangeStatus(D,A,C){var B="";if(A&&true){B="<div style='width:100%; padding-top:10px; display:none;' id='exchange"+D+"'>Business Card Exchanged</div>"}else{if(!A){B="<div style='width:100%; padding-top:10px; display:none;' id='exchange"+D+"'>Business Card Recieved</div>"}}return B}function subscriptionLevelHTML(E,B,A,D){var C=new Array();if(E==1){C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"unSubscribeToJobs\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Unsubscribe for jobs</a></div>');C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"subscribeToArticles\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Subscribe for articles</a></div>')}else{if(E==2){C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"subscribeToJobs\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Subscribe for jobs</a></div>');C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"unSubscribeToArticles\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Unsubscribe for articles</a></div>')}else{if(E==3){C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"unSubscribeToJobs\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Unsubscribe for jobs</a></div>');C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"unSubscribeToArticles\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Unsubscribe for articles</a></div>')}else{C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"subscribeToJobs\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Subscribe for jobs</a></div>');C.push("<div class='icon_link'><a onclick='changeSubscriptionLevelBizx(\"subscribeToArticles\", "+E+", "+B+', "successVCard","errorVCard")\' href=\'javascript:void(0);\'>Subscribe for articles</a></div>')}}}return C.join("")}function f(B,E,C,D,A){if(_selectedTabId!=D){if(E){if(!_azarray[C].isViewed){changeVCardViewed(A)}BusinessCardHolder.instance.getRange(D).getBusinessCard(C).isViewed=true;ge("tab"+_selectedTabId).innerHTML=BusinessCardHolder.instance.getRange(_selectedTabId).getRangeTabHTML("OPEN");ge("tab"+D).innerHTML=BusinessCardHolder.instance.getRange(D).getRangeTabHTML("CLOSED");_selectedTabId=D}else{ge("tab"+_selectedTabId).innerHTML=BusinessCardHolder.instance.getRange(_selectedTabId).getRangeTabHTML("CLOSED");ge("tab"+D).innerHTML=BusinessCardHolder.instance.getRange(D).getRangeTabHTML("OPEN");if(!_azarray[C].isViewed){changeVCardViewed(A)}BusinessCardHolder.instance.getRange(D).getBusinessCard(C).isViewed=true;_selectedTabId=D;ge(B).scrollIntoView()}}else{if(!_azarray[C].isViewed){changeVCardViewed(A)}}_azarray[_selectedBusCardId].isViewed=true;_azarray[_selectedBusCardId].isViewed=true;_azarray[_selectedBusCardId].reDraw("businessCardId"+_selectedBusCardId,true);_azarray[C].reDraw("businessCardId"+C,E);_selectedBusCardId=C}function changeVCardViewed(B){var A="extsignup.html?fromappname=Toostep&fromappuserid="+B+"&toappname=Toostep&task=changeviewed";var C={};loadWithParams(A,postChangeVCardViewed,"GET",C)}function postChangeVCardViewed(o){var response;eval("response="+o.responseText);ge("unviewedCards").innerHTML=response.NUM_UNVIEWED}Businesscard.prototype.reDraw=function(A,B){this.isMinimized=B;try{ge(A).innerHTML=this.getInnerHTML(B,true)}catch(C){}};Businesscard.prototype.getInnerHTML=function(A,C){this.prepareMinMaxHTML();this.isMinimized=A;var B=(A==true)?this.minHTML:this.maxHTML;if(C==null||C==""){B="<div id='businessCardId"+this.id+"'>"+B+"</div>"}return B};var card1='<table id="vcard1" cellpadding="0" cellspacing="0" bgcolor="__C1__" style="color:__T1__;border-right:2px solid #000000;border-bottom:2px solid #000000;border-left: 1px solid #CCCCCC;border-top: 1px solid #CCCCCC;width:305px; height:170px;">	<tr height="30px">		<td colspan=2>			<div style="font-weight:bold;font-size:13px;padding:10px 0 0 5px;" id="name1__ID__">__NAME__</div>		</td>	</tr>	<tr height="25px">		<td colspan=2 style="border-bottom: 1px solid #CCCCCC">			<div style="font-style: italic; font-size:13px;padding:2px 0 5px 5px;" id="title1__ID__">__TITLE__</div>		</td>	</tr>	<tr height="100px" bgcolor="__C2__">		<td valign="middle" align="center" width="80px">			<div>				<img src="__IMG__" id="photo1__ID__">			</div>		</td>		<td style="font-size:14px"> 			<div style="color:__T2__;font-size:1.2em;padding-left:5px;width:100%" id="company1__ID__">__COMPANY__</div>			<div style="color:__T2__;font-size:0.7em;padding:2px 0 5px 5px;width:100%">				<div style="background: transparent url(http://images.toostep.com/images/icons/phone.gif) no-repeat;padding-left:16px;" id="phone1__ID__">__PHONE__</div>				<div style="background: transparent url(http://images.toostep.com/images/icons/email.gif) no-repeat;padding-left:16px;" id="email1__ID__">__EMAIL__</div>				<div style="background: transparent url(http://images.toostep.com/images/icons/web.gif) no-repeat;padding-left:16px;" id="website1__ID__">__WEBSITE__</div>				<div style="background: transparent url(http://images.toostep.com/images/icons/home.gif) no-repeat;padding-left:16px;" id="city1__ID__">__CITY__</div>			</div>		</td>	</tr></table>';var card2='<table id="vcard2" cellpadding="0" cellspacing="0" bgcolor="__C2__" style="color:__T2__;border-right:2px solid #000000;border-bottom:2px solid #000000;border-left: 1px solid #CCCCCC;border-top: 1px solid #CCCCCC;width:305px; height:170px">	<tr height="77px">		<td valign="top" align="left" width="80px">			<div style="padding:2px 0 0 2px">				<img src="__IMG__" id="photo2__ID__">			</div>		</td>		<td align="right">			<div id="company2__ID__" style="font-weight:bold;font-size:14px;padding-right:5px;">__COMPANY__</div>		</td>	</tr>	<tr height="18px">		<td colspan="2" align="center">			<div style="font-size:13px;" id="name2__ID__">__NAME__</div>		</td>	</tr>	<tr height="19px">		<td colspan="2" align="center">			<div style="font-size:13px;font-style:italic;" id="title2__ID__">__TITLE__</div>		</td>	</tr>	<tr height="20px" style="padding-bottom:10px;">		<td colspan="2" align="center" valign="top">			<div id="website2__ID__">__WEBSITE__</div>		</td>	</tr>	<tr height="14px">		<td colspan="2" align="left">			<div style="font-size:10px;padding-left:5px;">				<div style="float:right;" id="phone2__ID__">__PHONE__</div>				<div id="city2__ID__">__CITY__</div>			</div>		</td>	</tr>	<tr height="14px">		<td colspan="2">			<div style="font-size:10px;padding-left:5px;">				<div id="email2__ID__">__EMAIL__</div>			</div>		</td>	</tr></table>';var colorscheme=[{c1:"#286AB2",c2:"#DEEDF9",t1:"#FFFFFF",t2:"#000000"},{c1:"#286AB2",c2:"#5A8FC5",t1:"#FFFFFF",t2:"#FFFFFF"},{c1:"#2D2D2D",c2:"#5A5A5A",t1:"#FFFFFF",t2:"#FFFFFF"},{c1:"#851D21",c2:"#F3E4E4",t1:"#FFFFFF",t2:"#000000"},{c1:"#FFFFE0",c2:"#FFFFFF",t1:"#000000",t2:"#000000"},{c1:"#FFFFFF",c2:"#FFFFE0",t1:"#000000",t2:"#000000"},{c1:"#F4B24C",c2:"#FDFBB4",t1:"#000000",t2:"#000000"},{c1:"#FDFBB4",c2:"#F4B24C",t1:"#000000",t2:"#000000"},{c1:"#226931",c2:"#CCEACA",t1:"#FFFFFF",t2:"#000000"},{c1:"#CCEACA",c2:"#226931",t1:"#000000",t2:"#FFFFFF"},{c1:"#E4CBCB",c2:"#F6E3E4",t1:"#000000",t2:"#000000"}];function replaceVCardElements(C,A){if(C=="fullname"){var B;B=A.split(" ");cardTemp.firstname=B[0];if(B.length>1){B[0]="";cardTemp.lastname=B.join("")}}if(C=="city"){cardTemp.city=A}if(C=="country"){cardTemp.country=A}if(C=="company"){cardTemp.company=A}if(C=="email"){cardTemp.email=A}if(C=="phone"){cardTemp.phone=A}if(C=="title"){cardTemp.title=A}if(C=="cardFormat"){cardTemp.cardFormat=A}if(C=="cardColor"){cardTemp.cardColor=A}if(C=="website"){cardTemp.cardColor=A}if(C=="photo"){cardTemp.s3ProfilePhoto=A}}function preview(C,B,A,E){try{ge(B).innerHTML=C}catch(D){}try{ge(A).innerHTML=C}catch(D){}}function buildCard(A,F){if(!F){F="0"}var B;B=colorscheme[A.cardColor];var E;var D=A;if(A.cardFormat==1){E=card1}if(A.cardFormat==2){E=card2}if(!A.cardFormat){E=card1}E=E.replace(/__I__/g,F);E=E.replace(/__COMPANY__/g,D.company);E=E.replace(/__NAME__/g,D.firstname+" "+D.lastname);E=E.replace(/__TITLE__/g,D.signature);E=E.replace(/__PHONE__/g,D.phone);E=E.replace(/__EMAIL__/g,D.email);if(!_isJobsite){E=E.replace(/__WEBSITE__/g,D.website)}else{try{hideDiv("website1__ID__")}catch(C){}try{hideDiv("website2__ID__")}catch(C){}try{hideDiv("website1_e")}catch(C){}try{hideDiv("website2_e")}catch(C){}E=E.replace(/__WEBSITE__/g,"")}if(F!="s"){E=E.replace(/__IMG__/g,D.s3ProfilePhoto)}else{E=E.replace('<img src="__IMG__" id="photo1__ID__">',"");E=E.replace('<img src="__IMG__" id="photo2__ID__">',"")}E=E.replace(/__C1__/g,B.c1);E=E.replace(/__C2__/g,B.c2);E=E.replace(/__T1__/g,B.t1);E=E.replace(/__T2__/g,B.t2);if((!isEmptyString(D.city))&&(!isEmptyString(D.country))){E=E.replace(/__CITY__/g,D.city+", "+D.country)}else{if(!isEmptyString(D.city)){E=E.replace(/__CITY__/g,D.city)}else{E=E.replace(/__CITY__/g,D.country)}}return E}function editVCardTemplate(D,B){var A="getMyVisitingCardJSON.html?";A+="apptype=Toostep";A+="&appuserid="+D;var C={isJobsite:B};_isJobsite=B;loadWithParams(A,showEditVCardForm,"GET",C)}function showEditVCardForm(o){var d;try{eval("d="+o.responseText);if(isEmptyString(d.OWNER_CARD[0].country)){d.OWNER_CARD[0].country="India"}var w=d.OWNER_CARD[0];cardTemp=d.OWNER_CARD[0];cardFormat=w.cardFormat;cardColor=w.cardColor;var selectBox=document.getElementById("colorPicId");selectBox.value=w.cardColor;var cardFormatBtns=document.getElementsByName("cardFormatRadio");for(var i=0;i<cardFormatBtns.length;i++){if(cardFormatBtns[i].value==w.cardFormat){cardFormatBtns[i].checked=true}}edit=true;loadAll()}catch(e){}}function loadAll(){var A;if(!cardColor){A=colorscheme[0]}else{A=colorscheme[cardColor]}if(cardFormat==1){ge("card2").style.display="none";ge("card1").style.display="block";if(edit){loadTemplate(card1,cardTemp,"card1",A);loadPreviewTemplate(card1,"card1",A)}else{loadTemplate(card1,o.vCard[0],"card1",A);loadPreviewTemplate(card1,"card1",A)}}if(cardFormat==2){ge("card1").style.display="none";ge("card2").style.display="block";if(edit){loadTemplate(card2,cardTemp,"card2",A);loadPreviewTemplate(card2,"card2",A)}else{loadTemplate(card2,o.vCard[0],"card2",A);loadPreviewTemplate(card2,"card2",A)}}}function loadTemplate(D,A,F,E){var B=D.replace("__COMPANY__",A.company);B=B.replace(/__NAME__/g,A.firstname+" "+A.lastname);if(edit){B=B.replace(/__ID__/g,"_e")}B=B.replace(/__TITLE__/g,(!isEmptyString(A.signature))?A.signature:"Signature");B=B.replace(/__PHONE__/g,(!isEmptyString(A.phone))?A.phone:"123-456-7890");B=B.replace(/__EMAIL__/g,A.email);B=B.replace(/__WEBSITE__/g,(!isEmptyString(A.website))?A.website:"http://toostep.com");if((!isEmptyString(A.city))&&(!isEmptyString(A.country))){B=B.replace(/__CITY__/g,A.city+", "+A.country)}else{if(!isEmptyString(A.city)){B=B.replace(/__CITY__/g,A.city)}else{B=B.replace(/__CITY__/g,A.country)}}B=B.replace(/__IMG__/g,A.s3ProfilePhoto);B=B.replace(/__C1__/g,E.c1);B=B.replace(/__C2__/g,E.c2);B=B.replace(/__T1__/g,E.t1);B=B.replace(/__T2__/g,E.t2);document.getElementById(F).innerHTML=B;if(_isJobsite){try{hideDiv("website1__ID__")}catch(C){}try{hideDiv("website2__ID__")}catch(C){}try{hideDiv("website1_e")}catch(C){}try{hideDiv("website2_e")}catch(C){}}}function loadPreviewTemplate(B,D,C){try{document.getElementById("tmplt1_1").style.background=C.c1;document.getElementById("tmplt1_2").style.background=C.c2;document.getElementById("tmplt1_1").style.color=C.t1;document.getElementById("tmplt2_1").style.background=C.c2;document.getElementById("tmplt2_1").style.color=C.t2}catch(A){}}function loadCard(A,B){if(A&&A!=""&&A!=null){cardFormat=A}if(B&&B!=""&&B!=null){cardColor=B}loadAll()}function saveVCardTemplate(){var A="extsignup.html?";A+="appname=Toostep";A+="&appuserid=";A+="&cardFormat="+encodeURIComponent(cardFormat);A+="&cardColor="+encodeURIComponent(cardColor);A+="&task=vcardtemplate";loadWithParams(A,postSaveVCardTemplate,"GET")}function postSaveVCardTemplate(o){var response;try{eval("response="+o.responseText);if(response.SUCCESS!=null&&response.SUCCESS!=""){loadTPanel(getTPanelByName("myProfile"))}else{alert("error occurred while saving the template, please try after some time")}}catch(e){}}function refreshPanel(){loadTPanel(getTPanelByName("myProfile"))}function changeVCardStatus(D,B,F,G){showDiv("myFriendsLoadingImageDiv");var A="extsignup.html?";A+="fromappname=Toostep";A+="&fromappuserid="+D;A+="&toappname=Toostep";A+="&task=changestatus";A+="&status="+B;var E=ge("filterId").innerHTML;var C=ge("sortId").innerHTML;A+="&filter="+E;A+="&sort="+C;var H={resultDiv:F,errorDiv:G,status:B,userId:D};loadWithParams(A,postChangeVCardStatus,"GET",H)}function postChangeVCardStatus(o){var response;try{eval("response="+o.responseText);if(response.SUCCESS!=null&&response.SUCCESS!=""){ge(o.argument.resultDiv).style.display="block";if(o.argument.status=="SENT"){ge(o.argument.resultDiv).innerHTML="Business Card of "+response.NAME+" has been accepted!!!"}else{if(o.argument.status=="REJECTED"){ge(o.argument.resultDiv).innerHTML="Business Card of "+response.NAME+" has been deleted!!! Click<a href='javascript:void(0);' onclick='javascript:changeVCardStatus(&quot;"+o.argument.userId+"&quot;, &quot;SENT&quot;, &quot;successVCard&quot;,&quot;errorVCard&quot;);return false;'>&nbsp;here</a>&nbsp;to undo."}}ge("allCards").innerHTML=response.NUM_ALL;ge("new7Cards").innerHTML=response.NUM_NEW7;ge("deletedCards").innerHTML=response.NUM_DELETED;ge("sentCards").innerHTML=response.NUM_SENT;ge("bizxjsondata").innerHTML=response.CARDS;createBusinessCardsFromData(true)}else{ge(o.argument.errorDiv).style.display="block";ge(o.argument.errorDiv).innerHTML="Alert!! Error occurred, please try after some time"}}catch(e){ge(o.argument.errorDiv).style.display="block";ge(o.argument.errorDiv).innerHTML="Unexpected error occurred, please refresh the page."}hideDiv("myFriendsLoadingImageDiv")};
