(function(F,V){var ac,Y=Array.prototype.slice,R=decodeURIComponent,ak=F.param,ai,Z,K,aj=F.bbq=F.bbq||{},T,L,ab,ag=F.event.special,ah="hashchange",U="querystring",P="fragment",H="elemUrlAttr",ae="location",aa="href",N="src",I=/^.*\?|#.*$/g,J=/^.*\#/,ad,Q={};function M(a){return typeof a==="string";}function S(a){var b=Y.call(arguments,1);return function(){return a.apply(this,b.concat(Y.call(arguments)));};}function X(a){return a.replace(/^[^#]*#?(.*)$/,"$1");}function W(a){return a.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1");}function af(j,c,l,h,k){var a,d,f,b,g;if(h!==ac){f=l.match(j?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);g=f[3]||"";if(k===2&&M(h)){d=h.replace(j?J:I,"");}else{b=Z(f[2]);h=M(h)?Z[j?P:U](h):h;d=k===2?h:k===1?F.extend({},h,b):F.extend({},b,h);d=ak(d);if(j){d=d.replace(ad,R);}}a=f[1]+(j?"#":d||!f[1]?"?":"")+d+g;}else{a=c(l!==ac?l:V[ae][aa]);}return a;}ak[U]=S(af,0,W);ak[P]=ai=S(af,1,X);ai.noEscape=function(a){a=a||"";var b=F.map(a.split(""),encodeURIComponent);ad=new RegExp(b.join("|"),"g");};ai.noEscape(",/");F.deparam=Z=function(a,d){var b={},c={"true":!0,"false":!1,"null":null};F.each(a.replace(/\+/g," ").split("&"),function(m,g){var o=g.split("="),h=R(o[0]),p,j=b,l=0,f=h.split("]["),k=f.length-1;if(/\[/.test(f[0])&&/\]$/.test(f[k])){f[k]=f[k].replace(/\]$/,"");f=f.shift().split("[").concat(f);k=f.length-1;}else{k=0;}if(o.length===2){p=R(o[1]);if(d){p=p&&!isNaN(p)?+p:p==="undefined"?ac:c[p]!==ac?c[p]:p;}if(k){for(;l<=k;l++){h=f[l]===""?j.length:f[l];j=j[h]=l<k?j[h]||(f[l+1]&&isNaN(f[l+1])?{}:[]):p;}}else{if(F.isArray(b[h])){b[h].push(p);}else{if(b[h]!==ac){b[h]=[b[h],p];}else{b[h]=p;}}}}else{if(h){b[h]=d?ac:"";}}});return b;};function G(a,c,b){if(c===ac||typeof c==="boolean"){b=c;c=ak[a?P:U]();}else{c=M(c)?c.replace(a?J:I,""):c;}return Z(c,b);}Z[U]=S(G,0);Z[P]=K=S(G,1);F[H]||(F[H]=function(a){return F.extend(Q,a);})({a:aa,base:aa,iframe:N,img:N,input:N,form:"action",link:aa,script:N});ab=F[H];function O(a,c,b,d){if(!M(b)&&typeof b!=="object"){d=b;b=c;c=ac;}return this.each(function(){var f=F(this),h=c||ab()[(this.nodeName||"").toLowerCase()]||"",g=h&&f.attr(h)||"";f.attr(h,ak[a](g,b,d));});}F.fn[U]=S(O,U);F.fn[P]=S(O,P);aj.pushState=T=function(a,d){if(M(a)&&/^#/.test(a)&&d===ac){d=2;}var b=a!==ac,c=ai(V[ae][aa],b?a:{},b?d:2);V[ae][aa]=c+(/#/.test(c)?"":"#");};aj.getState=L=function(b,a){return b===ac||typeof b==="boolean"?K(b):K(a)[b];};aj.removeState=function(b){var a={};if(b!==ac){a=L();F.each(F.isArray(b)?b:arguments,function(c,d){delete a[d];});}T(a,2);};ag[ah]=F.extend(ag[ah],{add:function(c){var a;function b(d){var f=d[P]=ai();d.getState=function(h,g){return h===ac||typeof h==="boolean"?Z(f,h):Z(f,g)[h];};a.apply(this,arguments);}if(F.isFunction(c)){a=c;return b;}else{a=c.handler;c.handler=b;}}});})(jQuery,this);(function(q,r,z){var p,o=q.event.special,y="location",x="hashchange",m="href",v=q.browser,u=document.documentMode,s=v.msie&&(u===z||u<8),w="on"+x in r&&!s;function A(a){a=a||r[y][m];return a.replace(/^[^#]*#?(.*)$/,"$1");}q[x+"Delay"]=100;o[x]=q.extend(o[x],{setup:function(){if(w){return false;}q(p.start);},teardown:function(){if(w){return false;}q(p.stop);}});p=(function(){var a={},b,g,f,c;function d(){f=c=function(h){return h;};if(s){g=q('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;c=function(){return A(g.document[y][m]);};f=function(h,k){if(h!==k){var j=g.document;j.open().close();j[y].hash="#"+h;}};f(A());}}a.start=function(){if(b){return;}var h=A();f||d();(function j(){var k=A(),l=c(h);if(k!==h){f(h=k,l);q(r).trigger(x);}else{if(l!==h){r[y][m]=r[y][m].replace(/#.*/,"")+"#"+l;}}b=setTimeout(j,q[x+"Delay"]);})();};a.stop=function(){if(!g){b&&clearTimeout(b);b=0;}};return a;})();})(jQuery,this);function $m(a){return document.getElementById(a);}function remove(a){a.parentNode.removeChild(a);}function addEvent(c,b,a){if(c.addEventListener){c.addEventListener(b,a,true);}if(c.attachEvent){c.attachEvent("on"+b,a);}}function removeEvent(c,b,a){if(c.detachEvent){c.detachEvent("on"+b,a);}else{c.removeEventListener(b,a,false);}}function micoxUpload(d,j,f,g,h){d=typeof(d)=="string"?$m(d):d;var c="";if(d==null||typeof(d)=="undefined"){c+="The form of 1st parameter does not exists.\n";}else{if(d.nodeName.toLowerCase()!="form"){c+="The form of 1st parameter its not a form.\n";}}if($m(f)==null){c+="The element of 3rd parameter does not exists.\n";}if(c.length>0){alert("Error in call micoxUpload:\n"+c);return;}var b=document.createElement("iframe");b.setAttribute("id","micox-temp");b.setAttribute("name","micox-temp");b.setAttribute("width","0");b.setAttribute("height","0");b.setAttribute("border","0");b.setAttribute("style","width: 0; height: 0; border: none;");d.parentNode.appendChild(b);window.frames["micox-temp"].name="micox-temp";var a=function(){removeEvent($m("micox-temp"),"load",a);var k="javascript: ";k+="window.parent.$m('"+f+"').innerHTML = document.body.innerHTML; void(0); ";$m(f).innerHTML=h;$m("micox-temp").src=k;setTimeout(function(){remove($m("micox-temp"));},250);};addEvent($m("micox-temp"),"load",a);d.setAttribute("target","micox-temp");d.setAttribute("type","text");d.setAttribute("action",j);d.setAttribute("method","post");d.setAttribute("enctype","multipart/form-data");d.setAttribute("encoding","multipart/form-data");d.submit();if(g.length>0){$m(f).innerHTML=g;}}function checkConnectionList(){var a=document.getElementById("msg_to");if(a.options.length==1||a.options.length==0){fillConnectionList("msg_to","forward");}}function fillConnectionList(b,a){var c=document.getElementById(b);if(!c){return;}fillConnectionCombo(c,MyConnectionList,b,a);}function fillConnectionCombo(f,d,c,a){clearList(f);if(a!="forward"){addElementToList(f,"My Connections","-- My Connections --");}var b=0;for(b=0;b<d.length;b++){if(d[b].username!=null){var h=d[b].email;var g=d[b].name.concat(" ("+h+")");addElementToList(f,d[b].username,g);}}}iCordX=(screen.width)?(screen.width-400)/2:0;iCordY=(screen.height)?(screen.height-400)/2:0;function inputs_prepopulate(){inputs=document.getElementsByTagName("input");n_inputs=inputs.length;for(i=0;i<n_inputs;i++){if(inputs[i].type=="text"){inputs[i].value=inputs[i].title;}}}function prepopulate(){inputs_prepopulate();}function browserCheck(){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var a=new Number(RegExp.$1);if(a<=7){window.onload=document.getElementById("support-browser-link").style.display="";window.onload=showcommondivIndex(contextRoot+"/jsp/BrowserSupportMessage.jsp","ConnectionPopUp","ConnectionPopUp");}}}function handleSearchBox(){var b=document.getElementById("search");if(b){var a=b.value;if(a.indexOf("Search by name")!=-1||a=="Search by name"){document.getElementById("search").value="";document.getElementById("search").focus();}else{selectSearchType();}}}var videos=new Array();videos[0]='<object width="240" height="209"><param name="movie" value="http://www.youtube-nocookie.com/v/SIS_0sbwRNQ?fs=1&amp;hl=en_US&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/SIS_0sbwRNQ?fs=1&amp;hl=en_US&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="240" height="209" wmode="transparent"></embed></object>';videos[1]='<object width="240" height="209"><param name="movie" value="http://www.youtube-nocookie.com/v/BJQi1jykeqU?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1&amp;color1=0x006699&amp;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/BJQi1jykeqU?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1&amp;color1=0x006699&amp;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="240" height="209" wmode="transparent"></embed></object>';videos[2]='<object width="240" height="209"><param name="movie" value="http://www.youtube-nocookie.com/v/nBlvkGyckoM?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1&amp;color1=0x006699&amp;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/nBlvkGyckoM?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1&amp;color1=0x006699&amp;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="240" height="209" wmode="transparent"></embed></object>';var videoIndex=0;function rotateVideo(){videoIndex++;if(videoIndex>=videos.length){videoIndex=0;}writeVideoCode(videos[videoIndex]);}function writeVideoCode(a){var b=a;document.getElementById("videospace").innerHTML=b;}function floatVideo(){var g=0;var f=3;var d=3;var a=0;for(var b=f;b>0;b--){a=g+b;if(a>d){a-=d;}var c=document.getElementById("video-float"+a);c.style.display="";}g=a;c=document.getElementById("video-float"+((a>1)?(a-1):d));c.style.display="none";}function ShowImportFromOtherId(a,b){if(a=="0"){document.getElementById("emailid").value="";document.getElementById("emailid").style.width="120px";document.getElementById("displayMailingDomains").style.display="";document.getElementById("OtherIdImport").style.display="none";document.getElementById("MyIdImport").style.display="";}if(a==1){document.getElementById("displayMailingDomains").style.display="none";document.getElementById("emailid").value=b;document.getElementById("emailid").style.width="220px";document.getElementById("MyIdImport").style.display="none";document.getElementById("OtherIdImport").style.display="";}document.getElementById("passwd").value="";}function getExpertise(f,c,d,a,g,b){otheruserid=b;profileparam=g;type=a;tabindexer=d;showResultWithQueryStr(f,c,callbackcommon,null,false,d,a);}function swapValuesNColor(b,c,a){if(a==1){document.getElementById(c).style.fontWeight="bold";document.getElementById(b).style.fontWeight="normal";document.getElementById("getComments").value="Write what help you may be looking about this content.";}else{if(a==2){document.getElementById(b).style.fontWeight="bold";document.getElementById(c).style.fontWeight="normal";document.getElementById("getComments").value="Write what help you may able to provide as an expert of this content.";}}}function checkstatus(b,a){showResultWithQueryStr(b,a,invitationHandler,null,true);return true;}function invitationErrorHandler(a){document.getElementById(a).innerHTML="";document.getElementById(a).innerHTML="Error while retrieving connection request";}function checkforother(c,b){var a=document.getElementById(c).value;if(a=="Other"){document.getElementById(b).style.display="";return true;}else{document.getElementById(b).style.display="none";return true;}}function invitationHandler(result,invID){document.getElementById(invID).innerHTML="";var output=document.getElementById(invID).innerHTML;var i;var jsonContent=eval("("+result+")");output+='<span style="font-weight: bold; color: rgb(0, 64, 128);" class="action" onclick=showmyconnectiion("pendingConnection.do?type=0","middle_div","pending",0,1,'+myuserid+')>Invitations (<span id="invCountID">'+jsonContent.length+"</span>)</span>";output+='<div id="specialdiv4" style="position: relative; width: 640px; height: auto; z-index: 2; left: 3%; margin-top: 1%; margin-bottom:1%;">';output+='<div align="left" style="position:relative;margin-top:0px; width:auto;height:auto; left: 0px; top: 0px;">';output+="</div>";output+="</div>";if(jsonContent.length>0){output+='<div id="connectionoutput" style="padding: 8px 5px;">';if(!jsonContent[jsonContent.length-1].response&&jsonContent.length>0){for(var i=0;i<jsonContent.length;i++){output+='<div id="inv'+i+'" style="position: relative; width: auto; height: 123px; padding-top: 0px; left: 0px; margin-top: 6px;">';output+='<div style="position: absolute; width: 100%; height: auto; left: 0px; margin-top: 0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div style="width:680px; height:120px;">';UserInfoConnDiv[i]=new UserInfo(jsonContent[i].userid,jsonContent[i].firstname,jsonContent[i].photo_thumbnail,jsonContent[i].summary,jsonContent[i].expertise,jsonContent[i].country,jsonContent[i].reviews,jsonContent[i].rating,jsonContent[i].rpm,jsonContent[i].category);output+='<div id="mulpv'+i+'" onmouseout="mclosetime()" onmouseover="mcancelclosetime()" style="display:none; left:80px; top:0px; position: absolute; width: 355px; height: auto; z-index: 100;"></div>';output+='<div id="ul" style="padding-right: 10px; cursor: pointer; padding-left: 10px; padding-top: 4px; width: 86px; z-index: 1;">';output+='<img id="mul'+i+'" onmouseout=mclosetime() onmouseover=viewBusinessCard('+i+',"mulpv'+i+'",event,"mul'+i+'","manageconnections") style="border: 0px; cursor:pointer;" height="76" alt="userimage" src="';if(jsonContent[i].photo_thumbnail){output+=localhost+jsonContent[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='"/></div>';output+='<div id="available" style="height: 13px; z-index: 2; font-size: 12px; width: 80px; margin-left: 30px; margin-top: 5px; float:left;">';output+="<img src="+((jsonContent[i].presence==PRESENCE_STATUS_ONLINE)?"../static/images/green-dot-icon.png":"../static/images/gray-dot-icon.png");output+=" />";output+="</div>";output+='<div style="overflow: hidden; position: absolute; height: 120px; top: 20px; line-height: 20px; width: 260px; left: 34%;">';if(login_user==null||login_user==""||!login_user){output+='<div id="namediv" style="overflow:hidden; max-height:20px;cursor:pointer;text-decoration:underline" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].username+'&from=index","middle_div","'+escape(jsonContent[i].username)+'") ><h1 style="font-size: 12px;">';}else{output+='<div id="namediv" style="overflow:hidden; max-height:20px;cursor:pointer;text-decoration:underline" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].username+'","middle_div","'+escape(jsonContent[i].username)+'") ><h1 style="font-size: 12px;">';}output+=jsonContent[i].firstname+"</h1></div>";output+='<div id="statusdiv" style="overflow:hidden; max-height: 20px; color: rgb(0, 64, 128);">';if(jsonContent[i].summary){if(jsonContent[i].summary.length>175){output+=jsonContent[i].summary.substr(0,175)+"</div>";}else{output+=jsonContent[i].summary+"</div>";}}else{output+="No summary</div>";}output+='<div class="clear" style="margin-left:0;">';output+='<div class="floatLeft rating'+jsonContent[i].rating+'" title="Profile Reviews"></div><div class="floatLeft">( <span class="action">'+jsonContent[i].reviews+" Reviews</span> )</div></div>";output+='<div class="clear" id="ratediv" style="color: rgb(51, 51, 51);">';output+="Rate : $ "+jsonContent[i].rpm+"/minute</div>";output+='<div id="sendMsgDiv" style="color: rgb(31, 101, 152);">';output+='<table width="180"><tr>';output+='<td><span class="action" onclick="openChatWindow(\'';output+=jsonContent[i].userid;output+="','"+jsonContent[i].category;output+="','"+jsonContent[i].firstname+"','";if(jsonContent[i].photo_thumbnail){output+=localhost+jsonContent[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')"><img alt="Chat" border="0" src="'+contextRoot+'/static/images/green-chat-icon.gif" title="Chat"/></span></td><td><span class="action" onclick="openChatWindow(\'';output+=jsonContent[i].userid;output+="','"+jsonContent[i].category;output+="','"+jsonContent[i].firstname+"','";if(jsonContent[i].photo_thumbnail){output+=localhost+jsonContent[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')">Chat</span></td><td width="10"></td>';output+='<td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(jsonContent[i].userid)+"&firstname="+escape(jsonContent[i].firstname)+'","common","compose",event)><img border="0" alt="" src="'+contextRoot+'/static/images/msgimg.png"/></span></td><td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(jsonContent[i].userid)+"&firstname="+escape(jsonContent[i].firstname)+'","common","compose",event)>Send Message</span></td>';output+="</tr></table>";output+="</div>";output+="</div>";output+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" style="position: absolute; top: 35px; left: 440px; margin-left: 35px;" onclick=showcommondiv("connection/AddConnections.jsp?username='+escape(jsonContent[i].fromuser)+"&tousername="+escape(jsonContent[i].firstname)+"&reqType=accept&connid="+escape(jsonContent[i].idconnection)+"&index="+i+'","ConnectionPopUp","ConnectionPopUp")>Accept Request As &raquo;</a>';output+="</div>";output+="</div>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+="</div>";}}}document.getElementById(invID).innerHTML=output;}function updateHomePage(c,g,j,m,f,k,a,l,b,h){userName=c;login_user=g;myuserid=g;otheruserid=g;var d=document.getElementById("login_chat");if(d){d.style.display="none";}doLogin(g,m,f,k);if(a=="null"||a==""||a==null){if(j=="showprofile"){showResultAct("MyProfile.do?pagnum=0","middle_div",3);}else{listUserConnections("MyConnection.do","0",login_user,"home",a,id,b,h);showResultAct("FetchEvent.do","inboxHome",2);}}else{checkForServices(a,b,l,h);}}function doStatusGreen(){showResultWithQueryStr("doOffline.do?flag=1",null,doStatusGreenCallback,"username="+hiddenUserid);}function doStatusGreenCallback(){}function postFeedback(a,g,c,r){pid=g;var d=a;var p=document.getElementById("toreview").value;var m=document.getElementById("skillid").value;var v;var x;for(var u=1;u<=5;u++){var o="communication"+u;if(document.getElementById(o).checked){v=document.getElementById(o).value;}}for(var s=1;s<=5;s++){var l="presentation"+s;if(document.getElementById(l).checked){x=document.getElementById(l).value;}}for(var q=1;q<=5;q++){var h="rating"+q;if(document.getElementById(h).checked){rating=document.getElementById(h).value;}}var w=document.getElementById("review").value;var b="user="+escape(p)+"&communication="+escape(v)+"&presentation="+escape(x)+"&rating="+escape(rating)+"&review="+escape(w)+"&skillid="+escape(m)+"&type="+c+"&remark="+r;var f=document.getElementById("payAmount");if(f&&f.value){b+="&Invoicerate="+f.value+"&expert_id="+escape(p)+"&projid="+r;showResultWithQueryStr(d,g,commoncallback,b);}else{showResultWithQueryStr(d,g,callback,b);closecommonconn();}return true;}function setDropDownValue(c){var a=c.selectedIndex;var b=c.options[a].value;return b;}checked=false;function checkedAll(c){var b=document.getElementsByName(c);if(checked==false){checked=true;}else{checked=false;}for(var a=0;a<b.length;a++){b[a].checked=checked;}}function toggleHeight(c,b){var a=document.getElementById(c);if(a.style.height=="268px"){a.style.height="auto";document.getElementById(b).innerHTML="<< show less";}else{a.style.height="268px";document.getElementById(b).innerHTML="show more >>";}}function toggleDiv(a){if(document.layers){if(document.layers[""+a+""].display==""){document.layers[""+a+""].display="none";document.getElementById("user-menu-btn").className="arrow-right";}else{document.layers[""+a+""].display="";document.getElementById("user-menu-btn").className="arrow-down";}}else{if(document.all){if(document.all[""+a+""].style.display==""){document.all[""+a+""].style.display="none";document.getElementById("user-menu-btn").className="arrow-right";}else{document.all[""+a+""].style.display="";document.getElementById("user-menu-btn").className="arrow-down";}}else{if(document.getElementById){if(document.getElementById(""+a+"").style.display==""){document.getElementById(""+a+"").style.display="none";document.getElementById("user-menu-btn").className="arrow-right";}else{document.getElementById(""+a+"").style.display="";document.getElementById("user-menu-btn").className="arrow-down";}}}}}function viewPopupDiv(a){document.getElementById(a).style.display="";}function hidePopDivForuser(a){document.getElementById(a).style.display="none";}function newviewPopupDivGeorge(a,c,d,b){var f=document.all?true:false;if(f){tempX=event.clientX;tempY=event.clientY;}else{tempX=c.pageX;tempY=c.pageY;}if(tempX<0){tempX=0;}if(tempY<0){tempY=0;}mcancelclosetime();if(ddmenuitem){ddmenuitem.style.display="none";}tempY=tempY-45;ddmenuitem=document.getElementById(a);ddmenuitem.style.display="";}function colorBG(a){document.getElementById(a).style.background="#F4F9FF";}function uncolorBG(a){document.getElementById(a).style.background="#FFFFFF";}function newhidePopDivForuser(){document.getElementById(ulpv).innerHTML="";document.getElementById(ulpv).style.display="none";}function toggleRowColor(a,b){if(a.checked==true){document.getElementById(b).style.backgroundColor="#EEF6FA";}else{if(a.checked==false){document.getElementById(b).style.backgroundColor="#FFF";}}}function check(d){var c=document.getElementsByName("subscriptions");var a=document.getElementsByName("rowcolor");var b=document.getElementById(d);if(b.checked==true){d=1;for(i=0;i<a.length;i++){a[i].style.backgroundColor="#EEF6FA";}}else{if(b.checked==false){d=0;for(i=0;i<a.length;i++){a[i].style.backgroundColor="#FFFFFF";}}}for(i=0;i<c.length;i++){c[i].checked=d;}}function mail_showlayer(d,c){var a=d+"body";var b=document.getElementById(d).style.display;if(b=="none"){document.getElementById(d).style.display="";wordWrapDiv(c);document.getElementById(c).innerHTML='<img alt="&and;" src="'+contextRoot+'/static/images/arrowDown_1.png" hspace="4" vspace="2"/>';}else{document.getElementById(d).style.display="none";document.getElementById(c).innerHTML='<img alt="&or;" src="'+contextRoot+'/static/images/arrowUp.gif" hspace="4" vspace="2"/>';}}function mail_showlayer_home(c){var b=document.getElementById(c).style.display;var a=c+"body";if(b=="none"){document.getElementById(c).style.display="";wordWrapDiv(a);}else{document.getElementById(c).style.display="none";}}function bae_showlayer(b){var a=document.getElementById(b).style.display;if(a=="none"){document.getElementById(b).style.display="";}else{document.getElementById(b).style.display="none";}}function getSelected(c){var d=new Array();var b=0;for(var a=0;a<c.length;a++){if(c[a].selected){b=d.length;d[b]=new Object();d[b].value=c[a].value;d[b].index=a;}}return d;}function outputSelected(b){var d=getSelected(b);var a="";for(var c in d){if(!c.hasOwnProperty(d)){continue;}a+=d[c].value+".";}return a;}function fetchServerResponse(d,b,a,f){var c=d;c=c+"?"+b;showResultWithQueryStr1(c,f,a,null,true);return true;}function onenterInviteeHome(a,c){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(b==13){ImportContactsHome(c,"ConnectionPopUp","Show_Error");}return false;}function onenterAction(b,d,a){var c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(c==13){if(a=="searchconn"){showmysearch(d,"connectionsAndPagination","view1");return false;}if(a=="manage"){showmysearch(d,"middle_div","manage");return false;}if(a=="forgetPswd"){checkUserExists(d,"invalid_div");return false;}}return true;}function updateUserName(a){document.getElementById("username").innerHTML=a;}function reduceProjBC(){document.getElementById("projBC").style.width="200px";}function changePic(c,b,a){document[c].src=b;changeTxt(a);}var maxmin=true;function setNextlinks(a,f,b,g){var d=1;var h=a;if(f=="Expert"){d=2;}if(f=="message"){d=2;}if(f=="ProjectProfile"){d=1;}var c="";if(b<(g-1)){if(b!=0){c+='<li onclick=setNextlinks("'+h+'","'+f+'",'+escape(0)+","+escape(g)+")>&laquo; First</li>";c+='<li onclick=setNextlinks("'+h+'","'+f+'",'+escape(b-1)+","+escape(g)+")>&laquo; Previous</li>";}b++;if(b==1){c+='<li class="current">'+escape(b)+'</li><li class="blank">of</li><li>'+escape(g)+"</li>";}else{c+='<li class="blank">Page</li><li class="current">'+escape(b)+'</li><li class="blank">of</li><li>'+escape(g)+"</li>";}b--;c+='<li onclick=setNextlinks("'+h+'","'+f+'",'+escape(b+1)+","+escape(g)+")>Next &raquo;</li>";c+='<li onclick=setNextlinks("'+h+'","'+f+'",'+escape(g-1)+","+escape(g)+")>Last &raquo;</li>";if(f=="message"){showResultAct(h+"?pagenum="+escape(b),"mydiv",2);}else{if(f=="ProjectProfile"){showResultAct(h+"?pagenum="+escape(b),"mydiv",1);}else{if(f=="messagesent"){showResultAct(h+"?pagenum="+escape(b),"specialdiv",1);}else{if(f=="connection"){showmyconnectiion(h,"connectionoutput","view",b,tabindexer,otheruserid);}else{if(f=="manageconn"){showmyconnectiion(h,"manageoutput","manage",b);}else{if(f=="Content"){jsonSearchNext(h+"?mypage="+escape(b)+"&pagetype=next",searchFilters.domain,"Content",tabindexer,"hidiv",searchFilters.mainSearchPattern);}else{if(f=="ContentRefined"){performSearchNext(+escape(b),f);}else{if(f=="Expert"){jsonSearchNext(h+"?mypage="+escape(b)+"&pagetype=next",searchFilters.domain,"Expert",tabindexer,"hellodiv",searchFilters.mainSearchPattern);}else{if(f=="ExpertRefined"){performSearchNext(+escape(b),f);}else{if(f=="AsExpert"){showResultAct(h+"?mypage="+escape(b),"expertdiv",2);}else{if(f=="Explorer"){showResultAct(h+"?mypage="+escape(b),"explorerdiv",1);}else{if(f=="Requirements"){showProjPages(h+"?pagenum="+escape(b),"mydiv",2);}}}}}}}}}}}}}else{if(b==g-1){c+='<li onclick=setNextlinks("'+h+'","'+f+'",'+escape(0)+","+escape(g)+")>&laquo; First</li>";c+='<li onclick=setNextlinks("'+h+'","'+f+'",'+escape(b-1)+","+escape(g)+")>&laquo; Previous</li>";b++;c+='<li class="current">'+escape(b)+'</li><li class="blank">of</li><li>'+escape(g)+"</li>";b--;if(f=="message"){showResultAct(h+"?pagenum="+escape(b),"mydiv",2);}else{if(f=="ProjectProfile"){showResultAct(h+"?pagenum="+escape(b),"mydiv",1);}else{if(f=="messagesent"){showResultAct(h+"?pagenum="+escape(b),"specialdiv",1);}else{if(f=="connection"){showmyconnectiion(h,"connectionoutput","view",+escape(b),0);}else{if(f=="Content"){jsonSearchNext(h+"?mypage="+escape(b)+"&pagetype=next",searchFilters.domain,"Content",tabindexer,"hidiv",searchFilters.mainSearchPattern);}else{if(f=="ContentRefined"){performSearchNext(+escape(b),f);}else{if(f=="manageconn"){showmyconnectiion(h,"manageoutput","manage",b);}else{if(f=="Expert"){jsonSearchNext(h+"?mypage="+escape(b)+"&pagetype=next",searchFilters.domain,"Expert",tabindexer,"hellodiv",searchFilters.mainSearchPattern);}else{if(f=="ExpertRefined"){performSearchNext(+escape(b),f);}else{if(f=="AsExpert"){showResultAct(h+"?mypage="+escape(b),"expertdiv",2);}else{if(f=="Explorer"){showResultAct(h+"?mypage="+escape(b),"explorerdiv",1);}else{if(f=="Requirements"){showProjPages(h+"?pagenum="+escape(b),"mydiv",2);}else{showResultAct(h+"?pagnum="+escape(b),"RequirementResults",d);}}}}}}}}}}}}}}if(f=="message"||f=="Requirements"){document.getElementById("mypagination").innerHTML=c;}else{if(f=="ProjectProfile"){document.getElementById("mypagination").innerHTML=c;}else{if(f=="Expert"||f=="ExpertRefined"){document.getElementById("ExpertSearchPages").innerHTML=c;}else{if(f=="Content"||f=="ContentRefined"){document.getElementById("ContentSearchPages").innerHTML=c;}else{document.getElementById("pagination").innerHTML=c;}}}}return true;}function viewBusinessCard(u,A,w,g,p){var a,v,c,r,k,h,b,l,B,s,y,m,x,q,z,d,o,j;if(p=="connections"){a=UserInfopopupDiv[u].userid;v=UserInfopopupDiv[u].firstname;c=UserInfopopupDiv[u].photo;k=UserInfopopupDiv[u].summary;h=UserInfopopupDiv[u].expertise;b=UserInfopopupDiv[u].conid;l=UserInfopopupDiv[u].relation;B=UserInfopopupDiv[u].tag;m=UserInfopopupDiv[u].rating;y=UserInfopopupDiv[u].reviews;x=UserInfopopupDiv[u].rpm;q=UserInfopopupDiv[u].category;z=UserInfopopupDiv[u].position;d=UserInfopopupDiv[u].company;o=UserInfopopupDiv[u].skypeid;}else{if(p=="commonconnections"){a=UserInfopopupCommonConnDiv[u].userid;v=UserInfopopupCommonConnDiv[u].firstname;c=UserInfopopupCommonConnDiv[u].photo;k=UserInfopopupCommonConnDiv[u].summary;h=UserInfopopupCommonConnDiv[u].expertise;m=UserInfopopupCommonConnDiv[u].rating;y=UserInfopopupCommonConnDiv[u].reviews;x=UserInfopopupCommonConnDiv[u].rpm;q=UserInfopopupCommonConnDiv[u].category;z=UserInfopopupCommonConnDiv[u].position;d=UserInfopopupCommonConnDiv[u].company;}else{if(p=="manageconnections"){a=UserInfopopupDiv[u].userid;v=UserInfopopupDiv[u].firstname;c=UserInfopopupDiv[u].photo;k=UserInfopopupDiv[u].summary;h=UserInfopopupDiv[u].expertise;b=UserInfopopupDiv[u].conid;l=UserInfopopupDiv[u].relation;B=UserInfopopupDiv[u].tag;m=UserInfopopupDiv[u].rating;y=UserInfopopupDiv[u].reviews;x=UserInfopopupDiv[u].rpm;q=UserInfopopupDiv[u].category;z=UserInfopopupDiv[u].position;d=UserInfopopupDiv[u].company;o=UserInfopopupDiv[u].skypeid;}else{if(p=="viewconnections"){a=UserInfoConnDiv[u].userid;v=UserInfoConnDiv[u].firstname;c=UserInfoConnDiv[u].photo;k=UserInfoConnDiv[u].summary;h=UserInfoConnDiv[u].expertise;m=UserInfopopupDiv[u].rating;y=UserInfoConnDiv[u].reviews;x=UserInfoConnDiv[u].rpm;q=UserInfoConnDiv[u].category;z=UserInfopopupDiv[u].position;d=UserInfopopupDiv[u].company;}else{if(p=="expertiselist"){a=ExpertsList[u].userid;v=ExpertsList[u].firstname;c=ExpertsList[u].photo;k=ExpertsList[u].summary;h=ExpertsList[u].expertise;m=ExpertsList[u].rating;y=ExpertsList[u].reviews;x=ExpertsList[u].rpm;q=ExpertsList[u].category;z=ExpertsList[u].position;d=ExpertsList[u].company;}}}}}var f='<div style="width: 370px; height:auto; z-index: 10000">';f+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 370px; height:auto;">';f+="<tr>";f+='<td class="corner_topleft">';f+="</td>";f+='<td class="top_side_border">';f+="</td>";f+='<td class="corner_topright">';f+="</td>";f+="</tr>";f+="<tr>";f+='<td class="left_side_border">';f+="</td>";f+='<td id="corner_content" class="corner_content">';f+='<div id="borderVline" style="margin:2px; height: 140px; width: 105px;">';f+='<div id="uploadPic" style="border-right: 1px solid #CCC; padding: 6px; height: 114px; width: 90px;">';if(c){if(login_user==null||login_user==""||!login_user){f+='<img onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'&from=index","middle_div","'+escape(a)+'") alt="uimg" width="80" src='+localhost+c+" alt="+v+' style="cursor:pointer"/>';}else{f+='<img onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'","middle_div","'+escape(a)+'") alt="uimg" width="80" src='+localhost+c+" alt="+v+' style="cursor:pointer"/>';}}else{if(login_user==null||login_user==""||!login_user){f+='<img onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'&from=index","middle_div","'+escape(a)+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png" style="margin-top:10px; cursor:pointer"/>';}else{f+='<img onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'","middle_div","'+escape(a)+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png" style="margin-top:10px; cursor:pointer"/>';}}f+='<div id="available" style="color: #333; padding:3px; padding-left:0px; text-align:center;">';f+="<img src="+((j==PRESENCE_STATUS_ONLINE)?"'+contextRoot+'/static/images/green-dot-icon.png":"'+contextRoot+'/static/images/gray-dot-icon.png");f+=" />";f+="</div>";f+="</div>";f+="</div>";f+='<div style="line-height: 18px; padding: 5px; min-height:85px; width: 235px; height: auto; position: relative; margin-top: -120px; margin-left: 110px;">';f+='<a id="ufn" href="javascript:void(0)" onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'","middle_div","'+escape(a)+'") style="color: #D26419; font-weight:bold;">';f+=v+"</a>";if(z&&d){f+='<div id="workDetails" style="max-height:100px; overflow:hidden;">';if(z.length>=50&&d.length>=50){f+=z.substring(0,50)+" at "+d.substring(0,50);}else{f+=z+" at "+d;}f+="</div>";}if(k){f+='<div id="summarytxts" style="max-height:100px; overflow:hidden;">';if(k.length>=100){f+=k.substring(0,100);}else{f+=k;}f+="</div>";}f+='<div id="ratediv" style="color: #333333;">';if(x=="0"){f+="$0 to $5 per minute";}else{f+="$ 0/minute";}f+="</div>";f+='<div id="RatingStars" class="clear" style="margin-left:0;"><div class="floatLeft rating'+m+'" title="Profile Reviews"></div><div class="floatLeft">&nbsp; <span class="action"onclick=showcommondiv("ViewAllReviews.do?username='+escape(a)+'&skillid=0","ConnectionPopUp","ConnectionPopUp")>'+y+" reviews</span></div>";f+="</div></div>";f+='<div id="topBarMenu" style="position: absolute; width: 240px; height: 23px; z-index: 100; left: 117px; top: 12px; background-color: #E5ECF2; border:1px solid #CCC;">';f+='<div id="morediv'+u+'" onmouseover=viewPopupDiv("moreList'+u+'") onmouseout=hidePopDivForuser("moreList'+u+'") style="border: 0px none #CCCCCC; padding: 4px 0px 4px 0px; position: absolute; width: 58px; height: auto; z-index: 100; left: 182px; top: 1px; color: #004080; text-align: center; cursor: pointer;">';f+='More <img alt="" src="'+contextRoot+'/static/images/arrowds.png" />';f+='<div id="moreList'+u+'" style="display:none;border: 1px solid #80A0C0; position: absolute; width: 100px; height: auto; z-index: 210; left: -20px; top: 20px; color: #004080; background-color: #FFFFFF;text-align:left;">';f+='<div style="display:block; z-index:100; margin-left:0px; margin-top:0px; padding:6px; line-height:15px;">';if(a==myuserid){f+='<span class="action" style="color:#1F6598;" onclick=showviewprofile("MyProfile.do?uid='+escape(a)+'","middle_div","'+escape(a)+'")>View Profile</span><br>';}else{if(checkInGroup(a)){if(login_user==null||login_user==""||!login_user){f+='<span class="action" style="color:#1F6598;" onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'&from=index","middle_div","'+escape(a)+'")>View Profile</span><br>';}else{f+='<span class="action" style="color:#1F6598;" onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'","middle_div","'+escape(a)+'")>View Profile</span><br>';}}else{if(login_user==null||login_user==""||!login_user){f+='<span class="action" style="color:#1F6598;" onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'&from=index","middle_div","'+escape(a)+'")>View Profile</span><br>';}else{f+='<span class="action" style="color:#1F6598;" onclick=showviewprofile("ViewOtherProfile.do?uid='+escape(a)+'","middle_div","'+escape(a)+'")>View Profile</span><br>';}}}if(a!=myuserid){f+='<span class="action" style="color:#1F6598;" onclick=showcommondiv("checkfeedback.do?uid='+escape(a)+"&name="+escape(v)+'&skillid=0&type=connection&remark=connection","ConnectionPopUp","ConnectionPopUp")>Give Feedback</span><br>';}f+='<span class="action" style="color:#1F6598;" onclick=showcommondiv("ViewAllReviews.do?username='+escape(a)+'&skillid=0","ConnectionPopUp","ConnectionPopUp")>View Feedback</span><br>';if(a!=myuserid){f+='<span class="action" style="color:#1F6598;" onclick=showcommondiv("connection/EditConnections.jsp?firstname='+escape(v)+"&conid="+escape(b)+"&touserid="+escape(a)+"&relation="+escape(l)+"&tag="+escape(B)+'","ConnectionPopUp","ConnectionPopUp")>Add as Expert</span><br>';f+='<span class="action" style="color:#1F6598;" onclick=showcommondiv("connection/EditConnections.jsp?firstname='+escape(v)+"&conid="+escape(b)+"&touserid="+escape(a)+"&relation="+escape(l)+"&tag="+escape(B)+'","ConnectionPopUp","ConnectionPopUp")>Add as Explorer</span><br>';f+='<span class="action" style="color:#1F6598;" onclick=showcommondiv("connection/EditConnections.jsp?firstname='+escape(v)+"&conid="+escape(b)+"&touserid="+escape(a)+"&relation="+escape(l)+"&tag="+escape(B)+'","ConnectionPopUp","ConnectionPopUp")>Add as Friend</span><br>';}f+="</div>";f+="</div></div>";if(a==hiddenUserid){f+='<div id="chatdiv"  style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 0px solid #CCCCCC; border-bottom: 0px solid #CCCCCC; padding: 4px 0px 4px 0px; position: absolute; width: 76px; height: auto; z-index: 1; left: 103px; top: 1px; color: #004080; text-align: center; cursor: pointer;">';f+="Live Chat</div>";}else{f+='<div id="chatdiv" onclick="openChatWindow(\'';f+=a;f+="','"+q;f+="','"+v+"','";if(c){f+=localhost+c;}else{f+=contextRoot+"/static/images/newUserImg.png";}f+="','"+o+"','"+z+"','"+d+'\',event)" style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 0px solid #CCCCCC; border-bottom: 0px solid #CCCCCC; padding: 4px 0px 4px 0px; position: absolute; width: 76px; height: auto; z-index: 1; left: 103px; top: 1px; color: #004080; text-align: center; cursor: pointer;">';f+="Live Chat</div>";}if(a==myuserid){f+='<div id="emaildiv"  style="padding: 4px 0px 4px 0px; position: absolute; width: 102px; height: auto; z-index: 1; left: 2px; top: 1px; color: #004080; text-align: center; cursor: pointer;">';f+="Send Message</div>";}else{f+='<div id="emaildiv" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(a)+"&firstname="+escape(v)+'","common","compose") style="padding: 4px 0px 4px 0px; position: absolute; width: 102px; height: auto; z-index: 1; left: 2px; top: 1px; color: #004080; text-align: center; cursor: pointer;">';f+="Send Message</div>";}f+="</div>";f+="</td>";f+='<td class="right_side_border">';f+="</td>";f+="</tr>";f+="<tr>";f+='<td class="corner_bottomleft">';f+="</td>";f+='<td class="bottom_side_border">';f+="</td>";f+='<td class="corner_bottomright">';f+="</td>";f+="</tr>";f+="</table>";f+="</div>";mcancelclosetime();if(ddmenuitem){ddmenuitem.style.display="none";}ddmenuitem=document.getElementById(A);ddmenuitem.innerHTML="";ddmenuitem.innerHTML=f;ddmenuitem.style.display="";}function managecommondiv(c,b,a,d){mangeuserid=b;var f=document.all?true:false;if(f){tempX=event.clientX;tempY=event.clientY;}else{tempX=d.pageX;tempY=d.pageY;}if(tempX<0){tempX=0;}if(tempY<0){tempY=0;}pid=a;showResultWithQueryStr(c,invID,commonmanagecallback,null);return true;}function showcommondiv(d,c,f,b,a){if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");if(b==null||b=="undefined"){document.getElementById("login_details").value="other:"+d+":"+c+":"+f;document.getElementById("regRedirect").value="other:"+d+":"+c+":"+f;}else{if(b=="forward"){document.getElementById("login_details").value="forward:"+d+":"+c+":"+f;document.getElementById("regRedirect").value="forward:"+d+":"+c+":"+f;}else{if(b=="training"){document.getElementById("regType").value="training";document.getElementById("regType2").value="training";}}}}else{freezid=c;lid=f;showResultWithQueryStr(d,c,commoncallback,null,true);if(b=="postRequirement"){if(login_user==null||login_user==""){addTrackEvent("Before Login","Post Project",a);}else{addTrackEvent("After Login","Post Project",a);}}if(b=="becomeAnExpert"){if(login_user==null||login_user==""){addTrackEvent("Before Login","Post Skill",a);}else{addTrackEvent("After Login","Post Skill",a);}}}if(b==1){getProfileViewers("getViewers.do","profileVisits");}else{if(b==2){window.setTimeout("showRequestResult('CheckMyConnections.do', 'invitationRequest',0)",2000);}}}function showContentFromIndex(d,a,f,g,b,c){contentId=b;contentComment=c;user_type=g;freezid=a;lid=f;showResultWithQueryStr(d,a,callbackCotentComment,null,true);}function callbackCotentComment(a,b){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;if(lid){ModalPopup(lid,"");}if(!readdedComment&&contentComment!=undefined&&contentId!=undefined){reAddUserComment(contentId,contentComment,user_type);alert(readdedComment);alert(contentComment);alert(contentId);}}function showcommondivIndex(c,b,d,a){freezid=b;lid=d;showResultWithQueryStr(c,b,commoncallbackindex,null,true);if(freezid=="postRequirement"){if(login_user==null||login_user==""){addTrackEvent("Before Login","Post Project",a);}else{addTrackEvent("After Login","Post Project",a);}}if(freezid=="becomeAnExpert"){if(login_user==null||login_user==""){addTrackEvent("Before Login","Post Skill",a);}else{addTrackEvent("After Login","Post Skill",a);}}}function showComposeMsg(f,b,d,a){if(a==1){var c=document.getElementById("viewkbname").innerHTML;f+="&firstname="+c;}if(a=="InvMsg"){closecommonconn();}pid=b;freezid=b;lid=d;if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="sendmsg:"+f+":"+b+":"+d;}else{showResultWithQueryStr(f,b,callbackCompose,null,true);}addTrackEvent("button","send","message");}var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);function fixPNG(f){if((version>=5.5)&&(version<7)&&(document.body.filters)){var b=(f.id)?"id='"+f.id+"' ":"";var d=(f.className)?"class='"+f.className+"' ":"";var g=(f.title)?"title='"+f.title+"' ":"title='"+f.alt+"' ";var c="display:inline-block;"+f.style.cssText;var a="<span "+b+d+g+' style="'+"width:"+f.width+"px; height:"+f.height+"px;"+c+";"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src='"+f.src+"', sizingMethod='scale');\"></span>";f.outerHTML=a;}}function checkForServices(c,g,f,a){var k=c.split(":");var b=k[0];if(f!="null"){directToReg(f,f,a);}else{if(b=="AddReq"){listUserConnections("MyConnection.do","0",login_user,"home",c,id,g,a);showResultAct("GetMessages.do","inboxHome",2);setTimeout("showcommondiv('InvitationRequest.jsp', 'ConnectionPopUp', 'ConnectionPopUp',2)",4000);return true;}else{if(b=="chat"){openChatWindow(k[1],k[2],k[3],k[4]);return true;}else{if(b=="sendmsg"){showComposeMsg(k[1],k[2],k[3],g);return true;}else{if(b=="viewprofile"){showviewprofile(k[1],k[2],k[3]);return true;}else{if(b=="viewkbprofile"){showResultAct(k[1],k[2],k[4],k[5],k[6],k[3]);return true;}else{if(b=="Inbox"){showResultAct("GetMessages.do","middle_div",3);return true;}else{if(b=="viewpendingreq"){showmyconnectiion(k[1],k[2],k[3],k[4],k[5]);return true;}else{if(b=="viewotherconnections"){showmyconnectiion(k[1],k[2],k[3],k[4],k[5],k[6]);return true;}else{if(b=="addcomment"){showContentFromIndex(k[1],"ConnectionPopUp","ConnectionPopUp",k[4],k[2],k[3]);return true;}else{if(b=="postskill"){postSkill(k[1],k[2],"globalErrorMessage");return true;}else{if(b=="postcontent"){postContent(k[1],k[2],"globalErrorMessage");return true;}else{if(b=="postproject"){ajaxFileUpload(k[1]+k[2]);return true;}else{if(b=="postbump"){showResultAct(k[1],k[2]);return true;}else{if(b=="other"){showcommondiv(k[1],k[2],k[3]);return true;}else{if(b=="forward"){listUserConnections("MyConnection.do","0",login_user,"home",c,id,g,a);showResultAct("GetMessages.do","inboxHome",2);showcommondiv(k[1],k[2],k[3]);return true;}else{if(b=="iknowit"){showKnowItInPopUp(k[1],k[2],k[3]);return true;}else{if(b=="ilearnit"){showLearnItInPopUp(k[1],k[2],k[3]);return true;}else{if(b=="search"){var j=document.getElementById("search");if(j){j.value=k[2];var h=document.getElementById((k[1]=="content")?"kb_search_btn":"expert_search_btn");if(h){h.onclick();}}}else{if(b=="paypal"){showcommondiv("AddFund.do?projectInfoType=addFund","ConnectionPopUp","ConnectionPopUp");return true;}else{if(b=="Project"){showResultAct(k[1],k[2]);if(k[3]==login_user){k[3]='[{"response":"Sorry!! You Can not bid your project yourself !!"}]';handleGlobalResponse2(k[3]);return true;}}else{if(b=="inviteFriends"){showcommondivIndex(contextRoot+"/jsp/InviteFriendsHome.jsp?flag=index&email="+k[1],"ConnectionPopUp","ConnectionPopUp");}}}}}}}}}}}}}}}}}}}}}}return false;}function updateTotalPoints(b){var a=parseInt($("#totalpoints").html(),10);if(isNaN(a)||a>=b){$("#totalpoints").removeClass("totalPointsUpdate");$("#totalpoints").html(b);}else{$("#totalpoints").html(++a);$("#totalpoints").addClass("totalPointsUpdate");window.setTimeout("updateTotalPoints("+b+")",200);}}function mopen(a){mcancelclosetime();if(ddmenuitem){ddmenuitem.style.display="none";}ddmenuitem=document.getElementById(a);ddmenuitem.style.display="";}function mclose(){if(ddmenuitem){ddmenuitem.style.display="none";}}function mclosetime(){closetimer=window.setTimeout(mclose,timeout);}function mclosetime2(a){uncolorBG(a);closetimer=window.setTimeout(mclose,timeout);}function mcancelclosetime(){if(closetimer){window.clearTimeout(closetimer);closetimer=null;}document.onclick=mclose;}function showMessageResult(d,b,c,a){pid=b;type=a;tabindexer=c;showResultWithQueryStr(d,b,callbackMessage,null,false,c,a);return true;}function showviewprofile(f,c,b,g){mid=c;useridvar=b;if(document.getElementById("EA")){document.getElementById("EA").className="ontab";}if(document.getElementById("KB")){document.getElementById("KB").className="ontab";}if(g){connectionflag=g;}if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="viewprofile:"+f+":"+c+":"+b;document.getElementById("regRedirect").value="viewprofile:"+f+":"+c+":"+b;return true;}else{var a=checkInGroup(b);var d=f+"&inConnection="+a;showResultWithQueryStr(d,c,callbackviewprofile,null,false,2,null);addTrackEvent("profile",(b==myuserid)?"self":"others","self="+myuserid+" other="+b);return true;}}function showMessageDivResult(c,a,b){mid=a;pid=b;showResultWithQueryStr(c,a,callback,null);}function callbackMessage(a,c){document.getElementById(c).innerHTML="";document.getElementById(c).innerHTML=a;clearItems(new Array("subcategory","sub_subcategory"));getAreaAndFill("category");fillConnectionList("msg_to");var b=new Spry.Widget.TabbedPanels("TabbedPanels1",tabindexer);}function callbackviewprofile(a,b){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;addShareButton();if(document.getElementById("privatesecureuserid")){useridvar=document.getElementById("privatesecureuserid").value;}if(connectionflag&&connectionflag=="editProfile"){listUserConnections("MyConnection.do","0",useridvar,connectionflag);}else{listUserConnections("MyConnection.do","0",useridvar);}}function callbackCompose(a,b){document.getElementById(b).style.display="";document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;document.getElementById("msg_to").style.display="none";document.getElementById("msg_to1").style.height="40px";document.getElementById("msg_to1").style.display="";if(lid){ModalPopup(b,"");}}function reloadHomePage(){var a="middle_div";var b="search";showResultWithQueryStr("UserHome.do",a,reloadHomePageHandler,null);isKBActive="ontab";isEAActive="ontab";isProjActive="ontab";if(b){if(document.getElementById("search")!=null){document.getElementById("search").value="Search by name";}document.getElementById("searchtype").value="experts";}}function reloadHomePageHandler(a,b){lid="";commoncallback(a,b);connectionflag="home";listUserConnections("MyConnection.do","0",myuserid,connectionflag);showResultAct("FetchEvent.do","inboxHome",2);updateLoingLogoutLinks();}var sDBFile,sVariables,imgpath,sNameDivErr,sNameDivMain,sProcessText,freezid;var index;var EzdiaUserDB=new Array();var EzdiaConnection=new Array();var SchoolProfile=new Array();var CollegeProfile=new Array();var CompanyProfile=new Array();var CategorySelection=new Array();var contentstr=new Array();var contentListing=new Array();var UserInfopopupDiv=new Array();var UserInfoConnDiv=new Array();var UserInfopopupCommonConnDiv=new Array();var MyConnectionList=new Array();var ChatUsers=new Array();var MyQaListing=new Array();var ExpertsList=new Array();var ViewPopuponSearch=new Array();var ViewPopuponSearch1=new Array();var fpmArray=new Array("rpm51","rpm5197","rpm97106","rpm106");var fpmArrayValues=new Array("Up to $0.51","$0.51 - $0.97","$0.97 - $1.06","$1.06 and Up");var ratingArray=new Array("rating1","rating14","rating45","rating5");var ratingArrayValues=new Array("Up to 1 star","1 stars - 4 stars","4 stars - 5 stars","5 stars");var profileparam;var globalErrorMessageDiv;var connectionflag;var projectMessage;var projectId="";var userId="";var contentComment="null";var contentId="null";var user_type="null";var readdedComment=false;var isKBActive;var isEAActive;var isProjActive;function ContentSearchFilter(){this.url="";this.mainurl="";this.searchType="";this.searchSubType="";this.categoryL1="";this.categoryL2="";this.categoryL3="";this.rating="";this.domain="";this.feePerMin="";this.mainSearchPattern="";var b=new Array();b["rpm51"]="Up to $0.51";b["rpm5197"]="$0.51 - $0.97";b["rpm97106"]="$0.97 - $1.06";b["rpm106"]="$1.06 and Up";var l=new Array();l["rating1"]="Up to 1 star";l["rating14"]="1 stars - 4 stars";l["rating45"]="4 stars - 5 stars";l["rating5"]="5 stars";function f(){var m="";if(this.categoryL1.length!=0){m+=">&nbsp;"+this.categoryL1;if(this.categoryL2.length!=0){m+="&nbsp;>&nbsp;"+this.categoryL2;if(this.categoryL3.length!=0){m+="&nbsp;>&nbsp;"+this.categoryL3;}}m+='<span class="action" onclick="searchFilters.clearCategory();performSearch(1);" style="align:right; color:#990000;">&nbsp;&nbsp; X Remove </span>';}if(this.feePerMin.length!=0){m+="<br/>>&nbsp;"+b[this.feePerMin];m+='<span class="action" onclick="searchFilters.clearRPM();performSearch();" style="align:right; color:#990000;">&nbsp;&nbsp; X Remove </span>';}if(this.rating.length!=0){m+="<br/>>&nbsp;"+l[this.rating];m+='<span class="action" onclick="searchFilters.clearRating();performSearch();" style="align:right; color:#990000;">&nbsp;&nbsp; X Remove </span>';}return unescape(m);}function g(){var o="";if(this.mainSearchPattern.length!=0){if(this.mainSearchPattern!="search="){o=this.mainSearchPattern;j(o);}else{o="search=";}}var m="";if(this.categoryL1.length!=0){m+=this.categoryL1;if(this.categoryL2.length!=0){m+="#"+this.categoryL2;if(this.categoryL3.length!=0){m+="#"+this.categoryL3;}else{m+="#*";}}else{m+="#*#*";}}if(trim(m).length!=0){o+="&categoryName="+escape(trim(m));}if(this.rating.length!=0){o+="&rating="+this.rating;}if(this.feePerMin.length!=0){o+="&rpm="+this.feePerMin;}return o;}function j(m){var r=new Array();var q=m.split("&");for(var p in q){var o=(q[p].toString()).split("=");r[o[0]]=o[1];}this.searchSubType=r["searchtype"];}function d(){this.feePerMin="";}function c(){this.rating="";}function k(){this.categoryL1="";this.categoryL2="";this.categoryL3="";}function h(){this.searchType="";this.searchSubType="";}function a(){this.searchSubType="";}this.getSearchString=g;this.formatSearchString=f;this.setSearchSubType=j;this.clearCategory=k;this.clearRating=c;this.clearRPM=d;this.clearSearchType=h;this.clearSearchSubType=a;}var searchFilters=new ContentSearchFilter();function MyConn(j,d,b,g,h,a,f,c){this.username=j;this.name=d;this.groupname=b;this.connectionid=g;this.relation=h;this.tag=a;this.presence=f;this.email=c;}function ChatArray(c,d,a,b,f){this.userid=c;this.name=d;this.position=a;this.company=b;this.skypeid=f;}function UserInfo(h,l,b,o,f,d,q,g,a,c,k,m,p,j){this.userid=h;this.firstname=l;this.photo=b;this.summary=o;this.expertise=f;this.country=d;this.reviews=q;this.rating=g;this.rpm=a;this.category=c;this.position=k;this.company=m;this.skypeid=p;this.presence=j;}function UserInfoDiv(a){this.divContent=a;}function UserInfo1(a){this.divContent=a;}function UserContent(a){this.contenturl=a;}function MyCategorySelection(a){this.categories=a;}function SchoolData(a,b,d,c){this.school=a;this.state=b;this.from=d;this.to=c;}function CollegeData(d,b,c,a,g,f){this.college=d;this.state=b;this.degree=c;this.major=a;this.from=g;this.to=f;}function CompanyData(b,c,a,d,g,f){this.company=b;this.state=c;this.position=a;this.industry=d;this.from=g;this.to=f;}function EzdiaUser(c,b,a){this.username=c;this.name=b;this.creationDate=a;}var month_name=new Array(13);month_name[0]="January";month_name[1]="February";month_name[2]="March";month_name[3]="April";month_name[4]="May";month_name[5]="June";month_name[6]="July";month_name[7]="August";month_name[8]="September";month_name[9]="October";month_name[10]="November";month_name[11]="December";month_name[12]="Till Date";function EzdiaConn(d,a,c,b){this.idconnection=d;this.fromuser=a;this.photo_thumbnail=c;this.firstname=b;}function SaveProfileData(){var a=document.getElementById("profilepagename").value;if(a=="general"){this.p_username=document.getElementById("gpusername").value;this.p_firstname=document.getElementById("firstname").value;this.p_lastname=document.getElementById("lastname").value;this.p_general_date=document.getElementById("general_date").value;this.p_general_month=document.getElementById("general_month").value;this.p_general_year=document.getElementById("general_year").value;this.p_streetaddress=document.getElementById("streetaddress").value;this.p_street2address=document.getElementById("street2address").value;this.p_city=document.getElementById("city").value;this.p_state=document.getElementById("state").value;this.p_country=document.getElementById("country").value;this.p_zip=document.getElementById("zip").value;this.p_language=document.getElementById("language").value;this.p_country_code=document.getElementById("country_code").value;this.p_code=document.getElementById("code").value;this.p_number=document.getElementById("number").value;this.p_extension=document.getElementById("extension").value;}}var search="";var userName;var myuserid;var pageId;var noOfPages;var startrecd;var endrecd;var mode;var iCordX=0,iCordY=0;var req;var sHTMLSearchAnim='<div align=center><img src="'+contextRoot+'/static/images/loading_animation_1.gif" width=48 height=54><br>###</div>';var sHTMLSearchAnimSmall='<div align=center><img src="'+contextRoot+'/static/images/loading.gif"><br>###</div>';var tempX;var tempY;var workarea="";var subarea="";var timeout=500;var timeout2=1000;var closetimer=0;var ddmenuitem=0;var wcsubsubcate="";var id;var showui;var pid;var nid;var lid;var useridvar=null;var mangeuserid;var ulpv="ulpv";var hiddenUserid;var interest_area="";var area_category="";var p_username;var p_firstname;var p_lastname;var p_general_date;var p_general_month;var p_general_year;var p_streetaddress;var p_street2address;var p_city;var p_state;var p_zip;var p_language;var p_country_code;var p_code;var p_number;var p_extension;var queryString;var contentdivname;var contentpagesize=3;var contentactionname;var contentpagenum;var actiontype=0;var contentmaxpagenum=0;var contentmaxpagenextflag=0;var contentsearchstr;var connectionjsonstring;var reg_username;var reg_password;var newIcordX=(screen.width)?(screen.width-934)/2:0;var requrl;var historyListener=function(b,c){if(b.indexOf("/p/")==0){showProjectResult(contextRoot+"/jsp/RequirementsSearch.do?url="+escape(b),"middle_div",3);}else{if(b.indexOf("/k/")==0){showProjectResult(contextRoot+"/jsp/KBSearch.do?url="+escape(b),"middle_div",3);}else{if(b.indexOf("/e/")==0){showProjectResult(contextRoot+"/jsp/EzdiaSearch.do?url="+escape(b),"middle_div",3);}else{if(c==null){return;}var a=c[0];if(typeof a=="function"){a.apply(this,c[1]);}}}}};var historyIndex=0;function replaceAndRunEzscript(result){var re=new RegExp(/<ezscript>([\s\S]*)<\/ezscript>/);var m=re.exec(result);if(m){eval("("+m[1]+")");result=result.replace(re,"");}return result;}var AjaxHandler=function(){this.callback=null;this.errCallback=null;this.req=null;this.updateDiv=null;this.clearGlobalMessage=true;this.init=function(a){this.req=getXHR();this.req.open("POST",a,true);this.setRequestHeader("X-Requested-With","XMLHttpRequest");};this.setRequestHeader=function(b,a){this.req.setRequestHeader(b,a);};this.setClearGlobalMessage=function(a){this.clearGlobalMessage=a;};this.send=function(b){var c=document.getElementById("globalErrorMessage");if(this.clearGlobalMessage&&c){c.innerHTML="";}var a=this;this.req.onreadystatechange=function(){switch(a.req.readyState){case 4:var g=a.req.status.toString().split("");switch(g[0]){case"2":var f=a.callback[0];a.callback[0]=replaceAndRunEzscript(a.req.responseText);if((BrowserDetect.browser=="Firefox")&&(BrowserDetect.version>=4)){a.callback=$.merge([],a.callback);}f.apply(this,a.callback);break;case"4":if(a.req.status==401){ModalPopup("NewLoginpopupdiv","");break;}case"5":if(a.errcallback){f=a.errcallback[0];a.errcallback.shift();f.apply(this,a.errcallback);}else{if(a.updateDiv){document.getElementById(a.updateDiv).innerHTML="Error while loading";}}break;}break;case 0:case 1:case 2:case 3:if(a.updateDiv){var h=document.getElementById(a.updateDiv);if(h){if(a.updateDiv=="requestTabhom"){h.innerHTML=sHTMLSearchAnimSmall.replace("###","");}else{h.innerHTML=sHTMLSearchAnim.replace("###","");}showDetails(a.updateDiv);}}}};this.param=b;this.req.send(b);};this.addCallback=function(){this.callback=arguments;};this.addErrCallback=function(a){this.errCallback=[].splice.call(arguments,0);};this.addUpdateDiv=function(a){this.updateDiv=a;};};var browser;var version;var OS;var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(d){for(var a=0;a<d.length;a++){var b=d[a].string;var c=d[a].prop;this.versionSearchString=d[a].versionSearch||d[a].identity;if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity;}}else{if(c){return d[a].identity;}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a==-1){return;}return parseFloat(b.substring(a+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function ChangeInEzdiaSearchTextIndex(){if(document.getElementById("search").value==document.getElementById("search").defaultValue){document.getElementById("search").value="";document.getElementById("search").className="bigSearchBarBlack";}}function ChangeInEzdiaSearchTextHome(){if(document.getElementById("search").value==document.getElementById("search").defaultValue){document.getElementById("search").value="";document.getElementById("search").className="homeSearchBoxBlack";}}function clearErrorMessage(){document.getElementById("globalErrorMessage").style.display="none";document.getElementById("globalErrorMessage").innerHTML="";}function setErrorMessage(d,a){var c=document.getElementById("errorSpan");if(c!=null){c.innerHTML=d;}else{c=document.createElement("span");c.id="errorSpan";c.style.color="Green";c.className="msgYellow";c.style.padding="2px 10px";c.innerHTML=d;var b=document.getElementById("globalErrorMessage");if(b!=null){b.style.display="";}b.appendChild(c);}hideSpan="<span style='border: 1px solid #2DADE1; padding: 1px 3px; font-weight: normal; vertical-align: top; margin-left: 5px; font-size: 8px; background-color: white;' class='action' onclick='clearErrorMessage()'>X</span>";var f=document.getElementById("globalErrorMessage");if(f!=null){f.innerHTML+=hideSpan;}if(a==1){window.setTimeout('clearErrorMessage("globalErrorMessage")',50000);}else{if(a==2){window.setTimeout('clearErrorMessage("globalErrorMessage")',300000);}else{window.setTimeout('clearErrorMessage("globalErrorMessage")',9000);}}}function storeGlobalErrorMessage(){var a=document.getElementById("globalErrorMessage");if(a!=null){globalErrorMessageDiv=a.innerHTML;}}function reStoreGlobalErrorMessage(){var a=document.getElementById("globalErrorMessage");if(a!=null){a.innerHTML=globalErrorMessageDiv;}}function addEventHandler(c,a,b){if(document.attachEvent){c.attachEvent("on"+a,b);}else{if(document.addEventListener){c.addEventListener(a,b,false);}}}function closeAllFreezPopup(a){if(document.getElementById(a)){ModalPopup.Close(a,"1");document.getElementById(a).innerHTML="";document.getElementById(a).style.display="none";return;}}function addShareButton(){var b=document.getElementById("addThisShare");if(!b){return;}var c=jQuery.extend(true,{},addthis_share);var a=b.getAttribute("url");if(a){c.url=a;}var f=b.getAttribute("title");if(f){c.title=f;}var d=b.getAttribute("description");if(d){c.description=d;}addthis.button(b,addthis_config,c);}function fblogin(){FB.login(function(a){if(a.authResponse){onFBLogin();}});}function onFBLogin(a){var f=FB.getAuthResponse();if(f){var d="fbId="+f.userID+"&token="+f.accessToken;var c=document.getElementById("login_details");if(c){var b=c.value;}if(b){d+="&details="+escape(b);}window.location.href=contextRoot+"/jsp/FBRegistration.do?"+d;}}function postToFBFeed(b,a,h,g,d,c){if(d==="shareSkill"){var f={method:"feed",link:b,picture:"http://www.ezdia.com/static/images/eZdia-logo.png",name:a+" has added a new skill on ezdia.com",caption:g,description:"Looking for expert help or become an expert by adding your Skills on ezdia. "};function j(k){if(k&&k.post_id){addTrackEvent("After Login","Post Skill","Social Sharing Page "+(c||""));$.ajax({url:"UserFeedAction.do",data:{eventid:c,remarks:"post_id="+k.post_id},success:function(l){updateTotalPoints(replaceAndRunEzscript(l));}});}}}else{if(d==="shareSkillBump"){f={method:"feed",link:b,picture:"http://www.ezdia.com/static/images/bump-up.png",name:a+" has Bumped "+h+"'s skill on ezdia.com",caption:g,description:"Find and bump more skills on ezdia. "};function j(k){if(k&&k.post_id){addTrackEvent("After Login","Post Bump","Social Sharing Page "+(c||""));$.ajax({url:"UserFeedAction.do",data:{eventid:c,remarks:"post_id="+k.post_id},success:function(l){updateTotalPoints(replaceAndRunEzscript(l));}});}}}else{if(d==="shareProject"){f={method:"feed",link:b,picture:"http://www.ezdia.com/static/images/eZdia-logo.png",name:a+" is looking for expert help in "+h+" on ezdia.com",caption:g,description:a+" has posted a new project on ezdia.com that may interest you to bid on the project."};function j(k){if(k&&k.post_id){addTrackEvent("After Login","Post Project","Social Sharing Page "+(c||""));$.ajax({url:"UserFeedAction.do",data:{eventid:c,remarks:"post_id="+k.post_id},success:function(l){updateTotalPoints(replaceAndRunEzscript(l));}});}else{}}}else{if(d==="shareService"){var f={method:"feed",link:b,name:"Trusted "+a+" | Try it yourself",caption:a};function j(k){if(k&&k.post_id){addTrackEvent("After Login","Service Launch","Social Sharing Page "+(c||""));$.ajax({url:"UserFeedAction.do",data:{eventid:c,remarks:"post_id="+k.post_id},success:function(l){updateTotalPoints(replaceAndRunEzscript(l));}});}}}}}}FB.ui(f,j);}ModalPopup=function(w,c){c=c||{};var r=(c.HasBackground!=null)?c.HasBackground:true;var g=c.BackgroundColor||"#000000";var x=c.BackgroundOpacity||60;x=(x>0)?x:1;var b=c.BackgroundOnClick||function(){};var k=c.BackgroundCursorStyle||"default";var f=c.Zindex||90000;var q=c.AddLeft||-10;var u=c.AddTop||0;function h(y){if(!y){return 1;}y=y.replace("px","");if(isNaN(y)){return 0;}return parseInt(y);}var a=document.getElementById(w);if(!a){return;}$(a).fadeIn(1000);a.onkeypress=function(y){return ModalPopup.onKeyPress(window.event?window.event:y,w);};var j=(document.layers||(document.getElementById&&!document.all))?window.outerWidth:(document.all?document.body.clientWidth:0);var s=window.innerHeight?window.innerHeight:(document.getBoxObjectFor?Math.min(document.documentElement.clientHeight,document.body.clientHeight):((document.documentElement.clientHeight!=0)?document.documentElement.clientHeight:(document.body?document.body.clientHeight:0)));a.style.display="";var m;if(a.currentStyle){m=a.currentStyle;}else{if(window.getComputedStyle){m=document.defaultView.getComputedStyle(a,null);}else{m=a.style;}}var l=a.offsetWidth-h(m.marginLeft)-h(m.marginRight)-h(m.borderLeftWidth)-h(m.borderRightWidth);var v=a.offsetHeight-h(m.marginTop)-h(m.marginBottom)-h(m.borderTopWidth)-h(m.borderBottomWidth);a.style.position="absolute";var d=(j/2-l/2+q);if(d<0){d=0;}a.style.left=d+"px";var o=(s/2-v/2+u-10);if(o<0){o=0;}a.style.top=o+"px";a.style.zIndex=f+1;if(r){if(!ModalPopup._BackgroundDiv){ModalPopup._BackgroundDiv=document.createElement("div");ModalPopup._BackgroundDiv.style.display="none";ModalPopup._BackgroundDiv.style.height="100%";if(browser=="Explorer"&&version<7){ModalPopup._BackgroundDiv.style.position="absolute";ModalPopup._BackgroundDiv.style.width=j;}else{ModalPopup._BackgroundDiv.style.position="fixed";ModalPopup._BackgroundDiv.style.width="100%";}ModalPopup._BackgroundDiv.style.top="0px";ModalPopup._BackgroundDiv.style.left="0px";document.body.appendChild(ModalPopup._BackgroundDiv);}ModalPopup._BackgroundDiv.onclick=b;ModalPopup._BackgroundDiv.onkeypress=function(y){return ModalPopup.onKeyPress(window.event?window.event:y,w);};ModalPopup._BackgroundDiv.style.background=g;ModalPopup._BackgroundDiv.style.height=document.all?Math.max(Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.body.scrollHeight)):(document.body?document.body.scrollHeight:((document.documentElement.scrollHeight!=0)?document.documentElement.scrollHeight:0))+"px";ModalPopup._BackgroundDiv.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+x+")";ModalPopup._BackgroundDiv.style.MozOpacity=x/100;ModalPopup._BackgroundDiv.style.opacity=x/100;ModalPopup._BackgroundDiv.style.zIndex=f;ModalPopup._BackgroundDiv.style.cursor=k;ModalPopup._BackgroundDiv.style.height="780px";ModalPopup._BackgroundDiv.style.display="";}if(c.selection){var p=document.getElementById("registration_category_list1");p.value=c.selection;renderRegistrationDetails(c.selection);}window.scroll(d,o);};ModalPopup.onKeyPress=function(a,b){if(a.keyCode==27){console.log("Esc key pressed so closing the dialog");ModalPopup.Close(b,1);}};ModalPopup.Close=function(c,b){var a=document.getElementById(c);if(c=="popupdiv"){if(c){document.getElementById(c).style.display="none";document.getElementById(c).style.display="none";document.getElementById(c).innerHTML="";}if(ModalPopup._BackgroundDiv){ModalPopup._BackgroundDiv.style.display="none";}document.getElementById(c).innerHTML="";}else{if(c=="SUpopupdiv"){if(c){document.getElementById(c).style.display="none";document.getElementById(c).style.display="none";}if(b=="1"){if(ModalPopup._BackgroundDiv){ModalPopup._BackgroundDiv.style.display="none";}}}else{if(c!=null){if(document.getElementById(c)){$(a).fadeOut(1000,"linear");document.getElementById(c).style.display="none";document.getElementById(c).style.display="none";}}if(ModalPopup._BackgroundDiv){ModalPopup._BackgroundDiv.style.display="none";}}}};function getXHR(){if(window.XMLHttpRequest){req=new XMLHttpRequest();}else{if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");}}return req;}function callback(a,b){clearErrorMessage();setErrorMessage(a);if(b!="Invitepopup"&&b!="globalErrorMessage"){mclosecommontime();var c=new Spry.Widget.TabbedPanels("TabbedPanels1",3);}}function callbackcheckuser(a){var b=new Array();b=a.split("####");indicator=b[1];if(indicator==1){document.getElementById(pid).style.display="none";if(document.getElementById("submitBtn_forepad")){document.getElementById("submitBtn_forepad").disabled=false;}if(pid=="SUerrordivIndex"){document.getElementById("su_firstname_index").className="bae-txt";document.getElementById("su_email_index").className="bae-txt";document.getElementById("su_password_index").className="";document.getElementById("SUerrordivIndex").style.display="";document.getElementById("SUerrordivIndex").innerHTML="";document.getElementById("SUerrordivIndex").className="errorGreen";document.getElementById("SUerrordivIndex").innerHTML=b[0];}else{if(pid=="SignUpError"){document.getElementById("SignUpSuccess").style.display="";document.getElementById("SignUpSuccess").innerHTML="";document.getElementById("SignUpSuccess").innerHTML=b[0];}else{if(pid=="registerError"){document.getElementById("SignUpSuccess").style.display="";document.getElementById("SignUpSuccess").innerHTML="";document.getElementById("SignUpSuccess").innerHTML=b[0];}else{if(pid=="SUerrordiv"){document.getElementById("su_firstname").className="bae-txt";document.getElementById("su_email").className="bae-txt";document.getElementById("su_password").className="";document.getElementById("SUerrordivG").style.display="";document.getElementById("SUerrordivG").innerHTML="";document.getElementById("SUerrordivG").innerHTML=b[0];}else{if(pid=="BEerrordivG"){document.getElementById("BEerrordivG").style.display="";document.getElementById("BEerrordivG").innerHTML="";document.getElementById("BEerrordivG").innerHTML=b[0];}else{document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML="";document.getElementById(pid).innerHTML=b[0];}}}}}}else{if(document.getElementById("submitBtn_forepad")){document.getElementById("submitBtn_forepad").disabled=true;}if(pid=="SUerrordivIndex"){document.getElementById("SUerrordivIndex").style.display="none";}else{if(pid=="SignUpError"){document.getElementById("SignUpSuccess").style.display="none";}else{if(pid=="registerError"){document.getElementById("SignUpSuccess").style.display="none";}else{if(pid=="SUerrordiv"){document.getElementById("SUerrordivG").style.display="none";}else{if(pid=="BEerrordivG"){document.getElementById("BEerrordivG").style.display="none";}else{document.getElementById(pid).style.display="none";}}}}}document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML="";document.getElementById(pid).innerHTML=b[0];}}function homePage(){document.getElementById("output").innerHTML="";}function showDetails(b){var a=document.getElementById(b);a.style.display="";}function callbackcommon(a,c){document.getElementById(c).innerHTML="";document.getElementById(c).innerHTML=a;addShareButton();if(type=="Content"){if(login_user==otheruserid){MyContent("KBSearchEditProfile.do","2","Content",0,"Content",login_user);}else{MyContent("KBSearch.do","2","Content",0,"Content",otheruserid);}tabindexer=0;}if(profileparam&&profileparam=="profileparam"){if(connectionflag&&connectionflag=="editProfile"){listUserConnections("MyConnection.do","0",otheruserid,connectionflag);}else{listUserConnections("MyConnection.do","0",otheruserid);}}var b=new Spry.Widget.TabbedPanels("TabbedPanels1",tabindexer);}function callbackcommonsearch(a,b){myresult=a.split("######");document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=myresult[0];addShareButton();if(b=="Content"){if(document.getElementById("kbowner")!=null){if(login_user==otheruserid){document.getElementById("kbowner").innerHTML='<span style="color: rgb(153, 0, 0);" onclick=showcommondiv("PostALink.jsp","PostLinkPopUp","PostLinkPopUp"); class="action"><b>Add first entry to your knowledge bucket</b></span>';document.getElementById("emptyBkt").innerHTML='<img onclick=showcommondiv("PostALink.jsp","PostLinkPopUp","PostLinkPopUp") style="padding: 40px 0px 20px 240px; cursor: pointer;" alt="Knowledge Bucket Empty" src="'+contextRoot+'/static/images/EmptyKnowledgeBucket.png" title="Add to your Knowledge Bucket"/>';document.getElementById("otheruseremptykb").innerHTML="You have added no contents yet. Your knowledge bucket is empty.";}else{if(document.getElementById("viewkbname")!=null){var c=document.getElementById("viewkbname").innerHTML;document.getElementById("kbowner").innerHTML='<span style="color: rgb(153, 0, 0);" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+otheruserid+"&firstname="+c+'","common","compose",event); class="action"><b>-: Suggest '+c+" to add content in his knowledge bucket :-</b></span>";document.getElementById("emptyBkt").innerHTML='<img onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+otheruserid+'","common","compose",1);" style="padding: 40px 0px 20px 240px; cursor: pointer;" alt="Knowledge Bucket Empty" src="'+contextRoot+'/static/images/EmptyKnowledgeBucket.png" title="Send a message"/>';document.getElementById("otheruseremptykb").innerHTML=c+" has added no contents yet. His knowledge bucket is empty.";}}}}}function callbackExpertsExplorers(a,b){myresult=a.split("######");document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=myresult[0];}function IsNumeric(b){var d="0123456789.";var c=true;var a;for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false;}}return c;}function clearDiv(a){document.getElementById(a).innerHTML="";document.getElementById(a).style.display="none";}function showResult(b,a){pid=a;showResultWithQueryStr(b,a,callback,null);return true;}function checkYoutube(){var a=new Image();a.src="http://youtube.com/favicon.ico";if(a.height>=0){}else{getTagCloud(contextRoot+"/jsp/GetTagCloud.do","tagCloudBox");}}function getTagCloud(b,a){showResultWithQueryStr(b,a,callbacktagcloud,null,true);return true;}function showResultWithQueryStr(h,c,k,f,j,a,g,d){if(j==undefined){j=false;}if(!j){var b=[showResultWithQueryStrDo];b.push(arguments);jQuery.bbq.pushState("#"+historyIndex);ezHistory[historyIndex++]=b;}else{showResultWithQueryStrDo(h,c,k,f,j,a,g,d);}}function showResultWithQueryStr1(g,d,c,f,b,h){if(b==undefined){b=false;}if(!b){var a=[showResultWithQueryStrDo1];a.push(arguments);jQuery.bbq.pushState("#"+historyIndex);ezHistory[historyIndex++]=a;}else{showResultWithQueryStrDo1(g,d,c,f,b,h);}if(h==undefined||h==null){h=true;}}function showResultWithQueryStrDo(h,c,k,f,j,a,b,d){if(b){mid=b;}if(b){type=b;}if(a||a==0){tabindexer=a;}if(d){mypage=d;}pid=c;var g=new AjaxHandler();g.init(h);g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(c!=null){g.addCallback(k,c);g.addErrCallback(invitationErrorHandler,c);g.addUpdateDiv(c);}else{g.addCallback(k);}g.send(f);closeAllFreezPopup(freezid);window.scrollTo(0,0);return true;}function showResultWithQueryStrDo1(g,d,c,f,b,h){pid=d;var a=new AjaxHandler();a.init(g);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(d!=null){a.addCallback(c,d);a.addErrCallback(invitationErrorHandler,d);a.addUpdateDiv(d);}else{a.addCallback(c);}a.setClearGlobalMessage(h);a.send(f);return true;}function directToReg(c,b,a){if(c=="AddReq"){showcommondiv(contextRoot+"/jsp/InvitationRequest.jsp","ConnectionPopUp","ConnectionPopUp",2);}else{if(c/c==1){showcommondivIndex(contextRoot+"/jsp/ResetPassword.jsp?showui="+c,"SUpopupdiv","SUpopupdiv");}else{if(c=="newreg"){showcommondiv(contextRoot+"/jsp/NewLogin.jsp","ConnectionPopUp","ConnectionPopUp");}else{if(c=="tagkb"){showContentFromIndex(contextRoot+"/jsp/PostALink.jsp","PostLinkPopUp","PostLinkPopUp");}else{if(c=="postproj"){showcommondivIndex(contextRoot+"/jsp/PostRequirement.jsp?isEdit=false&amp;projectInfoType=postProject","postRequirement","postRequirement");}else{if(c=="Inbox"){showResultAct("GetMessages.do","middle_div",3);}else{if(c=="Review"){showcommondiv("ViewAllReviews.do?username="+a+"&skillid=0","ConnectionPopUp","ConnectionPopUp");}else{if(c=="ViewOtherProfile"){showviewprofile("ViewOtherProfile.do?uid="+expertId,"middle_div",expertId);}else{if(c=="feedback"){showcommondivIndex(contextRoot+"/jsp/NewFeedback.jsp","ConnectionPopUp","ConnectionPopUp");}else{if(c=="Content"){document.getElementById("selected_ezdia_domain").value=2;document.ezdia_domain.submit();}}}}}}}}}}}function showResultAct(f,c,d,a,h,b,g){otheruserid=b;profileparam=h;pid=c;if(g){connectionflag=g;}if(login_user==null||login_user==""){if(a=="Content"){document.getElementById("login_details").value="viewkbprofile:"+f+":"+c+":"+b+":"+d+":"+a+":"+h;document.getElementById("regRedirect").value="viewkbprofile:"+f+":"+c+":"+b+":"+d+":"+a+":"+h;}else{if(a=="Project"){document.getElementById("login_details").value="Project:"+f+":"+c+":"+b;document.getElementById("regRedirect").value="Project:"+f+":"+c+":"+b;}else{if(a=="postproject"){document.getElementById("login_details").value="postproject:"+f+":"+querystr;document.getElementById("regRedirect").value="postproject:"+f+":"+querystr;}else{if(a=="postbump"){document.getElementById("login_details").value="postbump:"+f+":"+c;document.getElementById("regRedirect").value="postbump:"+f+":"+c;}else{document.getElementById("login_details").value="Inbox:";document.getElementById("regRedirect").value="Inbox:";}}}}ModalPopup("NewLoginpopupdiv","");return true;}else{type=a;tabindexer=d;showResultWithQueryStr(f,c,callbackcommon,null,false,d,a);}return true;}function showProjPages(d,b,c,a){type=a;tabindexer=c;pid=b;showResultWithQueryStr(d,b,callbackcommon,null,false,c,a);return true;}function showRequestResult(f,c,d,a,g,b){otheruserid=b;profileparam=g;pid=c;if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="AddReq:";document.getElementById("regRedirect").value="AddReq:";return true;}else{type=a;tabindexer=d;showResultWithQueryStr1(f,c,callbackrequests,null,false,d,a);}return true;}function callbackrequests(result,pid){document.getElementById(pid).innerHTML="";var output=document.getElementById(pid).innerHTML;var i;var jsonContent=eval("("+result+")");i=jsonContent.length;if(i==1&&jsonContent[0].response){output+='<span style="font-weight: bold; color: rgb(0, 64, 128);" class="action" onclick=showmyconnectiion("pendingConnection.do?type=0","middle_div","pending",0,1,'+myuserid+")>Invitations (0)</span>";output+='<div id="connectionoutput">'+jsonContent[0].response+"</div>";}else{output+='<span style="font-weight: bold; color: rgb(0, 64, 128);" class="action" onclick=showmyconnectiion("pendingConnection.do?type=0","middle_div","pending",0,1,'+myuserid+')>Invitations (<span id="invCountID">'+jsonContent.length+"</span>)</span>";if(jsonContent.length>0){output+='<div id="connectionoutput">';for(i=0;i<jsonContent.length;i++){output+='<div id="inv'+i+'" style="position: relative; width: auto; padding-top: 0px; left: 0px; margin-top: 6px;">';output+='<div style="width: 100%; height: auto; left: 0px; margin-top: 0px; position: relative;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div style="height: 60px; display: inline; position: relative; float: left; width: 450px;">';UserInfoConnDiv[i]=new UserInfo(jsonContent[i].username,jsonContent[i].firstname,jsonContent[i].photo_thumbnail,jsonContent[i].summary,jsonContent[i].expertise,jsonContent[i].country,jsonContent[i].reviews,jsonContent[i].rating,jsonContent[i].rpm,jsonContent[i].category);output+='<div id="ul" style="padding-right: 10px; padding-left: 10px; padding-top: 4px; width: 40px;" >';if(jsonContent[i].photo_thumbnail){output+='<img style="border: 0px; cursor: pointer;" alt="uimg" src='+jsonContent[i].photo_thumbnail+' height="38" />';}else{output+='<img style="border: 0px; cursor: pointer;" alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png" height="38"/>';}output+='<div id="available" style="margin-top: 5px; margin-left: 20px; height: 13px;">';output+='<div class="'+((jsonContent[i].presence==PRESENCE_STATUS_ONLINE)?"green-dot-icon":"red-dot-icon");output+=" />";output+='" style="float: left; margin-top: -79px; margin-left: -20px;">.</div>';output+="</div>";output+="</div>";output+='<div style="overflow: hidden; width: 350px; top: 5px; line-height: 20px; position: absolute; left: 90px;">';if(login_user==null||login_user==""||!login_user){output+='<div id="namediv" style="overflow:hidden; max-height:20px;cursor:pointer;text-decoration:underline" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].username+'&from=index","middle_div","'+escape(jsonContent[i].username)+'") ><h1 style="font-size: 12px;">';}else{output+='<div id="namediv" style="font-size: 12px; font-weight:bold; overflow:hidden; max-height:20px;cursor:pointer;text-decoration:underline" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].username+'","middle_div","'+escape(jsonContent[i].username)+'") ><h1 style="font-size: 12px;">';}output+=jsonContent[i].firstname+"</h1></div>";output+='<div id="sendMsgDiv" style="color: rgb(31, 101, 152);">';output+='<table width="180"><tr>';output+='<td><span class="action" onclick="openChatWindow(\'';output+=jsonContent[i].userid;output+="','"+jsonContent[i].category;output+="','"+jsonContent[i].firstname+"','";if(jsonContent[i].photo_thumbnail){output+=localhost+jsonContent[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')"><img alt="Chat" border="0" src="'+contextRoot+'/static/images/green-chat-icon.gif" title="Chat"/></span></td><td><span class="action" onclick="openChatWindow(\'';output+=jsonContent[i].userid;output+="','"+jsonContent[i].category;output+="','"+jsonContent[i].firstname+"','";if(jsonContent[i].photo_thumbnail){output+=localhost+jsonContent[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')">Chat</span></td><td width="10"></td>';output+='<td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(jsonContent[i].username)+"&firstname="+escape(jsonContent[i].firstname)+'","common","compose","InvMsg")><img border="0" alt="" src="'+contextRoot+'/static/images/msgimg.png"/></span></td><td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(jsonContent[i].userid)+"&firstname="+escape(jsonContent[i].firstname)+'","common","compose","InvMsg")>Send Message</span></td>';output+="</tr></table>";output+="</div>";output+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" style="position: absolute; left: 250px; top: 14px;" onclick=showcommondiv("connection/AddConnections.jsp?username='+escape(jsonContent[i].fromuser)+"&tousername="+escape(jsonContent[i].firstname)+"&reqType=accept&connid="+escape(jsonContent[i].idconnection)+"&index="+i+'","ConnectionPopUp","ConnectionPopUp")>Accept As &raquo;</a>';output+="</div>";output+="</div>";output+="</div>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+="</div>";}}}document.getElementById(pid).innerHTML=output;}function currentUnixTimeStamp(){var a=new Date();return(a.getTime()/1000);}function commoncallback(result,pid){document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML="";if(result.indexOf("div")==-1){var jsonContent=eval("("+result+")");if(jsonContent&&jsonContent[0].response){clearErrorMessage();setErrorMessage(jsonContent[0].response);storeGlobalErrorMessage();setTimeout(reStoreGlobalErrorMessage,2000);}}else{document.getElementById(pid).innerHTML=result;if(document.getElementById("categoryadd1")){getAreaAndFill("categoryadd1");}if(document.getElementById("description_div_wrap")){wordWrapDiv("description_div_wrap");}if(lid){ModalPopup(lid,"");}fillConnectionList("msg_to","forward");}}function getMailId(){var a=document.getElementById("msg_to").value;if(a=="Other"){document.getElementById("fwd_content_mail").style.display="";document.getElementById("fwd_content_mail").focus();}else{document.getElementById("fwd_content_mail").style.display="none";document.getElementById("Error_Forward").style.display="none";}}function commoncallbackindex(a,b){document.getElementById(b).style.display="";document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;if(document.getElementById("categoryadd1")){getAreaAndFill("categoryadd1");}if(lid){ModalPopup(lid,"");}}function showDetailscommon(b){var a=document.getElementById(b);a.style.display="";}function closecommon(){document.getElementById("common").innerHTML="";document.getElementById("ConnectionPopUp").style.display="none";ModalPopup.Close("ConnectionPopUp",1);}function closecommonconn(){document.getElementById("ConnectionPopUp").innerHTML="";document.getElementById("ConnectionPopUp").style.display="none";ModalPopup.Close("ConnectionPopUp",1);}function closeNews(){document.getElementById("NewsPopup").innerHTML="";document.getElementById("NewsPopup").style.display="none";ModalPopup.Close("NewsPopup",1);}function closeDeleteConn(a){document.getElementById("ConnectionPopUp").innerHTML="";document.getElementById("ConnectionPopUp").style.display="none";ModalPopup.Close("ConnectionPopUp",1);document.getElementById("manageFrnd"+a).innerHTML="<div class=msgYellow style=margin:20px;margin-top:12px;width:80%;>Removed Successfully !!</div>";window.setTimeout("cleardiv('manageFrnd"+a+"')",2000);}function closecommonconn1(){document.getElementById("ConnectionPopUp").innerHTML="";document.getElementById("ConnectionPopUp").style.display="none";}function mclosecommontime(){closetimer=window.setTimeout(closecommon,timeout2);}function mclosecommontime1(){closetimer=window.setTimeout(closecommonconn,2000);}function mclosecommontime2(){closetimer=window.setTimeout(closecommonconn1,2000);}function validateFeedbackForm(){var b=document.getElementById("feedbackemail").value;var a=document.getElementById("feedbacktext").value;document.getElementById("Feedback_Error").innerHTML="";if(b==""){document.getElementById("Feedback_Error").innerHTML+="Please enter your name or email!";document.getElementById("feedbackemail").focus();document.getElementById("Feedback_Error").style.display="";return false;}if(a==""){document.getElementById("Feedback_Error").innerHTML+="Your feedback field is empty!";document.getElementById("feedbacktext").focus();document.getElementById("Feedback_Error").style.display="";return false;}return true;}function giveEzdiaFeedback(f,c){if(!validateFeedbackForm()){return false;}else{pid=c;var b=document.getElementById("feedbackemail").value;var a=document.getElementById("feedbacktext").value;var d=document.getElementById("feedback_action").value;showResultWithQueryStr1(f,c,editcallbackcommon,"email="+escape(b)+"&feedback="+escape(a)+"&action="+escape(d));return true;}}function editcallbackcommon(a,b){document.getElementById("Feedback_Form").innerHTML="";document.getElementById(b).innerHTML="Thank You for the feedback. "+a;window.setTimeout("closecommonconn()",5000);}function getImagePath(){return thumbnail_base_url;}function trim(a){return a.replace(/^\s+|\s+$/g,"");}function myPopUp(a){popup=window.open(a,"myWindow","status = 1, height = 400, width = 790, resizable = yes, scrollbars = yes");popup.moveTo(0,0);}function addFundsWindow(a){a=a.replace("&amp;","&");if(addFundWindow!=null){addFundWindow.location.href=a;addFundWindow.moveTo(0,0);}else{addFundWindow=window.open(a,"myWindow","status = 1, height = 500, width = 900, resizable = yes, scrollbars = yes");setErrorMessage("A popup blocker is preventing add funds window. Please disable popup blocker and try again.",1);}}function getCheckedValue(b){if(!b){return"";}var c=b.length;if(c==undefined){if(b.checked){return b.value;}else{return"";}}for(var a=0;a<c;a++){if(b[a].checked){return b[a].value;}}return"";}function isAURL(a){a=unescape(a);var b=/^(((http(s?))|(ftp))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6})(\:[0-9]+)*(\/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-\(\)]+))*$/;if(b.test(a)){return true;}else{return false;}}function updatenavbar(c,a){var b="";if(c=="Content"){b='<span class="action" onclick="reloadHomePage();" style="color:#2AD;">Home > </span><span class="action" onclick=jsonSearch("ContentSearch.do","2","Content",2,"middle_div","'+token+'") style="color:#2AD;">Knowledge Bucket > </span>';document.getElementById("nvbar").innerHTML=b;}}String.prototype.ReplaceAll=function(c,d){var a=this;var b=a.indexOf(c);while(b!=-1){a=a.replace(c,d);b=a.indexOf(c);}return a;};function wordWrapDiv(b){var f,k,c,g;var h,a,l,d,j;h=document.getElementById(b);if(h.className=="word-wrap"){a=h;a.innerHTML=String(a.innerHTML).replace(/ /g,"Ø");d=String(a.innerHTML);a.innerHTML=" ";j=a.style.display;a.style.display="block";larg_oficial=a.offsetWidth;if(!document.all){a.style.display="table";}a.innerHTML=d;f=a.offsetWidth;g=0;l=d.length;d=d.replace(/Ø/g," ");k=f/l;if(f>larg_oficial){c=parseInt(larg_oficial/k);c=c-(parseInt(c/6));a.innerHTML="";while(g<=l){a.innerHTML=a.innerHTML+d.substring(g,g+c)+" ";g=g+c;}}else{a.innerHTML=d;}a.style.display=j;}return d;}function stripHTML(b){if(b){var a=/<(?:.|\s)*?>/g;return b.replace(a,"");}}function checkForSplChars(a){a=a.replace(/[^a-z A-Z 0-9 + # $ &]/g,"");a=a.replace(new RegExp("\\+","g"),"%2B");return a;}function uploadFile(c,b){var a=new AjaxHandler();a.init(c);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(b!=null){a.addCallback(callbackUpload,b);a.addErrCallback(invitationErrorHandler,b);a.addUpdateDiv(b);}else{a.addCallback(callbackUpload);}a.send(c);return true;}function callbackUpload(result){var output=eval("("+result+")");document.getElementById("Upload_Success").style.display="";document.getElementById("Upload_Files").style.display="none";document.getElementById("Upload_Success").innerHTML=output[0].response;window.setTimeout("closecommonconn()",5000);}function checkEmailStr(f){var d=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;var b=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;var c=d.test(f);if(navigator.appName!="Netscape"){var a=b.test(f);}else{a=b.test(f);}if(c||!a){return false;}return true;}function echeck(a){if(navigator.appName=="Netscape"){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(a)){return(true);}return(false);}return(true);}function validateLoginForm(a,c,d){var b=document.getElementById(a);var f=document.getElementById(c).value;if(echeck(b.value)==false){document.getElementById(d).innerHTML="";document.getElementById(d).innerHTML="Please enter a valid email Id!";document.getElementById(a).focus();return false;}if(!f){document.getElementById(d).innerHTML="";document.getElementById(d).innerHTML="Please enter your password!";document.getElementById(c).focus();return false;}return true;}function addExpertiseIndex(l){var p;var a=document.getElementById("categoryadd");var q=document.getElementById("subcategoryadd1");var o=document.getElementById("sub_subcategoryadd1");var d=document.getElementById("eoexnew");document.getElementById("expertise_error").innerHTML="";var c=d[d.selectedIndex].value;var j=document.getElementById("min_ratenew").value;var m=document.getElementById("mytitle").value;var h=document.getElementById("detaildesc").value;var g=document.getElementById("cert_type").value;var k=document.getElementById("id_type").value;var b=document.getElementById("profileid").value;if(m==""||m=="Title or a headline for your Skill"){p="Title field is empty";document.getElementById("mytitle").focus();skillErrorMsg(p);return false;}else{if(m.length>60){p="Title should not be more then 60 characters.";document.getElementById("mytitle").focus();skillErrorMsg(p);return false;}else{if(a==null||a.options[a.selectedIndex].value=="-1"){p="Select a category !";document.getElementById("categoryadd").focus();skillErrorMsg(p);return false;}else{if(q==null||q.options[q.selectedIndex].value==""||q.options[q.selectedIndex].value=="-1"){p="Select a subcategory !";document.getElementById("subcategoryadd1").focus();skillErrorMsg(p);return false;}else{if(o==null||o.options[o.selectedIndex].value==""||o.options[o.selectedIndex].value=="-1"){p="Select a sub subcategory !";document.getElementById("sub_subcategoryadd1").focus();skillErrorMsg(p);return false;}else{if(d==null||d[d.selectedIndex].value=="-1"){p="Select years of experience.";document.getElementById("eoexnew").focus();skillErrorMsg(p);return false;}else{if(j!="Rate/Hour"&&!IsNumeric(j)){p="Rate/Hour should be numeric.";document.getElementById("min_ratenew").focus();skillErrorMsg(p);return false;}else{if(h==""||h=="A short description about your experience"){p="Please enter description about your expertise";document.getElementById("detaildesc").focus();skillErrorMsg(p);return false;}}}}}}}}if(j=="Rate/Hour"){j="0";}var f="category="+escape(a.value)+"&subcategory="+escape(q.value)+"&sub_subcategory="+escape(o.value)+"&title="+escape(m)+"&exp="+escape(c)+"&rate="+escape(j)+"&desc="+escape(h)+"&certification="+escape(g)+"&type="+escape(k)+"&profileid="+escape(b);if(login_user==null||login_user==""){h.replace(new RegExp("\\n","g"),"<br>");ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="postskill:"+l+":"+f;document.getElementById("regRedirect").value="postskill:"+l+":"+f;document.getElementById("addSkillMsg").style.display="";window.setTimeout("document.getElementById('addSkillMsg').style.display = 'none'",10000);}else{showResultWithQueryStr1(l,null,callbackskill,f);}return true;}function skillErrorMsg(a){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").focus();document.getElementById("expertise_error").innerHTML=a;}function postSkill(b,a){userId=myuserid;showResultWithQueryStr1(b,null,callbackskill,a,true);return true;}function callbackskill(result,pid){try{if(pid!="output"){document.getElementById("middle_div").innerHTML="";document.getElementById("middle_div").innerHTML=result;}else{document.getElementById(pid).innerHTML="";document.getElementById(pid).innerHTML=result;}}catch(err){}var resp=eval("("+result+")");if(resp&&resp[0]&&resp[0].url){showResultAct(contextRoot+"/jsp/SocialShare.do?option=shareSkill&title="+encodeURIComponent(resp[0].title)+"&url="+encodeURIComponent(resp[0].url),"middle_div");}else{showResultAct("MyProfile.do?pagnum=0","middle_div",2,null,"profileparam",userid,"editProfile");}}function displaySkillSuccessMessage(a){handleGlobalResponse2(a);}function validateLogin(f,b,a){var c=document.getElementById(f);var d=document.getElementById(b).value;if(echeck(c.value)==false){document.getElementById(a).innerHTML="Username/Password entered is wrong!";document.getElementById(f).focus();document.getElementById(a).style.display="";document.getElementById(a).className="error";return false;}if(!d){document.getElementById(a).innerHTML="Invalid password!";document.getElementById(b).focus();document.getElementById(a).style.display="";document.getElementById(a).className="error";return false;}return true;}function validateEmailReg(){var a=document.getElementById("email_reg_training").value;if(a=="Enter Email Here"||a==""){document.getElementById("email_reg_training").focus();document.getElementById("validateEmailTraining").style.color="red";document.getElementById("email_reg_training").value="";document.getElementById("validateEmailTraining").style.display="";document.getElementById("validateEmailTraining").innerHTML="Please enter a valid email address.";return false;}if(echeck(a)==false){document.getElementById("validateEmailTraining").innerHTML="Please check your email <b>"+a+"</b> !";document.getElementById("validateEmailTraining").style.color="red";document.getElementById("email_reg_training").value="";document.getElementById("email_reg_training").focus();document.getElementById("validateEmailTraining").style.display="";return false;}document.getElementById("startTraining").method="POST";document.getElementById("startTraining").action=contextRoot+"/training/startTraining.do?email="+a+"&url="+window.location.href;document.getElementById("startTraining").submit();return true;}function callbackEmailRegister(a,b){var c=a;if(c.indexOf("success")!=-1){document.getElementById("validateEmailTraining").style.display="";document.getElementById("validateEmailTraining").className="errorBlue";document.getElementById("validateEmailTraining").innerHTML="Registered!!";showcommondivIndex(contextRoot+"/jsp/InviteFriendsHome.jsp?flag=index&email="+reg_username,"ConnectionPopUp","ConnectionPopUp");}else{if(c.indexOf("already exists")!=0){document.getElementById("validateEmailTraining").style.display="";document.getElementById("validateEmailTraining").innerHTML="Email is already registered.";}else{document.getElementById("validateEmailTraining").style.display="";document.getElementById("validateEmailTraining").innerHTML="Unable to register user";}}}function validateSimpleSignUp(g){var f=document.getElementById("firstname").value;var c=document.getElementById("email");var h=document.getElementById("password").value;var d=document.getElementById("captcha").value;var b=document.getElementById("subscribe").checked;document.getElementById("SignUpError").innerHTML="";document.getElementById("SignUpSuccess").style.display="none";var a="1";if(f==""){document.getElementById("SignUpError").innerHTML+="Invalid Name";document.getElementById("firstname").focus();document.getElementById("SignUpError").style.display="";a="0";}else{if(echeck(c.value)==false){document.getElementById("SignUpError").innerHTML+="Invalid Email address";document.getElementById("email").focus();document.getElementById("SignUpError").style.display="";a="0";}else{if(h==""){document.getElementById("SignUpError").innerHTML+="Invalid Password";document.getElementById("password").focus();document.getElementById("SignUpError").style.display="";a="0";}else{if(d==""){document.getElementById("SignUpError").innerHTML+="Invalid Security Code";document.getElementById("captcha").focus();document.getElementById("SignUpError").style.display="";a="0";}}}}if(a=="1"){reg_username=c.value;reg_password=h;showResultWithQueryStr1(g,null,callbackSimpleValidateSignUp,"firstname="+escape(f)+"&email="+escape(c.value)+"&password="+escape(h)+"&subscribe="+escape(b)+"&captcha="+escape(d)+"&vc=CuA");}}function validateRegistrationInfo(g){var h=document.getElementById("fullName").value;var d=document.getElementById("userEmail");var c=document.getElementById("userPassword").value;var f=document.getElementById("captchaCode").value;var b=document.getElementById("subscribeUser").checked;document.getElementById("registerError").innerHTML="";document.getElementById("SignUpSuccess").style.display="none";var a="1";if(h==""||h=="Full name"){document.getElementById("registerError").innerHTML+="Invalid Name";document.getElementById("fullName").focus();document.getElementById("registerError").style.display="";a="0";}else{if(echeck(d.value)==false||d=="Email"){document.getElementById("registerError").innerHTML+="Invalid Email address";document.getElementById("userEmail").focus();document.getElementById("registerError").style.display="";a="0";}else{if(c==""||c=="Password"){document.getElementById("registerError").innerHTML+="Invalid Password";document.getElementById("userPassword").focus();document.getElementById("registerError").style.display="";a="0";}else{if(f==""){document.getElementById("registerError").innerHTML+="Invalid Security Code";document.getElementById("captchaCode").focus();document.getElementById("registerError").style.display="";a="0";}}}}if(a=="1"){reg_username=d.value;reg_password=d;showResultWithQueryStr1(g,null,callbackRegisterValidate,"firstname="+escape(h)+"&email="+escape(d.value)+"&password="+escape(c)+"&subscribe="+escape(b)+"&captcha="+escape(f)+"&vc=CuA");}}var submitform;function validateSignUp(j,b){submitform=b;var d=document.getElementById("su_firstname").value;var f=document.getElementById("su_email");var m=document.getElementById("su_password").value;var o=document.getElementById("su_terms").checked;var h=document.getElementById("subscribe").checked;var l=document.getElementById("su_usertype").options[document.getElementById("su_usertype").selectedIndex].value;var c=document.getElementById("su_areaofinterest").options[document.getElementById("su_areaofinterest").selectedIndex].value;var g=document.getElementById("su_company").value;var k=document.getElementById("su_country").options[document.getElementById("su_country").selectedIndex].value;document.getElementById("SUerrordiv").innerHTML="";document.getElementById("SUerrordivG").style.display="none";var a="1";if(d==""){document.getElementById("SUerrordiv").innerHTML+="Invalid Name ! ";document.getElementById("su_firstname").focus();document.getElementById("su_firstname").className="required";document.getElementById("SUerrordiv").style.display="";document.getElementById("su_email").className="bae-txt";document.getElementById("su_password").className="";a="0";}else{if(echeck(f.value)==false){document.getElementById("SUerrordiv").innerHTML+="Invalid e-mail address !";document.getElementById("su_email").focus();document.getElementById("su_email").className="required";document.getElementById("SUerrordiv").style.display="";document.getElementById("su_firstname").className="bae-txt";document.getElementById("su_password").className="";a="0";}else{if(m==""){document.getElementById("SUerrordiv").innerHTML+="Invalid Password ! ";document.getElementById("su_password").focus();document.getElementById("su_password").className="required";document.getElementById("SUerrordiv").style.display="";document.getElementById("su_firstname").className="bae-txt";document.getElementById("su_email").className="bae-txt";a="0";}else{if(!o){document.getElementById("SUerrordiv").innerHTML+="Terms and conditions should be agreed ! ";document.getElementById("su_terms").focus();document.getElementById("SUerrordiv").style.display="";document.getElementById("su_firstname").className="bae-txt";document.getElementById("su_email").className="bae-txt";document.getElementById("su_password").className="";a="0";}}}}if(a=="1"){reg_username=f.value;reg_password=m;showResultWithQueryStr1(j,null,callbackValidatesignUp,"firstname="+escape(d)+"&email="+escape(f.value)+"&password="+escape(m)+"&category1="+escape(l)+"&workarea="+escape(c)+"&company="+escape(g)+"&country="+escape(k)+"&subscribe="+escape(h));}}function validateSignUpSimple(){var b=document.getElementById("su_firstname_index").value;var a=document.getElementById("su_email_index");var f=document.getElementById("su_password_index").value;var d=document.getElementById("su_terms_index").checked;var c=document.getElementById("regRedirect").value;document.getElementById("SUerrordivIndex").innerHTML="";document.getElementById("SUerrordivIndex").style.display="none";if(b==""){document.getElementById("SUerrordivIndex").innerHTML+="Invalid Name !";document.getElementById("SUerrordivIndex").className="error";document.getElementById("su_firstname_index").focus();document.getElementById("su_firstname_index").className="required";document.getElementById("SUerrordivIndex").style.display="";document.getElementById("su_email_index").className="bae-txt";document.getElementById("su_password_index").className="";return false;}else{if(echeck(a.value)==false){document.getElementById("su_firstname_index").className="";document.getElementById("SUerrordivIndex").innerHTML+="Invalid e-mail address !";document.getElementById("SUerrordivIndex").className="error";document.getElementById("su_email_index").focus();document.getElementById("su_email_index").className="required";document.getElementById("SUerrordivIndex").style.display="";document.getElementById("su_firstname_index").className="bae-txt";document.getElementById("su_password_index").className="";return false;}else{if(f==""){document.getElementById("SUerrordivIndex").innerHTML+="Invalid Password ! ";document.getElementById("SUerrordivIndex").className="error";document.getElementById("su_password_index").focus();document.getElementById("su_password_index").className="required";document.getElementById("SUerrordivIndex").style.display="";document.getElementById("su_firstname_index").className="bae-txt";document.getElementById("su_email_index").className="bae-txt";return false;}else{if(!d){document.getElementById("su_password_index").className="";document.getElementById("SUerrordivIndex").className="error";document.getElementById("SUerrordivIndex").innerHTML+="Terms and conditions should be agreed ! ";document.getElementById("su_terms_index").focus();document.getElementById("SUerrordivIndex").style.display="";document.getElementById("su_firstname_index").className="bae-txt";document.getElementById("su_email_index").className="bae-txt";document.getElementById("su_password_index").className="";return false;}}}}return true;}function onChangeUserType(a,b){var c=document.getElementById(a).options[document.getElementById(a).selectedIndex].value;if(c=="student"){document.getElementById(b).innerHTML="College/School";}else{if(c=="retired"){document.getElementById(b).innerHTML="Previous Company";}else{document.getElementById(b).innerHTML="Company";}}}function callbackSimpleValidateSignUp(a,b){var c=a;if(c.indexOf("captcha validation failed")==2){document.getElementById("SignUpError").style.display="";document.getElementById("captcha").focus();document.getElementById("SignUpError").innerHTML="The code you entered didn't match the security check. Please try again.";}else{if(c.indexOf("success")!=-1){document.getElementById("SignUpError").style.display="";document.getElementById("SignUpError").className="errorBlue";document.getElementById("SignUpError").innerHTML="Registered!!";showcommondivIndex(contextRoot+"/jsp/InviteFriendsHome.jsp?flag=index&email="+reg_username,"ConnectionPopUp","ConnectionPopUp");}else{if(c.indexOf("already exists")!=0){document.getElementById("SignUpError").style.display="";document.getElementById("SignUpError").innerHTML="The user is already registered.";}else{document.getElementById("SignUpError").style.display="";document.getElementById("SignUpError").innerHTML="Unable to register user";}}}}function callbackRegisterValidate(a,b){var c=a;if(c.indexOf("captcha validation failed")==2){document.getElementById("registerError").style.display="";document.getElementById("captchaCode").focus();document.getElementById("registerError").innerHTML="The code you entered didn't match the security check. Please try again.";}else{if(c.indexOf("success")!=-1){document.getElementById("registerError").style.display="";document.getElementById("registerError").className="errorBlue";document.getElementById("registerError").innerHTML="Registered!!";showcommondivIndex(contextRoot+"/jsp/InviteFriendsHome.jsp?flag=index&email="+reg_username,"ConnectionPopUp","ConnectionPopUp");}else{if(c.indexOf("already exists")!=0){document.getElementById("registerError").style.display="";document.getElementById("registerError").innerHTML="The user is already registered.";}else{document.getElementById("registerError").style.display="";document.getElementById("registerError").innerHTML="Unable to register user";}}}}function callbackValidatesignUp(a,b){var c=a;if(c.indexOf("success")!=-1){document.getElementById("SUerrordiv").className="errorBlue";document.getElementById("su_email").className="norequired";ModalPopup.Close("SUpopupdiv","0");showcommondivIndex(contextRoot+"/jsp/InviteFriendsHome.jsp?flag=index&email="+reg_username,"ConnectionPopUp","ConnectionPopUp");}else{if(c.indexOf("already exists")!=0){document.getElementById("SUerrordiv").innerHTML="The user is already registered.";}else{document.getElementById("SUerrordiv").innerHTML="Unable to register user";}}}function checkUserExists(d,f){var a=document.getElementById("invalid_div");var c=document.getElementById("forgotEmail");if(c==null||echeck(c.value)==false){document.getElementById("invalid_div").style.display="";a.innerHTML="Error: Invalid Email Address. Please check your e-mail string.";document.getElementById("forgotEmail").focus();}else{var b=contextRoot+"/jsp/"+d;showResultWithQueryStr1(b,f,callbackCheckUserExists,"email="+escape(c.value));}}function checkuser(b,c,a){pid=c;a=document.getElementById(a);if(echeck(a.value)==false){if(pid=="SignUpError"){document.getElementById("SignUpError").innerHTML="";document.getElementById("SignUpError").innerHTML+="Invalid Email address";document.getElementById("email").focus();document.getElementById("SignUpError").style.display="";}if(pid=="registerError"){document.getElementById("registerError").innerHTML="";document.getElementById("registerError").innerHTML+="Invalid Email address";document.getElementById("userEmail").focus();document.getElementById("registerError").style.display="";}if(pid=="SUerrordiv"){document.getElementById("SUerrordiv").innerHTML="";document.getElementById("SUerrordiv").innerHTML+="Invalid Email address !";document.getElementById("su_email").focus();document.getElementById("su_email").className="required";document.getElementById("SUerrordiv").style.display="";}if(pid=="SUerrordivIndex"){document.getElementById("SUerrordivIndex").innerHTML="";document.getElementById("SUerrordivIndex").innerHTML+="Invalid Email address !";document.getElementById("SUerrordivIndex").className="error";document.getElementById("su_email_index").focus();document.getElementById("su_email_index").className="required";document.getElementById("SUerrordivIndex").style.display="";}}else{showResultWithQueryStr1(b,c,callbackcheckuser,"email="+escape(a.value));}}function checkEmailString(b,a){pid=b;a=document.getElementById(a);if(echeck(a.value)==false){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML+="Invalid Email address !";document.getElementById(b).className="error";if(pid=="displayMailingDomains"){document.getElementById("emailid").focus();}document.getElementById(b).style.display="";return false;}else{document.getElementById(b).style.display="none";}return true;}function callbackCheckUserExists(a){var b="";var c=a;if(a){document.getElementById("Forgotpopupdiv").innerHTML=c;}else{b+='<div id="in_div" style="border-bottom:1px solid #CCCCCC; border-top:1px solid #CCCCCC; position: relative; width: 640px; height: 70px; z-index: 6; left: 0px; margin-top: 0px">';b+='<div id="enteremail_text1" style="font-size:10px; position: absolute; width: auto; height: 15px; z-index: 4; left: 31px; top: 40px">';b+="The email address you entered has not been registered.</div>";b+='<div id="unreg_div" style="position: absolute; width: auto; height: 20px; z-index: 5; left: 30px; top: 14px; font-size: 12px; font-weight: bold; color: #D24619; text-decoration: none;">';b+="Unregistered Email</div>";b+="</div>";document.getElementById("invalid_div").innerHTML=b;document.getElementById("email").innerHTML="";}}function changePassword(f){document.getElementById("changepassword_error").style.display="";var b=document.getElementById("email").value;var c=document.getElementById("oldPassword").value;var d=document.getElementById("newPassword").value;var g=document.getElementById("cnf_newPassword").value;if(c.length<1){document.getElementById("changepassword_error").innerHTML="Current password is empty.";document.getElementById("oldPassword").focus();}else{if(d.length<1){document.getElementById("changepassword_error").innerHTML="New password is empty.";document.getElementById("newPassword").focus();}else{if(g.length<1){document.getElementById("changepassword_error").innerHTML="Confirm password is empty.";document.getElementById("cnf_newPassword").focus();}else{if(c==d){document.getElementById("changepassword_error").innerHTML="Current and New password can not be same.";}else{if(d!=g){document.getElementById("changepassword_error").innerHTML="New password and Confirm password do not match.";}else{var a="jsp/"+f;showResultWithQueryStr(f,null,callbackChangePassword,"email="+escape(b)+"&password="+escape(c)+"&newPassword="+escape(d));}}}}}}function resetPassword(d){document.getElementById("changepassword_error").style.display="";var b=document.getElementById("resetEmail").value;var c=document.getElementById("newPassword").value;var f=document.getElementById("cnf_newPassword").value;if(c.length<1){document.getElementById("changepassword_error").innerHTML="New password is empty.";document.getElementById("newPassword").focus();}else{if(f.length<1){document.getElementById("changepassword_error").innerHTML="Confirm password is empty.";document.getElementById("cnf_newPassword").focus();}else{if(c!=f){document.getElementById("changepassword_error").innerHTML="New password and Confirm password do not match.";}else{var a="jsp/"+d;showResultWithQueryStr1(d,null,callbackChangePassword,"email="+escape(b)+"&newPassword="+escape(c));}}}}function callbackChangePassword(a){var b=a;document.getElementById("resetPassword").innerHTML=a;if(document.getElementById("changepassword_error")&&document.getElementById("changepassword_error").innerHTML.indexOf("Please check your Email ID")!=-1){document.getElementById("changepassword_error").innerHTML="Please check your Email ID";}else{timer();}}function timer(){window.setTimeout("ModalPopup.Close('SUpopupdiv','1')",3000);return true;}function setUsername(a){login_user=a;}function removeUsername(){login_user="";}function acceptInvitation(c,y,q,g,f,l,o,h,b,a){myuserid=a;actiontype=1;pid=y;var d;for(var v=1;v<=2;v++){var m=g+v;if(document.getElementById(m).checked){d=document.getElementById(m).value;}}var u;for(var w=1;w<=6;w++){var p=l+w;if(document.getElementById(p).checked){u=document.getElementById(p).value;}}var s=document.getElementById(q).value;var r=document.getElementById(f).value;var x=checkInGroup(s,d);if(x){document.getElementById(pid).style.height="auto";document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML=sHTMLSearchAnim.replace("###","");document.getElementById(pid).innerHTML="<br/><p>This User Is Already In Your Connection..!!</p>";document.getElementById("inv"+h).style.display="none";closecommonconn();return false;}else{EzdiaConnection.splice(h,1);showResultWithQueryStr(c,y,messageHandler,"fromuser="+escape(s)+"&connid="+escape(o)+"&togroup="+escape(d)+"&action="+escape(actiontype)+"&message="+escape(r)+"&tag=0&relation="+escape(u));var z=parseInt(document.getElementById("invCountID").innerHTML);document.getElementById("inv"+h).style.display="none";document.getElementById("invCountID").innerHTML=z-1;return true;}}function sendInvitation(l,d,c,g,b,k,a){var j=document.getElementById(k);var o;if(j.checked){o=0;}else{o=0;}pid=d;var p=document.getElementById(b).value;var m=document.getElementById(c).value;var f=document.getElementById(g).value;document.getElementById("Show_Error").style.display="";document.getElementById("Show_Error").className="error";if(hiddenUserid==m){document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML=sHTMLSearchAnim.replace("###","");document.getElementById(pid).innerHTML="YOU CAN NOT ADD URSELF!!";return false;}var h=checkInGroup(m,f);if(h){document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML=sHTMLSearchAnim.replace("###","");document.getElementById(pid).innerHTML="This User Is Already In Your Connection.";return false;}else{showResultWithQueryStr(l,d,messageHandler,"to="+escape(m)+"&fromgroup="+escape(f)+"&inviteMessage="+escape(p)+"&action="+escape(o)+"&relation=1");document.getElementById(a).innerHTML="";return true;}}function addIntoConnection(c,x,u,h,g,l,b,a){myuserid=a;var f=0;pid=x;var d;var q;for(var s=1;s<=6;s++){var o=l+s;if(document.getElementById(o).checked){q=document.getElementById(o).value;}}for(var r=1;r<=2;r++){var m=h+r;if(document.getElementById(m).checked){d=document.getElementById(m).value;}}var p=document.getElementById(g).value;p=p.replace(/\n/g,"<br />");var w=document.getElementById(u).value;if(hiddenUserid==w){document.getElementById(pid).style.height="auto";document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML=sHTMLSearchAnim.replace("###","");document.getElementById(pid).innerHTML="You can not add yourself!!";mclosecommontime2();return false;}var v=checkInGroup(w,d);if(v){document.getElementById(pid).style.height="auto";document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML=sHTMLSearchAnim.replace("###","");document.getElementById(pid).innerHTML="This User Is Already In Your Connection.. ";closecommonconn();return false;}else{showResultWithQueryStr(c,x,messageHandler,"to="+escape(w)+"&fromgroup="+escape(d)+"&inviteMessage="+escape(p)+"&action="+escape(f)+"&relation="+escape(q)+"&tag=0");return true;}}function declineInvitation(g,d,f,j,c,b){myuserid=b;actiontype=2;EzdiaConnection.splice(c,1);pid=d;var h=f;showResultWithQueryStr(g,d,messageHandler,"connid="+escape(j)+"&to="+escape(h)+"&action=2");var a=parseInt(document.getElementById("invCountID").innerHTML);document.getElementById("inv"+c).style.display="none";document.getElementById("invCountID").innerHTML=a-1;return true;}function messageHandler(a,b){if(actiontype!=0){listUserConnections("MyConnection.do","0",myuserid);}handleGlobalResponse2(a);ModalPopup.Close(b,"1");mclosecommontime1();}function callbackimportcontacthome(a,b){if(a.indexOf("INVALID")!=-1||a.indexOf("Sorry")!=-1){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;timerBrInvite();}else{document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;document.getElementById(b).style.display="";if(b=="InviteHomepopup"){document.getElementById(b).style.width="780px";document.getElementById(b).style.height="635px";document.getElementById(b).style.marginTop="-105px";}}}function callbackinvitecontact(a,b){if(a.indexOf("INVALID")!=-1||a.indexOf("Sorry")!=-1){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;}else{doLogin1("invite");}}function doLogin1(a){if(a=="invite"){document.getElementById("import_username").value=reg_username;document.getElementById("import_password").value=reg_password;document.inviteForm.submit();}else{if(a=="import"){document.getElementById("invite_username").value=reg_username;document.getElementById("invite_password").value=reg_password;document.importForm.submit();}}}function ImportContactsHome(l,g,c){var h="",m="";var b="",d=true;pid=g;var k=document.getElementById("displayMailingDomains").style.display;var j=document.getElementById("emailid").value;if(k==""){m=document.getElementById("maildomain").value;if(j.length<1||j.indexOf("@")!=-1){h="Fill your email address";document.getElementById("emailid").focus();d=false;}}else{var f=checkEmailStr(j);if(f==false){h="Invalid email address";d=false;}var a=j.split("@");j=a[0];m=a[1];}var o=document.getElementById("passwd").value;document.getElementById("Show_Error").style.display="";document.getElementById("Show_Error").className="error";if(d==true){if(o.length<1){h="Invalid password";}else{clearDiv("Show_Error");actionURLs=l;showResultWithQueryStr1(actionURLs,g,callbackimportcontacthome,"emailid="+escape(j)+"&maildomain="+escape(m)+"&passwd="+escape(o));}}if(h.length>0){b=document.getElementById(c);b.innerHTML="";b.innerHTML=h;b.style.display="";}return true;}function projectInvitation(b,c,d,a,k,g){var h;if(login_user==null||login_user==""){h="index";}else{h="home";}pid=d;var f=document.getElementsByName(c);var j=get_checked_value(f);if(j.length==0){document.getElementById("Show_Error").innerHTML="Please select any contact or Enter email list or skip this step!!!";return true;}showcommondivIndex(contextRoot+"/jsp/ProjectInvitation.do?flag="+h+"&msg_ids="+j+"&category="+b+"&projectId="+g,"ConnectionPopUp","ConnectionPopUp");}function inviteFriends(j,c,d,a,k){var g;if(login_user==null||login_user==""){g="index";}else{g="home";}pid=d;var b=j;var f=document.getElementsByName(c);var h=get_checked_value(f);if(h.length==0){document.getElementById("Show_Error").innerHTML="Please select any contact or Enter email list or skip this step!!!";return true;}b=b+"&userfriend="+h;showcommondivIndex(b,"ConnectionPopUp","ConnectionPopUp");}function countchecks(b,a){var d=document.getElementsByName(b);var c=get_check_count(d);if(c>a){return 0;}else{return 1;}}function get_check_count(b){var c=0;for(var a=0;a<b.length;a++){if(b[a].checked){c++;}}return c;}function inviteFriendsHome(h,g,d){pid=d;var b=h;var a;var f=new Array();a=document.getElementById("invitecontacts").value.replace(" ","");f=a.split(";");var c;for(c=0;c<f.length;c++){if(f[c]==""){document.getElementById("Show_Error").innerHTML="Please Put a Valid Email ID";document.getElementById(g).focus();return true;}else{if(echeck(f[c])==false){document.getElementById("Show_Error").innerHTML=notvalidemail;document.getElementById(g).focus();return true;}showResultWithQueryStr(h,d,callbackx,"userfriend="+escape("emaily#"+a));return true;}}}function callbackx(a,b){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;window.setTimeout('clearDiv("Show_Error")',3000);}function get_checked_value(b){var c="";for(var a=0;a<b.length;a++){if(b[a].checked){c=c+b[a].value+";";}}return c;}function inviteFriends2(h,f,a){pid=f;var c=h;var b;var g=new Array();b=document.getElementById("invitecontacts").value.replace(" ","");g=b.split(";");var d;for(d=0;d<g.length;d++){if(g[d]==""){document.getElementById("Show_Error").innerHTML=notvalidemail;document.getElementById(a).focus();return;}else{if(echeck(g[d])==false){document.getElementById("Show_Error").innerHTML=notvalidemail;document.getElementById(a).focus();return;}showResultWithQueryStr(h,f,callbackx,"userfriend="+escape("emaily#"+b));document.getElementById("Show_Error").innerHTML="Your request has been recorded.";document.getElementById(f).style.display="";}}}function inviteFriendsOneByOne(g,f,a,d){var c;if(login_user==null||login_user==""){c="index";}else{c="home";}pid=f;var b;var h;b=document.getElementById("invitecontacts").value.replace(" ","");h=document.getElementById("invitecontactsName").value.replace(" ","");document.getElementById("Show_Error").style.display="";document.getElementById("Show_Error").className="error";if(h==""){document.getElementById("Show_Error").innerHTML="";document.getElementById("Show_Error").innerHTML="Please type a name";document.getElementById(d).focus();return;}else{if(b==""){document.getElementById("Show_Error").innerHTML="";document.getElementById("Show_Error").innerHTML="Please enter an Email ID";document.getElementById(a).focus();return;}else{if(echeck(b)==false){document.getElementById("Show_Error").innerHTML="";document.getElementById("Show_Error").innerHTML="Please Put a Valid Email ID";document.getElementById(a).focus();return;}showcommondivIndex(contextRoot+"/jsp/InviteMyFriends.do?name="+h+"&email="+b+"&flag="+c,"ConnectionPopUp","ConnectionPopUp");}}}function showInvitaionMail(){msg_csv=document.getElementById("invitecontacts").value.replace(" ","");msg_to_name=document.getElementById("invitecontactsName").value.replace(" ","");showcommondiv("InvitationMessage.jsp?name="+msg_to_name+"&email="+msg_csv,"ConnectionPopUp","ConnectionPopUp");}function sendInvitation(f,c,b,a){var d=document.getElementById("invitemessage").value;d=d.replace(/\n/g,"<br />");showResultWithQueryStr1(f,c,callbackx,"friendMail="+b+"&friendName="+a+"&message="+d);}function sendInvitationFromList(f,b,c,a){var d=document.getElementById("invitemessage").value;d=d.replace(/\n/g,"<br />");showResultWithQueryStr1(f+"?flag="+a,b,callbackx,"userfriend="+escape(c)+"&message="+d);}function timerBrInvite(){window.setTimeout("cleardiv('Show_Error')",4000);return true;}function cleardiv(a){document.getElementById(a).style.display="none";}var otheruserid;function listUserConnections(f,d,a,g){otheruserid=a;if(g){connectionflag=g;}var c=f+"?type="+escape(d)+"&uid="+escape(a);var b="listconnectionsdiv";if(g=="home"){showResultWithQueryStr(c,b,callbackconnectionlist,null,true);}else{showResultWithQueryStr(c,b,callBackConnected,null,true);}return true;}function callbackconnectionlist(result,pid){var output="";var i;myresult=result.split("####");connectionjsonstring=myresult[0];username=myresult[2];numOfConn=myresult[1];name=myresult[4];if(login_user==username){output='<div class="connHeadTitle">My Connections ('+numOfConn+")</div>";}else{output='<div class="connHeadTitle">Connections ('+numOfConn+")</div>";}var jsonContent=eval("("+connectionjsonstring+")");for(i=0;i<jsonContent.length;i++){if(login_user==username){MyConnectionList[i]=new MyConn(jsonContent[i].userid,jsonContent[i].firstname,jsonContent[i].groupname,jsonContent[i].conid,jsonContent[i].relation,jsonContent[i].tag,jsonContent[i].presence,jsonContent[i].email);}}if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){var maxLength=jsonContent.length<4?jsonContent.length:4;}else{maxLength=jsonContent.length<6?jsonContent.length:6;}}else{maxLength=jsonContent.length<5?jsonContent.length:5;}for(i=0;i<maxLength;i++){if(jsonContent[i].response){if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){output+='<div id="userdiv1"  style="position: relative; width: 180px; left: 0px; top: 0px;">';output+=jsonContent[i].response;}else{output+='<div id="userdiv1"  style="position: relative; width: 180px; left: 0px; top: 0px;">';output+=jsonContent[i].response;output+='<div id="StartBuildingNetwork" style="z-index: 2; color: rgb(0, 64, 128); position: relative; font-size: 10px; width: 100%; height: 6%; bottom: -2%; text-align: right; left: 0%;">';output+='<a href="javascript:void(0)" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")><b>Start building your network</b></a></div>';}}else{output+='<div id="userdiv"  style="position: relative; width: 186px; left: 0px; top: 5px; padding-bottom:25px;">Currently no connections to this user !!';}output+="</div>";}else{UserInfopopupDiv[i]=new UserInfo(jsonContent[i].userid,jsonContent[i].firstname,jsonContent[i].photo_thumbnail,jsonContent[i].summary,jsonContent[i].expertise,jsonContent[i].country,jsonContent[i].reviews,jsonContent[i].rating,jsonContent[i].rpm,jsonContent[i].category,jsonContent[i].position,jsonContent[i].company,jsonContent[i].skypeid,jsonContent[i].presence);output+='<div id="ulpv'+i+'" onmouseout="mclosetime()" onmouseover="mcancelclosetime()" style="display:none; left:-356px; margin-top:-10px; position: absolute; width: 355px; height: auto; z-index: 100;"></div>';if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){output+='<div id="ul'+i+'" onmouseout=mclosetime2("ul'+i+'") onmouseover=viewBusinessCard('+i+',"ulpv'+i+'",event,"ul'+i+'","connections");colorBG("ul'+i+'");  style="border-bottom: 1px solid #DAEFFE; background: rgb(255, 255, 255) none repeat scroll 0% 0%; position: relative; cursor: pointer; z-index: 1; top: 0%; height: 20px; left: 0%; width: 100%;">';}else{output+='<div id="ul'+i+'" onmouseout=mclosetime2("ul'+i+'") onmouseover=viewBusinessCard('+i+',"ulpv'+i+'",event,"ul'+i+'","connections");colorBG("ul'+i+'");  style="border-bottom: 1px solid #DAEFFE; background: rgb(255, 255, 255) none repeat scroll 0% 0%; position: relative; cursor: pointer; z-index: 1; top: 0%; height: 20px; left: 0%; width: 100%;">';}}else{output+='<div id="ul'+i+'" onmouseout=mclosetime2("ul'+i+'") onmouseover=viewBusinessCard('+i+',"ulpv'+i+'",event,"ul'+i+'","connections");colorBG("ul'+i+'");  style="border-bottom: 1px solid #DAEFFE; background: rgb(255, 255, 255) none repeat scroll 0% 0%; position: relative; cursor: pointer; z-index: 1; top: 0%; height: 20px; left: 0%; width: 100%;">';}if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){}else{}}else{}if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){output+='<div id="greendiv3" style="position: absolute; width: 10px; height: 10px; z-index: 1; left: 0%; top: 12%;">';}else{output+='<div id="greendiv3" style="position: absolute; width: 10px; height: 10px; z-index: 1; left: 0%; top: 12%;">';}}else{output+='<div id="greendiv3" style="position: absolute; width: 10px; height: 10px; z-index: 1; left: 0%; top: 12%;">';}output+="<img src="+((jsonContent[i].presence==PRESENCE_STATUS_ONLINE)?"../static/images/green-dot-icon.png":"../static/images/gray-dot-icon.png");output+=" />";output+="</div>";if(login_user==null||login_user==""||!login_user){if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){output+='<div id="namediv3" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'&from=index","middle_div","'+jsonContent[i].userid+'","editProfile") style="overflow: hidden; position: absolute; height: 12px; z-index: 1; color: rgb(0, 0, 0); left: 10%; top: 14%; width: 90%;">';}else{output+='<div id="namediv3" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'&from=index","middle_div","'+jsonContent[i].userid+'","home") style="overflow: hidden; position: absolute; height: 12px; z-index: 1; color: rgb(0, 0, 0); left: 10%; top: 14%; width: 90%;">';}}else{output+='<div id="namediv3" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'&from=index","middle_div","'+jsonContent[i].userid+'","editProfile") style="overflow: hidden; position: absolute; height: 12px; z-index: 1; color: rgb(0, 0, 0); left: 10%; top: 14%; width: 90%;">';}}else{if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){output+='<div id="namediv3" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'","middle_div","'+jsonContent[i].userid+'","editProfile") style="overflow: hidden; position: absolute; height: 16px; z-index: 1; color: rgb(0, 0, 0); left: 10%; top: 14%; width: 90%;">';}else{output+='<div id="namediv3" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'","middle_div","'+jsonContent[i].userid+'","home") style="overflow: hidden; position: absolute; height: 16px; z-index: 1; color: rgb(0, 0, 0); left: 10%; top: 14%; width: 90%;">';}}else{output+='<div id="namediv3" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'","middle_div","'+jsonContent[i].userid+'","editProfile") style="overflow: hidden; position: absolute; height: 16px; z-index: 1; color: rgb(0, 0, 0); left: 10%; top: 14%; width: 90%;">';}}output+=jsonContent[i].firstname.substring(0,22);output+="</div>";if(login_user==username){if(connectionflag&&connectionflag=="editProfile"){}else{}}else{}output+="</div>";}}if(jsonContent.length-1==0&&jsonContent[0].response&&otheruserid==myuserid){output+='<div id="view4" style="z-index: 2; color: rgb(0, 64, 128); position: relative; font-size: 10px; width: 100%; height: 6%; bottom: -2%; text-align: right; left: 0%;">';output+='<a href="javascript:void(0)" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")><b>Start building your network</b></a></div>';}else{if(numOfConn>0){output+='<div id="view4" style="text-align: right; position: relative;">';output+='<span class="action" onclick=showmyconnectiion("MyConnection.do?type=0&uid='+username+'","middle_div","view",0,0,"'+username+'","viewotherconnections");>View all &raquo;</span></div>';}}var pidDiv=document.getElementById(pid);if(pidDiv!=null){pidDiv.innerHTML=output;}addTrackEvent("connection",(login_user==otheruserid)?"self":"other",otheruserid);return true;}function callBackConnected(result,pid){var output="";var i;myresult=result.split("####");connectionjsonstring=myresult[0];username=myresult[2];numOfConn=myresult[1];name=myresult[4];var jsonContent=eval("("+connectionjsonstring+")");for(i=0;i<jsonContent.length;i++){MyConnectionList[i]=new MyConn(jsonContent[i].userid,jsonContent[i].firstname,jsonContent[i].groupname,jsonContent[i].conid,jsonContent[i].relation,jsonContent[i].tag,jsonContent[i].presence,jsonContent[i].email);}var maxLength=jsonContent.length<6?jsonContent.length:6;if(numOfConn>0){for(i=0;i<maxLength;i++){UserInfopopupDiv[i]=new UserInfo(jsonContent[i].userid,jsonContent[i].firstname,jsonContent[i].photo_thumbnail,jsonContent[i].summary,jsonContent[i].expertise,jsonContent[i].country,jsonContent[i].reviews,jsonContent[i].rating,jsonContent[i].rpm,jsonContent[i].category,jsonContent[i].position,jsonContent[i].company,jsonContent[i].skypeid,jsonContent[i].presence);output+='<div class="floatLeft">';output+='<a href="javascript:void(0)" onclick=showviewprofile("ViewOtherProfile.do?uid='+jsonContent[i].userid+'&from=index","middle_div","'+jsonContent[i].userid+'","home")>';output+='<img title="View '+jsonContent[i].firstname+'\'s Profile" alt="uimg" src="';if(jsonContent[i].photo_thumbnail){output+=localhost+jsonContent[i].photo_thumbnail;}else{output+="../static/images/userimg2.png";}output+='" width="31" hspace="2" border="0"/></a>';output+="</div>";}output+='<div style="position: absolute; margin-left: 220px; margin-top: 30px;">';output+='<a href="javascript:void(0)" onclick=showmyconnectiion("MyConnection.do?type=0&uid='+username+'","middle_div","view",0,0,"'+username+'","viewotherconnections");>View all &raquo;</a></div>';}else{if(otheruserid==myuserid){output+='<a href="javascript:void(0)" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")>Start building your network</a>';}else{output+="No Connections!";}}var pidDiv=document.getElementById(pid);if(pidDiv!=null){pidDiv.innerHTML=output;}addTrackEvent("profile_connection",(login_user==otheruserid)?"self":"other",otheruserid);return true;}var chatwith;function checkInGroup(b,c){var a;for(a=0;a<MyConnectionList.length;a++){if(MyConnectionList[a].username==b){chatwith=MyConnectionList[a].name;return true;}}return false;}function viewPendingConnection(result,pid){closecommon();var output="";var desired;var CONNECTION_PAGE_LIMIT=10;start=page*CONNECTION_PAGE_LIMIT;end=start+CONNECTION_PAGE_LIMIT;var allpages;var totalpages=new Array();totalpages=result.split("####");myresult=totalpages[0];totalrec=totalpages[3];var parseJsonResponse=eval("("+myresult+")");if(mid=="pending"){output+='<div id="output1">';if(!isAlphaRelease){output+='<div id="ContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:23px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="padding: 0% 0% 0% 0%; margin-top:-3px; text-align: center; width: 100%; height: 71px; z-index: 100; line-height:15px;">';output+='<b style="color:#990000;">Contacts</b>';output+='<ul style="display:block; list-style-type:none; text-align: left; padding-left:65px; margin:0px; color:black; "><li>All(60)</li><li>Expert(20)</li><li>Explorer(20)</li><li>Friends(20)</li></b>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div id="DownloadContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:125px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<div style="width: 135px; margin: auto;"><div class="global-button global-color"><span class="action" style="color:#4070A0;">Download Contacts</span></div></div>';output+='<div style="width: 140px; text-align: left; margin-left: 22px;">You can download all your contacts in CSV(comma separated value) format.</div>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}if(pid=="middle_div"){output+='<div id="InviteConnectionsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<img onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp") src="'+contextRoot+'/static/images/invite_all_logo.png">';output+='<div align="center" style="margin: auto; width: 152px;"><a href="javascript:void(0)" class="global-button global-color" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")>Invite More Friends</a>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div style="position: relative; height: auto; width: 736px; top: 35px;">';output+='<table id="corner_dialog_table_bdr1" align="left" class="corner_dialog_table_bdr1" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft_bdr1"></td>';output+='<td class="corner_border_bdr1_tm"></td>';output+='<td class="corner_topright_bdr1"></td>';output+="</tr>";output+="<tr>";output+='<td class="corner_border_bdr1_lm"></td>';output+='<td id="corner_content_bdr1" class="corner_content_bdr1">';output+='<div style="width: 100%; height: auto;">';output+='<div class="popup-header global-bg-color" style="position: relative; height: 20px; z-index: 10; left: -13px; top: -42px; width: 720px;">Manage Connections';output+="</div>";output+='<div id="TabbedPanels1" class="TabbedPanels"  style="position: relative; width: 705px; height: auto; padding-top: 0px; left: 0px; top: 0px; z-index: 10;">';output+='<ul class="TabbedPanelsTabGroup" style="margin-top: -67px;">';output+='<li class="TabbedPanelsTab" tabindex="0" onclick=showmyconnectiion("MyConnection.do?type=0","MyConnections","view1",0,0,'+myuserid+') style="width:155px; float:left;">';if(myuserid==otheruserid){output+="My Connections";}else{output+="Connections";}output+="</li>";if(myuserid==otheruserid){output+='<li class="TabbedPanelsTab" tabindex="0" style="width:155px; float:left;" onclick=showmyconnectiion("pendingConnection.do?type=0","MyConnections","pending",0,1,"'+myuserid+'");><span id="requestTabhom"></span>';output+="</li>";}output+="</ul>";output+='<div class="TabbedPanelsContentGroup">';}output+='<div id="MyConnections" class="TabbedPanelsContent" style="padding:0px; width: 100%; height:auto; position:relative;">';output+="</div>";output+='<div id="MyRequests" class="TabbedPanelsContent" style="padding:0; width: 100%; height:auto;">';}if(parseJsonResponse.length>0){output+='<div id="connectionoutput" style="position: relative; padding: 5px; margin-top: 28px;">';if(end>parseJsonResponse.length){end=parseJsonResponse.length;}if(!parseJsonResponse[parseJsonResponse.length-1].response&&parseJsonResponse.length>0){for(var i=start;i<end;i++){output+='<div style="position: relative; width: auto; height: 123px; padding-top: 0px; left: 0px; margin-top: 6px;">';output+='<div style="position: absolute; width: 100%; height: auto; left: 0px; margin-top: 0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="NoSearchConn" style="width:auto; height:100px;">';UserInfoConnDiv[i]=new UserInfo(parseJsonResponse[i].username,parseJsonResponse[i].firstname,parseJsonResponse[i].photo_thumbnail,parseJsonResponse[i].summary,parseJsonResponse[i].expertise,parseJsonResponse[i].country,parseJsonResponse[i].reviews,parseJsonResponse[i].rating,parseJsonResponse[i].rpm,parseJsonResponse[i].category);output+='<div id="mulpvPnd'+i+'" onmouseout="mclosetime()" onmouseover="mcancelclosetime()" style="display:none; left: 80px; top: 0px; position: absolute; height: auto; z-index: 100; width: 370px;"></div>';output+='<div id="ul" style="padding-right: 10px; padding-left: 10px; padding-top: 4px; width: 86px; z-index: 1;" >';if(parseJsonResponse[i].photo_thumbnail){if(login_user==null||login_user==""||!login_user){output+='<img id="mulPnd'+i+'" onmouseout=mclosetime(); onmouseover=viewBusinessCard('+i+',"mulpvPnd'+i+'",event,"mulPnd'+i+'","manageconnections"); style="border: 0px; cursor:pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src='+localhost+parseJsonResponse[i].photo_thumbnail+' height="76" />';}else{output+='<img id="mulPnd'+i+'" onmouseout=mclosetime(); onmouseover=viewBusinessCard('+i+',"mulpvPnd'+i+'",event,"mulPnd'+i+'","manageconnections"); style="border: 0px; cursor:pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src='+localhost+parseJsonResponse[i].photo_thumbnail+' height="76" />';}}else{if(login_user==null||login_user==""||!login_user){output+='<img id="mulPnd'+i+'" onmouseout=mclosetime(); onmouseover=viewBusinessCard('+i+',"mulpvPnd'+i+'",event,"mulPnd'+i+'","manageconnections"); style="border: 0px; cursor:pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png" height="76"/>';}else{output+='<img id="mulPnd'+i+'" onmouseout=mclosetime(); onmouseover=viewBusinessCard('+i+',"mulpvPnd'+i+'",event,"mulPnd'+i+'","manageconnections"); style="border: 0px; cursor:pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png" height="76"/>';}}output+="</div>";output+='<div id="available" style="width: 80px; margin-left: 30px; font-size: 12px; margin-top: 5px;">';output+="<img src="+((parseJsonResponse[i].presence==PRESENCE_STATUS_ONLINE)?"../static/images/green-dot-icon.png":"../static/images/gray-dot-icon.png");output+=" />";output+="</div>";output+='<div style="overflow: hidden; position: absolute; height: 120px; top: 20px; line-height: 20px; left: 34%;">';if(login_user==null||login_user==""||!login_user){output+='<div id="namediv" style="cursor:pointer; overflow:hidden; max-height:20px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].username+'&from=index","middle_div","'+escape(parseJsonResponse[i].username)+'")><h1 style="font-size: 12px;">';}else{output+='<div id="namediv" style="cursor:pointer; overflow:hidden; max-height:20px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].username+'","middle_div","'+escape(parseJsonResponse[i].username)+'")><h1 style="font-size: 12px;">';}output+=parseJsonResponse[i].firstname+"</h1></div>";output+='<div id="sendMsgDiv" style="color: rgb(31, 101, 152);">';output+='<table width="180"><tr>';output+='<td><span class="action" onclick="openChatWindow(\'';output+=parseJsonResponse[i].userid;output+="','"+parseJsonResponse[i].category;output+="','"+parseJsonResponse[i].firstname+"','";if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')"><img alt="Chat" border="0" src="'+contextRoot+'/static/images/green-chat-icon.gif" title="Chat"/></span></td><td><span class="action" onclick="openChatWindow(\'';output+=parseJsonResponse[i].userid;output+="','"+parseJsonResponse[i].category;output+="','"+parseJsonResponse[i].firstname+"','";if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')">Chat</span></td><td width="10"></td>';output+='<td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(parseJsonResponse[i].userid)+"&firstname="+escape(parseJsonResponse[i].firstname)+'","common","compose",event)><img border="0" alt="" src="'+contextRoot+'/static/images/msgimg.png"/></span></td><td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(parseJsonResponse[i].userid)+"&firstname="+escape(parseJsonResponse[i].firstname)+'","common","compose",event)>Send Message</span></td>';output+="</tr></table>";output+="</div>";output+="</div>";output+='<a href="javascript:void(0)" id="button" class="global-button global-color small-button-padding" style="position: absolute; top: 35px; left: 440px; margin-left: 35px;" onclick=showcommondiv("connection/AddConnections.jsp?username='+escape(parseJsonResponse[i].fromuser)+"&tousername="+escape(parseJsonResponse[i].firstname)+"&reqType=accept&connid="+escape(parseJsonResponse[i].idconnection)+"&index="+i+'","ConnectionPopUp","ConnectionPopUp")>Accept Request As &raquo;</a>';output+="</div>";output+="</div>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+="</div>";}}else{output+='<div style="margin-left: 4px; margin-top: 38px; height: 65px; width: 699px;"';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+="<b>"+parseJsonResponse[parseJsonResponse.length-1].response+"</b>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}}else{output+='<div id="pending" style="position: relative; width: auto; left: 0px; margin-top: 36px;">';output+='<table id="corner_dialog_table" align="center" class="corner_dialog_table" style="width: 695px;">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div style="height:20px; font-weight:bold;">';output+="No Pending Invitations";output+="</div>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+="</div>";if(mid=="pending"&&pid=="middle_div"){output+='<table width="100%" align="right">';output+='<tr><td style="text-align:right;">';if(allpages>1){output+=' <table id="pagination" align="right" width="180" style="margin-right:2%">';output+="<tr>";output+='<td width="30">Page</td>';output+='<td width="15">';output+="1";output+="</td>";output+='<td width="20">of</td>';output+='<td width="15">';output+=allpages;output+="</td>";output+='<td width="30">';lastpage=allpages-1;output+='<span class="action" onclick=setNextlinks("MyConnection.do","connection",1,"'+allpages+'")>Next</span>';output+="</td>";output+='<td width="30">';output+='<span class="action" onclick=setNextlinks("MyConnection.do","connection","'+lastpage+'","'+allpages+'")>Last</span>';output+="</td></tr>";output+=" </table>";}if(pid=="middle_div"){output+="</div>";output+="</div>";output+="</td></tr>";output+="</table>";output+="</div>";output+="</td>";output+='<td class="corner_border_bdr1_rm"></td>';output+="</tr>";output+='<td class="corner_bottomleft_bdr1"></td>';output+='<td class="corner_border_bdr1_bm"></td>';output+='<td class="corner_bottomright_bdr1"></td>';output+="</tr>";output+="</table>";output+="</div>";output+="</div>";}}document.getElementById(pid).innerHTML=output;}function viewMyConnection(result,pid){closecommon();var output="";var desired="";var CONNECTION_PAGE_LIMIT=10;start=page*CONNECTION_PAGE_LIMIT;end=start+CONNECTION_PAGE_LIMIT;var totalpages=new Array();totalpages=result.split("####");myresult=totalpages[0];totalrecords=totalpages[1];totalrec=totalpages[3];numOfConn=totalpages[1];if(totalrecords%CONNECTION_PAGE_LIMIT==0){allpages=totalrecords/CONNECTION_PAGE_LIMIT;allpages=parseInt(allpages);}else{allpages=totalrecords/CONNECTION_PAGE_LIMIT+1;allpages=parseInt(allpages);}lastpage=allpages-1;var parseJsonResponse=eval("("+myresult+")");if(mid=="view"){output+='<div id="output1">';if(!isAlphaRelease){output+='<div id="ContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:23px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="padding: 0% 0% 0% 0%; margin-top:-3px; text-align: center; width: 100%; height: 71px; z-index: 100; line-height:15px;">';output+='<b style="color:#990000;">Contacts</b>';output+='<ul style="display:block; list-style-type:none; text-align: left; padding-left:65px; margin:0px; color:black; "><li>All(60)</li><li>Expert(20)</li><li>Explorer(20)</li><li>Friends(20)</li></b>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div id="DownloadContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:125px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<div style="width: 152px; margin: auto;"><div class="global-button global-color"><span class="action" style="color:#4070A0;">Download Contacts</span></div></div>';output+='<div style="width: 140px; text-align: left; margin-left: 22px;">You can download all your contacts in CSV(comma separated value) format.</div>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+='<div id="InviteConnectionsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:0px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<img onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp") src="'+contextRoot+'/static/images/invite_all_logo.png">';output+='<div align="center" style="margin: auto; width: 152px;"><a href="javascript:void(0)" class="global-button global-color" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")>Invite More Friends</a>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div style="position: relative; height: auto; width: 736px; top: 35px;">';output+='<table id="corner_dialog_table_bdr1" align="left" class="corner_dialog_table_bdr1" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft_bdr1"></td>';output+='<td class="corner_border_bdr1_tm"></td>';output+='<td class="corner_topright_bdr1"></td>';output+="</tr>";output+="<tr>";output+='<td class="corner_border_bdr1_lm"></td>';output+='<td id="corner_content_bdr1" class="corner_content_bdr1">';output+='<div style="width: 100%; height: auto;">';output+='<div class="popup-header global-bg-color" style="position: relative; height: 20px; z-index: 10; left: -13px; top: -42px; width: 720px;">';output+="</div>";output+='<div id="TabbedPanels1" class="TabbedPanels"  style="position: relative; width: 705px; height: auto; padding-top: 0px; left: 0px; top: 0px; z-index: 10;">';output+='<ul class="TabbedPanelsTabGroup" style="margin-top: -67px;">';if(myuserid==otheruserid){output+='<li class="TabbedPanelsTab" tabindex="0" onclick=showmyconnectiion("MyConnection.do?type=0","MyConnections","view1",0,0,'+myuserid+') style="width:155px; float:left;">';output+="My Connections ("+numOfConn+")</li>";}else{output+='<li class="TabbedPanelsTab" tabindex="0" onclick=showmyconnectiion("MyConnection.do?type=0&uid='+otheruserid+'","middle_div","view",0,0,'+otheruserid+') style="width:155px; float:left;">';output+="Connections ("+numOfConn+")";output+="</li>";}if(myuserid==otheruserid){output+='<li class="TabbedPanelsTab" tabindex="0" style="width:155px; float:left;" onclick=showmyconnectiion("pendingConnection.do?type=0","MyConnections","pending",0,1,"'+myuserid+'","viewpendingreq");><span id="requestTabhom"></span>';output+="</li>";}output+="</ul>";output+='<div class="TabbedPanelsContentGroup">';output+='<div id="MyConnections" class="TabbedPanelsContent">';output+='<div id="searchFrndsA" style="margin-left: 4px; margin-top: 38px; height: 65px; width: 699px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft1">';output+="</td>";output+='<td class="corner_border_top1">';output+="</td>";output+='<td class="corner_topright1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_border1"';output+="</td>";output+='<td id="corner_content1" class="corner_content1">';output+='<div style="width:100%; height:30px;">';output+='<div class="row" style="width:410px; margin-left:140px;"><div class="cell" style="font-size:12px; color:#990000; width:85px; margin-top:7px;">Search Friends</div><div class="cell" style="width:210px;"><input id="mysearch" onkeypress=onenterAction(event,"SearchFriendsInConn.do","searchconn"); type="text" value="" style="width:200px;"/></div><div class="cell" style="width:75px;"><a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=showmysearch("SearchFriendsInConn.do","connectionsAndPagination","view1")>Search</a></div></div>';output+="</div>";output+="</td>";output+='<td class="corner_border_right1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_bottomleft1">';output+="</td>";output+='<td class="corner_border_bottom1">';output+="</td>";output+='<td class="corner_bottomright1">';output+="</td>";output+="</tr>";output+="</table>";output+="</div>";}output+='<div id="connectionsAndPagination">';output+='<div id="connectionoutput">';if(end>parseJsonResponse.length){end=parseJsonResponse.length;}if(!parseJsonResponse[parseJsonResponse.length-1].response&&parseJsonResponse.length>0){for(var i=start;i<end;i++){output+='<div style="position: relative; width: auto; height: 147px; padding-top: 0px; left: 0px; margin-top: 0px;">';output+='<div style="position: absolute; width: 99%; height: 145px; padding: 5px; left: 0px; margin-top: 0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div style="width:680px; height:120px;">';if(login_user==username){UserInfopopupDiv[i]=new UserInfo(parseJsonResponse[i].userid,parseJsonResponse[i].firstname,parseJsonResponse[i].photo_thumbnail,parseJsonResponse[i].summary,parseJsonResponse[i].expertise,parseJsonResponse[i].country,parseJsonResponse[i].reviews,parseJsonResponse[i].rating,parseJsonResponse[i].rpm,parseJsonResponse[i].category,parseJsonResponse[i].position,parseJsonResponse[i].company,parseJsonResponse[i].skypeid,parseJsonResponse[i].presence);}output+='<div id="mulpv'+i+'" style="display:none; left: 80px; top: 0px; position: absolute; height: auto; z-index: 100; width: 370px;"></div>';output+='<div id="ul" style="padding-right: 10px; padding-left: 10px; padding-top: 4px; width: 86px; z-index: 1;" >';if(parseJsonResponse[i].photo_thumbnail){if(login_user==null||login_user==""||!login_user){output+='<img id="mul'+i+'" style="cursor: pointer; border: 0px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src='+localhost+parseJsonResponse[i].photo_thumbnail+' height="96" />';}else{output+='<img id="mul'+i+'" style="cursor: pointer; border: 0px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src='+localhost+parseJsonResponse[i].photo_thumbnail+' height="96" />';}}else{if(login_user==null||login_user==""||!login_user){output+='<img id="mul'+i+'" style="cursor: pointer; border: 0px; margin-top:10px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png"/>';}else{output+='<img id="mul'+i+'" style="cursor: pointer; border: 0px; margin-top:10px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png"/>';}}output+="</div>";output+='<div id="available" style="width: 80px; margin-left: 30px; font-size: 12px; margin-top: 5px;">';output+="<img src="+((parseJsonResponse[i].presence==PRESENCE_STATUS_ONLINE)?"../static/images/green-dot-icon.png":"../static/images/gray-dot-icon.png");output+=" />";output+="</div>";output+='<div style="overflow: hidden; position: absolute; height: 120px; top: 20px; line-height: 20px; left: 34%;">';if(login_user==null||login_user==""||!login_user){output+='<div id="namediv" style="cursor: pointer; overflow:hidden; max-height:20px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'")><h1 style="font-size: 12px;">';}else{output+='<div id="namediv" style="cursor: pointer; overflow:hidden; max-height:20px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'")><h1 style="font-size: 12px;">';}output+=parseJsonResponse[i].firstname+"</h1></div>";output+='<div id="statusdiv" style="overflow: hidden; width: 440px; line-height: 15px; max-height: 32px;">';if(parseJsonResponse[i].summary){if(parseJsonResponse[i].summary.length>175){output+=parseJsonResponse[i].summary.substr(0,175)+"</div>";}else{output+=parseJsonResponse[i].summary+"</div>";}}else{output+="No summary</div>";}output+='<div class="clear" style="margin-left:0;">';output+='<div class="floatLeft rating'+parseJsonResponse[i].rating+'" title="Profile Reviews"></div><div class="floatLeft">( <span class="action">'+parseJsonResponse[i].reviews+" Reviews</span> )</div></div>";output+='<div class="clear" id="ratediv" style="color: rgb(51, 51, 51);">';output+="Rate : $ "+parseJsonResponse[i].rpm+"/minute</div>";output+='<div id="sendMsgDiv" style="color: rgb(31, 101, 152);">';output+='<table width="280"><tr>';if(myuserid!=parseJsonResponse[i].userid){output+='<td><span class="action" onclick="openChatWindow(\'';output+=parseJsonResponse[i].userid;output+="','"+parseJsonResponse[i].category;output+="','"+parseJsonResponse[i].firstname+"','";if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+="','"+parseJsonResponse[i].skypeid+"','"+parseJsonResponse[i].position+"','"+parseJsonResponse[i].company+'\')"><img alt="Chat" border="0" src="'+contextRoot+'/static/images/green-chat-icon.gif" title="Chat"/></span></td><td><span class="action" onclick="openChatWindow(\'';output+=parseJsonResponse[i].userid;output+="','"+parseJsonResponse[i].category;output+="','"+parseJsonResponse[i].firstname+"','";if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+="','"+parseJsonResponse[i].skypeid+"','"+parseJsonResponse[i].position+"','"+parseJsonResponse[i].company+'\')">Chat</span></td><td width="10"></td>';output+='<td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(parseJsonResponse[i].userid)+"&firstname="+escape(parseJsonResponse[i].firstname)+'","common","compose",event)><img border="0" alt="" src="'+contextRoot+'/static/images/msgimg.png"/></span></td><td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(parseJsonResponse[i].userid)+"&firstname="+escape(parseJsonResponse[i].firstname)+'","common","compose",event)>Send Message</span></td>';output+='<td><span class="action" style="color:#1F6598;" onclick=showcommondiv("checkfeedback.do?uid='+escape(parseJsonResponse[i].userid)+"&name="+escape(parseJsonResponse[i].firstname)+'&skillid=0&type=connection&remark=connection","ConnectionPopUp","ConnectionPopUp")>Give Feedback</span></td>';}output+="</tr></table>";output+="</div>";output+="</div>";output+="</div>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";if(!isAlphaRelease){output+='<div style="position: relative; left: 53.5%; z-index: 1; width: 46.2%; height: 124px; top: -17px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; line-height:15px; z-index: 10">';output+='<tr><td class="corner_topleft1"></td><td class="corner_border_top1"></td><td class="corner_topright1"></td></tr>';output+='<tr><td class="corner_border1"></td><td id="corner_content1" class="corner_content1">';output+='<div style="width:100%; height:100px;">';output+='<span style="color:teal; margin-left:5px;"><b>Java Tutorials</b></span><br/>';output+='<div style="position:relative; width:280px; height:50px; margin-left:5px; color:#004080; overflow:none;">Java made easy for you. It is commonly used programming....&nbsp;<span class="action" style="color:#004080">more</span></div>';output+='<div id="reviewdiv" style="cursor: pointer; position: relative; width: auto; height: 14px; z-index: 9; margin-left:5px; margin-top: 1%;">';output+='<img alt="" src="'+contextRoot+"/static/images/"+parseJsonResponse[i].rating+'rating.png"/>&nbsp; <span id="reviewsdiv">( <span class="action">'+parseJsonResponse[i].reviews+" Reviews</span> )</span></div>";output+="</div>";output+='</td><td class="corner_border_right1"></td></tr>';output+='<tr><td class="corner_bottomleft1"></td><td class="corner_border_bottom1"></td><td class="corner_bottomright1"></td>';output+="</tr></table>";output+="</div>";}output+="</div>";}}else{output+='<div style="margin-top: 10px; width: 699px; height: auto; margin-left: 4px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+="<b>"+parseJsonResponse[parseJsonResponse.length-1].response+"</b>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+="</div>";if(mid=="view"){output+='<table width="100%" align="right">';output+='<tr><td style="text-align:right;">';if(allpages>1){output+='<div id="pagination">';output+='<table align=right width="180" style="margin-right:2%">';output+="<tr>";output+='<td width="30">Page</td>';output+='<td width="15">';output+="1";output+="</td>";output+='<td width="20">of</td>';output+='<td width="15">';output+=allpages;output+="</td>";output+='<td width="30">';lastpage=allpages-1;output+='<span class="action" onclick=setNextlinks("MyConnection.do?uid='+totalpages[2]+'","connection",1,"'+allpages+'","'+totalpages[2]+'")>Next</span>';output+="</td>";output+='<td width="30">';output+='<span class="action" onclick=setNextlinks("MyConnection.do?uid='+totalpages[2]+'","connection","'+lastpage+'","'+allpages+'","'+totalpages[2]+'")>Last</span>';output+="</td></tr>";output+=" </table>";}output+="</td></tr>";output+="</table>";output+="</div>";output+="</div>";output+="</div>";output+='<div id="MyRequests" class="TabbedPanelsContent" style="padding:0px; width: 100%; height:auto;">';output+="</div>";output+="</div>";output+="</div>";output+="</td>";output+='<td class="corner_border_bdr1_rm"></td>';output+="</tr>";output+='<td class="corner_bottomleft_bdr1"></td>';output+='<td class="corner_border_bdr1_bm"></td>';output+='<td class="corner_bottomright_bdr1"></td>';output+="</tr>";output+="</table>";output+="</div>";output+="</div>";}document.getElementById(pid).innerHTML=output;if(myuserid==otheruserid){var TabbedPanels1=new Spry.Widget.TabbedPanels("TabbedPanels1",tabindexer);}showResultAct("GetReqCountHome.do","requestTabhom",0);}function viewMyConnection1(result,pid){closecommon();var output="";var desired="";var CONNECTION_PAGE_LIMIT=10;start=page*CONNECTION_PAGE_LIMIT;end=start+CONNECTION_PAGE_LIMIT;var totalpages=new Array();totalpages=result.split("####");myresult=totalpages[0];totalrecords=totalpages[1];totalrec=totalpages[3];if(totalrecords%CONNECTION_PAGE_LIMIT==0){allpages=totalrecords/CONNECTION_PAGE_LIMIT;allpages=parseInt(allpages);}else{allpages=totalrecords/CONNECTION_PAGE_LIMIT+1;allpages=parseInt(allpages);}lastpage=allpages-1;var parseJsonResponse=eval("("+myresult+")");if(pid!="connectionoutput"){if(document.getElementById("searchFrndsA")!=null){document.getElementById("searchFrndsA").style.display="none";}output+='<div id="searchFrndsB" style="margin-left: 4px; margin-top: 38px; height: 65px; width: 699px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft1">';output+="</td>";output+='<td class="corner_border_top1">';output+="</td>";output+='<td class="corner_topright1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_border1"';output+="</td>";output+='<td id="corner_content1" class="corner_content1">';output+='<div style="width:100%; height:30px;">';output+='<div class="row" style="width:410px; margin-left:140px;"><div class="cell" style="font-size:12px; color:#990000; width:85px; margin-top:7px;">Search Friends</div><div class="cell" style="width:210px;"><input id="mysearch" onkeypress=onenterAction(event,"SearchFriendsInConn.do","searchconn"); type="text" value="" style="width:200px;"/></div><div class="cell" style="width:75px;"><a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=showmysearch("SearchFriendsInConn.do","connectionsAndPagination","view1")>Search</a></div></div>';output+="</div>";output+="</td>";output+='<td class="corner_border_right1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_bottomleft1">';output+="</td>";output+='<td class="corner_border_bottom1">';output+="</td>";output+='<td class="corner_bottomright1">';output+="</td>";output+="</tr>";output+="</table>";output+="</div>";}output+='<div id="connectionsAndPagination">';output+='<div id="connectionoutput">';if(end>parseJsonResponse.length){end=parseJsonResponse.length;}if(!parseJsonResponse[parseJsonResponse.length-1].response&&parseJsonResponse.length>0){for(var i=start;i<end;i++){output+='<div style="position: relative; width: auto; height: 147px; padding-top: 0px; left: 0px; margin-top: 0px;">';output+='<div style="position: absolute; width: 99%; height: 145px; padding: 5px; left: 0px; margin-top: 0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div style="width:680px; height:120px;">';UserInfopopupDiv[i]=new UserInfo(parseJsonResponse[i].userid,parseJsonResponse[i].firstname,parseJsonResponse[i].photo_thumbnail,parseJsonResponse[i].summary,parseJsonResponse[i].expertise,parseJsonResponse[i].country,parseJsonResponse[i].reviews,parseJsonResponse[i].rating,parseJsonResponse[i].rpm,parseJsonResponse[i].category,parseJsonResponse[i].position,parseJsonResponse[i].company,parseJsonResponse[i].skypeid,parseJsonResponse[i].presence);output+='<div id="mulpv'+i+'" style="display:none; left: 80px; top: 0px; position: absolute; height: auto; z-index: 100; width: 370px;"></div>';output+='<div id="ul" style="padding-right: 10px; padding-left: 10px; padding-top: 4px; width: 86px; z-index: 1;" >';if(parseJsonResponse[i].photo_thumbnail){if(login_user==null||login_user==""||!login_user){output+='<img id="mul'+i+'" style="border: 0px; cursor: pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src='+localhost+parseJsonResponse[i].photo_thumbnail+' height="96" />';}else{output+='<img id="mul'+i+'" style="border: 0px; cursor: pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src='+localhost+parseJsonResponse[i].photo_thumbnail+' height="96" />';}}else{if(login_user==null||login_user==""||!login_user){output+='<img id="mul'+i+'" style="border: 0px; margin-top:10px; cursor: pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png"/>';}else{output+='<img id="mul'+i+'" style="border: 0px; margin-top:10px; cursor: pointer;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") alt="uimg" src="'+contextRoot+'/static/images/newUserImg.png"/>';}}output+="</div>";output+='<div id="available" style="width: 80px; margin-left: 30px; font-size: 12px; margin-top: 5px;">';output+="<img src="+((parseJsonResponse[i].presence==PRESENCE_STATUS_ONLINE)?"../static/images/green-dot-icon.png":"../static/images/gray-dot-icon.png");output+=" />";output+="</div>";output+='<div style="overflow: hidden; position: absolute; height: 120px; top: 20px; line-height: 20px; left: 34%;">';if(login_user==null||login_user==""||!login_user){output+='<div id="namediv" style="cursor: pointer; overflow:hidden; max-height:20px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'")><h1 style="font-size: 12px;">';}else{output+='<div id="namediv" style="cursor: pointer; overflow:hidden; max-height:20px;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'")><h1 style="font-size: 12px;">';}output+=parseJsonResponse[i].firstname+"</h1></div>";output+='<div id="statusdiv" style="overflow: hidden; width: 440px; line-height: 15px; max-height: 33px;">';if(parseJsonResponse[i].summary){if(parseJsonResponse[i].summary.length>175){output+=parseJsonResponse[i].summary.substr(0,175)+"</div>";}else{output+=parseJsonResponse[i].summary+"</div>";}}else{output+="No summary</div>";}output+='<div class="clear" style="margin-left:0;">';output+='<div class="floatLeft rating'+parseJsonResponse[i].rating+'" title="Profile Reviews"></div><div class="floatLeft">( <span class="action">'+parseJsonResponse[i].reviews+" Reviews</span> )</div></div>";output+='<div class="clear" id="ratediv" style="color: rgb(51, 51, 51);">';output+="Rate : $ "+parseJsonResponse[i].rpm+"/minute</div>";output+='<div id="sendMsgDiv" style="color: rgb(31, 101, 152);">';output+='<table width="280"><tr>';output+='<td><span class="action" onclick="openChatWindow(\'';output+=parseJsonResponse[i].userid;output+="','"+parseJsonResponse[i].category;output+="','"+parseJsonResponse[i].firstname+"','";if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+='\')"><img alt="Chat" border="0" src="'+contextRoot+'/static/images/green-chat-icon.gif" title="Chat"/></span></td><td><span class="action" onclick="openChatWindow(\'';output+=parseJsonResponse[i].userid;output+="','"+parseJsonResponse[i].category;output+="','"+parseJsonResponse[i].firstname+"','";if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/newUserImg.png";}output+="','"+parseJsonResponse[i].skypeid+"','"+parseJsonResponse[i].position+"','"+parseJsonResponse[i].company+'\')">Chat</span></td><td width="10"></td>';output+='<td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(parseJsonResponse[i].userid)+"&firstname="+escape(parseJsonResponse[i].firstname)+'","common","compose",event)><img border="0" alt="" src="'+contextRoot+'/static/images/msgimg.png"/></span></td><td><span class="action" onclick=showComposeMsg("messages/popupcompose.jsp?replyto='+escape(parseJsonResponse[i].userid)+"&firstname="+escape(parseJsonResponse[i].firstname)+'","common","compose",event)>Send Message</span></td>';output+='<td><span class="action" style="color:#1F6598;" onclick=showcommondiv("checkfeedback.do?uid='+escape(parseJsonResponse[i].userid)+"&name="+escape(parseJsonResponse[i].firstname)+'&skillid=0&type=connection&remark=connection","ConnectionPopUp","ConnectionPopUp")>Give Feedback</span></td>';output+="</tr></table>";output+="</div>";output+="</div>";output+="</div>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";if(!isAlphaRelease){output+='<div style="position: relative; left: 53.5%; z-index: 1; width: 46.2%; height: 124px; top: -17px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; line-height:15px; z-index: 10">';output+='<tr><td class="corner_topleft1"></td><td class="corner_border_top1"></td><td class="corner_topright1"></td></tr>';output+='<tr><td class="corner_border1"></td><td id="corner_content1" class="corner_content1">';output+='<div style="width:100%; height:100px;">';output+='<span style="color:teal; margin-left:5px;"><b>Java Tutorials</b></span><br/>';output+='<div style="position:relative; width:280px; height:50px; margin-left:5px; color:#004080; overflow:none;">Java made easy for you. It is commonly used programming....&nbsp;<span class="action" style="color:#004080">more</span></div>';output+='<div id="reviewdiv" style="cursor: pointer; position: relative; width: auto; height: 14px; z-index: 9; margin-left:5px; margin-top: 1%;">';output+='<img alt="" src="'+contextRoot+"/static/images/"+parseJsonResponse[i].rating+'rating.png"/>&nbsp; <span id="reviewsdiv">( <span class="action">'+parseJsonResponse[i].reviews+" Reviews</span> )</span></div>";output+="</div>";output+='</td><td class="corner_border_right1"></td></tr>';output+='<tr><td class="corner_bottomleft1"></td><td class="corner_border_bottom1"></td><td class="corner_bottomright1"></td>';output+="</tr></table>";output+="</div>";}output+="</div>";}output+="</div>";}else{output+='<div style="margin-left: 4px; margin-top: 38px; height: 65px; width: 699px;"';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+="<b>"+parseJsonResponse[parseJsonResponse.length-1].response+"</b>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}if(mid=="view1"){output+='<table width="100%" align="right">';output+='<tr><td style="text-align:right;">';if(allpages>1){output+='<div id="pagination">';output+='<table align="right" width="180" style="margin-right:2%">';output+="<tr>";output+='<td width="30">Page</td>';output+='<td width="15">';output+="1";output+="</td>";output+='<td width="20">of</td>';output+='<td width="15">';output+=allpages;output+="</td>";output+='<td width="30">';lastpage=allpages-1;output+='<span class="action" onclick=setNextlinks("MyConnection.do","connection",1,"'+allpages+'")>Next</span>';output+="</td>";output+='<td width="30">';output+='<span class="action" onclick=setNextlinks("MyConnection.do","connection","'+lastpage+'","'+allpages+'")>Last</span>';output+="</td></tr>";output+=" </table>";}output+="</td></tr>";output+="</table>";output+="</div>";output+="</div>";output+="</div>";output+='<div id="MyRequests" class="TabbedPanelsContent" style="padding:0px; width: 100%; height:auto;">';output+="</div>";output+="</div>";output+="</div>";output+="</td>";output+='<td class="corner_border_bdr1_rm"></td>';output+="</tr>";output+='<td class="corner_bottomleft_bdr1"></td>';output+='<td class="corner_border_bdr1_bm"></td>';output+='<td class="corner_bottomright_bdr1"></td>';output+="</tr>";output+="</table>";output+="</div>";output+="</div>";}document.getElementById(pid).innerHTML=output;var TabbedPanels1=new Spry.Widget.TabbedPanels("TabbedPanels1",tabindexer);}function ManageMyConnection(result,pid){closecommon();var output="";var CONNECTION_PAGE_LIMIT=10;start=page*CONNECTION_PAGE_LIMIT;end=start+CONNECTION_PAGE_LIMIT;var desired;var totalpages=new Array();totalpages=result.split("####");myresult=totalpages[0];totalrecords=totalpages[1];mypage=start;if(totalrecords%CONNECTION_PAGE_LIMIT==0){allpages=totalrecords/CONNECTION_PAGE_LIMIT;allpages=parseInt(allpages);}else{allpages=totalrecords/CONNECTION_PAGE_LIMIT+1;allpages=parseInt(allpages);}var parseJsonResponse=eval("("+myresult+")");if(mid=="manage"){output+='<div id="output1">';if(!isAlphaRelease){output+='<div id="ContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:23px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="padding: 0% 0% 0% 0%; margin-top:-3px; text-align: center; width: 100%; height: 71px; z-index: 100; line-height:15px;">';output+='<b style="color:#990000;">Contacts</b>';output+='<ul style="display:block; list-style-type:none; text-align: left; padding-left:65px; margin:0px; color:black; "><li>All(60)</li><li>Expert(20)</li><li>Explorer(20)</li><li>Friends(20)</li></b>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div id="DownloadContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:125px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<div style="width: 152px; margin: auto;"><div class="global-button global-color"><span class="action" style="color:#4070A0;">Download Contacts</span></div></div>';output+='<div style="width: 140px; text-align: left; margin-left: 22px;">You can download all your contacts in CSV(comma separated value) format.</div>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+='<div id="InviteConnectionsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<span class="action" onclick=onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")><img src="'+contextRoot+'/static/images/invite_all_logo.png"></span>';output+='<div align="center" style="margin: auto; width: 152px;"><a href="javascript:void(0)" class="global-button global-color" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")>Invite More Friends</a>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div class="popup-header global-bg-color" style="position: relative; height: auto; z-index: 10; left: 3px; width: 726px; top: 0px; margin-top: 10px;">Manage Connections';output+="</div>";output+='<div style="position: relative; width: 78%; height: auto; left: 0px; z-index: 1; top: -6px;">';output+='<table id="corner_dialog_table_bdr1" align="left" class="corner_dialog_table_bdr1" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft_bdr1"></td>';output+='<td class="corner_border_bdr1_tm"></td>';output+='<td class="corner_topright_bdr1"></td>';output+="</tr>";output+="<tr>";output+='<td class="corner_border_bdr1_lm"></td>';output+='<td id="corner_content_bdr1" class="corner_content_bdr1">';output+='<div style="width: 100%; height: auto;">';output+='<div style="position: relative; padding:2px; left: 0%; z-index: 1; width: 705px; height: 65px; top: 0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft1">';output+="</td>";output+='<td class="corner_border_top1">';output+="</td>";output+='<td class="corner_topright1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_border1">';output+="</td>";output+='<td id="corner_content1" class="corner_content1">';output+='<div style="width:100%; height:30px;">';output+='<div class="row" style="width:410px; margin-left:140px;"><div class="cell" style="font-size:12px; color:#990000; width:85px; margin-top:7px;">Search Friends</div><div class="cell" style="width:210px;">';output+='<input id="mysearch" type="text" value="" style="width:200px;" onkeypress=onenterAction(event,"SearchFriendsInConn.do","manage") /></div><div class="cell" style="width:75px;"><a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=showmysearch("SearchFriendsInConn.do","middle_div","manage")>Search</a></div></div>';output+="</div>";output+="</td>";output+='<td class="corner_border_right1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_bottomleft1">';output+="</td>";output+='<td class="corner_border_bottom1">';output+="</td>";output+='<td class="corner_bottomright1">';output+="</td>";output+="</tr>";output+="</table>";output+="</div>";}output+='<div id="manageoutput" style="position: relative; width: auto; height: auto; left: 0px; padding: 3px; z-index: 10;">';if(!parseJsonResponse[parseJsonResponse.length-1].response&&parseJsonResponse.length>0){for(var i=start;i<end;i++){if(parseJsonResponse[i]){output+='<div id="manageFrnd'+i+'" name="manageFrnd" style="background: url('+contextRoot+'/static/images/edit_conn_bg.png) no-repeat; position: relative; width: 360px; height: 50px; padding: 5px; padding-right:0px; left: 0px; margin-top: 0px; z-index: 10;">';UserInfoConnDiv[i]=new UserInfo(parseJsonResponse[i].userid,parseJsonResponse[i].firstname,parseJsonResponse[i].photo_thumbnail,parseJsonResponse[i].summary,parseJsonResponse[i].expertise,parseJsonResponse[i].country,parseJsonResponse[i].reviews,parseJsonResponse[i].rating,parseJsonResponse[i].rpm,parseJsonResponse[i].category);output+='<div style="padding:5px; position: absolute; z-index: 100; height: 37px; width: 31px; top: 5px; left: 10px;">';if(login_user==null||login_user==""||!login_user){output+='<img onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'") style="border: 0px; cursor:pointer;" alt="uimg" src="';}else{output+='<img onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'") style="border: 0px; cursor:pointer;" alt="uimg" src="';}if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/userimg2.png";}output+='" width="28" /></div>';if(login_user==null||login_user==""||!login_user){output+='<div id="namediv" style="position: absolute; width: auto; height: 14px; z-index: 3; left: 20%; top: 10%;"><h1 style="font-size: 12px;"><span class="action" style="color:black;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'&from=index","middle_div","'+parseJsonResponse[i].userid+'")>';}else{output+='<div id="namediv" style="position: absolute; width: auto; height: 14px; z-index: 3; left: 20%; top: 10%;"><h1 style="font-size: 12px;"><span class="action" style="color:black;" onclick=showviewprofile("ViewOtherProfile.do?uid='+parseJsonResponse[i].userid+'","middle_div","'+parseJsonResponse[i].userid+'")>';}output+=parseJsonResponse[i].firstname+"</span></h1></div>";if(parseJsonResponse[i].summary){output+='<div id="GroupName" style="overflow: hidden; left: 20%; position: absolute; width: 57%; height: 28px; top: 35%; color:#666;">';output+=parseJsonResponse[i].summary+"</div>";}else{output+="";}output+='<div id="Edit_Delete2" style="position: absolute; width: auto; height: auto; z-index: 10; left: 80%; top: 60%">';output+='<span class="action" onclick=showcommondiv("connection/EditConnections.jsp?firstname='+escape(parseJsonResponse[i].firstname)+"&conid="+escape(parseJsonResponse[i].conid)+"&touserid="+escape(parseJsonResponse[i].userid)+"&relation="+escape(parseJsonResponse[i].relation)+"&tag="+escape(parseJsonResponse[i].tag)+'","ConnectionPopUp","ConnectionPopUp") style="font-size:9px; color:gray;"> [Edit]</span>';output+='<span class="action" onclick=showcommondiv("profile/delete.jsp?id='+escape(parseJsonResponse[i].conid)+"&type=deleteconnection&divid="+i+'","ConnectionPopUp","ConnectionPopUp") style="font-size:9px; color:#990000;"> [Delete]</span></div>';output+="</div>";}}output+="</div>";}else{output+='<div style="position: relative; z-index: 1; left: 0px; top: 0pt; padding-top: 2px; width: 702px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+="<b>"+parseJsonResponse[parseJsonResponse.length-1].response+"</b>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+="</div>";if(mid=="manage"){output+='<table width="100%" align="right">';output+='<tr><td style="text-align:right;">';if(allpages>1){output+='<div id="pagination">';output+='<table align="right" width="180" style="margin-right:2%">';output+="<tr>";output+='<td width="30">Page</td>';output+='<td width="15">';output+="1";output+="</td>";output+='<td width="20">of</td>';output+='<td width="15">';output+=allpages;output+="</td>";output+='<td width="30">';mypage++;output+='<span class="action" onclick=setNextlinks("MyConnection.do","manageconn","'+mypage+'","'+allpages+'") >Next</span>';output+="</td>";output+='<td width="30">';output+='<span class="action" onclick=setNextlinks("MyConnection.do","manageconn","'+mypage+'","'+allpages+'")>Last</span>';output+="</td></tr>";output+=" </table>";}output+="</td></tr>";output+="</table>";output+="</div>";output+="</td>";output+='<td class="corner_border_bdr1_rm"></td>';output+="</tr>";output+="<tr>";output+='<td class="corner_bottomleft_bdr1"></td>';output+='<td class="corner_border_bdr1_bm"></td>';output+='<td class="corner_bottomright_bdr1"></td>';output+="</tr>";output+="</table>";output+="</div>";output+="</div>";}document.getElementById(pid).innerHTML=output;}function ManageMyConnection1(result,pid){closecommon();var output="";var CONNECTION_PAGE_LIMIT=10;start=page*CONNECTION_PAGE_LIMIT;end=start+CONNECTION_PAGE_LIMIT;var desired;var totalpages=new Array();totalpages=result.split("####");myresult=totalpages[0];totalrecords=totalpages[1];mypage=start;if(totalrecords%CONNECTION_PAGE_LIMIT==0){allpages=totalrecords/CONNECTION_PAGE_LIMIT;allpages=parseInt(allpages);}else{allpages=totalrecords/CONNECTION_PAGE_LIMIT+1;allpages=parseInt(allpages);}var parseJsonResponse=eval("("+myresult+")");if(mid=="manage"&&pid!="manageoutput"){output+='<div id="output1">';if(!isAlphaRelease){output+='<div id="ContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:23px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="padding: 0% 0% 0% 0%; margin-top:-3px; text-align: center; width: 100%; height: 71px; z-index: 100; line-height:15px;">';output+='<b style="color:#990000;">Contacts</b>';output+='<ul style="display:block; list-style-type:none; text-align: left; padding-left:65px; margin:0px; color:black; "><li>All(60)</li><li>Expert(20)</li><li>Explorer(20)</li><li>Friends(20)</li></b>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div id="DownloadContactsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:125px; z-index: 10;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<div style="width: 152px; margin: auto;"><div class="global-button global-color"><span class="action" style="color:#4070A0;">Download Contacts</span></div></div>';output+='<div style="width: 140px; text-align: left; margin-left: 22px;">You can download all your contacts in CSV(comma separated value) format.</div>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+='<div id="InviteConnectionsDiv" style="position: absolute; width: 22%; height: auto; padding: 0px; left: 78.5%; top:0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="position:relative; margin-top:6px; width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+='<div id="InviteConnDiv" style="text-align: center; width: 100%; height: auto; z-index: 100;">';output+='<span class="action" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")><img src="'+contextRoot+'/static/images/invite_all_logo.png"></span>';output+='<div align="center" style="margin: auto; width: 152px;"><a href="javascript:void(0)" class="global-button global-color" onclick=showcommondivIndex("'+contextRoot+'/jsp/InviteFriendsHome.jsp?flag=home","ConnectionPopUp","ConnectionPopUp")>Invite More Friends</a>';output+="</div>";output+='</td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td>';output+='<td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";output+='<div class="popup-header global-bg-color" style="position: relative; height: auto; z-index: 10; left: 3px; width: 726px; top: 0px; margin-top: 10px;">Manage Connections';output+="</div>";output+='<div style="position: relative; width: 78%; height: auto; left: 0px; z-index: 1; top: -6px;">';output+='<table id="corner_dialog_table_bdr1" align="left" class="corner_dialog_table_bdr1" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft_bdr1"></td>';output+='<td class="corner_border_bdr1_tm"></td>';output+='<td class="corner_topright_bdr1"></td>';output+="</tr>";output+="<tr>";output+='<td class="corner_border_bdr1_lm"></td>';output+='<td id="corner_content_bdr1" class="corner_content_bdr1">';output+='<div style="width: 100%; height: auto;">';output+='<div style="position: relative; padding:2px; left: 0%; z-index: 1; width: 705px; height: 65px; top: 0px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%;">';output+="<tr>";output+='<td class="corner_topleft1">';output+="</td>";output+='<td class="corner_border_top1">';output+="</td>";output+='<td class="corner_topright1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_border1">';output+="</td>";output+='<td id="corner_content1" class="corner_content1">';output+='<div style="width:100%; height:30px;">';output+='<div class="row" style="width:410px; margin-left:140px;"><div class="cell" style="font-size:12px; color:#990000; width:85px; margin-top:7px;">Search Friends</div><div class="cell" style="width:210px;"><input id="mysearch" type="text" value="" style="width:200px;"/></div><div class="cell" style="width:75px;"><a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=showmysearch("SearchFriendsInConn.do","middle_div","manage")>Search</a></div></div>';output+="</div>";output+="</td>";output+='<td class="corner_border_right1">';output+="</td>";output+="</tr>";output+="<tr>";output+='<td class="corner_bottomleft1">';output+="</td>";output+='<td class="corner_border_bottom1">';output+="</td>";output+='<td class="corner_bottomright1">';output+="</td>";output+="</tr>";output+="</table>";output+="</div>";}if(!parseJsonResponse[parseJsonResponse.length-1].response&&parseJsonResponse.length>0){if(end>parseJsonResponse.length){end=parseJsonResponse.length;}for(var i=start;i<end;i++){output+='<div id="mulpv'+i+'" onmouseout="mclosetime()" onmouseover="mcancelclosetime()" style="display:none; left:60px; position: absolute; width: 355px; height: auto; z-index: 100;"></div>';output+='<div id="manageFrnd'+i+'" name="manageFrnd" style="background: url('+contextRoot+'/static/images/edit_conn_bg.png) no-repeat; position: relative; width: 360px; height: 50px; padding: 5px; padding-right:0px; left: 0px; margin-top: 0px; z-index: 10;">';UserInfoConnDiv[i]=new UserInfo(parseJsonResponse[i].userid,parseJsonResponse[i].firstname,parseJsonResponse[i].photo_thumbnail,parseJsonResponse[i].summary,parseJsonResponse[i].expertise,parseJsonResponse[i].country,parseJsonResponse[i].reviews,parseJsonResponse[i].rating,parseJsonResponse[i].rpm,parseJsonResponse[i].category);output+='<div style="padding:5px; position: absolute; z-index: 100; height: 37px; width: 31px; top: 5px; left: 10px;">';output+='<img id="mul'+i+'" onmouseout=mclosetime() onmouseover=viewBusinessCard('+i+',"mulpv'+i+'",event,"mul'+i+'","manageconnections") style="border: 0px; cursor:pointer;" alt="uimg" src="';if(parseJsonResponse[i].photo_thumbnail){output+=localhost+parseJsonResponse[i].photo_thumbnail;}else{output+=contextRoot+"/static/images/userimg2.png";}output+='" width="28" /></div>';output+='<div id="namediv" style="position: absolute; width: auto; height: 14px; z-index: 3; left: 20%; top: 10%;"><h1 style="font-size: 12px;">';output+=parseJsonResponse[i].firstname+"</h1></div>";if(parseJsonResponse[i].summary){output+='<div id="GroupName" style="overflow: hidden; left: 20%; position: absolute; width: 57%; height: 28px; top: 35%; color:#666;">';output+=parseJsonResponse[i].summary+"</div>";}else{output+="";}output+='<div id="Edit_Delete2" style="position: absolute; width: auto; height: auto; z-index: 10; left: 80%; top: 60%">';output+='<span class="action" onclick=showcommondiv("connection/EditConnections.jsp?firstname='+escape(parseJsonResponse[i].firstname)+"&conid="+escape(parseJsonResponse[i].conid)+"&touserid="+escape(parseJsonResponse[i].userid)+"&relation="+escape(parseJsonResponse[i].relation)+"&tag="+escape(parseJsonResponse[i].tag)+'","ConnectionPopUp","ConnectionPopUp") style="font-size:9px; color:gray;"> [Edit]</span>';output+='<span class="action" onclick=showcommondiv("profile/delete.jsp?id='+escape(parseJsonResponse[i].conid)+"&type=deleteconnection&divid="+i+'","ConnectionPopUp","ConnectionPopUp") style="font-size:9px; color:#990000;"> [Delete]</span></div>';output+="</div>";}output+="</div>";}else{output+='<div style="position: relative; z-index: 1; left: 0px; top: 0pt; padding-top: 2px; width: 702px;">';output+='<table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10">';output+='<tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr>';output+='<tr><td class="left_side_border"></td><td id="corner_content" class="corner_content">';output+="<b>"+parseJsonResponse[parseJsonResponse.length-1].response+"</b>";output+='</td><td class="right_side_border"></td></tr>';output+='<tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr>';output+="</table>";output+="</div>";}output+="</div>";document.getElementById(pid).innerHTML=output;}function editManageConnection(s,h,d,o,c,r,b){pid=h;var l;var q;for(var g=1;g<=6;g++){var p=c+g;if(document.getElementById(p).checked){q=document.getElementById(p).value;}}var w=document.getElementById(r).value;if(w=="put your own group name"){w="";}for(var f=1;f<=3;f++){var m=o+f;if(document.getElementById(m).checked){l=document.getElementById(m).value;}}var v="your group has been changed ";var u=document.getElementById(d).value;var a=s;showResultWithQueryStr(s,h,messageHandler,"connuser="+escape(u)+"&group="+escape(l)+"&inviteMessage="+escape(v)+"&relation="+escape(q)+"&tag="+escape(w)+"&connid="+escape(b)+"&action=0");ModalPopup.Close(h,"1");mclosecommontime2();return true;}function deleteFromConnection(d,b,c){pid=b;var a=d;showResultWithQueryStr(d,b,messageHandler,"connid="+escape(c)+"&action=1");mclosecommontime2();return true;}function commonmanagecallback(){if(req.readyState==4){if(req.status==200){document.getElementById(pid).style.display="";document.getElementById(pid).style.top=(tempY-50)+"px";document.getElementById(pid).style.marginLeft=newIcordX+"px";document.getElementById(pid).innerHTML="";document.getElementById(pid).innerHTML=req.responseText;}else{}}else{document.getElementById(pid).style.display="";document.getElementById(pid).innerHTML=sHTMLSearchAnim.replace("###","");showDetailscommon("output");}}function addcustomgroup(a){document.getElementById(a).style.display="";}function clearcutomgroup(a){document.getElementById(a).style.display="none";}function showmyconnectiion(g,c,f,j,d,h,b){var a=f;mid=f;pid=c;page=j;tabindexer=d;if(!h){otheruserid=myuserid;}else{otheruserid=h;}if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value=b+":"+g+":"+c+":"+f+":"+j+":"+d+":"+h;return true;}else{if(a=="view"){if(c=="middle_div"){showResultWithQueryStr(g,c,viewMyConnection,null,true,d,f,j);}else{showResultWithQueryStr(g,c,viewMyConnection1,null,false,d,f,j);}}if(a=="view1"){if(c=="middle_div"){showResultWithQueryStr(g,c,viewMyConnection,null,false,d,f,j);}else{showResultWithQueryStr(g,c,viewMyConnection1,null,false,d,f,j);}}if(a=="pending"){showResultWithQueryStr(g,c,viewPendingConnection,null,false,d,f,j);}if(a=="manage"){if(c=="middle_div"){showResultWithQueryStr(g,c,ManageMyConnection,null,false,d,f,j);}else{showResultWithQueryStr(g,c,ManageMyConnection1,null,false,d,f,j);}}return true;}}function showmysearch(f,b,c,d){if(document.getElementById("mysearch")){desired=document.getElementById("mysearch").value;}else{desired=d;}if(desired==""){document.getElementById("connectionoutput").innerHTML='<div style="position: relative; z-index: 1; left: 4px; top: 0pt; padding-top: 4px; width: 698px;"><table id="corner_dialog_table" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10"><tr><td class="corner_topleft"></td><td class="top_side_border"></td><td class="corner_topright"></td></tr><tr><td class="left_side_border"></td><td id="corner_content" class="corner_content"><b>No String for Search</b></td><td class="right_side_border"></td></tr><tr><td class="corner_bottomleft"></td><td class="bottom_side_border"></td><td class="corner_bottomright"></td></tr></table></div>';return;}var a=c;mid=c;pid=b;if(a=="view"){showResultWithQueryStr(f,b,viewMyConnection,"desired="+escape(desired));}if(a=="view1"){showResultWithQueryStr(f,b,viewMyConnection,"desired="+escape(desired));}if(a=="manage"){showResultWithQueryStr(f,b,ManageMyConnection,"desired="+escape(desired));}if(a=="pending"){showResultWithQueryStr(f,b,viewPendingConnection,"desired="+escape(desired));}if(a=="manage1"){showResultWithQueryStr(f,b,ManageMyConnection,"desired="+escape(desired));}}function homePageHeaderTabs(a){if(a=="mouse out"){if(isKBActive=="ontabactive"){document.getElementById("EA").className="ontab";b=document.getElementById("Projects");if(b){b.className="ontab";}}else{if(isEAActive=="ontabactive"){document.getElementById("EA").className="ontabactive";b=document.getElementById("Projects");if(b){b.className="ontab";}}else{if(isProjActive=="ontabactive"){document.getElementById("EA").className="ontab";b=document.getElementById("Projects");if(b){b.className="ontabactive";}}else{document.getElementById("EA").className="ontab";b=document.getElementById("Projects");if(b){b.className="ontab";}}}}}if(a=="Home"){document.getElementById("EA").className="ontab";var b=document.getElementById("Projects");if(b){b.className="ontab";}}else{if(a=="EA"){document.getElementById("EA").className="ontabactive";b=document.getElementById("Projects");if(b){b.className="ontab";}}else{if(a=="KB"){document.getElementById("EA").className="ontab";b=document.getElementById("Projects");if(b){b.className="ontab";}}else{if(a=="Projects"){document.getElementById("Projects").className="ontabactive";document.getElementById("EA").className="ontab";}}}}}function selectSearchType(a){if(a=="selExperts"){document.getElementById("currentOptionContainer").innerHTML='Search Experts <span class="arrow"></span>';document.getElementById("selExperts").className="searchOption selected";document.getElementById("selProjects").className="searchOption ";document.getElementById("selKnowledge").className="searchOption ";document.getElementById("searchtype").value="experts";}else{if(a=="selProjects"){document.getElementById("currentOptionContainer").innerHTML='Search Projects <span class="arrow"></span>';document.getElementById("selExperts").className="searchOption ";document.getElementById("selProjects").className="searchOption selected";document.getElementById("selKnowledge").className="searchOption ";document.getElementById("searchtype").value="projects";}else{if(a=="selKnowledge"){document.getElementById("currentOptionContainer").innerHTML='Search Knowledge <span class="arrow"></span>';document.getElementById("selExperts").className="searchOption ";document.getElementById("selProjects").className="searchOption ";document.getElementById("selKnowledge").className="searchOption selected";document.getElementById("searchtype").value="knowledge";}else{document.getElementById("currentOptionContainer").innerHTML='Search Experts <span class="arrow"></span>';document.getElementById("selExperts").className="searchOption selected";document.getElementById("selProjects").className="searchOption ";document.getElementById("selKnowledge").className="searchOption ";document.getElementById("searchtype").value="experts";}}}document.getElementById("optionListContainer").style.display="none";document.getElementById("currentOptionContainer").className="currentOptionContainer";}function onEnterKey(c){var d=c.keyCode?c.keyCode:c.which?c.which:c.charCode;if(d==13){var b=document.getElementById("search").value;var a=document.getElementById("searchtype").value;if(a=="knowledge"){if(login_user==null||login_user==""||!login_user){window.location.href=contextRoot+"/knowledge?search="+b;}else{jsonSearch(contextRoot+"/jsp/KBSearch.do","2","Content",2,"middle_div",b,"","","ezdianw","header");}}else{if(a=="experts"){if(login_user==null||login_user==""||!login_user){window.location.href=contextRoot+"/experts?search="+b;}else{jsonSearch(contextRoot+"/jsp/EzdiaSearch.do","2","Expert",0,"middle_div",b);}}else{if(a=="projects"){if(login_user==null||login_user==""||!login_user){window.location.href=contextRoot+"/projects?search="+b;}else{showProjectResult(contextRoot+"/jsp/RequirementsSearch.do?sortBy=posteddate&asExpertOrExplorer=null&uid="+login_user+"&category=&pagetype=index&projectInfoType=findProject&pageNo=0&search="+b,"middle_div");}}else{if(login_user==null||login_user==""||!login_user){window.location.href=contextRoot+"/experts?search="+b;}else{jsonSearch(contextRoot+"/jsp/EzdiaSearch.do","2","Expert",0,"middle_div",b);}}}}}return false;}function showProjectResult(b,a){if(document.getElementById("search")==null){document.getElementById("search").value="Search by name";}isKBActive="ontab";isEAActive="ontab";isProjActive="ontabactive";type="Project";showResultWithQueryStr(b,a,callbackcommon,null,false);return true;}function showEasyResult(b,a){showResultWithQueryStr(b,a,easyCallBack,null,true);return true;}function easyCallBack(a,b){document.getElementById(b).style.display="";document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;}function jsonSearchExpertAdvice(h,g,d,c,j,f){if(f!=null){search=f;}document.getElementById("SearchSelection").value="Expert";isKBActive="ontab";isEAActive="ontabactive";isProjActive="ontab";if(f=="<username>"){document.getElementById("search").value="Search by name";}pid=j;var a="search=&searchtype=expertadvice&searchfrom1=expertsearch";var b=h;token="";tabindexer=c;searchFilters.searchType=d;searchFilters.url=h;searchFilters.mainurl=h;searchFilters.mainSearchPattern=a;searchFilters.domain=g;searchFilters.setSearchSubType(a);showResultWithQueryStr(b,j,callbackcommonsearch,a,false,c,null);addTrackEvent("search","expertadvice",f);}function jsonSearch(k,c,j,d,h,b,l,g,f){if(b==""){document.getElementById("search").value="Search by name";}isKBActive="ontabactive";isEAActive="ontab";isProjActive="ontab";if(j=="Expert"){isKBActive="ontab";isEAActive="ontabactive";isProjActive="ontab";}else{if(j=="Content"){isKBActive="ontabactive";isEAActive="ontab";isProjActive="ontab";}}pid=h;if(!f){f="ezdianw";}if(l=="fromContentPopUp"){javascript:ModalPopup.Close("ConnectionPopUp",1);jsonSearch("KBSearch.do","2","Content",0,"middle_div",escape(b),"","","ezdianw");return false;}if(j=="Content"&&c=="2"){if(document.getElementById("Content")){document.getElementById("Content").innerHTML="";}if(document.getElementById("MyNetwork")){document.getElementById("MyNetwork").innerHTML="";}if(document.getElementById("MyOwn")){document.getElementById("MyOwn").innerHTML="";}}if(b!=null){var m=b;if(g==undefined){g="search";}if(c=="1"){m=checkForSplChars(m);querystr=g+"="+encodeURIComponent(m)+"&searchtype=index&searchfrom="+f;}else{if(b==login_user){querystr="search=&searchtype=myown&searchfrom="+f;}else{if(g=="content_id"){querystr="content_id="+encodeURIComponent(m)+"&searchtype=ezdianetwork&searchfrom="+f;}else{querystr="search="+encodeURIComponent(m)+"&searchtype=ezdianetwork&searchfrom="+f;}}}}else{if(document.getElementById("search")){m=document.getElementById("search").value;m=checkForSplChars(m);}if(m.indexOf("Search by name")==-1){if(c==1){querystr="search="+encodeURIComponent(m)+"&searchtype=index&searchfrom="+f;}else{querystr="search="+encodeURIComponent(m)+"&searchtype=index&searchfrom="+f;}}else{querystr="search=&searchtype=index&searchfrom="+f;m="";}}var a=k;token=m;tabindexer=d;searchFilters.searchType=j;searchFilters.url=k;searchFilters.mainurl=k;searchFilters.mainSearchPattern=querystr;searchFilters.domain=c;searchFilters.setSearchSubType(querystr);showResultWithQueryStr(a,h,callbackcommonsearch,querystr,false,d,null);addTrackEvent("search",j,m);}function jsonSearchNext(g,f,c,b,h,d){var a=d;if(f==2){a=d;}if(f==1){a="search="+escape(search)+"&searchtype=index&pagetype=next&searchfrom=ezdianw";}tabindexer=b;searchFilters.searchType=c;searchFilters.url=g;searchFilters.mainSearchPattern=a;searchFilters.domain=f;searchFilters.setSearchSubType(a);if(c=="Content"){showResultWithQueryStr(g,h,callbackRefineJSONSearchResult,a,false,b,null);}else{if(c=="Expert"){showResultWithQueryStr(g,h,callbackRefineJSONSearchResult,a,false,b,null);}}}function assocaitedContent(h,g,f,d,j,b){var a;if(f=="Content"&&g=="2"){if(f=="Content"&&g=="2"){if(document.getElementById("Content")){document.getElementById("Content").innerHTML="";}if(document.getElementById("MyNetwork")){document.getElementById("MyNetwork").innerHTML="";}if(document.getElementById("MyOwn")){document.getElementById("MyOwn").innerHTML="";}}}token=unescape(b);if(b!=null&&b==myuserid){search=b;if(d==0){a="search=&searchtype=ezdianetwork&tab=no&searchfrom=ezdianw";}else{a="search="+escape(search)+"&searchtype=myown&tab=no&searchfrom=ezdianw";}}else{if(document.getElementById("search")){search=document.getElementById("search").value;if(d==0){if(search.indexOf("Search by name")==-1){a="search="+escape(search)+"&searchtype=ezdianetwork&tab=no&searchfrom=ezdianw";}else{a="search=&searchtype=ezdianetwork&tab=no&searchfrom=ezdianw";search="";}}else{if(search.indexOf("Search by name")==-1){a="search="+escape(search)+"&searchtype=myown&tab=no&searchfrom=ezdianw";}else{a="search=&searchtype=myown&tab=no&searchfrom=ezdianw";search="";}}}}var c=h+"?"+a;tabindexer=d;searchFilters.url=h;searchFilters.mainurl=h;searchFilters.searchType=f;searchFilters.domain=g;searchFilters.mainSearchPattern=a;searchFilters.setSearchSubType(a);showResultWithQueryStr(c,j,callbackcommonsearch,null,false,d,null);}function MyContent(h,g,f,d,j,b){var a;if(f=="Content"&&g=="2"){if(f=="Content"&&g=="2"){if(document.getElementById("Content")){document.getElementById("Content").innerHTML="";}if(document.getElementById("MyNetwork")){document.getElementById("MyNetwork").innerHTML="";}if(document.getElementById("MyOwn")){document.getElementById("MyOwn").innerHTML="";}}}if(b==login_user){token="your profile";a="search="+escape(b)+"&searchtype=myown&tab=no&searchfrom=myown&profileKB=true";}else{token="his profile";a="search="+escape(b)+"&tab=no&searchfrom=networkkb&profileKB=true";}var c=h+"?"+a;if(d==0){c+="&clickFrom=notFromHeader";}if(d==2){c+="&searchtype=myown";}tabindexer=d;searchFilters.url=h;searchFilters.mainurl=h;searchFilters.searchType=f;searchFilters.domain=g;searchFilters.mainSearchPattern=a;searchFilters.setSearchSubType(a);showResultWithQueryStr(c,j,callbackcommonsearch,null,false,d,null);}var search1="";function networkKB(h,g,f,d,j,b){pid=j;token=unescape(b);search=unescape(b);if(f=="Content"&&g=="2"){if(f=="Content"&&g=="2"){if(document.getElementById("Content")){document.getElementById("Content").innerHTML="";}if(document.getElementById("MyNetwork")){document.getElementById("MyNetwork").innerHTML="";}if(document.getElementById("MyOwn")){document.getElementById("MyOwn").innerHTML="";}}}var a;if(search!=myuserid){a="search="+escape(search)+"&searchtype=connection&tab=no&searchfrom=networkkb";}else{a="search=&searchtype=connection&tab=no&searchfrom=networkkb";}var c=h+"?"+a;tabindexer=d;searchFilters.searchType=f;searchFilters.url=h;searchFilters.mainurl=h;searchFilters.mainSearchPattern=a;searchFilters.searchType=f;searchFilters.domain=g;searchFilters.setSearchSubType(a);showResultWithQueryStr(c,j,callbackcommonsearch,null,false,d,null,false,d,null);}var contentName=new Array();var token;function getExpertsById(g,b,d,f){var a="search="+escape(b.replace(","," ","g"));if(searchFilters.domain==1){a=a+"&searchtype=index";}divid="getAssociatedUsers"+f;document.getElementById("getAssociatedUsers"+f).style.display="";if(d=="Experts"){document.getElementById("viewMoreExpert"+f).style.display="";}else{document.getElementById("viewMoreExplorer"+f).style.display="";}var c=g+"?"+a+"&contentSelected="+f;showResultWithQueryStr(c,divid,callbackExpertsExplorers,null);}function hideExpertsExplorers(a){document.getElementById("getAssociatedUsers"+a).style.display="none";document.getElementById("viewMoreExpert"+a).style.display="none";document.getElementById("viewMoreExplorer"+a).style.display="none";}function getAllExpertsById(f,b,d,g){var a="search="+escape(b.replace(","," ","g"))+"&type="+d;if(searchFilters.domain==1){a=a+"&searchtype=index";}var c=f+"?"+a;if(login_user==null||login_user==""||!login_user){ModalPopup("NewLoginpopupdiv","");}showResultWithQueryStr(c,g,callbackExpertsExplorers,null);}function clearSearch(a){var b=document.getElementById(a).value;if(b=="Search by name"){document.getElementById(a).value="";}else{if(b==""){document.getElementById(a).value="Search by name";}else{document.getElementById(a).value=b;}}}function clearRequirementSearch(a){var b=document.getElementById(a).value;if(b=="Search for Projects by Id or Name"){document.getElementById(a).value="";}else{if(b==""){document.getElementById(a).value="Search for Projects by Id or Name";}else{document.getElementById(a).value=b;}}}function getMargin(){document.getElementById("getMargin").style.marginTop="-120px";}function filterByRating(a){searchFilters.rating=a;performSearch();}function filterByRPM(a){searchFilters.feePerMin=a;performSearch();}function performSearch(b){if(document.getElementById("pagination_div")){document.getElementById("pagination_div").style.display="none";}var a=b;var d;if(a==1){d="narrowed_result_center@1";}else{d="narrowed_result_center";}var c=searchFilters.mainurl+"?"+searchFilters.getSearchString()+"&pagetype=next&searchfrom1=browsecat&searchfrom=expertsearch&searchtype=myown";showResultWithQueryStr(c,d,callbackRefineJSONSearchResult,null);}function performSearchNext(c,b){var d="";if(b=="ContentRefined"){d="hidiv";}else{if(b=="ExpertRefined"){d="hidiv";}}var a=searchFilters.mainurl+"?"+searchFilters.getSearchString()+"&mypage="+c+"&pagetype=next";showResultWithQueryStr(a,d,callbackRefineJSONSearchResultNext,null);}function callbackRefineJSONSearchResult(d,f){var c="";var a=d;var b;myresult=new Array();if(f=="narrowed_result_center@1"){f="narrowed_result_center";b=1;}if(a.indexOf("No Result Found")!=-1){c+="No Result for your search";}else{document.getElementById("selectedCritera").style.display="";document.getElementById("search_result_header").innerHTML=searchFilters.formatSearchString();document.getElementById(f).innerHTML=a;if(b!=1){if(document.getElementById("google")){document.getElementById("google").style.display="none";}}else{if(b==1){if(document.getElementById("selectedCritera")){document.getElementById("selectedCritera").style.display="none";}}}}}function callbackRefineJSONSearchResultNext(c,d){var b="";var a=c;myresult=new Array();myresult=a.split("##");a=myresult[0];totalpages=myresult[1];if(a.indexOf("No Result Found")!=-1){b+="No Result for your search";}else{document.getElementById("search_result_header").innerHTML=searchFilters.formatSearchString();document.getElementById(d).innerHTML=a;}}function onenterRequirementSearch(a,c){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(b==13){jsonRequirementSearch(c,"Requirement",1);}return false;}function getCount(c){var b=0;if(c.constructor==Number){return c;}for(var a in c){if(!c.hasOwnProperty(a)){continue;}b+=getCount(c[a]);}return b;}function getAreaExpertCount(b){var a=b;searchFilters.url="/EzdiaLive/jsp/EzdiaSearch.do";searchFilters.mainSearchPattern="search=";showResultWithQueryStr(a,null,callbackAreaExpertCount,null);}function callbackAreaExpertCount(response){var output="";var result=response;if(result.indexOf("No Result Found")!=-1){output+="No Result for your search";}else{var expertCountByArea=eval("("+result+")");var nCount=1;viewNewAreacount=expertCountByArea;for(var w1 in expertCountByArea){if(!expertCountByArea.hasOwnProperty(w1)){continue;}output+='<div id="area_'+nCount+'" class="drag_cmn" onclick=narrowExpertSearchByCategory("'+escape(w1)+'","'+escape(expertCountByArea)+'",1)><a href="javascript:void(0)" style="color:#000;">'+w1+"("+getCount(expertCountByArea[w1])+")</a></div>";output+='<div id="'+escape(w1)+'"></div>';nCount++;}document.getElementById("Drag_layer").innerHTML="";document.getElementById("Drag_layer").innerHTML=output;for(var w2 in expertCountByArea){if(!expertCountByArea.hasOwnProperty(w2)){continue;}narrowExpertSearchByCategory(escape(w2),escape(expertCountByArea),1);break;}}}function showContentInPopUp(c,k,o,s,p,j,v,g,f,m,a,w,q,b,h,x){k=unescape(k);o=unescape(o);s=unescape(s);var l="";l+='<div id="ContentFrame" style="background:white; position:relative; margin:auto; margin-top:0; left:0; top:0; width:100%; height:100%;">';l+='<table class="contentBar"><tr>';l+='<td class="midContentBar">';if(s=="Video"||s=="Slide Show"){l+='<div style="position: absolute; top:0px; left:2%; z-index: 100; height:43px;"><img height="51" src="../static/images/eZdiaNewLogo.png"></div>';}else{l+='<div style="position: absolute; top:0px; left:2%; z-index: 100; height:60px; width:40px;"><img height="60" width="40" src="../static/images/eZdiaNewLogo.png"></div>';}l+='<div id="btn_div" style="position: absolute; height: auto; width: auto; z-index: 100; left: 8%; top: 3px;">';l+='<div class="row" style="width:230px;">';if(b=="google"){l+='<div class="cell-search-btn4" id="i_know_it" onclick=javascript:ModalPopup.Close("ConnectionPopUp",1);showBodyHeight();showcommondiv("PostALink.jsp?url='+escape(o)+"&title="+escape(j)+"&desc="+escape(stripHTML(q))+'","PostLinkPopUp","PostLinkPopUp");validateURLBox();>';}else{l+='<div class="cell-search-btn4" id="i_know_it" onclick=showKnowItInPopUp('+p+',"'+j+'","'+v+'","KBContent");showBodyHeight();>';}l+='<span class="action" style="color: #4070A0;">I know It <span style="font-size:8px;">('+g+")</span></span>";l+="</div>";if(b=="google"){l+='<div class="cell-search-btn4" onclick=javascript:ModalPopup.Close("ConnectionPopUp",1);showBodyHeight();showcommondiv("PostALink.jsp?url='+escape(o)+"&title="+escape(j)+"&desc="+escape(stripHTML(q))+'","PostLinkPopUp","PostLinkPopUp");validateURLBox();>';}else{l+='<div class="cell-search-btn4" onclick=showLearnItInPopUp('+p+',"'+j+'","'+v+'","KBContent");showBodyHeight();>';}l+='<span class="action" style="color: #4070A0;">I Need Help <span style="font-size:8px;">('+f+")</span></span>";l+="</div>";l+="</div>";l+="</div>";if(myuserid!=undefined){l+='<div id="closeimg" onclick=javascript:ModalPopup.Close("'+c+'",1);showBodyHeight(); style="cursor: pointer; position: absolute; width: 50px; z-index: 100; color: white; right: 1%; font-weight: bold; top: 1%; font-size: 12px;">Close X</div>';}else{l+='<div id="closeimg" onclick=javascript:ModalPopup.Close("'+c+'",1);showBodyHeight();closeContentPopup("'+escape(k)+'"); style="cursor: pointer; position: absolute; width: 50px; z-index: 100; color: white; right: 1%; font-weight: bold; top: 1%; font-size: 12px;">Close X</div>';}l+="</div>";if(b=="google"){l+='<div style="position: absolute; top: 11px; left: 35%;"><span class="action" style="color:#FFF; float: left; padding-right: 4px; padding-top: 4px;" onclick=javascript:ModalPopup.Close("ConnectionPopUp",1);showBodyHeight();showcommondiv("PostALink.jsp?url='+escape(o)+"&title="+escape(j)+"&desc="+escape(stripHTML(q))+'","PostLinkPopUp","PostLinkPopUp");validateURLBox();><b>Add this content to my </b></span><img height="20" width="20" src="../static/images/smallBucket.png" alt=""/></div>';}else{l+='<div style="position: absolute; left: 69%; top: 10px;" id="NoOfExpertIcon">';var r="";if(g>0){r='onclick=javascript:ModalPopup.Close("'+c+'",1);showBodyHeight();getExpertsById("GetExpertsExplorers.do","'+m+'","Expert","'+x+'");';}l+='<img height="25" src="../static/images/userimg2.png" alt="Get experts" '+r+"/> </div>";l+='<div style="position: absolute; top: 15px; left: 72%; width: 85px;" id="NoOfExpertIcon">';l+='<span class="action" '+r+' style="color: white;">Get Experts ('+g+")</span></div>";l+='<div style="position: absolute; left: 81%; top: 10px;" id="NoOfExpertIcon">';r="";if(f>0){r='onclick=javascript:ModalPopup.Close("'+c+'",1);showBodyHeight();getExpertsById("GetExpertsExplorers.do","'+a+'","Expert","'+x+'");';}l+='<img src="../static/images/Explorer.png" alt="Get explorers" '+r+"/> </div>";l+='<div style="position: absolute; top: 15px; left: 83%;" id="NoOfExplorersIcon">';l+='<span class="action" '+r+' style="color: white;">Get Explorers ('+f+")</span></div>";l+='<div id="TinyIcon" style="position: absolute; width: 17px; height: 25px; left: 41%; top: 4px;">';l+='<img alt="" src="../static/images/tinylogo.png" /></div>';l+='<div id="catslists" style="overflow: hidden; position: absolute; height: 16px; width: 26%; top: 11px; left: 42.5%;">';if(w!=null){if(login_user==null||login_user==""||!login_user){l+='<a style="color: #FFF" href='+contextRoot+"/jsp/IndexSearch.do?search="+escape(w)+"&searchtype=index&selected_ezdia_domain=2>"+unescape(w).substring(0,37)+"</a>";}else{w=w.split(",");for(i=0;i<w.length;i++){l+='<span class="action" style="color:#FFF;" onclick=jsonSearch("ContentSearch.do","2","Content",0,"middle_div","'+escape(w[i])+'","fromContentPopUp");showBodyHeight();>'+unescape(w[i])+"</span>";l+=",";}}}l+='<span class="action" style="margin-left:10px; color:#FFF;" onclick=showcommondiv("ContentDetails.jsp?url='+escape(o)+"&title="+escape(j)+"&desc="+escape(q)+'","ConnectionPopUp","ConnectionPopUp");showBodyHeight();>View All</span>';l+="</div>";l+='<div id="forwardDiv" style="position: absolute; height: 15px; cursor: pointer; width: 65px; top: 10px; left: 32%;" onclick=showcommondiv("../jsp/ForwardContent.jsp?&isForward=true&flag=content&content_name='+escape(j)+"&content_url="+host+contextRoot+"/jsp/Content.do?id="+p+"&content_type="+escape(s)+"&id="+escape(p)+"&category_name="+escape(v)+"&expert_users="+escape(m?m.length:0)+"&explorer_users="+escape(a?a.length:0)+"&expert_users_id="+escape(m)+"&actual_url="+escape(o)+'","ConnectionPopUp","ConnectionPopUp");showBodyHeight();><img alt="Forward" src="../static/images/forwardIconWhite.png" title="Forward" /><span class="action" style="color:#FFF;"> Forward</span> </div>';l+='<div id="ContentURLDiv" style="position: absolute; height: 15px; cursor: pointer; width: 36%; top: 33px; left: 32%; overflow:hidden; color:white;"><b>Source : </b> <a href="'+o+'" target="_blank" style="color:white;">'+o+"</a></div>";if(h){l+='<div style="position: absolute; width: 36%; top: 33px; left: 58%;">';l+='<a class="a2a_dd" target="_blank" href="http://www.addtoany.com/share_save"><img src="http://static.addtoany.com/buttons/share_save_120_16.gif" width="120" height="16" border="0" alt="Share/Save/Bookmark"/></a><script type="text/javascript">a2a_linkname=document.title;a2a_linkurl=location.href;<\/script><script type="text/javascript" src="http://static.addtoany.com/menu/page.js"><\/script>';l+="</div>";}}l+="</td>";l+="</tr></table>";l+='<div style="width: 100%; height: 100%; position: relative;" align="center">';l+='<iframe id="content_display_iframe" src="'+o+'" onload="checkFrameHeight();" onresize="checkFrameHeight();" scrolling="yes" style="height:500px; width:100%;" frameborder="0" noresize="resize"></iframe>';l+="</div>";l+="</div>";document.getElementById(c).innerHTML="";document.getElementById(c).innerHTML=l;document.getElementById(c).style.display="";var u=document.getElementById("bottomBarMain");if(u){u.style.display="none";}document.getElementById(c).style.top="0px";document.getElementById(c).style.left="0px";document.getElementById(c).style.right="0px";document.getElementById(c).style.margin="auto";if(browser=="Explorer"){if(login_user==null||login_user==""||!login_user){document.getElementById(c).style.position="absolute";}else{document.getElementById(c).style.position="fixed";}}else{document.getElementById(c).style.position="fixed";}document.body.style.overflow="hidden";addTrackEvent("content",s,p);}function checkFrameHeight(){var a=document.getElementById("content_display_iframe");var b=500;document.body.style.overflow="hidden";if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){b=window.innerHeight;}if(navigator.appName.indexOf("Microsoft")!=-1){b=document.documentElement.clientHeight;if(b==0){b=document.body.clientHeight;}}}if(login_user==null||login_user==""||!login_user){a.style.height=(b-65)+"px";}else{a.style.height=(b-33)+"px";}}function showBodyHeight(){document.body.style.overflow="visible";}function showCommentPanel(){CommentBox=document.getElementById("CommentBox").style.display;if(CommentBox==""){document.getElementById("VisibleContentFrame").style.width="100%";document.getElementById("CommentBox").style.width="0%";document.getElementById("CommentBox").style.display="none";document.getElementById("sideArrowImg").src=contextRoot+"/static/images/chatBillingSideArrowImgLeft.png";}else{if(CommentBox=="none"){document.getElementById("VisibleContentFrame").style.width="79%";document.getElementById("CommentBox").style.width="21%";document.getElementById("CommentBox").style.display="";document.getElementById("sideArrowImg").src=contextRoot+"/static/images/chatBillingSideArrowImg.png";}}}function showHideTxtsIKnowIt(b){var a=document.getElementById(b).value;if(a=="Hint Message: * I have developed similar solutions for another client OR * I have provided detailed market research & competitive summary on this topic."){document.getElementById(b).value="";document.getElementById(b).style.color="#000";}else{if(a==""){document.getElementById(b).value="Hint Message: * I have developed similar solutions for another client OR * I have provided detailed market research & competitive summary on this topic.";document.getElementById(b).style.color="#999";}else{document.getElementById(b).value=a;}}}function showKnowItInPopUp(o,j,g,f){var m=escape(j);var k=m.replace("+","&nbsp;","g");if(login_user==null||login_user==""||!login_user){if(document.getElementById(f)){ModalPopup.Close(f,"1");}ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="iknowit:"+o+":"+m+":"+g;document.getElementById("regRedirect").value="iknowit:"+o+":"+m+":"+g;}else{var d="CL1";var b="CL2";var p="CL3";var a=unescape(g);var c=a.replace("#","&nbsp;>&nbsp;","g");c=c.replace('["',"");c=c.replace('"]',"");c=c.replace("+","&nbsp;","g");var l="ConnectionPopUp";var h="";h+='<table id="corner_dialog_table" align="center" class="corner_dialog_table" style="width: 780px; z-index: 10; height: auto;">';h+="<tr>";h+='<td class="corner_topleft_green"></td>';h+='<td class="corner_topborder_green"></td>';h+='<td class="corner_topright_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_borderleft_green"></td>';h+='<td id="corner_content_grn" class="corner_content_grn">';h+='<div style="width: 100%; height: auto;">';h+='<div id="closeimg" onclick=javascript:ModalPopup.Close("'+l+'","1") style="cursor: pointer; position: absolute; width: 50px; margin-left:695px; margin-top:3px; font-size:12px; z-index:100"><b>Close X</b></div>';h+='<div style="text-align: center; font-size: 20px; color: teal;">I Know It !!!</div>';h+='<div style="padding: 0px; position: relative; width: 750px; height: auto; left: 0%; margin-top: 0px; z-index: 10; top: 0px;">';h+='<table id="corner_dialog_table0" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10; height: auto;">';h+="<tr>";h+='<td class="corner_topleft_green"></td>';h+='<td class="corner_topborder_green"></td>';h+='<td class="corner_topright_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_borderleft_green"></td>';h+='<td id="corner_content_grn0" class="corner_content_grn">';h+='<div id="errorKnowIt" class="error" style="display:none;"></div>';h+='<div id="maindiv" style="width: 720px; height: auto; line-height:30px;">';h+='<table width="500">';h+="<tr>";h+='<td class="kbtxt">Title :</td>&nbsp;';h+="<td>";h+='<input class="tdinput_I" name="i_know_it_title" id="i_know_it_title" type="text" value="'+unescape(k)+'" /></td>';h+="</tr>";h+="<tr>";h+='<td class="kbtxt" valign="top">Highlight your experience on this topic/area :</td>&nbsp;';h+='<td><textarea onfocus=showHideTxtsIKnowIt("i_know_it_description") onblur=showHideTxtsIKnowIt("i_know_it_description") style="font-size:12px; color:#999; width: 309px; height: 50px;" id="i_know_it_description" name="i_know_it_description">Hint Message: * I have developed similar solutions for another client OR * I have provided detailed market research & competitive summary on this topic.</textarea></td>';h+="</tr>";h+="<tr>";h+='<td class="kbtxt">Tags :</td>&nbsp;';h+='<td><input class=" tdinput_I" name="i_know_it_tags" id="i_know_it_tags" type="text" value="" /></td>';h+="</tr>";h+="</table>";h+='<div style="font-size: 10px; color:#666; position: absolute; width: 200px; left: 515px; line-height: 12px; top: 111px;">(Provide keywords for easy searching) Comma Separated</div>';h+='<div style="font-size: 12px; font-weight: bold; position: absolute; margin-left: 52px;">Associated Category :</div>';h+='<table id="onCheckFillDetails0" width="540" style="line-height:20px; margin-left:183px; margin-top:2px;">';h+="<tr>";h+='<td style="color:#666; padding-top:2px; font-weight:bold; font-size:12px;">'+c+'</td></tr><tr><td style="color:#004080; font-size:12px;"><input type="radio" id="expert_categories" name="content_expert" value="'+c+'" onchange=checkBG_showlayertome("onCheckFillDetails0","onCheckFillDetails")> Make me expert for this category</td>';h+="</tr>";h+='<tr id="onCheckFillDetails" style="display:none; text-align:right;"><td><span class="action" onclick=showcommondiv("profile/UpdateExpertiseAgain.jsp?title='+escape(m)+"&category="+escape(c)+"&contentID="+o+'","mynewpopup","mynewpopup");ModalPopup.Close("ConnectionPopUp","1")>Fill in detail</span></td></tr>';h+="</table>";if(!isAlphaRelease){h+='<table id="makmeexpert" width="555" style="padding: 0px 10px; margin-left: 162px; background-color: rgb(255, 255, 255);"><tr><td style="width:646px; color:#004080;"><input class="style_div" type="radio" name="content_expert" onchange=checkBG_showlayer("onCheckFillDetails0","onCheckFillDetails","makmeexpert","onLastCheck")> Make me the Expert of another category related to this article</td></tr>';h+='<tr id="onLastCheck" style="display:none;"><td>';h+="<table>";h+="<tr>";h+="<td>";h+='<select name="category" id="categoryadd" onChange=getCategoryAndFill(this,"subcategoryadd1"); style="width: 155px" tabindex="21">';h+='<option value="-1">-- Select One --</option>';h+='<option value="Education">Education</option>';h+='<option value="Healthcare and Medicine">Healthcare and Medicine</option>';h+='<option value="Legal">Legal</option>';h+='<option value="Personal Development">Personal Development</option>';h+='<option value="Business and Finance">Business and Finance</option>';h+='<option value="Technology & Computers">Technology & Computers</option>';h+="</select>";h+="</td>&nbsp;";h+="<td>";h+='<select id="subcategoryadd1" name="subcategory" onChange=getSubCategoryAndFill(this,"sub_subcategoryadd1"); style="width: 155px" tabindex="22">';h+='<option value="-1">-- Select One --</option>';h+="</select>";h+="</td>&nbsp;";h+="<td>";h+='<select id="sub_subcategoryadd1" name="sub_subcategory" style="width: 155px" tabindex="23">';h+='<option value="-1">-- Select One --</option>';h+="</select>";h+="</td>";h+="</tr>";h+='<tr><td><span class="action" onclick=checkBG_showlayerlast("details","submit_btn_tb")>Fill in detail</span></td></tr>';h+="</table>";h+='<table id="details" style="display:none; line-height:22px;">';h+='<tr><td>Experience :</td> <td><select name="Select4" id="eoexnew" style="width: auto">';h+='<option value="1"> Min </option>';h+='<option value="2"> 0 -  3 </option>';h+='<option value="3"> 3 -  6 </option>';h+='<option value="4"> 6 -  10 </option>';h+='<option value="5"> 10 +   </option>';h+="</select> years</td></tr>";h+="<tr><td> Rate/Hour :</td><td> ";h+='<input id="min_ratenew" name="Text2" style="width: 55px;height:12px;" type="text" />&nbsp;in USD</td></tr>';h+="<tr><td>";h+='<table style="line-height:15px; position: relative; left: 220px;">';h+='<tr><td><a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=addANewExpertiesToUser1("addUserAsExpertDetails.do","percentdiv","indicator",0);closecommonconn(); style="color: black;">Submit</a></td></tr></table>';h+="</td></tr>";h+="</table>";h+="</td></tr></table>";}h+='<div style="background-color: #FFF; height: 10px; top: 0px;">';h+="</div>";h+="</div>";h+='<table id="submit_btn_tb" align="center" style="text-align:center;"><tr><td>';h+='<a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=associateExpertToContent('+o+',"'+escape(c)+'",1,"'+l+'","'+m+'")>Submit</a></td>';h+="<td>";h+='<a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=javascript:ModalPopup.Close("'+l+'","1")>Cancel</a>';h+="</td></tr></table>";h+="</td>";h+='<td class="corner_border_right_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_bottomleft_grn"></td>';h+='<td class="corner_border_bottom_grn"></td>';h+='<td class="corner_bottomright_grn"></td>';h+="</tr>";h+="</table>";h+="</div>";h+="</td>";h+='<td class="corner_border_right_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_bottomleft_grn"></td>';h+='<td class="corner_border_bottom_grn"></td>';h+='<td class="corner_bottomright_grn"></td>';h+="</tr>";h+="</table>";document.getElementById(l).innerHTML="";document.getElementById(l).innerHTML=h;ModalPopup(l,"");}}function showHideTxtsILearnIt(b){var a=document.getElementById(b).value;if(a=="Hint Message: * I need someone to train me in hedge funding as described OR * I need a web developer, who can design a website in php using similar styles as shown in this article"){document.getElementById(b).value="";document.getElementById(b).style.color="#000";}else{if(a==""){document.getElementById(b).value="Hint Message: * I need someone to train me in hedge funding as described OR * I need a web developer, who can design a website in php using similar styles as shown in this article";document.getElementById(b).style.color="#999";}else{document.getElementById(b).value=a;}}}function showLearnItInPopUp(m,l,g,f){var j=l.replace("+","&nbsp;","g");if(login_user==null||login_user==""||!login_user){if(document.getElementById(f)){ModalPopup.Close(f,"1");}ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="ilearnit:"+m+":"+j+":"+g;document.getElementById("regRedirect").value="ilearnit:"+m+":"+j+":"+g;}else{var h="";var k="ConnectionPopUp";var d="CL1";var b="CL2";var o="CL3";var a=unescape(g);var c=a.replace("#","&nbsp;>&nbsp;","g");c=c.replace('["',"");c=c.replace('"]',"");c=c.replace("+","&nbsp;","g");h+='<table id="corner_dialog_table" align="center" class="corner_dialog_table" style="width: 780px; z-index: 10; height: auto;">';h+="<tr>";h+='<td class="corner_topleft_green"></td>';h+='<td class="corner_topborder_green"></td>';h+='<td class="corner_topright_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_borderleft_green"></td>';h+='<td id="corner_content_grn" class="corner_content_grn">';h+='<div style="width: 100%; height: auto;">';h+='<div id="closeimg" onclick=javascript:ModalPopup.Close("'+k+'","1") style="cursor: pointer; position: absolute; width: 50px; margin-left:695px; margin-top:3px; font-size:12px; z-index:100"><b>Close X</b></div>';h+='<div style="text-align: center; font-size: 20px; color: teal;">I need help !!!</div>';h+='<div style="padding: 0px; position: relative; width: 750px; height: auto; left: 0%; margin-top: 0px; z-index: 10; top: 0px;">';h+='<table id="corner_dialog_table0" align="left" class="corner_dialog_table" style="width: 100%; z-index: 10; height: auto;">';h+="<tr>";h+='<td class="corner_topleft_green"></td>';h+='<td class="corner_topborder_green"></td>';h+='<td class="corner_topright_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_borderleft_green"></td>';h+='<td id="corner_content_grn0" class="corner_content_grn">';h+='<div style="width: 720px; height: auto">';h+='<div id="errorNeedHelp" class="error" style="display:none;"></div>';h+='<div style="position: relative; width: 717px; height: auto;">';h+='<table width="582">';h+="<tr>";h+='<td class="kbtxt">Title :</td>';h+='<td style="padding-top:5px;">&nbsp;<input id="type_from_user" name="type_from_user" class=" tdinput_I" style="width: 300px; height: 18px;" tabindex="52" type="text" value="'+unescape(j)+'"/></td>';h+="</tr>";h+="<tr>";h+='<td class="kbtxt" valign="top">Describe what you are looking for :</td>';h+='<td style="padding-top:5px;">&nbsp;<textarea onfocus=showHideTxtsILearnIt("review_from_user") onblur=showHideTxtsILearnIt("review_from_user") id="review_from_user" name="review_from_user" style="font-size:12px; color:#999; width: 300px; height: 60px;" tabindex="53" type="text">Hint Message: * I need someone to train me in hedge funding as described OR * I need a web developer, who can design a website in php using similar styles as shown in this article</textarea></td>';h+="</tr>";h+="<tr>";h+='<td class="kbtxt">Tags :</td>';h+='<td style="padding-top:5px;">&nbsp;<input class=" tdinput_I" name="i_know_it_tags" id="i_know_it_tags" type="text" value="" style="width: 300px; height: 18px;"/></td>';h+="</tr>";h+="</table>";h+='<div style="font-size: 10px; color:#666; position: absolute; width: 200px; left: 543px; top: 111px;">(Provide keywords for easy searching) Comma Separated</div>';h+="</div>";h+='<div id="categories" style="padding-top:10px;">';h+="<table><tr>";if(!isAlphaRelease){h+='<td class="kbtxt">Select the category you need help in :</td>';}h+='<td style="color:#004080; font-weight:bold;"><input type="hidden" id="learner_category" name="learner_category" value="'+c+'"><div>&nbsp;'+c+"</div></td>";h+="</tr>";if(!isAlphaRelease){h+='<tr id="lowerrow">';h+='<td></td><td style="color:#004080;"><input type="radio" onchange=showCategoryFill("fillCategory") id="learner_category" name="learner_category" value="">&nbsp;Need help in another category relevant to this article</td>';h+="</tr>";h+="</table>";h+='<table id="fillCategory" style="z-index:20; display:none; line-height: 25px; padding:2px; width:100%;>';h+='<tr id="onradio" style="width: 650px; padding:5px; text-align:left;">';h+="<td>";h+='Category : <select name="category" id="categoryadd123" onChange=getCategoryAndFill(this,"subcategoryadd123"); style="width: 155px">';h+='<option value="-1">-- Select One --</option>';h+='<option value="Education">Education</option>';h+='<option value="Healthcare and Medicine">Healthcare and Medicine</option>';h+='<option value="Legal">Legal</option>';h+='<option value="Personal Development">Personal Development</option>';h+='<option value="Business and Finance">Business and Finance</option>';h+='<option value="Technology & Computers">Technology & Computers</option>';h+="</select>";h+=' Sub-Category : <select id="subcategoryadd123" name="subcategory" onChange=getSubCategoryAndFill(this,"sub_subcategoryadd123"); style="width: 155px">';h+='<option value="-1">-- Select One --</option>';h+="</select>";h+=' Sub Sub-Catgegory : <select id="sub_subcategoryadd123" name="sub_subcategory" style="width: 155px">';h+='<option value="-1">-- Select One --</option>';h+="</select>";h+="</td>";h+="</tr>";h+='<tr><td><span class="action" onclick=checkBG_showlayerlast("detailed_entry","hideBtn")>Fill in detail</span></td></tr>';}h+='<tr id="detailed_entry" style="display:none;"><td>';h+='<table style="line-height: 25px; width: 100%;">';h+='<tr><td><span style="margin-left:3px;">Requirement Type : ';h+='<select name="reqtype" id="reqtype123" style="width: 155px; color:#333333;">';h+='<option value="-1">Select the following</option>';h+='<option value="Expert Help">Expert Help</option>';h+='<option value="Learning">Learning</option>';h+='<option value="Long Term Requriment">Long Term Requriment</option>';h+="</select></span>";h+='<span style="margin-left:5px;">Duration : ';h+='<select name="reqduration" id="reqduration123" style="width: 155px; color:#333333;">';h+='<option value="-1">Select  the following</option>';h+='<option value="1">1 Day</option>';h+='<option value="7">1 Week</option>';h+='<option value="30">1 Month</option>';h+='<option value="365">1 Year</option>';h+="</select></span>";h+="<br>";h+='<div id="reqmsg123" class="error" style="display:none;">';h+="</div>";h+="Request Expires in : ";h+='<select name="reqexpires" id="reqexpires123" style="width: 155px; color:#333333;">';h+='<option value="-1">Select the following</option>';h+='<option value="7">7 Days</option>';h+='<option value="14">14 Days</option>';h+="</select>&nbsp;&nbsp;";h+='<span style="margin-left:5px;">Budget : ';h+='<select name="reqbudget" id="reqbudget123" style="width: 155px; color:#333333;">';h+='<option value="-1" style="color:#999999">Select  the following</option>';h+='<option value="0" style="color:#004080">Free</option>';h+='<option value="10" style="color:#004080">0 - 10 $</option>';h+='<option value="20" style="color:#004080">10 - 20 $</option>';h+='<option value="50" style="color:#004080">20 - 50 $</option>';h+='<option value="100" style="color:#004080">50 - 100 $</option>';h+='<option value="200" style="color:#004080">100 - 200 $</option>';h+='<option value="300" style="color:#004080">More than 200 $</option>';h+='<option value="Leave on Expert" style="color:#004080">Leave on Expert</option>';h+="</select></span>";h+='&nbsp; Skype Id : <input type="text" style="width: 151px;" id="skypeName123" name="skypeName"/>';h+="</td></tr>";h+="</td><td>";h+='<table align="center" style="text-align:center; margin-top:10px; line-height:15px;"><tr><td>';h+='<a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=postRequirementAgain("PostRequirement.do","postRequirement");>Submit</a></td>';h+="</tr>";h+="</td></tr></table>";h+="</td></tr>";h+="</table>";h+="</td></tr>";h+="</table>";h+='<div id="hideBtn">';h+='<table align="center" style="text-align:center; margin-top:10px;"><tr><td>';h+='<a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=associateLearnerToContent('+m+',0,"'+k+'","'+escape(l)+'")>Submit</a></td>';h+="<td>";h+='<a style="width: 60px;" href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=javascript:ModalPopup.Close("'+k+'","1")>Cancel</a>';h+="</td></tr></table>";h+="</div>";h+="</div>";h+="</div>";h+="</td>";h+='<td class="corner_border_right_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_bottomleft_grn"></td>';h+='<td class="corner_border_bottom_grn"></td>';h+='<td class="corner_bottomright_grn"></td>';h+="</tr>";h+="</table>";h+="</div>";h+='<div id="empdiv" style="display:none;"></div>';h+="</div>";h+="</td>";h+='<td class="corner_border_right_grn"></td>';h+="</tr>";h+="<tr>";h+='<td class="corner_bottomleft_grn"></td>';h+='<td class="corner_border_bottom_grn"></td>';h+='<td class="corner_bottomright_grn"></td>';h+="</tr>";h+="</table>";document.getElementById(k).innerHTML="";document.getElementById(k).innerHTML=h;ModalPopup(k,"");}}function attachUserToContent(f,j,h){var a=document.getElementById("type_from_user").value;var d=document.getElementById("review_from_user").value;var c="addExpert.do";var b=userAttached;var g="";g="contentId="+f;g+="&type_from_user="+escape(a);g+="&review_from_user="+escape(d);g+="&user_type="+escape(j);fetchServerResponse(c,g,b,h);}function userAttached(b){if(req.readyState==4||req.readyState=="complete"){if(req.status==200){var a=req.responseText;}else{}}else{}javascript:ModalPopup.Close(b,"1");}function catagoryLevel2Manage(d,c,b){var a=document.getElementById(d);clearItems(new Array(c,b));getCategoryAndFill(a,c);}function categoryLevel3Manage(c,b){var a=document.getElementById(c);getSubCategoryAndFill(a,b);}function checkBG_showlayer(g,d,c,b){var f=document.getElementById(b).style.display;if(f=="none"){document.getElementById(b).style.display="";document.getElementById(g).style.border="none";document.getElementById(c).style.backgroundColor="#EEF6FA";document.getElementById(c).style.border="1px solid #2AD";document.getElementById(b).style.backgroundColor="#EEF6FA";}var a=document.getElementById(d).style.display;if(a!="none"){document.getElementById(g).style.backgroundColor="#FFFFFF";document.getElementById(d).style.display="none";document.getElementById(d).style.backgroundColor="#FFFFFF";}}function checkBG_showlayertome(g,f,d,c){var b=document.getElementById("expert_categories").checked;var a=document.getElementById(f).style.display;if(b){document.getElementById(f).style.display="";document.getElementById(g).style.backgroundColor="#EEF6FA";document.getElementById(g).style.border="1px solid #2AD";document.getElementById(f).style.backgroundColor="#EEF6FA";}else{document.getElementById(f).style.display="none";document.getElementById(g).style.backgroundColor="#FFFFFF";document.getElementById(g).style.border="none";}}function checkBG_showlayerlast(c,b){var a=document.getElementById(c).style.display;if(a=="none"){document.getElementById(c).style.display="";document.getElementById(c).style.backgroundColor="#EEF6FA";document.getElementById(b).style.display="none";}else{document.getElementById(c).style.backgroundColor="#FFFFFF";document.getElementById(c).style.display="none";document.getElementById(b).style.display="";}}function checkBG_showradiolayer(b){var a=document.getElementById(b).style.display;if(a!="none"){document.getElementById(b).style.display="none";}javascript:ModalPopup.Close("ConnectionPopUp","1");showcommondiv("PostRequirement.jsp","postRequirement","postRequirement");}function showCategoryFill(b){var a=document.getElementById(b).style.display;if(a=="none"){document.getElementById(b).style.display="";document.getElementById(b).style.border="1px solid #2AD";document.getElementById(b).style.backgroundColor="#EEF6FA";}}function getCheckedValue(b){if(!b){return"";}var c=b.length;if(c==undefined){if(b.checked){return b.value;}else{return"";}}for(var a=0;a<c;a++){if(b[a].checked){return b[a].value;}}return"";}function associateLearnerToContent(d,j,h,b){if(b!=null){var a="/"+b.replace("%20","_")+"/Content.do?id="+d;}var g=document.getElementById("learner_category").value;var f=document.getElementById("review_from_user").value;var c="";if(g.length==0){if(g.charAt(g.length-1)=="#"){g=g.substr(0,g.length-1);}}else{if(f=="Hint Message: * I need someone to train me in hedge funding as described OR * I need a web developer, who can design a website in php using similar styles as shown in this article"){f="";}}associateUserToContent(d,g,j,title,f,c,h,a);}function associateExpertToContent(j,a,d,c,k){if(k!=null){var b="/"+k.replace("%20","_")+"/Content.do?id="+j;}var g=document.getElementById("i_know_it_title").value;var h=document.getElementById("i_know_it_description").value;var l=document.getElementById("i_know_it_tags").value;var f=document.getElementById("expert_categories");a=getCheckedValue(f);if(h=="Hint Message: * I have developed similar solutions for another client OR * I have provided detailed market research & competitive summary on this topic."){h="";}associateUserToContent(j,a,d,g,h,l,c,b);}function associateUserToContent(m,c,g,k,l,o,f,d){var a="associateUserToContent.do";f="corner_content_grn";var h,j;h=escape(c).replace("%A0","%20","g");j=h.replace("%20%3E%20","%23","g");var b="&description="+escape(l);b+="&tags="+escape(o);b+="&category="+j;b+="&content_id="+escape(m);b+="&user_type="+escape(g);b+="&content_url="+d;showResultWithQueryStr1(a,f,callbackContentAsso,b);return true;}function callbackContentAsso(b){var a=b.split("##");if(document.getElementById("UserComment")!=null){if(a[1]=="Exp"){document.getElementById("UserComment").style.display="none";document.getElementById("commentPostedMsg").innerHTML="Comment Posted as an Expert";document.getElementById("commentPostedMsg").style.display="";}else{if(a[1]=="Explr"){document.getElementById("UserComment").style.display="none";document.getElementById("commentPostedMsgExplr").innerHTML="Comment Posted as an Explorer";document.getElementById("commentPostedMsgExplr").style.display="";}else{if(a[1]=="AlrExp"){document.getElementById("commentPostedMsg").innerHTML="You are already an EXPERT";document.getElementById("commentPostedMsg").style.display="";document.getElementById("getComments").value="Write what help you may able to provide as an expert of this content.";}else{if(a[1]=="AlrExpr"){document.getElementById("commentPostedMsgExplr").innerHTML="You are already an EXPLORER";document.getElementById("commentPostedMsgExplr").style.display="";document.getElementById("getComments").value="Write what help you may be looking about this content.";}else{document.getElementById("UserComment").style.display="none";}}}}window.setTimeout("refreshComments("+a[2]+")",2000);}else{closecommonconn();document.getElementById("globalErrorMessage").style.display="";if(a[1]=="Exp"){setErrorMessage("You are now an EXPERT for this content ..");}else{if(a[1]=="Explr"){setErrorMessage("You are now an EXPLORER for this content ..");}else{if(a[1]=="AlrExp"){setErrorMessage("You are already an EXPLORER for this content ..");}else{if(a[1]=="AlrExpr"){setErrorMessage("You are already an EXPLORER for this content ..");}}}}window.setTimeout("clearDiv('globalErrorMessage')",5000);}}function addUserComment(j){var f;var h=document.getElementById("getComments").value;var d=document.getElementById("readCommentTypeUp").checked;var c=document.getElementById("readCommentTypeDown").checked;var a="associateUserToContent.do";var g=document.getElementById("getComments").value;var k=j;divname="corner_content_grn";if(d){f=0;}else{if(c){f=1;}}if(h=="Write what help you may able to provide as an expert of this content."||h=="Write what help you may be looking about this content."||h==""){return false;}if(login_user==null||login_user==""){closecommonconn();showBodyHeight();ModalPopup("NewLoginpopupdiv","");a=contextRoot+"/jsp/ContentHome.jsp?id="+k+"&searchId=1&source=ezdia";document.getElementById("login_details").value="addcomment:"+a+":"+k+":"+g+":"+f;document.getElementById("regRedirect").value="addcomment:"+a+":"+k+":"+g+":"+f;}else{var b="description="+escape(h);b+="&content_id="+escape(j);b+="&user_type="+escape(f);showResultWithQueryStr1(a,divname,callbackContentAsso,b);}return true;}function reAddUserComment(c,b,f){var a="associateUserToContent.do";divname="corner_content_grn";readdedComment=true;var d="description="+escape(b);d+="&content_id="+escape(c);d+="&user_type="+escape(f);showResultWithQueryStr1(a,divname,callbackContentAsso,d);return true;}function addANewExpertiesToUser(h){var o=document.getElementById("id_type").value;var b=document.getElementById("profileid").value;var j=document.getElementById("expertise_title").value;var k=document.getElementById("expertise_category").value;var l=document.getElementById("detaildesc").value;var m=document.getElementById("enterrate").value;var g=document.getElementById("cert_type").value;var d=document.getElementById("albertpinto");var f=d.options[d.selectedIndex].value;if(j==""||f==""||m==""||l==""||!IsNumeric(m)){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter valid data marked with [ * ]";return false;}else{if(j=="Title or a headline for your expertise"){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Title field is empty";document.getElementById("expertise_title").focus();return false;}else{if(l=="A short description about your experience"){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter description about your expertise";document.getElementById("detaildesc").focus();return false;}else{l.replace(new RegExp("\\n","g"),"<br>");var c="category="+escape(k)+"&"+"certificate="+escape(g)+"&"+"title="+escape(j)+"&"+"desc="+escape(l)+"&"+"rate="+escape(m)+"&"+"exp="+escape(f)+"&"+"id_type="+escape(o)+"&"+"profileid="+escape(b);var a=h+"?"+c;showResultWithQueryStr(a,null,handleGlobalResponse,null);closecommonconn();return true;}}}}function addANewExpertiesToUser1(g){var j=document.getElementById("i_know_it_title").value;var b=document.getElementById("categoryadd").options[document.getElementById("categoryadd").selectedIndex].value;var k=document.getElementById("subcategoryadd1").options[document.getElementById("subcategoryadd1").selectedIndex].value;var h=document.getElementById("sub_subcategoryadd1").options[document.getElementById("sub_subcategoryadd1").selectedIndex].value;var l=document.getElementById("min_ratenew").value;var d=document.getElementById("eoexnew");var f=d.options[d.selectedIndex].value;var c="category="+escape(b)+"&"+"subcategory="+escape(k)+"&"+"sub_subcategory="+escape(h)+"&"+"title="+escape(j)+"&"+"rate="+escape(l)+"&"+"exp="+escape(f);var a=g+"?"+c;req=getXHR();req.open("POST",a,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.onreadystatechange=function(){if(req.readyState==4||req.readyState=="complete"){if(req.status==200){var m=req.responseText;}}else{}};req.send(null);}function changebutton(b,a){document.getElementById(b).style.display="none";document.getElementById(a).style.display="";}var flag=false;function checkuserinlist(a,c){for(var b=0;b<a.length;b++){if(hiddenUserid==a[b]){return true;}}}function contentMsg(a){if(a=="Expert"){clearErrorMessage();setErrorMessage("You are already an expert for this content.");}else{clearErrorMessage();setErrorMessage("You are already a learner for this content.");}}function getDomain(a){return a.match(/:\/\/(.[^\/]+)/)[1];}function closeButtonURLForContent(){var a=document.referrer.indexOf(window.host);if(a==-1||a==0){history.go(-1);}else{document.location.href=contextRoot+"/knowledge";}}function clearList(a){if(!a){return;}while(a.length>0){a.remove(0);}}function addElementToList(f,d,b){var c=document.createElement("option");c.value=d;c.title=b;var a=document.createTextNode(b);c.appendChild(a);f.appendChild(c);}function clearItems(a){for(i=0;i<a.length;i++){var b=document.getElementById(a[i]);if(!b){return;}clearList(b);addElementToList(b,"","-- Select One --");}}function getServerData(c,a,d){var b=c;b=b+"?"+a;showResultWithQueryStr(b,d,showOnStateChange,null);return true;}function getServerData1(b,a,c){requrl=b;requrl=requrl+"?"+a;showResultWithQueryStr(requrl,c,showOnStateChange,null);return true;}function showOnStateChange1(result,divname){jsonString=eval("("+result+")");}function showOnStateChange(result,divname){jsonString=eval("("+result+")");}function getAreaAndFill(a){var b=document.getElementById(a);if(!b){return;}fillCombo(b,jsonString);}function getCategoryAndFill(c,d){var b=c.selectedIndex;var a=c.options[b].value;interest_area=jsonString[a];if(interest_area==null){return;}var f=document.getElementById(d);fillCombo(f,interest_area);}function getSubCategoryAndFill(c,d){var b=c.selectedIndex;var a=c.options[b].value;area_category=interest_area[a];if(area_category==null){return;}var f=document.getElementById(d);fillComboWithUniqueEntries(f,area_category);}function getWorth(c,f,k){var g=document.getElementById(k);var h=c.selectedIndex;var d=c.options[h].value;var a=document.getElementById(f);var l=a.selectedIndex;var j=d;if(l!=-1){var b=a.options[l].value;if(b.length!=0){j=b+"#"+d;}}g.innerHTML="$"+area_category[j]*60+"/Hr";}function IsNumeric(b){var d="0123456789.";var c=true;var a;for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false;}}return c;}Array.prototype.deDupe=function(){var d=this;var a,c;for(var b=0;b<d.length;b++){c=b+1;for(a=c;c<d.length;a++){if(d[b]==d[c]){d.splice(c,1);}else{c++;}}}return d;};function fillComboWithUniqueEntries(c,b){clearList(c);if(b.length>0){addElementToList(c,"","-- Select One --");for(var a=0;a<b.length;a++){addElementToList(c,b[a],b[a]);}}else{addElementToList(c,"","-- NA --");}}function fillCombo(c,b){clearList(c);addElementToList(c,"","-- Select One --");for(var a in b){if(!b.hasOwnProperty(a)){continue;}if(a!=null){addElementToList(c,a,a);}}}function launchCalculator(){getServerData("WorthCalculator.do","","workarea");hideInfo("detailContent");var a=document.getElementById("registration_category_list");a.selectedIndex=0;ModalPopup("calculate","");}function selectsubcategory(){sub_subcategory=document.getElementById("sub_subcategoryadd1");selected_category=document.getElementById("categoryadd1");selected_subcategory=document.getElementById("subcategoryadd1");var b=selected_category.options[selected_category.selectedIndex].value;var d=selected_subcategory.options[selected_subcategory.selectedIndex].value;var c;document.getElementById("skillset").innerHTML="";i=0;for(var a=0;a<sub_subcategory.length;a++){if(sub_subcategory.options[a].selected){c=b+" > "+d+" > "+sub_subcategory.options[a].value+"<br/>";CategorySelection[i]=new MyCategorySelection(c);document.getElementById("skillset").innerHTML+=c;i++;}}}function set(){var a=document.getElementById("fees");if(a.style.display=="none"){a.style.display="";document.getElementById("rate").value="";document.getElementById("min_rate").value="";document.getElementById("error").innerHTML="";}else{a.style.display="none";}}function calculate(){var c=document.getElementById("rate").value;var d="0123456789.";var b=true;var a;document.getElementById("error").innerHTML="";for(i=0;i<c.length&&b==true;i++){a=c.charAt(i);if(d.indexOf(a)==-1){b=false;}}if(b==false){document.getElementById("error").innerHTML="Error: Please enter numeric values only.";document.getElementById("rate").value="";document.getElementById("min_rate").value="";}else{c*=60;c=""+c;document.getElementById("min_rate").value=c.substring(0,5);}}var Spry;if(!Spry){Spry={};}if(!Spry.Widget){Spry.Widget={};}Spry.Widget.TabbedPanels=function(b,a,d){this.tabid=a;this.element=this.getElement(b);this.defaultTab=this.tabid;this.bindings=[];this.tabSelectedClass="TabbedPanelsTabSelected";this.tabHoverClass="TabbedPanelsTabHover";this.tabFocusedClass="TabbedPanelsTabFocused";this.panelVisibleClass="TabbedPanelsContentVisible";this.focusElement=null;this.hasFocus=false;this.currentTabIndex=0;this.enableKeyboardNavigation=true;Spry.Widget.TabbedPanels.setOptions(this,d);if(typeof(this.defaultTab)=="number"){if(this.defaultTab<0){this.defaultTab=0;}else{var c=this.getTabbedPanelCount();if(this.defaultTab>=c){this.defaultTab=(c>1)?(c-1):0;}}this.defaultTab=this.getTabs()[this.defaultTab];}if(this.defaultTab){this.defaultTab=this.getElement(this.defaultTab);}this.attachBehaviors();};Spry.Widget.TabbedPanels.prototype.getElement=function(a){if(a&&typeof a=="string"){return document.getElementById(a);}return a;};Spry.Widget.TabbedPanels.prototype.getElementChildren=function(b){var a=[];var c=b.firstChild;while(c){if(c.nodeType==1){a.push(c);}c=c.nextSibling;}return a;};Spry.Widget.TabbedPanels.prototype.addClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))!=-1)){return;}b.className+=(b.className?" ":"")+a;};Spry.Widget.TabbedPanels.prototype.removeClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))==-1)){return;}b.className=b.className.replace(new RegExp("\\s*\\b"+a+"\\b","g"),"");};Spry.Widget.TabbedPanels.setOptions=function(d,c,a){if(!c){return;}for(var b in c){if(!c.hasOwnProperty(b)){continue;}if(a&&c[b]==undefined){continue;}d[b]=c[b];}};Spry.Widget.TabbedPanels.prototype.getTabGroup=function(){if(this.element){var a=this.getElementChildren(this.element);if(a.length){return a[0];}}return null;};Spry.Widget.TabbedPanels.prototype.getTabs=function(){var a=[];var b=this.getTabGroup();if(b){a=this.getElementChildren(b);}return a;};Spry.Widget.TabbedPanels.prototype.getContentPanelGroup=function(){if(this.element){var a=this.getElementChildren(this.element);if(a.length>1){return a[1];}}return null;};Spry.Widget.TabbedPanels.prototype.getContentPanels=function(){var a=[];var b=this.getContentPanelGroup();if(b){a=this.getElementChildren(b);}return a;};Spry.Widget.TabbedPanels.prototype.getIndex=function(c,a){c=this.getElement(c);if(c&&a&&a.length){for(var b=0;b<a.length;b++){if(c==a[b]){return b;}}}return -1;};Spry.Widget.TabbedPanels.prototype.getTabIndex=function(b){var a=this.getIndex(b,this.getTabs());if(a<0){a=this.getIndex(b,this.getContentPanels());}return a;};Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex=function(){return this.currentTabIndex;};Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount=function(a){return Math.min(this.getTabs().length,this.getContentPanels().length);};Spry.Widget.TabbedPanels.addEventListener=function(c,b,d,a){try{if(c.addEventListener){c.addEventListener(b,d,a);}else{if(c.attachEvent){c.attachEvent("on"+b,d);}}}catch(f){}};Spry.Widget.TabbedPanels.prototype.onTabClick=function(b,a){this.showPanel(a);};Spry.Widget.TabbedPanels.prototype.onTabMouseOver=function(b,a){this.addClassName(a,this.tabHoverClass);};Spry.Widget.TabbedPanels.prototype.onTabMouseOut=function(b,a){this.removeClassName(a,this.tabHoverClass);};Spry.Widget.TabbedPanels.prototype.onTabFocus=function(b,a){this.hasFocus=true;this.addClassName(this.element,this.tabFocusedClass);};Spry.Widget.TabbedPanels.prototype.onTabBlur=function(b,a){this.hasFocus=false;this.removeClassName(this.element,this.tabFocusedClass);};Spry.Widget.TabbedPanels.ENTER_KEY=13;Spry.Widget.TabbedPanels.SPACE_KEY=32;Spry.Widget.TabbedPanels.prototype.onTabKeyDown=function(c,b){var a=c.keyCode;if(!this.hasFocus||(a!=Spry.Widget.TabbedPanels.ENTER_KEY&&a!=Spry.Widget.TabbedPanels.SPACE_KEY)){return true;}this.showPanel(b);if(c.stopPropagation){c.stopPropagation();}if(c.preventDefault){c.preventDefault();}return false;};Spry.Widget.TabbedPanels.prototype.preorderTraversal=function(a,b){var d=false;if(a){d=b(a);if(a.hasChildNodes()){var f=a.firstChild;while(!d&&f){d=this.preorderTraversal(f,b);try{f=f.nextSibling;}catch(c){f=null;}}}}return d;};Spry.Widget.TabbedPanels.prototype.addPanelEventListeners=function(d,b){var c=this;Spry.Widget.TabbedPanels.addEventListener(d,"click",function(g){return c.onTabClick(g,d);},false);Spry.Widget.TabbedPanels.addEventListener(d,"mouseover",function(g){return c.onTabMouseOver(g,d);},false);Spry.Widget.TabbedPanels.addEventListener(d,"mouseout",function(g){return c.onTabMouseOut(g,d);},false);if(this.enableKeyboardNavigation){var f=null;var a=null;this.preorderTraversal(d,function(g){if(g.nodeType==1){var h=d.attributes.getNamedItem("tabindex");if(h){f=g;return true;}if(!a&&g.nodeName.toLowerCase()=="a"){a=g;}}return false;});if(f){this.focusElement=f;}else{if(a){this.focusElement=a;}}if(this.focusElement){Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"focus",function(g){return c.onTabFocus(g,d);},false);Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"blur",function(g){return c.onTabBlur(g,d);},false);Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"keydown",function(g){return c.onTabKeyDown(g,d);},false);}}};Spry.Widget.TabbedPanels.prototype.showPanel=function(b){var g=-1;if(typeof b=="number"){g=b;}else{g=this.getTabIndex(b);}if(!g<0||g>=this.getTabbedPanelCount()){return;}var f=this.getTabs();var c=this.getContentPanels();var a=Math.max(f.length,c.length);for(var d=0;d<a;d++){if(d!=g){if(f[d]){this.removeClassName(f[d],this.tabSelectedClass);}if(c[d]){this.removeClassName(c[d],this.panelVisibleClass);c[d].style.display="none";}}}this.addClassName(f[g],this.tabSelectedClass);this.addClassName(c[g],this.panelVisibleClass);c[g].style.display="";this.currentTabIndex=g;};Spry.Widget.TabbedPanels.prototype.attachBehaviors=function(d){var c=this.getTabs();var a=this.getContentPanels();var f=this.getTabbedPanelCount();for(var b=0;b<f;b++){this.addPanelEventListeners(c[b],a[b]);}this.showPanel(this.defaultTab);};var checkPresence=0;var avtar1="../static/images/newUserImg.png";var ms=0;var state=0;var ssbutton;var transaction_id=0;var ms2=0;var position1;var company1;var skypeid1;var tc;var Expert_Status="";var state1=0;var hire1;var myUserId;var otherUserId;var initialJSJaCMessage;var msgBlinkTimer=null;var lastWindowTitle;var hasWindowFocus=true;var lastMessageSenderName=[[],[]];var arDhtmlWindows=[[],[]];var documentHeight=1;var documentWidth=1;var btnTextColor="#004080";var showWarningMessageForFunds=true;var nextReconnectTimer=null;var retryAttemptCount=0;var nextReconnectMS=3*1000;var backend="binding";var user,password,httpBase,localDomain;var xPackets=[[],[]];var xBillingData=[[],[]];var balCheckTimer=null;function billingData(){var a;var k;var g;var j;var f=0;var b="";var l;var h;var c;var d;}var myBalance=0;var currentWinRemoteUserId;function handleIQ(a){oDbg.log("IQ :"+a.xml().htmlEnc());con.send(a.errorReply(ERR_FEATURE_NOT_IMPLEMENTED));}function handlePresence(a){}function handleError(c){var b="An error occured:<br />"+("Code: "+c.getAttribute("code")+"\nType: "+c.getAttribute("type")+"\nCondition: "+c.firstChild.nodeName).htmlEnc();oDbg.log(b);if(retryAttemptCount<=3&&nextReconnectTimer==null){retryAttemptCount=retryAttemptCount+1;nextReconnectTimer=setTimeout("doReconnect();",nextReconnectMS);nextReconnectMS=nextReconnectMS*10;}else{var d=document.getElementById("login_chat");if(d){d.style.display="";}var a=document.getElementById("logout_chat");if(a){a.style.display="none";}if(con.connected()){con.disconnect();}}}function handleStatusChanged(a){oDbg.log("status changed: "+a);}function handleConnected(){document.getElementById("err").innerHTML="";con.send(new JSJaCPresence());oDbg.log("connected");nextReconnectMS=3*1000;retryAttemptCount=0;if(nextReconnectTimer){clearTimeout(nextReconnectTimer);nextReconnectTimer=null;}}function handleDisconnected(){try{var c=document.getElementById("login_chat");if(c){c.style.display="";}var b=document.getElementById("logout_chat");if(b){b.style.display="none";}}catch(a){}oDbg.log("disconnected");}function handleIqVersion(a){con.send(a.reply([a.buildNode("name","ezdia"),a.buildNode("version",JSJaC.Version),a.buildNode("os",navigator.userAgent)]));return true;}function handleIqTime(b){var a=new Date();con.send(b.reply([b.buildNode("display",a.toLocaleString()),b.buildNode("utc",a.jabberDate()),b.buildNode("tz",a.toLocaleString().substring(a.toLocaleString().lastIndexOf(" ")+1))]));return true;}function handleMessage(l){try{var d="";var b=l.getFromJID();var j=l.getType();var f;if(j=="error"){var k;for(var c=0;c<l.getNode().getElementsByTagName("x").length;c++){if(l.getNode().getElementsByTagName("x").item(c).getAttribute("xmlns")=="ezdia:xmpp:billing"){k=l.getNode().getElementsByTagName("x").item(c);break;}}if(k){processBillingMessageError(b._node,k);}else{addMessageDeliveryFailureMsg(b._node,"Failed to deliver the message, Please try again.");}return;}if(b.toString().indexOf("@")==-1){handleBroadcastMessage(l.getBody());return;}var h=false;if(h){if(l.getFromJID()!=null){var a=b._node+"chatBody";var m=document.getElementById(a);if(!m){getUserData("getUserData.do",b._node,l,1);}processXMPPMessage(chatwith,l);}}else{if(checkInChatGroup(b._node,l)){}else{getUserData("getUserData.do",b._node,l,1);}}}catch(g){}}function setupCon(a){a.registerHandler("message",handleMessage);a.registerHandler("presence",handlePresence);a.registerHandler("iq",handleIQ);a.registerHandler("onconnect",handleConnected);a.registerHandler("onerror",handleError);a.registerHandler("status_changed",handleStatusChanged);a.registerHandler("ondisconnect",handleDisconnected);a.registerIQGet("query",NS_VERSION,handleIqVersion);a.registerIQGet("query",NS_TIME,handleIqTime);}function processBillingMessageError(c,b){if(b.getAttribute("a")=="hire"){addMessageDeliveryFailureMsg(c,"Failed to send hire request, Please try again.");var a=document.getElementById(c+"hireBtn");if(a){a.style.display="";}}else{if(b.getAttribute("a")=="rpause"){addMessageDeliveryFailureMsg(c,"Failed to send Pause request, Please try again.");var a=document.getElementById(c+"hireBtn");if(a){a.style.display="";}}}}function processXMPPMessage(f,h){var a;for(var d=0;d<h.getNode().getElementsByTagName("x").length;d++){if(h.getNode().getElementsByTagName("x").item(d).getAttribute("xmlns")=="ezdia:xmpp:billing"){a=h.getNode().getElementsByTagName("x").item(d);break;}}if(a){otherUserId=h.getFromJID().getNode();if(a.getAttribute("a")!="pong"&&a.getAttribute("a")!="ping"){xPackets[h.getFromJID().getNode()]=a;}if(a.getAttribute("a")=="hire"){handleHireRequest(f,h,a);var c=h.getFromJID().getNode();if(arDhtmlWindows[c]&&arDhtmlWindows[c].style.display=="none"){arDhtmlWindows[c].show(arDhtmlWindows[c]);}}else{if(a.getAttribute("a")=="cancel"){handleCancelRequest(f,h,a);}else{if(a.getAttribute("a")=="busy"){handleBusyResponse(f,h,a);}else{if(a.getAttribute("a")=="rate"){handleRate(f,h,a);}else{if(a.getAttribute("a")=="agree"){handleAgree(f,h,a);}else{if(a.getAttribute("a")=="disagree"){handleDisagree(f,h,a);}else{if(a.getAttribute("a")=="propose"){handlePropose(f,h,a);}else{if(a.getAttribute("a")=="nragree"){handleNewRateAgree(f,h,a);}else{if(a.getAttribute("a")=="nrdisagree"){handleNewRateDisAgree(f,h,a);}else{if(a.getAttribute("a")=="start"){handleStart(f,h,a);}else{if(a.getAttribute("a")=="stop"){handleStop(f,h,a);}else{if(a.getAttribute("a")=="rpause"){handleRequestPause(f,h,a);}else{if(a.getAttribute("a")=="pagree"){handlePauseAgree(f,h,a);}else{if(a.getAttribute("a")=="pdisagree"){handlePauseDisagree(f,h,a);}else{if(a.getAttribute("a")=="resume"){handleResumeService(f,h,a);}else{if(a.getAttribute("a")=="ping"){handlePing(f,h,a);}else{if(a.getAttribute("a")=="pong"){handlePong(f,h,a);}}}}}}}}}}}}}}}}}clearUserBalanceChecker();}else{var b=h.getFromJID();var g=h.getType();addMessageToChatWindow(f,b.getNode(),h.getBody().htmlEnc());}}function handleHireRequest(f,h,g){if(allowMultipleHire()==false){var j=buildJSCACMessage(h.getFromJID().getNode()+"@"+con.domain,"");j=buildEzdiaXmppPacket(j,myUserId,h.getFromJID().getNode(),null,null,null,null,null,"busy");con.send(j);var d="<div class='chatuseragree'>"+getCurrentTime()+"<br>Hire request from "+f+" rejected.</div>";addInfoToChatWindow(h.getFromJID().getNode(),d);return;}xBillingData[h.getFromJID().getNode()]=new billingData();var c="<div class='chatuseragree'>"+getCurrentTime()+"<br>Request from "+f+" to hire you.</div>";addInfoToChatWindow(h.getFromJID().getNode(),c);xBillingData[h.getFromJID().getNode()].billingSubject=h.getBody();var b=f+" wants to hire you<br /><br />If you wants to continue click Agree<br /><br />Subject: "+h.getBody()+"<br /><br />Select the category from next screen according to the subject and send the rate.";xBillingData[h.getFromJID().getNode()].tmpJSJaCPacket=h;var a=h.getFromJID().getNode()+"BillingRoot";var k=document.getElementById(a);k.innerHTML=getIncomingHireRequestUI(h.getFromJID().getNode(),b);k.style.display="";}function agreeForHireRequest(b){xBillingData[b].totalServiceDurationMs=0;ms=0;var a=b+"BillingRoot";var c=document.getElementById(a);c.innerHTML=getBillingRequestUI(b,xBillingData[b].tmpJSJaCPacket.getBody().htmlEnc());c.style.display="";var d=document.getElementById(b+"hireBtn");if(d){d.style.display="none";}getMyExpertise(b+"Category");getUserAccountBalance(null);}function handleBusyResponse(d,f,b){var c="<div class='chatuseragree'>"+d+" is busy.</div>";addInfoToChatWindow(f.getFromJID().getNode(),c);var a=document.getElementById(f.getFromJID().getNode()+"hireBtn");if(a){a.style.display="block";}}function handleCancelRequest(d,f,b){var c="";if(b.getAttribute("e")==myUserId){c="<div class='chatuseragree'>"+getCurrentTime()+"<br>"+d+" Cancelled the request.</div>";}else{c="<div class='chatuseragree'>"+getCurrentTime()+"<br>"+d+" Cancelled the request sent to hire.</div>";}addInfoToChatWindow(f.getFromJID().getNode(),c);var a=document.getElementById(f.getFromJID().getNode()+"hireBtn");if(a){a.style.display="block";}if(document.getElementById(f.getFromJID().getNode()+"BillingRoot")){hideBillingLayer(f.getFromJID().getNode()+"BillingRoot");}}function handleRate(c,f,a){var b=f.getFromJID().getNode()+"BillingRoot";var d=document.getElementById(b);d.innerHTML=getRateUI(f.getFromJID().getNode(),a,null);d.style.display="";}function handleAgree(d,g,a){var c;if(a.getAttribute("t")=="fix"){c="<div class='chatuseragree'>"+d+" agree for your fix rate "+a.getAttribute("fr")+" $</div>";}else{c="<div class='chatuseragree'>"+d+" agree for your rate "+a.getAttribute("vr")+" $ per min</div>";}addInfoToChatWindow(g.getFromJID().getNode(),c);var b=g.getFromJID().getNode()+"BillingRoot";var f=document.getElementById(b);f.innerHTML=getServiceUIForExpert(g.getFromJID().getNode(),xPackets[g.getFromJID().getNode()],false);f.style.display="";}function handleDisagree(c,d,a){var b;if(a.getAttribute("t")=="fix"){b="<div class='chatuseragree'>"+c+" disagree for your fix rate "+a.getAttribute("fr")+" $</div>";}else{b="<div class='chatuseragree'>"+c+" disagree for your rate "+a.getAttribute("vr")+" $ per min</div>";}addInfoToChatWindow(d.getFromJID().getNode(),b);}function handlePropose(d,h,a){var g;var f;var c=h.getFromJID().getNode();xBillingData[c].tmpJSJaCPacket=h;xBillingData[c].tmpxPackets=a;if(a.getAttribute("e")==myUserId){if(a.getAttribute("t")=="fix"){g="<div class='chatuseragree'>"+d+" proposed new rate<br />Explorer Price : "+a.getAttribute("nr")+" $ </div>";f=d+" proposed new rate<br />Explorer Price : "+a.getAttribute("nr")+" $<br /><br />Do you want to continue?";}else{g="<div class='chatuseragree'>"+d+" proposed new rate<br />Explorer Price : "+a.getAttribute("nr")+" $ per min</div>";f=d+" proposed new rate<br />Explorer Price : "+a.getAttribute("nr")+" $ per min<br /><br />Do you want to continue?";}addInfoToChatWindow(c,g);var b='<div style="width: 557px; height: auto;">';b+='<table id="corner_dialog_table0" align="center" class="corner_dialog_table" style="width: 100%; height: auto;">';b+="<tr>";b+='<td class="corner_topleft_green"></td>';b+='<td class="corner_topborder_green"></td>';b+='<td class="corner_topright_grn"></td>';b+="</tr>";b+="<tr>";b+='<td class="corner_borderleft_green"></td>';b+='<td id="corner_content_grn0" class="corner_content_grn">';b+='<div id="checkoutid"style="width: 100%; height: auto;">';b+='<div class="popup-header global-bg-color" style="position:relative; width:539px; margin-left:-10px; margin-top:-10px;">';b+='<div style="font-size:14px;">';b+="Proposed Rate";b+='<div style="cursor: pointer; position: absolute; font-size: 9px; font-weight: bold; right: 10px; width: auto; top: 10px;">';b+="</div>";b+="</div>";b+="</div>";b+='<div id="CashierInnerDiv">';b+='<div class="row" style="padding-top:10px;"><div class="cell nml_bluetxt" style="width:100%;text-align:left;">'+f+"</div></div>";b+='<div class="row" style="padding-top:20px; height:40px;">';b+='<div class="cell" style="width:110px; margin-left: 140px;">';b+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="handlePropose_Agree(\''+c+"','"+d+"')\">";b+="Yes";b+="</a>";b+="</div>";b+='<div class="cell" style="width:110px;">';b+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="handlePropose_Disagree(\''+c+"');\">";b+="No";b+="</a>";b+="</div>";b+="</div>";b+="</div>";b+="</div>";b+="</td>";b+='<td class="corner_border_right_grn"></td>';b+="</tr>";b+="<tr>";b+='<td class="corner_bottomleft_grn"></td>';b+='<td class="corner_border_bottom_grn"></td>';b+='<td class="corner_bottomright_grn"></td>';b+="</tr>";b+="</table>";b+="</div>";lid="ConnectionPopUp";commoncallback(b,"ConnectionPopUp");}else{}}function handlePropose_Agree(f,g){var j=buildJSCACMessage(f+"@"+con.domain,"ezd");var h=xBillingData[f].tmpxPackets;if(h.getAttribute("t")=="fix"){j=buildEzdiaXmppPacket(j,myUserId,f,"fix",xPackets[f].getAttribute("nr"),"","","0","nragree");}else{j=buildEzdiaXmppPacket(j,myUserId,f,"pm","",xPackets[f].getAttribute("nr"),"","0","nragree");}con.send(j);var d="<div class='chatuseragree'>New rate sent to "+g+".</div>";addInfoToChatWindow(f,d);var b;for(var c=0;c<j.getNode().getElementsByTagName("x").length;c++){b=j.getNode().getElementsByTagName("x").item(c);}var a=f+"BillingRoot";var k=document.getElementById(a);k.innerHTML=getRateSentUI(f,xBillingData[f].billingSubject,b);closecommonconn();}function handlePropose_Disagree(c){var a=buildJSCACMessage(c+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,myUserId,c,xPackets[c].getAttribute("t"),xPackets[c].getAttribute("fr"),xPackets[c].getAttribute("vr"),null,0,"nrdisagree");con.send(a);var b="<div class='chatuseragree'>You have disagree for new rate.</div>";addInfoToChatWindow(c,b);closecommonconn();}function handleNewRateAgree(f,h,a){var d=h.getFromJID().getNode();var c="<div class='chatuseragree'>"+f+" agree to your rate.</div>";addInfoToChatWindow(d,c);var b=h.getFromJID().getNode()+"BillingRoot";var g=document.getElementById(b);g.innerHTML=getRateUI(h.getFromJID().getNode(),a,null);g.style.display="";}function handleNewRateDisAgree(f,h,a){var d=h.getFromJID().getNode();var c="<div class='chatuseragree'>"+f+" disagree to your rate.</div>";addInfoToChatWindow(d,c);var b=h.getFromJID().getNode()+"BillingRoot";var g=document.getElementById(b);g.innerHTML=getRateUI(h.getFromJID().getNode(),a,null);g.style.display="";}function handleStart(d,g,a){var b=g.getFromJID().getNode()+"BillingRoot";var f=document.getElementById(b);f.innerHTML=getServiceUIForExpert(g.getFromJID().getNode(),xPackets[g.getFromJID().getNode()],true);f.style.display="";xBillingData[g.getFromJID().getNode()].serviceStartTime=new Date();xBillingData[g.getFromJID().getNode()].lastSyncTime=new Date();var c="<div class='chatuseragree'>"+d+" has started the service.</div>";addInfoToChatWindow(g.getFromJID().getNode(),c);updateTimer(g.getFromJID().getNode());}function handleStop(d,j,h){var c="<div class='chatuseragree'>"+d+" has stopped the services.</div>";addInfoToChatWindow(j.getFromJID().getNode(),c);clearTimeout(xBillingData[j.getFromJID().getNode()].hndUpdateTimer);var f=document.getElementById(j.getFromJID().getNode()+"hireBtn");if(f){f.style.display="block";}var b=document.getElementById(j.getFromJID().getNode()+"stopBtn");if(b){b.style.display="none";}var a=j.getFromJID().getNode()+"BillingRoot";var k=document.getElementById(a);ms=parseInt(h.getAttribute("ms"));if((MIN_BILLING_SECONDS*1000)>ms){ms=MIN_BILLING_SECONDS*1000;}if(h.getAttribute("c")==myUserId){if(h.getAttribute("t")=="fix"){var g=parseFloat(h.getAttribute("fr"));k.innerHTML=getSummaryInfo(j.getFromJID().getNode(),time(ms),g,myBalance-g);chatBillingEvent(j.getFromJID().getNode(),1,h.getAttribute("e"),h.getAttribute("fr"),1);}else{ms=roundServiceTime(ms);var g=(parseFloat((ms/1000/60))*parseFloat(h.getAttribute("vr")));g=roundNumber(g,2);k.innerHTML=getSummaryInfo(j.getFromJID().getNode(),time(ms),g,myBalance-g);chatBillingEvent(j.getFromJID().getNode(),1,h.getAttribute("e"),h.getAttribute("vr"),0);}}else{if(h.getAttribute("t")=="fix"){var g=parseFloat(h.getAttribute("fr"));k.innerHTML=getSummaryInfoForExpert(j.getFromJID().getNode(),time(ms),g,myBalance+g);}else{ms=roundServiceTime(ms);var g=(parseFloat((ms/1000/60))*parseFloat(h.getAttribute("vr")));g=roundNumber(g,2);k.innerHTML=getSummaryInfoForExpert(j.getFromJID().getNode(),time(ms),g,myBalance+g);}}k.style.display="";}function handleRequestPause(d,f,a){var c=f.getFromJID().getNode();xBillingData[c].tmpJSJaCPacket=f;xBillingData[c].tmpxPackets=a;var b='<div style="width: 557px; height: auto;">';b+='<table id="corner_dialog_table0" align="center" class="corner_dialog_table" style="width: 100%; height: auto;">';b+="<tr>";b+='<td class="corner_topleft_green"></td>';b+='<td class="corner_topborder_green"></td>';b+='<td class="corner_topright_grn"></td>';b+="</tr>";b+="<tr>";b+='<td class="corner_borderleft_green"></td>';b+='<td id="corner_content_grn0" class="corner_content_grn">';b+='<div id="checkoutid"style="width: 100%; height: auto;">';b+='<div class="popup-header global-bg-color" style="position:relative; width:539px; margin-left:-10px; margin-top:-10px;">';b+='<div style="font-size:14px;">';b+="Pause Service?";b+='<div style="cursor: pointer; position: absolute; font-size: 9px; font-weight: bold; right: 10px; width: auto; top: 10px;">';b+="</div>";b+="</div>";b+="</div>";b+='<div id="CashierInnerDiv">';b+='<div class="row" style="padding-top:10px;"><div class="cell nml_bluetxt" style="width:300px;text-align:left;">'+d+" has requested to pause. You will not be paid until client resume the service. Are you agree with the request.</div></div>";b+='<div class="row" style="padding-top:20px; height:40px;">';b+='<div class="cell" style="width:110px; margin-left: 140px;">';b+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="handleRequestPauseAgree(\''+c+"')\">";b+="Agree";b+="</a>";b+="</div>";b+='<div class="cell" style="width:110px;">';b+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="handleRequestPauseDisagree(\''+c+"');\">";b+="Disagree";b+="</a>";b+="</div>";b+="</div>";b+="</div>";b+="</div>";b+="</td>";b+='<td class="corner_border_right_grn"></td>';b+="</tr>";b+="<tr>";b+='<td class="corner_bottomleft_grn"></td>';b+='<td class="corner_border_bottom_grn"></td>';b+='<td class="corner_bottomright_grn"></td>';b+="</tr>";b+="</table>";b+="</div>";lid="ConnectionPopUp";commoncallback(b,"ConnectionPopUp");}function handleRequestPauseAgree(c){now=new Date();xBillingData[c].totalServiceDurationMs=xBillingData[c].totalServiceDurationMs+now.getTime()-xBillingData[c].serviceStartTime.getTime();var b=xBillingData[c].tmpxPackets;clearTimeout(xBillingData[c].hndUpdateTimer);var a=buildJSCACMessage(c+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,b.getAttribute("e"),b.getAttribute("c"),b.getAttribute("t"),b.getAttribute("fr"),b.getAttribute("vr"),null,b.getAttribute("n"),"pagree");con.send(a);document.getElementById(c+"pause").style.display="none";document.getElementById(c+"resume").style.display="block";closecommonconn();if(b.getAttribute("c")==myUserId){chatBillingEvent(c,2,null,null,null);}}function handleRequestPauseDisagree(c){var b=xBillingData[c].tmpxPackets;var a=buildJSCACMessage(c+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,b.getAttribute("e"),b.getAttribute("c"),b.getAttribute("t"),b.getAttribute("fr"),b.getAttribute("vr"),null,b.getAttribute("n"),"pdisagree");con.send(a);closecommonconn();}function handlePauseAgree(c,d,a){now=new Date();xBillingData[d.getFromJID().getNode()].totalServiceDurationMs=xBillingData[d.getFromJID().getNode()].totalServiceDurationMs+now.getTime()-xBillingData[d.getFromJID().getNode()].serviceStartTime.getTime();clearTimeout(xBillingData[d.getFromJID().getNode()].hndUpdateTimer);var b="<div class='chatuseragree'>"+c+" agree to pause the service.</div>";addInfoToChatWindow(d.getFromJID().getNode(),b);document.getElementById(d.getFromJID().getNode()+"pause").style.display="none";document.getElementById(d.getFromJID().getNode()+"resume").style.display="block";if(a.getAttribute("c")==myUserId){chatBillingEvent(d.getFromJID().getNode(),2,null,null,null);}}function handlePauseDisagree(c,d,a){var b="<div class='chatuseragree'>"+c+" disagree to pause the service.</div>";addInfoToChatWindow(d.getFromJID().getNode(),b);}function handleResumeService(c,d,a){xBillingData[d.getFromJID().getNode()].hndUpdateTimer=new Date();xBillingData[d.getFromJID().getNode()].serviceStartTime=new Date();xBillingData[d.getFromJID().getNode()].lastSyncTime=new Date();updateTimer(d.getFromJID().getNode());var b="<div class='chatuseragree'>"+c+" has resumes the service.</div>";addInfoToChatWindow(d.getFromJID().getNode(),b);document.getElementById(d.getFromJID().getNode()+"pause").style.display="block";document.getElementById(d.getFromJID().getNode()+"resume").style.display="none";if(a.getAttribute("c")==myUserId){chatBillingEvent(d.getFromJID().getNode(),3,null,null,null);}}function handlePing(c,d,b){if(xBillingData[d.getFromJID().getNode()]){xBillingData[d.getFromJID().getNode()].lastSyncTime=new Date();}var a=buildJSCACMessage(d.getFromJID().getNode()+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,b.getAttribute("e"),b.getAttribute("c"),b.getAttribute("t"),b.getAttribute("fr"),b.getAttribute("vr"),null,b.getAttribute("n"),"pong");con.send(a);}function handlePong(b,c,a){if(xBillingData[c.getFromJID().getNode()]){xBillingData[c.getFromJID().getNode()].lastSyncTime=new Date();}}function chattrim(a){while(a.substring(0,1)==" "||a.substring(0,1)=="\n"||a.substring(0,1)=="\r"){a=a.substring(1,a.length);}while(a.substring(a.length-1,a.length)==" "){a=a.substring(0,a.length-1);}return a;}function addMessageDeliveryFailureMsg(b,d){var a='<div class="chatuseragree">'+d+"</div>";var c=document.getElementById(b+"chatBody");if(c){c.innerHTML+=a;c.scrollTop=c.scrollHeight;}}function addMessageToChatWindow(g,b,f){if(arDhtmlWindows[b]&&arDhtmlWindows[b].style.display=="none"){arDhtmlWindows[b].show(arDhtmlWindows[b]);}var a="";f=chattrim(f);f=f.replace(/\r\n/g,"<br />");f=f.replace(/\n/g,"<br />");if(lastMessageSenderName[b]!=g){var c=g;if(g!="Me"){c='<a href="javascript:void(0)" onClick="showviewprofile(\'ViewOtherProfile.do?uid='+b+"','middle_div','"+b+"','home')\">"+g+"</a>";}a='<table class="chatuser '+((g=="Me")?"username1":"username2")+'"><tr><td width="300"> '+c+' </td><td class="time">'+getCurrentTime()+"</td></tr></table>";lastMessageSenderName[b]=g;}a+='<div class="usertext">'+f+"</div>";var d=document.getElementById(b+"chatBody");if(d){d.innerHTML+=a;d.scrollTop=d.scrollHeight;}if(g!="Me"&&msgBlinkTimer==null&&hasWindowFocus==false){notifyWindowTitle(g);}if(g!="Me"){playSound("chat_recv");}}function addInfoToChatWindow(b,a){var c=document.getElementById(b+"chatBody");c.innerHTML+=a;c.scrollTop=c.scrollHeight;}function getCurrentTime(){var b=new Date();var a=b.getHours();var d=false;if(a<10){a="0"+a;d=true;}if(a<12){d=true;}var c=b.getMinutes();if(c<10){c="0"+c;}return a+":"+c+(d?"am":"pm");}function doLogin(b,d,a,g){if(nextReconnectTimer){clearTimeout(nextReconnectTimer);nextReconnectTimer=null;}myUserId=b;this.user=b;this.password=d;this.httpBase=a;this.localDomain=g;try{oDbg=new JSJaCConsoleLogger(2);oArgs=new Object();oArgs.httpbase=a;oArgs.timerval=2000;if(typeof(oDbg)!="undefined"){oArgs.oDbg=oDbg;}if(backend){con=new JSJaCHttpBindingConnection(oArgs);}else{con=new JSJaCHttpPollingConnection(oArgs);}setupCon(con);var j=document.getElementById("login_chat");if(j){j.style.display="none";}var f=document.getElementById("logout_chat");if(f){f.style.display="";}var c=new Date();oArgs=new Object();oArgs.domain=g;oArgs.username=b;oArgs.resource="ezdia"+c.getHours()+c.getMinutes()+c.getSeconds();oArgs.pass=d;oArgs.authtype="nonsasl";con.connect(oArgs);}catch(h){document.getElementById("err").innerHTML="Oops !! There is an error to connect";}finally{return false;}}function doReconnect(){if(nextReconnectTimer){clearTimeout(nextReconnectTimer);nextReconnectTimer=null;}if(!con.connected()&&c!="offline"){doLogin(user,password,httpBase,localDomain);return;}var a="available";var b=new JSJaCPresence();var c="available";b.setStatus("online");b.setShow(c);con.send(b);}function handleBroadcastMessage(a){alert(a);var b=document.getElementById("globalErrorMessage");if(b){b.innerHTML=a;}}function cancelClickBubbeling(a){if(document.all){a=event;}a.cancelBubble=true;if(window.ActiveXObject){event.returnValue=false;}else{a.preventDefault();}}function sendMsg(a,f,c){var h;if(window.event){f=window.event;h=window.event.keyCode;}else{if(f){h=f.which;}else{return true;}}var l=(window.event)?event.keyCode:f.keyCode;var k=(window.event)?27:f.DOM_VK_ESCAPE;if(l==k&&arDhtmlWindows[c]){arDhtmlWindows[c].close();cancelEventBubbeling(f);return true;}if(h==13){if(f.shiftKey){if(document.selection){myField.focus();sel=document.selection.createRange();sel.text="\r\n";}else{var g=a.selectionStart;var b=a.selectionEnd;a.value=a.value.substring(0,g)+"\r\n"+a.value.substring(b,a.value.length);a.setSelectionRange(g+1,g+1);a.focus();}cancelClickBubbeling(f);}else{if(chattrim(a.value)==""){return;}try{if(!validateXmppConnection(c)){a.value="";return;}addMessageToChatWindow("Me",c,chattrim(a.value));var d=c;if(d.indexOf("@")==-1){d+="@"+con.domain;}con.send(buildJSCACMessage(d,chattrim(a.value)));a.value="";return;}catch(j){html='<div class="msg error">Error: Oops there is an error, Try Again </div>';document.getElementById(chatBody).innerHTML+=html;oDbg.log(html);return;}}}}function loginToChat(a){if(a){a.style.display="none";}if(!isConnectedToChatServer()){doReconnect();}}function validateXmppConnection(b){if(typeof(con)=="undefined"||con.connected()==false){addInfoToChatWindow(b,'<div class="chatuseragree">Please login to Chat first ! <br /><a style="cursor:pointer;cursor: hand;text-decoration: underline;display:block;" onClick="loginToChat(this)">Login to Chat</a></div>');var c=document.getElementById("login_chat");if(c){c.style.display="";}var a=document.getElementById("logout_chat");if(a){a.style.display="none";}return false;}else{return true;}}function isConnectedToChatServer(){if(typeof(con)=="undefined"||con.connected()==false){return false;}else{return true;}}function buildJSCACMessage(c,b){var a=new JSJaCMessage();a.setTo(new JSJaCJID(c));a.setType("chat");a.setBody(b);return a;}function quit(){if(con&&con.connected()){con.disconnect();oDbg.log("quit called");}var b=document.getElementById("login_chat");if(b){b.style.display="";}var a=document.getElementById("logout_chat");if(a){a.style.display="none";}}function buildEzdiaXmppPacket(m,g,f,k,a,j,b,d,c,h){var l;if(window.ActiveXObject){l=m.getNode().appendChild(m.getDoc().createElement("x"));l.setAttribute("xmlns","ezdia:xmpp:billing");}else{l=m.getNode().appendChild(m.getDoc().createElementNS("ezdia:xmpp:billing","x"));}l.setAttribute("e",g);l.setAttribute("c",f);if(k!=null){l.setAttribute("t",k);}if(a!=null){l.setAttribute("fr",a);}if(j!=null){l.setAttribute("vr",j);}if(b!=null){l.setAttribute("nr",b);}if(d!=null){l.setAttribute("n",d);}if(h&&!isNaN(h)){l.setAttribute("ms",h);}l.setAttribute("a",c);return m;}function openRequestUIForHire(b){var a=b+"BillingRoot";var c=document.getElementById(a);c.innerHTML=getHireRequestUI(b);c.style.display="";}function showModelConfirmBox(){var a="";a+='<div style="width: 557px; height: auto;">';a+='<table id="corner_dialog_table0" align="center" class="corner_dialog_table" style="width: 100%; height: auto;">';a+="<tr>";a+='<td class="corner_topleft_green"></td>';a+='<td class="corner_topborder_green"></td>';a+='<td class="corner_topright_grn"></td>';a+="</tr>";a+="<tr>";a+='<td class="corner_borderleft_green"></td>';a+='<td id="corner_content_grn0" class="corner_content_grn">';a+='<div id="checkoutid"style="width: 100%; height: auto;">';a+='<div class="popup-header global-bg-color" style="position:relative; width:539px; margin-left:-10px; margin-top:-10px;">';a+='<div style="font-size:14px;">';a+="Add funds to your account";a+='<div style="cursor: pointer; position: absolute; font-size: 9px; font-weight: bold; right: 10px; width: auto; top: 10px;">';a+='<a href="javascript:void(0);" id="loginpopup_closeimg" onclick="closecommonconn()" style="color: white;">Close X</a>';a+="</div>";a+="</div>";a+="</div>";a+='<div id="CashierInnerDiv">';a+='<div class="row" style="padding-top:20px; height:40px;">';a+='<div class="cell" style="width:110px; margin-left: 140px;">';a+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="">';a+="Submit Deposit";a+="</a>";a+="</div>";a+='<div class="cell" style="width:110px;">';a+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="closecommonconn();">';a+="Cancel";a+="</a>";a+="</div>";a+="</div>";a+="</div>";a+="</div>";a+="</td>";a+='<td class="corner_border_right_grn"></td>';a+="</tr>";a+="<tr>";a+='<td class="corner_bottomleft_grn"></td>';a+='<td class="corner_border_bottom_grn"></td>';a+='<td class="corner_bottomright_grn"></td>';a+="</tr>";a+="</table>";a+="</div>";lid="ConnectionPopUp";commoncallback(a,"ConnectionPopUp");}function requestForHire(d){if(!validateXmppConnection(d)){return;}var c=document.getElementById(d+"TxtSubject").value;if(c.length>"50"){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Subject of topic should be less then 50 Chars";document.getElementById(d+"TxtSubject").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(c!=null&&c!=""){xBillingData[d]=new billingData();ms=0;xBillingData[d].totalServiceDurationMs=0;var a=buildJSCACMessage(d+"@"+con.domain,c);a=buildEzdiaXmppPacket(a,d,myUserId,null,null,null,null,null,"hire");var b="<div class='chatuseragree'>"+getCurrentTime()+"<br>Request sent to hire Expert </div>";con.send(a);addInfoToChatWindow(d,b);document.getElementById(d+"hireBtn").style.display="none";document.getElementById("BillingErrorMess").style.display="none";hideBillingLayer(d+"BillingRoot");}else{document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter subject of the topic.";document.getElementById(d+"TxtSubject").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}getUserAccountBalance(d);showWarningMessageForFunds=true;}function cancelHire(c,d){var b=buildJSCACMessage(c+"@"+con.domain,"ezd");b=buildEzdiaXmppPacket(b,myUserId,c,null,null,null,null,null,"cancel");con.send(b);infoHtml="<div class='chatuseragree'>"+getCurrentTime()+"<br>"+d+"</div>";addInfoToChatWindow(c,infoHtml);var a=document.getElementById(c+"hireBtn");if(a){a.style.display="block";}if(document.getElementById(c+"BillingRoot")){hideBillingLayer(c+"BillingRoot");}clearUserBalanceChecker();}function sendRateToExplorer(g){if(!validateXmppConnection(g)){return;}var l=document.getElementById(g+"ChkTerms").checked;if(l==true){var j;var h="";var d="";if(document.getElementById(g+"RatePerMin").checked){d=document.getElementById(g+"TextRpm").value;if(chattrim(d)==""){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter per minute charges.";document.getElementById(g+"TextRpm").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(isNaN(d)){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter a valid Per/min charges (e.g. 1 or 1.5).";document.getElementById(g+"TextRpm").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(parseFloat(d)<=0){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Per minute charges cann't be zero or less";document.getElementById(g+"TextRpm").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}}if(document.getElementById(g+"RateFix").checked){h=document.getElementById(g+"TextFix").value;if(chattrim(h)==""){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter fix price.";document.getElementById(g+"TextFix").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(isNaN(h)){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter a valid fix price (e.g. 1 or 1.5).";document.getElementById(g+"TextFix").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(parseFloat(h)<=0){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Fix price cann't be zero or less.";document.getElementById(g+"TextFix").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}}if(h==""&&d==""){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please select price type.";window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}else{if(h!=""&&d!=""){j="both";}else{if(h!=""&&d==""){j="fix";}else{if(h==""&&d!=""){j="pm";}}}}var b;if(document.getElementById(g+"ChkNgo").checked){b="1";}else{b="0";}var m=buildJSCACMessage(g+"@"+con.domain,"ezd");m=buildEzdiaXmppPacket(m,myUserId,g,j,h,d,null,b,"rate");var f="<div class='chatuseragree'>"+getCurrentTime()+"<br>Rate sent to explorer.</div>";con.send(m);addInfoToChatWindow(g,f);var k;for(var c=0;c<m.getNode().getElementsByTagName("x").length;c++){k=m.getNode().getElementsByTagName("x").item(c);}var a=g+"BillingRoot";var o=document.getElementById(a);o.innerHTML=getRateSentUI(g,xBillingData[g].billingSubject,k);}else{document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please agree terms and conditions.";document.getElementById(g+"ChkTerms").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);}}function agreeToRate(f){if(!validateXmppConnection(f)){return;}if(!document.getElementById(f+"TermsAgree").checked){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please agree terms and conditions.";document.getElementById(f+"TermsAgree").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}var b="";var k=document.getElementById(f+"RdoPerMin");var c=0;if(k&&k.checked){b="pm";c=parseFloat(xPackets[f].getAttribute("vr"))*(MIN_BILLING_FUNDS_SECONDS/60);}else{b="fix";c=parseFloat(xPackets[f].getAttribute("fr"));}if(c>myBalance){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="You should have funds for at least 5 minutes of talk time";window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}var h=buildJSCACMessage(f+"@"+con.domain,"ezd");h=buildEzdiaXmppPacket(h,f,myUserId,b,xPackets[f].getAttribute("fr"),xPackets[f].getAttribute("vr"),null,xPackets[f].getAttribute("n"),"agree");con.send(h);var g;for(var d=0;d<h.getNode().getElementsByTagName("x").length;d++){g=h.getNode().getElementsByTagName("x").item(d);}xPackets[f]=g;var a=f+"BillingRoot";var j=document.getElementById(a);j.innerHTML=getServiceUI(f,xPackets[f]);j.style.display="";if(g.getAttribute("t")=="fix"){initiateOnAgree(f,f,g.getAttribute("fr"),1);}else{initiateOnAgree(f,f,g.getAttribute("vr"),0);}clearUserBalanceChecker();}function sendPing(b){var a=buildJSCACMessage(b+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,myUserId,b,null,null,null,null,null,"ping");con.send(a);}function startService(c){if(!validateXmppConnection(c)){return;}var b=buildJSCACMessage(c+"@"+con.domain,"ezd");b=buildEzdiaXmppPacket(b,c,myUserId,xPackets[c].getAttribute("t"),xPackets[c].getAttribute("fr"),xPackets[c].getAttribute("vr"),null,xPackets[c].getAttribute("n"),"start");con.send(b);document.getElementById(c+"start").style.display="none";document.getElementById(c+"pause").style.display="block";document.getElementById(c+"stopBtn").style.display="block";var a=document.getElementById(c+"stop");a.style.display="block";document.getElementById(c+"stopspan").style.color="#FF0033";document.getElementById(c+"resume").style.display="none";xBillingData[c].serviceStartTime=new Date();xBillingData[c].lastSyncTime=new Date();updateTimer(c);chatBillingEvent(c,0,null,null,null);}function proposeNewRate(h){if(!validateXmppConnection(h)){return;}var b="";var j=document.getElementById(h+"RdoPerMin");var d=0;var f=document.getElementById(h+"NewRate").value;if(chattrim(f)==""){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter new rate to propose.";document.getElementById(h+"NewRate").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(isNaN(f)){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please enter valid new rate to propose(e.g. 1 or 1.5).";document.getElementById(h+"NewRate").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(parseFloat(f)<=0){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="New rate can't be zero or less.";document.getElementById(h+"NewRate").focus();window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}if(j&&j.checked){b="pm";d=parseFloat(f)*(MIN_BILLING_FUNDS_SECONDS/60);}else{b="fix";d=parseFloat(f);}if(d>myBalance){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="You don't have sufficient balance to propose this rate. Please add some funds to proceed.";window.setTimeout('cleardiv("BillingErrorMess")',9000);return;}var a=buildJSCACMessage(h+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,h,myUserId,b,xPackets[h].getAttribute("fr"),xPackets[h].getAttribute("vr"),f,xPackets[h].getAttribute("n"),"propose");con.send(a);var g="<div class='chatuseragree'>New rate sent to hire expert.</div>";addInfoToChatWindow(h,g);var c=document.getElementById(h+"BottomButtons");if(c){c.style.display="none";}}function stopService(b,c){if(ms==0){return;}if(!validateXmppConnection(b)){return;}if(c==true){stopServiceConfirmed(b,c);}else{var a="";a+='<div style="width: 557px; height: auto;">';a+='<table id="corner_dialog_table0" align="center" class="corner_dialog_table" style="width: 100%; height: auto;">';a+="<tr>";a+='<td class="corner_topleft_green"></td>';a+='<td class="corner_topborder_green"></td>';a+='<td class="corner_topright_grn"></td>';a+="</tr>";a+="<tr>";a+='<td class="corner_borderleft_green"></td>';a+='<td id="corner_content_grn0" class="corner_content_grn">';a+='<div id="checkoutid"style="width: 100%; height: auto;">';a+='<div class="popup-header global-bg-color" style="position:relative; width:539px; margin-left:-10px; margin-top:-10px;">';a+='<div style="font-size:14px;">';a+="Stop Service?";a+='<div style="cursor: pointer; position: absolute; font-size: 9px; font-weight: bold; right: 10px; width: auto; top: 10px;">';a+="</div>";a+="</div>";a+="</div>";a+='<div id="CashierInnerDiv">';a+='<div class="row" style="padding-top:10px;"><div class="cell nml_bluetxt" style="width:220px;">Do you really want to exit the session?</div></div>';a+='<div class="row" style="padding-top:20px; height:40px;">';a+='<div class="cell" style="width:110px; margin-left: 140px;">';a+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="stopServiceConfirmed(\''+b+"', "+((c==true)?true:false)+')">';a+="OK";a+="</a>";a+="</div>";a+='<div class="cell" style="width:110px;">';a+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="closecommonconn();">';a+="Cancel";a+="</a>";a+="</div>";a+="</div>";a+="</div>";a+="</div>";a+="</td>";a+='<td class="corner_border_right_grn"></td>';a+="</tr>";a+="<tr>";a+='<td class="corner_bottomleft_grn"></td>';a+='<td class="corner_border_bottom_grn"></td>';a+='<td class="corner_bottomright_grn"></td>';a+="</tr>";a+="</table>";a+="</div>";lid="ConnectionPopUp";commoncallback(a,"ConnectionPopUp");}}function stopServiceConfirmed(g,j){if(j==false){closecommonconn();}clearTimeout(xBillingData[g].hndUpdateTimer);var b=document.getElementById(g+"hireBtn");if(b){b.style.display="block";}var f=document.getElementById(g+"stopBtn");if(f){f.style.display="none";}var a=buildJSCACMessage(g+"@"+con.domain,"ezd");if((MIN_BILLING_SECONDS*1000)>ms){ms=MIN_BILLING_SECONDS*1000;}a=buildEzdiaXmppPacket(a,xPackets[g].getAttribute("e"),xPackets[g].getAttribute("c"),xPackets[g].getAttribute("t"),xPackets[g].getAttribute("fr"),xPackets[g].getAttribute("vr"),null,xPackets[g].getAttribute("n"),"stop",ms);con.send(a);var d=g+"BillingRoot";var h=document.getElementById(d);if(xPackets[g].getAttribute("c")==myUserId){if(xPackets[g].getAttribute("t")=="fix"){var c=parseFloat(xPackets[g].getAttribute("fr"));h.innerHTML=getSummaryInfo(g,time(ms),c,myBalance-c);chatBillingEvent(g,1,xPackets[g].getAttribute("e"),xPackets[g].getAttribute("fr"),1);}else{ms=roundServiceTime(ms);var c=(parseFloat((ms/1000/60))*parseFloat(xPackets[g].getAttribute("vr")));c=roundNumber(c,2);h.innerHTML=getSummaryInfo(g,time(ms),c,myBalance-c);chatBillingEvent(g,1,xPackets[g].getAttribute("e"),xPackets[g].getAttribute("vr"),0);}}else{if(xPackets[g].getAttribute("t")=="fix"){var c=parseFloat(xPackets[g].getAttribute("fr"));h.innerHTML=getSummaryInfoForExpert(g,time(ms),c,myBalance+c);}else{ms=roundServiceTime(ms);var c=(parseFloat((ms/1000/60))*parseFloat(xPackets[g].getAttribute("vr")));c=roundNumber(c,2);h.innerHTML=getSummaryInfoForExpert(g,time(ms),c,myBalance+c);}}h.style.display="";}function roundServiceTime(a){var b=a/1000/60;var b=Math.round(b);return b*1000*60;}function requestPauseService(c){if(!validateXmppConnection(c)){return;}var a=buildJSCACMessage(c+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,xPackets[c].getAttribute("e"),xPackets[c].getAttribute("c"),xPackets[c].getAttribute("t"),xPackets[c].getAttribute("fr"),xPackets[c].getAttribute("vr"),null,xPackets[c].getAttribute("n"),"rpause");con.send(a);var b="<div class='chatuseragree'>Requested to pause the service.</div>";addInfoToChatWindow(c,b);}function resumeService(b){if(!validateXmppConnection(b)){return;}xBillingData[b].lastSyncTime=new Date();xBillingData[b].serviceStartTime=new Date();updateTimer(b);var a=buildJSCACMessage(b+"@"+con.domain,"ezd");a=buildEzdiaXmppPacket(a,xPackets[b].getAttribute("e"),xPackets[b].getAttribute("c"),xPackets[b].getAttribute("t"),xPackets[b].getAttribute("fr"),xPackets[b].getAttribute("vr"),null,xPackets[b].getAttribute("n"),"resume");con.send(a);document.getElementById(b+"pause").style.display="block";document.getElementById(b+"resume").style.display="none";if(xPackets[b].getAttribute("c")==myUserId){chatBillingEvent(b,3,null,null,null);}}function stopServiceOnError(a){stopService(a,true);}function updateTimer(c){xBillingData[c].hndUpdateTimer=setTimeout("updateTimer('"+c+"');",1000);now=new Date();ms=xBillingData[c].totalServiceDurationMs+(now.getTime()-xBillingData[c].serviceStartTime.getTime());document.getElementById(c+"TimerId").innerHTML=time(ms);var d=(new Date())-xBillingData[c].lastSyncTime;if(xPackets[c].getAttribute("t")!="fix"&&xPackets[c].getAttribute("e")==myUserId){if(((ms/1000)%30)<=1){xBillingData[c].earnedMoney=(parseFloat((ms/1000/60))*parseFloat(xPackets[c].getAttribute("vr")));xBillingData[c].earnedMoney=roundNumber(xBillingData[c].earnedMoney,2);xBillingData[c].earnedMoneyEzdia=xBillingData[c].earnedMoney*5/100;document.getElementById(c+"Earned").innerHTML=xBillingData[c].earnedMoney+" $";if(d>35000){stopServiceOnError(c,true);alert("Service has to stop because connectivity lost with Explorer.");}sendPing(c);}}if(xPackets[c].getAttribute("t")=="fix"&&xPackets[c].getAttribute("e")==myUserId){document.getElementById(c+"Earned").innerHTML=xPackets[c].getAttribute("fr")+" $";}else{if(((ms/1000)%30)<=1){chatBillingEvent(c,5,null,null,null);if(xPackets[c].getAttribute("t")=="pm"){var b=(parseFloat((ms/1000/60))*parseFloat(xPackets[c].getAttribute("vr")));b=roundNumber(b,2);timeAvailable=document.getElementById(c+"timeAvailable");timeAvailable.innerHTML=roundNumber((myBalance-b)/parseFloat(xPackets[c].getAttribute("vr")),2)+":00";var a=parseFloat(xPackets[c].getAttribute("vr"))+b;if(a>myBalance){stopService(c,true);document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Service has to stop because of you don't have sufficient funds.";window.setTimeout('cleardiv("BillingErrorMess")',9000);}if(d>35000){stopServiceOnError(c,true);document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Service has to stop because connectivity lost with Expert.";window.setTimeout('cleardiv("BillingErrorMess")',9000);}}}}}function showFundsWarningMessage(){showWarningMessageForFunds=false;alert("Service will be stopped soon because of low funds. Please add enough funds to your account to continue uninterrupted  service.");}function two(a){return((a>9)?"":"0")+a;}function three(a){return((a>99)?"":"0")+((a>9)?"":"0")+a;}function time(b){var f=Math.floor(b/1000);b=b%1000;t=three(b);var c=Math.floor(f/60);f=f%60;t=two(f);var d=Math.floor(c/60);c=c%60;t=two(c)+":"+t;var a=Math.floor(d/60);d=d%60;t=two(d)+":"+t;return t;}function unhideBillingLayer(b,a){var c=document.getElementById(b+"BillingRoot");if(c){c.style.display="";}if(a){a.style.display="none";}}function hideBillingLayer(f,a,c){var b=document.getElementById(f).style.display;if(b!="none"){document.getElementById(f).style.display="none";var d=document.getElementById("openSlideWin"+a);if(a&&d){d.style.display="";}return true;}return false;}function updateLoingLogoutLinks(){try{if(isConnectedToChatServer()){var c=document.getElementById("login_chat");if(c){c.style.display="none";}var a=document.getElementById("logout_chat");if(a){a.style.display="";}}else{var c=document.getElementById("login_chat");if(c){c.style.display="";}var a=document.getElementById("logout_chat");if(a){a.style.display="none";}}}catch(b){}}function beforeClose(a){if(document.getElementById(a+"stop")){alert("Please stop the service before you close this window.");return false;}}function allowMultipleHire(){if(MIN_BILLING_ALLOW_MULTIPLE_SERVE){return true;}for(var a in xBillingData){if(document.getElementById(a+"stop")){return false;}}return true;}function updateWindowHeightWidth(){if(window.innerWidth||window.innerHeight){documentWidth=window.innerWidth;documentHeight=window.innerHeight;}if(document.body.clientWidth||document.body.clientHeight){documentWidth=document.body.clientWidth;documentHeight=document.body.clientHeight;}documentHeight=Math.max(document.documentElement.clientWidth,document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth);}window.onfocus=function(){hasWindowFocus=true;if(msgBlinkTimer!=null){clearTimeout(msgBlinkTimer);document.title=lastWindowTitle;msgBlinkTimer=null;}window.title=lastWindowTitle;};window.onblur=function(){hasWindowFocus=false;};function notifyWindowTitle(b){var a=b+" Says...";if(document.title!=a){lastWindowTitle=document.title;}if(lastWindowTitle==document.title){document.title=b+" Says...";window.focus();}else{document.title=lastWindowTitle;}msgBlinkTimer=setTimeout("notifyWindowTitle('"+b+"');",1500);}function getBillingRequestUI(j,m){var l=j+"BillingRoot";var d=j+"rateSession";var a=j+"availableBalance";var k=j+"checkBox";var b=j+"RatePerMin";var g=j+"RateFix";var c=j+"checkBoxError";var h=j+"Category";var f='<div class="ChatBilling_header_nav">';f+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",j)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td><img onclick="hideBillingLayer(\''+l+"', '"+j+'\')" alt="" src="../static/images/chatBillingSideArrowImg.png" style="cursor: pointer; padding-right: 7px;"/></td></tr></table></td></tr></table>';f+="</div>";f+='<div class="base_bg_holder">';f+='<div class="ChatBilling_sendRate_txt">Send Rate for this session</div>';f+='<div id="BillingErrorMess" class="msgYellow chatErrorDisplay" style="display:none;"></div>';f+='<div style="color:#76AE31; padding: 4px 0px 2px 10px;">'+m+"</div>";f+='<div style="float:left; padding:2px;">Select the category for above subject:</div>';f+='<div style="float:left;"><select style="width:140px;" size="1" id="'+h+'" onchange="document.getElementById(\''+j+"TextRpm').value=this.value;\"></select></div>";f+='<div class="row" style="width:290px;"><div class="cell" style="width:14px;"><input type="checkbox" id="'+b+'"></div><div class="cell" style="margin-top:8px; width:99px;">Per minute charges :</div>';f+='<div class="cell" style="margin-left:0; width:50px;"><input type="text" size="5" id="'+j+"TextRpm"+'"></div><div class="cell" style="margin-top:8px; margin-left:0; width:50px; color:#CCC;">$ per min</div></div>';f+='<div class="row" style="width:290px; height:auto;"><div class="cell" style="width:14px;"><input type="checkbox" id="'+g+'"></div><div class="cell" style="margin-top:8px; width:47px;">Fix Price :</div>';f+='<div class="cell" style="margin-left:0; width:50px;"><input type="text" size="5" id="'+j+"TextFix"+'"></div><div class="cell" style="margin-top:8px; width:50px; color:#CCC;">$ per talk</div></div>';f+='<div class="row" style="margin:0; border-top:1px solid #E5E5E5;">';f+='<div class="row" style="width:290px;">';f+='<div class="cell" style="width:14px; margin-top:0;"><input type="checkbox" id="'+j+"ChkNgo"+'"></div><div class="cell" style="width:110px; color:#004080; margin-top:3px;">My Rate is Negotiable</div></div>';f+='<div class="row" style="color: rgb(0, 64, 128); width: 290px;"><div class="cell" style="width:14px; margin-top:0;"><input type="checkbox" id="'+j+"ChkTerms"+'"></div>';f+='<div class="cell" style="width:260px; color:#004080; margin-top:3px;">I Agree to the Expert Fee <span class="action" style="text-decoration:underline;" onclick="myPopUp(\''+contextRoot+"/jsp/TermsAndConditions.jsp')\">Agreement</span> for all the transactions made</div>";f+="</div></div>";f+='<div class="row" style="width: 200px; padding-top: 0px; margin-left: 90px;">';f+='<div class="cell chat-billing-small-Btn"><span class="action" onclick=sendRateToExplorer("'+j+'")>Send</span></div>';f+='<div class="cell chat-billing-small-Btn"><span class="action" onclick="cancelHire(\''+j+"','You have cancelled the request to hire.')\" >Cancel</span></div></div></div>";return f;}function getRateSentUI(d,c,a){var b='<div class="ChatBilling_header_nav">';b+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",d)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';b+="</div>";b+='<div class="base_bg_holder">'+'<div class="ChatBilling_sendRate_txt">Send Rate for this session</div>';b+='<div style="height:auto; margin: 4px 0px; -moz-border-radius:6px; background-color:#DAEFFE;">'+'<div style="padding: 5px 10px;">Subject: <span style="color:#76AE31">'+c+"</span></div>";if(a.getAttribute("t")=="pm"||a.getAttribute("t")=="both"){b+='<div style="padding: 5px 22px;">Per minute charges : '+'<span style="color:#004080;">'+a.getAttribute("vr")+"&nbsp; $ per min</span></div>";}if(a.getAttribute("t")=="fix"||a.getAttribute("t")=="both"){b+='<div style="padding: 5px 22px;">Fix Price : '+'<span style="color:#004080;">'+a.getAttribute("fr")+"&nbsp; $</span></div>";}if(a.getAttribute("n")=="1"){b+='<div style="padding: 15px; color:#FF0033;">* You have given a chance to negotiate rate.</div>';}b+="</div>";b+='<div style="border-top:1px solid #E5E5E5;">';b+='<div class="chat-billing-small-Btn" style="margin: 15px 140px;"><span class="action" onclick="cancelHire(\''+d+"','You have cancelled the request to hire.')\">Cancel</span></div></div></div>";return b;}function getHireRequestUI(b){var c=b+"TxtSubject";var d=b+"BillingRoot";var a='<div class="ChatBilling_header_nav">';a+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",b)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Hire</td><td><table align="center" width="12"><tr><td><img onclick="hideBillingLayer(\''+d+"', '"+b+'\')" alt="" src="../static/images/chatBillingSideArrowImg.png" style="cursor: pointer; padding-right: 7px;"/></td></tr></table></td></tr></table>';a+="</div>";a+='<div class="base_bg_holder">';a+='<div id="BillingErrorMess" class="msgYellow chatErrorDisplay" style="display:none;"></div>';a+='<div class="ChatBilling_title_txt">Please enter the subject of the topic & click Hire</div>';a+='<div style="padding:10px 2px 2px 10px;"><input type="text" style="width:300px" id="'+c+'"/></div>';a+='<div class="row" style="margin-left: 100px; width: 228px;">';a+='<div class="cell chat-billing-small-Btn"><span class="action" onclick=requestForHire("'+b+'")>Hire</span></div>';a+='<div class="cell chat-billing-small-Btn"><span class="action" onclick="hideBillingLayer(\''+b+'BillingRoot\');" >Cancel</span></div></div><br/><br/><p align="center"><font color="#CCC">Note: The subject of the topic should be less then 50 Chars.</font></p></div>';return a;}function getIncomingHireRequestUI(b,c){var d=b+"BillingRoot";var a='<div class="ChatBilling_header_nav">';a+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",b)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Hire Request</td><td><table align="center" width="12"><tr><td><img onclick="hideBillingLayer(\''+d+"', '"+b+'\')" alt="" src="../static/images/chatBillingSideArrowImg.png" style="cursor: pointer; padding-right: 7px;"/></td></tr></table></td></tr></table>';a+="</div>";a+='<div class="base_bg_holder">';a+='<div class="ChatBilling_title_txt" style="padding-top:10px;">'+c+"</div>";a+='<div class="row" style="margin-left: 100px; width: 228px;">';a+='<div class="cell chat-billing-small-Btn"><span class="action" onclick=agreeForHireRequest("'+b+'")>Agree</span></div>';a+='<div class="cell chat-billing-small-Btn"><span class="action" onclick="cancelHire(\''+b+"', 'You have Cancelled the request for hire.');\" >Cancel</span></div></div></div>";return a;}function getRateUI(g,l,m){var j=g+"BillingRoot";var d=g+"rateSession";var a=g+"availableBalance";var h=g+"checkBox";var c=g+"checkBoxError";var b=g+"AvalBalance";if(m==null){if(l.getAttribute("t")=="fix"){m="fix";}else{m="pm";}}var f='<div class="ChatBilling_header_nav">';f+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",g)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';f+="</div>";f+='<div class="base_bg_holder">';f+='<div id="BillingErrorMess" class="msgYellow chatErrorDisplay chatErrorDisplay" style="display:none;"></div>';f+='<div class="row thd">';f+='<div class="cell" style="width:92px; padding-left:8px;">Available Balance :</div>';f+='<div class="cell" style="width:105px;" id="'+b+'"> '+myBalance+"$</div>";f+="<div class=\"cell afl\" onClick=\"showcommondiv('AddFund.do', 'ConnectionPopUp','ConnectionPopUp');currentWinRemoteUserId="+g+';">Add funds</div></div>';f+='<div class="ChatBilling_sendRate_txt">Rate for this session</div>';f+='<div class="bdr-color-E5E5E5">';var k="";if(l.getAttribute("t")=="pm"||l.getAttribute("t")=="both"){f+='<div class="row" style="height:20px;">'+'<div class="cell" style="margin: 1px; width: 20px;">'+'<input type="radio" name="'+g+'rdoName" id="'+g+'RdoPerMin" '+((m=="pm")?'checked="checked"':"")+" onclick=\"updateRateInfo('"+g+"RateInfo','Expert Rate /Min','"+l.getAttribute("vr")+"');\" ></div>"+'<div class="cell" style="width:200px;">Per minute charges : '+'<span style="color:#004080;">'+l.getAttribute("vr")+"&nbsp; $ per min</span></div></div>";k='<span>Expert Rate /Min :</span>&nbsp;<span style="color:#004080;">'+l.getAttribute("vr")+" $</span>";}if(l.getAttribute("t")=="fix"||l.getAttribute("t")=="both"){f+='<div class="row" style="height:20px;">'+'<div class="cell" style="margin: 1px; width: 20px;">'+'<input type="radio" name="'+g+'rdoName" id="'+g+'RdoFix" '+((m!="pm")?'checked="checked"':"")+" onclick=\"updateRateInfo('"+g+"RateInfo','Fix Price','"+l.getAttribute("fr")+"');\"></div>"+'<div class="cell">Fix Price : '+'<span style="color:#004080;">'+l.getAttribute("fr")+"&nbsp; $</span></div></div>";if(m=="fix"){k='<span>Fix Price :</span>&nbsp;<span style="color:#004080;">'+l.getAttribute("fr")+" $</span>";}}if(l.getAttribute("n")=="1"){f+='<div class="row nR">'+'<div class="cell" style="width:14px; margin-top:0;"><input type="checkbox" onclick="updateRateUI(this,\''+g+"');\"></div>"+'<div class="cell" style="width:160px; margin-top:3px;">Negotiate Rate ( only one time  )</div></div>';}f+="</div>";f+='<div class="rimd"><br>'+'<div align="center" class="rI" id="'+g+'RateInfo">'+k+"</div>"+'<div class="row">'+'<div class="cell" style="width:15px; margin-top:0;"><input type="checkbox" id="'+g+'TermsAgree"></div>'+'<div class="cell" style="width:291px; margin-top:1px;">I Agree to the Expert Fee <span class="action" style="text-decoration:underline;" onclick="myPopUp(\''+contextRoot+"/jsp/TermsAndConditions.jsp')\">Agreement</span> for all the transactions made.</div></div>"+'<div class="row" style="width: 200px; margin-left: 90px;">'+'<div class="cell chat-billing-small-Btn"><span class="action" style="color:#76AE31;" onclick=agreeToRate("'+g+'") >Agree</span></div>'+'<div class="cell chat-billing-small-Btn"><span class="action" onclick="cancelHireButtonClicked(\'By clicking this, you are going to cancel the rate proposed by Expert. Click OK to continue.\', \''+g+"','You have canceled the rate sent from Expert. You may indicate your interest over chat and hire him again by clicking on the Hire button.')\">Cancel</span></div></div></div></div>";return f;}function getRateUIWithNego(g,l,m){var j=g+"BillingRoot";var d=g+"rateSession";var a=g+"availableBalance";var h=g+"checkBox";var c=g+"checkBoxError";var b=g+"AvalBalance";var f='<div class="ChatBilling_header_nav">';f+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",g)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';f+="</div>";f+='<div class="base_bg_holder">';f+='<div id="BillingErrorMess" class="msgYellow chatErrorDisplay" style="display:none;"></div>';f+='<div class="row thd">';f+='<div class="cell" style="width:92px; padding-left:8px;">Available Balance :</div>';f+='<div class="cell" style="width:105px;" id="'+b+'"> '+myBalance+"$</div>";f+="<div class=\"cell afl\" onClick=\"showcommondiv('AddFund.do', 'ConnectionPopUp','ConnectionPopUp');currentWinRemoteUserId="+g+';">Add funds</div></div>';f+='<div class="ChatBilling_sendRate_txt" style="color:#004080;">Rate for this session</div>';f+='<div class="bdr-color-E5E5E5">';var k="";if(l.getAttribute("t")=="pm"||l.getAttribute("t")=="both"){f+='<div class="row">'+'<div class="cell" style="margin: 1px; width: 20px;">'+'<input type="radio" name="'+g+'rdoName" id="'+g+'RdoPerMin" '+((m=="pm")?'checked="checked"':"")+"  onclick=\"updateRateInfo('"+g+"RateInfo','Expert Rate /Min','"+l.getAttribute("vr")+"');\" ></div>"+'<div class="cell" style="width:200px;">Per minute charges : '+'<span style="color:#004080;">'+l.getAttribute("vr")+"&nbsp; $ per min</span></div></div>";k='<span>Expert Rate /Min :</span>&nbsp;<span style="color:#004080;">'+l.getAttribute("vr")+" $</span>";}if(l.getAttribute("t")=="fix"||l.getAttribute("t")=="both"){f+='<div class="row">'+'<div class="cell" style="margin: 1px; width: 20px;">'+'<input type="radio" name="'+g+'rdoName" id="'+g+'RdoFix" '+((m!="pm")?'checked="checked"':"")+" onclick=\"updateRateInfo('"+g+"RateInfo','Fix Price','"+l.getAttribute("fr")+"');\"></div>"+'<div class="cell">Fix Price : '+'<span style="color:#004080;">'+l.getAttribute("fr")+"&nbsp; $</span></div></div>";if(m!="pm"){k='<span>Fix Price :</span>&nbsp;<span style="color:#004080;">'+l.getAttribute("fr")+" $</span>";}}if(l.getAttribute("n")=="1"){f+='<div class="row nR">'+'<div class="cell" style="width:14px; margin-top:0;"><input type="checkbox" onclick="updateRateUI(this,\''+g+'\');" checked="checked"></div>'+'<div class="cell" style="width:160px; margin-top:3px;">Negotiate Rate ( only one time  )</div></div>';}f+="</div>";f+='<div class="rimd"><br>'+'<div align="center" class="rI" id="'+g+'RateInfo">'+k+"</div>"+'<div class="row">'+'<div class="cell" style="width: 55px; margin-top: 3px; margin-left:88px;">New Rate :</div>'+'<div class="cell" style="width: 50px; margin-top: 0pt;"><input type="text" size="5" id="'+g+'NewRate" ></div>'+'<div class="cell" style="width:10px; color:#004080; margin-top:3px;">$</div></div>';f+='<div class="row" style="width: 200px; margin-left: 90px;" id="'+g+'BottomButtons">'+'<div class="cell chat-billing-small-Btn"><span class="action" style="color:#D34619;" onclick=proposeNewRate("'+g+'") >Propose</span></div>'+'<div class="cell chat-billing-small-Btn"><span class="action" onclick="cancelHireButtonClicked(\'By clicking this, you are going to cancel the rate proposed by Expert. Click OK to continue.\', \''+g+"','You have canceled the rate sent from Expert. You may indicate your interest over chat and hire him again by clicking on the Hire button.')\">Cancel</span></div></div></div></div>";return f;}function cancelHireButtonClicked(c,b,d){var a='<div style="width: 557px; height: auto;">';a+='<table id="corner_dialog_table0" align="center" class="corner_dialog_table" style="width: 100%; height: auto;">';a+="<tr>";a+='<td class="corner_topleft_green"></td>';a+='<td class="corner_topborder_green"></td>';a+='<td class="corner_topright_grn"></td>';a+="</tr>";a+="<tr>";a+='<td class="corner_borderleft_green"></td>';a+='<td id="corner_content_grn0" class="corner_content_grn">';a+='<div id="checkoutid"style="width: 100%; height: auto;">';a+='<div class="popup-header global-bg-color" style="position:relative; width:539px; margin-left:-10px; margin-top:-10px;">';a+='<div style="font-size:14px;">';a+="Cancel Service?";a+='<div style="cursor: pointer; position: absolute; font-size: 9px; font-weight: bold; right: 10px; width: auto; top: 10px;">';a+="</div>";a+="</div>";a+="</div>";a+='<div id="CashierInnerDiv">';a+='<div class="row" style="padding-top:10px;"><div class="cell nml_bluetxt" style="width:100%;text-align:left;">'+c+"</div></div>";a+='<div class="row" style="padding-top:20px; height:40px;">';a+='<div class="cell" style="width:110px; margin-left: 140px;">';a+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="cancelHire(\''+b+"','"+d+"');closecommonconn();\">";a+="OK";a+="</a>";a+="</div>";a+='<div class="cell" style="width:110px;">';a+='<a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick="closecommonconn();">';a+="Cancel";a+="</a>";a+="</div>";a+="</div>";a+="</div>";a+="</div>";a+="</td>";a+='<td class="corner_border_right_grn"></td>';a+="</tr>";a+="<tr>";a+='<td class="corner_bottomleft_grn"></td>';a+='<td class="corner_border_bottom_grn"></td>';a+='<td class="corner_bottomright_grn"></td>';a+="</tr>";a+="</table>";a+="</div>";lid="ConnectionPopUp";commoncallback(a,"ConnectionPopUp");}function updateRateUI(g,c){var a=c+"BillingRoot";var d=document.getElementById(a);var b="";var f=document.getElementById(c+"RdoPerMin");if(f&&f.checked){b="pm";}else{b="fix";}if(g.checked){d.innerHTML=getRateUIWithNego(c,xPackets[c],b);}else{d.innerHTML=getRateUI(c,xPackets[c],b);}}function updateRateInfo(a,c,b){document.getElementById(a).innerHTML="<span>"+c+' :</span>&nbsp;<span style="color:#004080;">'+b+" $</span>";}function getServiceUIForExpert(h,o,m){var k=h+"BillingRoot";var p=h+"agree";var a=h+"timer";var d=h+"TimerId";var c=h+"EarnedEzdia";var j=h+"Earned";var l=h+"msgDiv";var q=h+"pause";var b=h+"stop";var g=h+"resume";var f='<div class="ChatBilling_header_nav">';f+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",h)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';f+="</div>";f+='<div class="base_bg_holder">'+'<div class="rimd" style="height:auto;">'+'<div align="center" class="hbE">You are hired by Explorer for following cost</div>';if(o.getAttribute("t")=="fix"){f+='<div align="center" style="padding:5px; padding-top:0;"><span style="color:#666;">Fix Rate :</span>&nbsp;<span>'+o.getAttribute("fr")+" $</span></div>";}else{f+='<div align="center" style="padding:5px; padding-top:0;"><span style="color:#666;">Rate/Min :</span>&nbsp;<span>'+o.getAttribute("vr")+" $</span></div>";}f+="</div>"+'<div class="thd" style="border-top:1px solid #E5E5E5; text-align:center; padding-top:10px;"> Duration : '+'<b id="'+d+'">00:00</b> &nbsp;'+"&nbsp;mm:ss"+"</div>"+'<div class="row thd" style="height:70px;">'+'<div class="cell eMtxt">Earned Money :</div>'+'<div class="cell emCounter" id="'+j+'">'+((o.getAttribute("t")=="fix")?"0.00":"0.00")+" $</div>"+"</div>";if(m){f+='<div class="row enableButton">'+'<div class="cell cell-search-btn4" id="'+q+'" style="display:block"><span class="action" onclick="requestPauseService(\''+h+'\')" style="color:#FF3300;">Pause Service</span></div>'+'<div class="cell cell-search-btn4" id="'+g+'" style="display:none"><span class="action" onclick="resumeService(\''+h+'\')" style="color:#330099;">Resume Service</span></div>'+'<div class="cell cell-search-btn4" id="'+b+'" style="display:block"><span class="action" onclick="stopService(\''+h+'\', false)" style="color:#FF0033;">Stop Service</span></div>'+"</div>";}f+="</div>";return f;}function getServiceUI(h,o){var l=h+"BillingRoot";var p=h+"agree";var a=h+"timer";var d=h+"TimerId";var j=h+"start";var q=h+"pause";var c=h+"stop";var g=h+"resume";var m=h+"msgDiv";var b=h+"AvalBalance";var k=h+"timeAvailable";var f='<div class="ChatBilling_header_nav">';f+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",h)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';f+="</div>";f+='<div class="base_bg_holder">'+'<div class="rimd" style="height:auto;">'+'<div align="center" class="hbE">You have hired Expert for following cost</div>';if(o.getAttribute("t")=="pm"){f+='<div align="center" style="padding:5px; padding-top:0;"><span style="color:#666;">Rate/Min :</span>&nbsp;<span>'+o.getAttribute("vr")+" $</span></div>";}else{f+='<div align="center" style="padding:5px; padding-top:0;"><span style="color:#666;">Fix Rate :</span>&nbsp;<span>'+o.getAttribute("fr")+" $</span></div>";}f+="</div>";f+='<div class="row thd" style="border-top:1px solid #E5E5E5;">';f+='<div class="cell" style="padding-left:8px; width:92px;">Available Balance :</div>';f+='<div class="cell" style="width:105px;"><b id="'+b+'">'+myBalance+" $</b></div>";f+="<div class=\"cell afl\" onClick=\"showcommondiv('AddFund.do', 'ConnectionPopUp','ConnectionPopUp');currentWinRemoteUserId="+h+';">Add funds</div></div>';if(o.getAttribute("t")=="pm"){f+='<div class="row thd">'+'<div class="cell" style="width: 200px; padding-left: 23px;">Time Available : '+'<span style="font-weight:bold;">&nbsp;<span id="'+k+'">'+getTimeAvailableBeforeStartService(o.getAttribute("vr"))+"</span>&nbsp;mins</span></div>";}f+='<div class="row thd" style="height:80px">'+'<div class="cell eMtxt" style="width:50px;">Duration :</div>'+'<div class="cell emCounter"><span id="'+d+'">00:00:00</span>'+'<div class="emTimer">hh : mm : ss</div></div></div>';f+='<div class="row enableButton">'+'<div class="cell cell-search-btn4" id="'+j+'"><span class="action" onclick="startService(\''+h+'\')" style="color:#76AE31;">Start Service</span></div>'+'<div class="cell cell-search-btn4" id="'+q+'" style="display:none"><span class="action" onclick="requestPauseService(\''+h+'\')" style="color:#FF3300;">Pause Service</span></div>'+'<div class="cell cell-search-btn4" id="'+g+'" style="display:none"><span class="action" onclick="resumeService(\''+h+'\')" style="color:#330099;">Resume Service</span></div>'+'<div class="cell cell-search-btn4" id="'+c+'" slyle="display:none"><span class="action" id="'+c+'span" onclick="stopService(\''+h+'\',false)" style="color:gray;">Stop Service</span></div>'+"</div></div>";return f;}function getTimeAvailableBeforeStartService(c){try{var a=parseFloat(c);var b=myBalance/a;return roundNumber(b,0)+":00";}catch(d){return"--:--";}}function getSummaryInfo(c,d,f,a){var b='<div class="ChatBilling_header_nav">';b+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",c)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';b+="</div>";b+='<div class="base_bg_holder">'+'<div class="thd" style="height: auto;">'+'<div class="rimd" style="height:auto; margin: 0px 4px 4px;">'+'<div align="center" class="hbE">Successfully completed the service.</div>'+'<div align="right" class="fwt"><span>Served time:</span>&nbsp;<span>'+d+"</span>&nbsp;<span>min</span></div>"+'<div align="right" class="fwt"><span>Deducted amount from account:</span>&nbsp;<span>'+roundNumber(f,2)+"</span><span>$</span></div>"+'<div align="right" class="fwt"><span>Available Balance :</span>&nbsp;<b>'+roundNumber(a,2)+"</b>&nbsp;<b>$</b></div><br>"+"</div>"+"</div>"+'<div class="row" style="margin-left: 140px; width: 175px;">'+'<div class="cell chat-billing-small-Btn"><span class="action" onclick="showFeedBackForm(\''+c+"')\">Next</span></div>"+"</div>"+"</div>";return b;}function getSummaryInfoForExpert(c,d,f,a){var b='<div class="ChatBilling_header_nav">';b+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",c)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Billing</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';b+="</div>";b+='<div class="base_bg_holder">'+'<div class="thd" style="height: auto;">'+'<div class="rimd" style="height:auto; margin: 0px 4px 4px;">'+'<div align="center" class="hbE">Successfully completed the service.</div>'+'<div align="right" class="fwt"><span>Served time:</span>&nbsp;<span>'+d+"</span>&nbsp;<span>min</span></div>"+'<div align="right" class="fwt"><span>Earned Amount:</span>&nbsp;&nbsp;<span>'+roundNumber(f,2)+"</span><span>$</span></div>"+'<div align="right" class="fwt"><span>Available Balance :</span>&nbsp;<b>'+roundNumber(a,2)+"</b>&nbsp;<b>$</b></div><br>"+"</div>"+"</div>"+'<div class="row" style="margin-left: 140px; width: 175px;">'+'<div class="cell chat-billing-small-Btn"><span class="action" onclick="showFeedBackForm(\''+c+"')\">Next</span></div>"+"</div>"+"</div>";return b;}function showFeedBackForm(b){var a=b+"BillingRoot";var c=document.getElementById(a);c.innerHTML=getFeedbackUIForm(b,"Service");c.style.display="";}function getFeedbackUIForm(c,a){var b='<div class="ChatBilling_header_nav">';b+='<table align="right" width="340" cellpadding="0" cellspacing="0"><tr><td width="5"><img src="'+PRESENCE_SERVICE_URL.replace("$uid$",c)+"&rnd="+Math.random()+'" /></td><td class="topUserName" width="300">Feedback</td><td><table align="center" width="12"><tr><td>&nbsp;</td></tr></table></td></tr></table>';b+="</div>";b+='<div class="base_bg_holder">'+'<div class="thd" style="height: auto;">'+'<div class="rimd" style="height:auto; margin: 0px 4px 4px;">'+'<div class="ChatBilling_sendRate_txt">Give Reviews for the '+a+"</div>"+'<div id="BillingErrorMess" class="msgYellow chatErrorDisplay" style="display:none;"></div>'+'<div style="font-weight: bold; padding-left: 20px;">Over all Service</div>'+'<div class="row" style="height:15px;">'+'<div class="cell fct"><input type="radio" id="'+c+'rating5" name="'+c+'rating"></div>'+'<div class="cell" style="width:55px;">Excellent</div>'+'<div class="cell fct"><input type="radio" id="'+c+'rating4" name="'+c+'rating"></div>'+'<div class="cell" style="width:65px;">Very Good</div>'+'<div class="cell fct"><input type="radio" id="'+c+'rating3" name="'+c+'rating"></div>'+'<div class="cell" style="width:45px;">Good</div>'+"</div>"+'<div class="row" style="height:25px;">'+'<div class="cell fct"><input type="radio" id="'+c+'rating2" name="'+c+'rating"></div>'+'<div class="cell" style="width:55px;">Average</div>'+'<div class="cell fct"><input type="radio" id="'+c+'rating1" name="'+c+'rating"></div>'+'<div class="cell" style="width:45px;">Poor</div>'+"</div>"+"</div>"+"</div>"+'<div class="fcct">Other Comments</div>'+'<div align="center"><textarea cols="45" rows="3" id="'+c+'FeedbackText"></textarea></div>'+'<div class="row" style="width:295px;">'+'<div class="cell" style="padding-left: 90px; width: 116px;">'+'<div class="blueBtn"><span class="action" onclick="closeFeedBackForm(true, \''+c+"')\">Submit & Close</span></div>"+"</div>"+'<div class="cell" style="width: 80px; padding-top: 10px; margin:0"><a href="javascript:void(0)" style="text-decoration:underline;" onclick="closeFeedBackForm(false, \''+c+"')\">Review Later</a></div>"+"</div>"+"</div>";return b;}function closeFeedBackForm(d,c){if(d){var f=-1;if(document.getElementById(c+"rating5").checked){f=5;}else{if(document.getElementById(c+"rating4").checked){f=4;}else{if(document.getElementById(c+"rating3").checked){f=3;}else{if(document.getElementById(c+"rating2").checked){f=2;}else{if(document.getElementById(c+"rating1").checked){f=1;}}}}}if(f==-1){document.getElementById("BillingErrorMess").style.display="";document.getElementById("BillingErrorMess").innerHTML="Please select rating to this service.";window.setTimeout('cleardiv("BillingErrorMess")',5000);return;}var a=document.getElementById(c+"FeedbackText").value;addInfoToChatWindow(c,'<div class="chatuseragree">Thanks for your feedback.</div>');chatFeedBackWebHit(otherUserId,f,a,"noDiv");}var b=c+"BillingRoot";var g=document.getElementById(b);g.style.display="none";}function move(d,b){var c=document.getElementById(d);var a=document.getElementById(b);Drag.init(c,a);}onerror=function(a){if(typeof(con)!="undefined"&&con.connected()){}return false;};onunload=function(){if(typeof(con)!="undefined"){if(con._hold){(new JSJaCCookie("btype","binding")).write();}else{(new JSJaCCookie("btype","polling")).write();}if(con.suspend){con.suspend();}}};var iCordX=0,iCordY=0;function resizeChatWindow(b){var a=b+"msgArea";var f=b+"inputArea";var g=b+"chatBody";var c=b+"pane";var d=b+"Root";if(document.getElementById(d).style.height!="0px"){document.getElementById(f).style.display="none";document.getElementById(a).style.display="none";document.getElementById(g).style.display="none";document.getElementById(c).style.display="none";document.getElementById(d).style.height="0px";return;}document.getElementById(d).style.height="262px";document.getElementById(f).style.display="";document.getElementById(a).style.display="";document.getElementById(g).style.display="";document.getElementById(c).style.display="";}function openChatWindow(x,P,G,I,o,H,l,d){if(arDhtmlWindows[x]){arDhtmlWindows[x].show(arDhtmlWindows[x]);return;}var y="";if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="chat:"+x+":"+P+":"+G+":"+I;}else{if(G==undefined){checkInChatGroup(x);G=chatwith;}if(!checkInChatGroup2(x)){getUserData2("getUserData.do",x,0);}lastMessageSenderName[x]="";var f=P;var g=x+"Root";var r=x+"pane";var N=x+"move";var R=x+"msgArea";var J=x+"inputArea";var p=x+"minIcon";var E=x+"chatBody";var k=x+"BillingRoot";var c=x+"stopBtn";var a=x+"hireBtn";hire1=x+"BillingTop";var u=x+"agree";var q=x+"agree2";var D=x+"agreeFunds";var B="../static/images/newUserImg.png";var A=x+"status";var L=x+"formArea";var C=H;var v=l;var z=u+"timer";var T=z+"seconds";var s=z+"display";var F=x+"msgDiv";var M=x+"checkBox";var m=x+"checkBoxError";var K=x+"rateSession";if(document.getElementById(g)){document.getElementById(g).style.display="";return;}var O=login_user+"availableBalance";var w=x+"rpm";var Q=x+"fixedRate";var j=x+"MoveDiv";var b=x+"divwin";y+='<div id="'+g+'" >';y+='<div id="'+r+'" class="mainChatWinBG">';y+='<div id="UserDetailsDiv">';y+='<div id="UserNameDiv">';y+='<h1 style="font-size: 12px;">'+G+"</h1></div>";y+='<div id="UserCompanyDetail">';if(C&&C!="undefined"){y+=""+C+" <br />";}if(v&&v!="undefined"){y+=""+v+"";}y+="</div>";y+='<div id="UserImage">';if(I){y+='<img alt="" src="'+I+'" height="60"/></div>';}else{y+='<img alt="" src="'+B+'" width="60" height="67"/></div>';}if(o&&o!=""&&o!="undefined"){y+='<div id="skypeImage"><a href="skype:'+o+'?call"/><img src="../static/images/skype.png" border="0" alt="skype"/></a></div>';}else{y+='<div id="skypeImage"><img src="../static/images/noskype.png" border="0" alt="skype"/></div>';}if(!chatFlag){y+='<div id="'+a+'" class="hireBtn"><a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=openRequestUIForHire("'+x+'")>Hire</a></div>';y+='<div id="'+c+'" class="hireBtn" style="display:none;"><a href="javascript:void(0)" class="global-button global-color small-button-padding" onclick=stopService("'+x+'",false)>Stop</a></div>';}y+="</div>";y+='<div id="'+E+'" class="ChatBody"></div>';y+='<div id="'+J+'" class="ChatArea">';y+='<textarea id="'+R+'" name="msg" class="userstxt" style="width: 330px; border:1px solid #FFF; height:1.4em;" onKeyPress="sendMsg(this, event, \''+x+"')\" /></textarea>";y+="</div>";y+="</div>";y+='<div id="'+k+'" class="ChatBillingBG" style="display:none;">';y+="</div>";var h=document.getElementById("chatwindow");if(h!=null){h.innerHTML+=y;}var S;if(d){S=d.clientY-20;}else{S=100;}b=dhtmlwindow.open(j,"div",g,G,"width=354px,height=254px,left=200px,top="+S+"px,scrolling=1,userid="+x);arDhtmlWindows[x]=b;b.onclose=function(){h.innerHTML=" ";return true;};}addTrackEvent("button","chat","open");updateWindowHeightWidth();}function cancelEventBubbeling(a){if(document.all){a=event;}a.cancelBubble=true;if(window.ActiveXObject){event.returnValue=false;}else{a.preventDefault();}}function clearUserBalanceChecker(){if(balCheckTimer!=null){clearTimeout(balCheckTimer);balCheckTimer=null;}}function startUserBalanceChecker(){getUserAccountBalance(currentWinRemoteUserId);balCheckTimer=setTimeout("startUserBalanceChecker()",15000);}function checkInChatGroup(a,h){var f="";var d;var c=new Date();for(d=0;d<ChatUsers.length;d++){if(ChatUsers[d].userid==a){chatwith=ChatUsers[d].name;company1=ChatUsers[d].company;position1=ChatUsers[d].position;skypeid1=ChatUsers[d].skypeid;if(h.getFromJID()!=null){var g=a+"chatBody";var b=document.getElementById(g);if(!b){initialJSJaCMessage=h;getUserThumbnail("getUserImage.do",a);}if(h){processXMPPMessage(chatwith,h);}}return true;break;}}return false;}function getUserData(c,a,d,b){initialJSJaCMessage=d;showResultWithQueryStr1(c,null,callbackuserdataforchat,"uid="+escape(a));return true;}function getUserThumbnail(b,a){showResultWithQueryStr1(b,null,callbackuserthumbnail,"uid="+escape(a));return true;}function getUserData2(c,a,b){showResultWithQueryStr1(c,null,callbackuserpresence,"uid="+escape(a));return true;}function callbackuserdataforchat(response){var chatID;var result=eval("("+chattrim(response)+")");if(ChatUsers.length==0){ChatUsers[ChatUsers.length]=new ChatArray(result.username,result.firstname,result.company,result.position,result.skypeid);chatwith=result.firstname;position1=result.position;company1=result.company;skypeid1=result.skypeid;oDbg.log("Message :"+initialJSJaCMessage.getBody().htmlEnc());if(initialJSJaCMessage.getFromJID()!=null){chatID=document.getElementById(result.username+"chatBody");if(!chatID){getUserThumbnail("getUserImage.do",result.username);}else{processXMPPMessage(chatwith,initialJSJaCMessage);}}}else{ChatUsers[ChatUsers.length]=new ChatArray(result.username,result.firstname,result.company,result.position,result.skypeid);chatwith=result.firstname;position1=result.position;company1=result.company;skypeid1=result.skypeid;oDbg.log("Message :"+initialJSJaCMessage.getBody().htmlEnc());if(initialJSJaCMessage.getFromJID()!=null){chatID=document.getElementById(result.username+"chatBody");if(!chatID){getUserThumbnail("getUserImage.do",result.username);}}}}function callbackuserpresence(response){var chatBody;var result=eval("("+response+")");if(result.presence==0){chatBody=document.getElementById(result.username+"chatBody");if(chatBody){chatBody.innerHTML+="<br> User is not logged in for Chat or Hire <br>";}checkPresence=0;}else{ChatUsers[ChatUsers.lengh]=new ChatArray(result.username,result.firstname);chatwith=result.firstname;}}function callbackuserthumbnail(response){var result=eval("("+response+")");avtar1=result.image;openChatWindow(result.username,"",chatwith,avtar1,skypeid1,position1,company1);processXMPPMessage(chatwith,initialJSJaCMessage);}function checkInChatGroup2(a){if(ChatUsers.length>0){for(i=0;i<ChatUsers.length;i++){if(ChatUsers[i].userid==a){return true;}}return false;}return false;}var playSounds=true;var SOUNDS=new Object();SOUNDS["message_recv"]="../static/sounds/message1.mp3";SOUNDS["message_queue"]="../static/sounds/message_queue.swf";SOUNDS["chat_recv"]="../static/sounds/chat_recv.swf";SOUNDS["chat_queue"]="../static/sounds/chat_queue.swf";SOUNDS["online"]="../static/sounds/online.swf";SOUNDS["offline"]="../static/sounds/offline.swf";SOUNDS["startup"]="../static/sounds/startup.swf";SOUNDS["connected"]="../static/sounds/connected.swf";function playSound(d){try{var a=frames["sound_iframe"].document;var c='<embed src="'+SOUNDS[d]+'" width="1" height="1" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash">';a.open();a.write(c);a.close();}catch(b){}}function roundNumber(b,c){var a=Math.round(b*Math.pow(10,c))/Math.pow(10,c);return a;}function getMyExpertise(a){showResultWithQueryStr1("getChatExpertise.do",a,getMyExpertise_Callback,null);}function getMyExpertise_Callback(result,pid){jsonString=eval("("+chattrim(result)+")");var j=jsonString.length;var k;var carCombo=document.getElementById(pid);if(j==1&&jsonString[0].category_id=="0"){carCombo.options[0]=new Option("Technology and Computer","0");carCombo.selectedIndex=0;return;}else{if(carCombo){for(var i=0;i<jsonString.length;i++){if(jsonString[i].category_id=="Select Category..."){k=i;}carCombo.options[i]=new Option(jsonString[i].category_id,jsonString[i].rpm);}carCombo.selectedIndex=k;}}if(carCombo.options.length==0){carCombo.options[0]=new Option("Technology and Computer","0");}}function getUserAccountBalance(a){showResultWithQueryStr1("getUserAmount.do",a,getUserAccountBalance_Callback,null,true,false);}function getUserAccountBalance_Callback(result,pid){jsonString=eval("("+chattrim(result)+")");var i=jsonString.length;if(i==1){try{var myBalance1=roundNumber(parseFloat(jsonString[0].totaldollars),2);if(myBalance!=myBalance1&&balCheckTimer!=null){clearUserBalanceChecker();}myBalance=myBalance1;var AvalBalance=document.getElementById(currentWinRemoteUserId+"AvalBalance");if(AvalBalance){AvalBalance.innerHTML=myBalance+"&nbsp;$";}}catch(ex){}}return;}function initiateOnAgree(j,c,d,a){var h=c;var g=d;var b=a;var f="e="+h+"&r="+g+"&rt="+b;showResultWithQueryStr1("agreeForChat.do",j,initiateOnAgree_CallBack,f);}var remark_transid;function initiateOnAgree_CallBack(result,pid){jsonString=eval("("+result+")");var i=jsonString.length;if(i==1){remark_transid=jsonString[0].transid;xBillingData[pid].billingTranId=jsonString[0].transid;}return;}function chatBillingEvent(g,d,b,c,a){var f;if(d==0){f="ev="+d+"&tid="+xBillingData[g].billingTranId;}else{if(d==1){f="ev="+d+"&tid="+xBillingData[g].billingTranId+"&dt="+(ms/1000/60)+"&e="+b+"&r="+c+"&rt="+a;}else{if(d==2){f="ev="+d+"&tid="+xBillingData[g].billingTranId+"&dt="+(ms/1000/60);}else{if(d==3){f="ev="+d+"&tid="+xBillingData[g].billingTranId;}else{if(d==4){f="ev="+d+"&tid="+xBillingData[g].billingTranId;}else{if(d==5){f="ev="+d+"&tid="+xBillingData[g].billingTranId+"&dt="+(ms/1000/60);}}}}}}showResultWithQueryStr1("chatEventHandler.do",g,chatBillingEvent_CallBack,f);}function chatBillingEvent_CallBack(result,pid){jsonString=eval("("+result+")");var i=jsonString.length;if(i==1&&jsonString[i-1].response){var resp=jsonString[i-1].response;if(resp=="success"){}else{if(resp=="fail"){}}}else{}return;}function chatFeedBackWebHit(b,c,a,f){var d="user="+b+"&skillid=0&rating="+escape(c)+"&type=chat&remark="+remark_transid+"&review="+escape(a);showResultWithQueryStr("checkfeedback.do",f,commoncallback,d,true);}function chatFeedBack_CallBack(a,b){}function showIframe(c,b){var a='<div id="iframeResult" style="background:#FFFFFF; border:1px solid #80A0C0; position: relative; width: 610px; height: 300px; z-index: 50; left: 0px; top: 0px;">';a+='<div id="closeimg" class="closetextreg" onclick="closeIframe(\''+c+"','iframeResult')\" style=\"cursor:pointer; position: absolute; width: 50px; height: 15px; z-index: 3; left: 565px; top: 3px; \">";a+="Close X</div>";a+='<iframe style="position: absolute;top: 50px; height: 250px; width: 610px;border: none;" src="'+b+'"/>';document.getElementById(c).innerHTML="";document.getElementById(c).innerHTML=a;}function closeIframe(b,c){var a=document.getElementById(c);a.style.display="none";a.getElementsByTagName("iframe").src="";a.innerHTML="";document.getElementById(b).removeChild(a);}function showVideos(b,f,d,c){var a=document.getElementById(d).style.display;if(a=="none"){document.getElementById(d).style.display="";document.getElementById(c).style.display="";document.getElementById(d).style.width="300px";document.getElementById(d).style.height="200px";document.getElementById(c).style.width="300px";document.getElementById(c).style.height="180px";document.getElementById(f).style.height="350px";document.getElementById(d).innerHTML=contentstr[b].contenturl;}else{document.getElementById(d).style.display="none";document.getElementById(c).style.display="none";document.getElementById(d).style.width="0px";document.getElementById(d).style.height="0px";document.getElementById(c).style.width="0px";document.getElementById(c).style.height="0px";document.getElementById(f).style.height="auto";}}function showPostLinkDescp(b,a){if(b=="describetxtlabelexpert"){document.getElementById("describetxtlabelexpert").style.display="";document.getElementById("describetxtlabelexplorer").style.display="none";document.getElementById(a).style.display="";document.getElementById("category_expert").disabled="";}else{if(b=="describetxtlabelexplorer"){document.getElementById("describetxtlabelexplorer").style.display="";document.getElementById("describetxtlabelexpert").style.display="none";document.getElementById(a).style.display="none";document.getElementById("category_expert").disabled="true";}}}function insertContent(d,m,o){var w=document.getElementById("contenturl").value;var l=document.getElementById("contentlang").value;var f;var k=document.getElementById("contentname").value;var c=document.getElementById("contentdescription").value;var s=setDropDownValue(document.getElementById("catlevel1"))+"#"+setDropDownValue(document.getElementById("catlevel2"))+"#"+setDropDownValue(document.getElementById("catlevel3"));var b=document.getElementById("category_expert").checked;var g=document.getElementsByName("contentdifficulty");var a=getCheckedValue(g);var p=document.getElementById("contentkeywords").value;document.getElementById("errorContent").innerHTML="";w=extractURL(w);if(w!=""){document.getElementById("contenturlcheck").innerHTML="";}else{document.getElementById("contenturlcheck").innerHTML='<div><img alt="" src="'+contextRoot+'/static/images/error.png"></div><div style=" margin-top: -30px; padding-left: 25px; position: absolute; color:#990000;">Invalid or Empty URL. At present we support only YouTube/SlideShare video URLs/Embed XML</div>';return false;}for(var u=1;u<=3;u++){var q=o+u;if(document.getElementById(q).checked){f=document.getElementById(q).value;}}if(a==""){a=2;}if(k=="Write an accurate and meaningful Title for the content"){document.getElementById("errorContent").style.display="";document.getElementById("errorContent").innerHTML="Please enter a title";document.getElementById("contentname").focus();return false;}else{if(c=="Enter detailed description of the content, as often people don't understand just from the title"){document.getElementById("errorContent").style.display="";document.getElementById("errorContent").innerHTML="Please add some description about this content";document.getElementById("contentdescription").focus();return false;}else{if(s=="##"||document.getElementById("catlevel2").value==""||document.getElementById("catlevel3").value==""){document.getElementById("errorContent").style.display="";document.getElementById("errorContent").innerHTML="Please select the suitable categories";return false;}else{if(p=="Enter tags related to the content, so others can find them easily"){document.getElementById("errorContent").style.display="";document.getElementById("errorContent").innerHTML="Please enter some tags separated by comma";document.getElementById("contentkeywords").focus();return false;}else{var h=d;var v="content_url="+escape(w)+"&content_name="+escape(k)+"&category="+escape(s)+"&description="+escape(c)+"&keywords="+escape(p)+"&category_expert="+escape(b)+"&content_difficulty="+a+"&content_lang="+escape(l)+"&content_type="+escape(f);var x=contentInserted;var r=m;if(login_user==null||login_user==""){ModalPopup.Close("PostLinkPopUp","1");ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="postcontent:"+h+":"+v;document.getElementById("regRedirect").value="postcontent:"+h+":"+v;}else{fetchServerResponse(h,v,x,r);ModalPopup.Close("PostLinkPopUp","1");MyContent("KBSearch.do","2","Content",2,"MyNetwork",username);}return true;}}}}}function postContent(d,c,b){var a=contentInserted;var f=b;fetchServerResponse(d,c,a,f);}function getVideoList(f,d){var a=document.getElementById("search_str").value;if(a==""){document.getElementById("search_str_check").innerHTML="";document.getElementById("search_str_check").innerHTML="Enter a search string";return false;}else{document.getElementById("search_str_check").innerHTML="";}var c=f;var b=videoList;var g="search_str="+escape(a);fetchServerResponse(c,g,b,d);return true;}function contentInserted(o,f){var l,a;var m=o.split("####")[0];var k=o.split("####")[1];var c=o.split("####")[2];var h=o.split("####")[3];var j=o.split("####")[4];var b=o.split("####")[5];var d=o.split("####")[6];if(d==0){l=0;a=1;}else{if(d==1){l=1;a=0;}}var g='["'+b+'"]';clearErrorMessage();m+="<span class=\"action\" style='color:#990000; margin-left:5px;' onclick=\"showContentFromIndex('"+contextRoot+"/jsp/ContentHome.jsp?id="+j+"&searchId=1&source=ezdia&content_url="+c+'\',\'ConnectionPopUp\',\'ConnectionPopUp\')" >View your content</span><img hspace="5" title="Forward" src="../static/images/forwardIcon.png" alt="Forward"/><span class="action" onclick="showcommondiv('+"'ForwardContent.jsp?isForward=true&flag=content&content_name="+escape(k)+"&content_url="+escape(c)+"&content_type="+h+"&id="+j+"&category_name="+escape(g)+"&expert_users="+l+"&explorer_users="+a+"&actual_url="+escape(c)+"','ConnectionPopUp',"+"'ConnectionPopUp');\">Forward</span>";setErrorMessage(m,1);}function contentList(result,divname){var video_lst=eval("("+result+")");var i=0;var outputstr='<div id="videotab" onclick=showMessageResult("../jsp/learning3.jsp","mainvideodiv","") class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 49px; height: 16px; z-index: 19; left: 296px; top: 10px; cursor: pointer; text-decoration: none; ">';outputstr+="Videos</div>";outputstr+='<div id="learningtab0" class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 49px; height: 16px; z-index: 19; left: 562px; top: -8px; cursor: pointer; text-decoration: none;">';outputstr+="Favorite</div>";outputstr+='<div id="learningtab" onclick=showMessageResult("../jsp/learning2.jsp","mainvideodiv","") class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 98px; height: 16px; z-index: 19; left: 463px; top: -26px; cursor: pointer; text-decoration: none;">';outputstr+="Learning Buddy</div>";outputstr+='<div id="experttab" class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 58px; height: 16px; z-index: 19; left: 404px; top: -44px; cursor: pointer; text-decoration: none;">';outputstr+="Experts</div>";outputstr+='<div id="articletab" class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 57px; height: 16px; z-index: 19; left: 346px; top: -62px; cursor: pointer; text-decoration: none;">';outputstr+="Articles</div>";outputstr+='<div id="alltab" onclick=showMessageResult("../jsp/learning1.jsp","learning_div2","") class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 40px; height: 16px; z-index: 19; left: 255px; top: -80px; cursor: pointer; text-decoration: none;background-color: #336699; color: #FFFFFF;">';outputstr+="All</div>";outputstr+='<div id="topline2"style="background:#e6e6e6; position: relative; width: 430px; height: 1px; z-index: 8; left: 209px; top: -81px; ">';outputstr+="</div>";outputstr+='<div id="mainvideodiv" style="position: relative; width: 624px; height: auto; z-index: 20; left: 5px; top: -75px">';outputstr+='<div id="videos" class="learning_video_subheading " style="position: relative; width: 55px; height: 19px; z-index: 6; left: 30px; top: -10px;">Videos</div>';for(i=0;i<video_lst.length;i++){contentstr[i]=new UserContent('<object width="300" height="200" align="center"><param name="movie" value="'+video_lst[i].location+'&fs=1"></param><param name="wmode" value="transparent"></param><param name="allowFullScreen" value="true"></param><embed src="'+video_lst[i].location+'&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="transparent" width="300" height="200"></embed></object>');outputstr+='       <div id="v1'+i+'" style="position: relative; width: 620px; height: auto; z-index: 9; left: 0px; top: 0px;">';outputstr+='  <div id="videoicon1" style="cursor:pointer;position: relative; width: 35px; height: 35px; z-index: 1; left: 20px; top: 5px">';outputstr+='  <img alt="image1" onclick=getEmbedURLs("'+i+'","v1'+i+'","v2'+i+'","v3'+i+'","vt'+i+'") height="37" src="../static/images/videosmallicon.jpg" width="37" /></div>';outputstr+='  <div id="layer23" class="learning_search_title" style="position: relative; width: 232px; height: 16px; z-index: 2; left: 60px; top: -28px">';outputstr+="  <b> "+video_lst[i].name+"</b></div>";outputstr+='  <div id="introCategory3" style="position: relative; width: 120px; height: 90px; z-index: 3; left: 76px; top:-30px">';outputstr+='      <span class="learning_video_selection">'+video_lst[i].description+"<br />";outputstr+='      Author</span><br class="learning_video_selection" />';outputstr+='     <span class="learning_video_selection">'+video_lst[i].description+'</span><br class="learning_video_selection" />';outputstr+='     <span class="learning_video_selection">Number of hits </span><br/>';outputstr+='     <span class="learning_video_selection">Reviews </span><br/>';outputstr+='     <span class="learning_video_selection">'+video_lst[i].experts+" Experts of this video</span>";outputstr+="</div>";outputstr+='  <div id="intromenu1" class="learning_video_title1" style="position: relative; width: 237px; height: 15px; z-index: 4; left: 210px; top: -40px">';outputstr+='  <span class="action" onclick=addExpert("addExpert.do",'+video_lst[i].content_id+',"experts'+i+'")>Add as Expert</span> | Read article | Refer a friend | Read later </div>';outputstr+='  <div id="expertlist1"  class="learning_video_title1" style="position: relative; width: 60px; height: 13px; z-index: 5; left: 520px; top: -145px">';outputstr+='  <span class="action" onclick=getExperts("experts.do",'+video_lst[i].content_id+',"experts'+i+'")>Expert List</span></div>';outputstr+='  <div id="experts'+i+'"  class="learning_video_title1" style="position: relative; width: 100px; height: 13px; z-index: 5; left: 520px; top: -145px"></div>';outputstr+='  <div id="v2'+i+'" align="center" style="position: relative;top:-40px;width:0px;height:0px;left:170px;z-index: 3;">';outputstr+="</div>";outputstr+='  <div id="v3'+i+'" align="center" style="background-color:white;opacity: .05;filter: alpha(opacity=1);position: relative;top:-242px;width:0px;height:0px;left:170px;z-index: 20;">';outputstr+="</div>";outputstr+=' <div id="vt'+i+'" style="background: #e6e6e6; position: relative; width: 623px; height: 2px; z-index: 8; left: -3px; top:-40px; ">';outputstr+="  </div>";outputstr+="</div>";}outputstr+="</div>";document.getElementById(divname).innerHTML="";document.getElementById(divname).innerHTML=outputstr;}function getExperts(d,g,c){var b=d;var a=listExperts;var f="contentId="+escape(g);fetchServerResponse(b,f,a,c);}function listExperts(result,divname){var jsonContent=eval("("+result+")");var i=0;var output="";var top1=115;for(i=0;i<jsonContent.length;i++){if(jsonContent[i].response){output+=jsonContent[i].response;}else{ExpertsList[jsonContent[i].username]=new UserInfo(jsonContent[i].username,jsonContent[i].firstname,jsonContent[i].photo,jsonContent[i].summary,jsonContent[i].workarea,jsonContent[i].country,jsonContent[i].reviews,jsonContent[i].rating,jsonContent[i].rpm,jsonContent[i].category);output+='<div id="lul'+i+'" onmouseout=mclosetime() onmouseover=viewBusinessCard('+jsonContent[i].username+',"mulpv'+jsonContent[i].username+'",event,"lul'+i+'","expertiselist") style="cursor:pointer;position: relative; width: 150px; height: 15px; z-index: 1; left: 0px; top: 0px">';output+='<div id="mulpv'+jsonContent[i].username+'" onmouseout="mclosetime()" onmouseover="mcancelclosetime()" style="display:none;border: 1px solid #80A0C0; left:80px; position: absolute; width: 355px; height: 130px; z-index: 100; background-color: #FFFFFF; text-decoration: none;"></div>';output+=jsonContent[i].firstname;output+="</div>";top1+=15;}}document.getElementById(divname).innerHTML="";document.getElementById(divname).innerHTML=output;}function addExpert(d,g,c){var b=d;var a=listExperts;var f="contentId="+escape(g);fetchServerResponse(b,f,a,c);}function expertAdded(a,b){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML="expert added";}function extractURL(c){if(!c||c==""){return"";}var g=/^((http(s?))\:\/\/)?(www|[a-zA-Z]{2,6}).youtube.com\/.*v=([_0-9a-zA-Z-]*)/i;var a=new Array();a[0]=/^((http(s?))\:\/\/)?(www|[a-zA-Z]{2,6}).youtube.com\/v\/.*/i;a[1]=/^((http(s?))\:\/\/)?(www|[a-zA-Z]{2,6}).slideshare.net\/\w*\/\w+/i;var f=new Array();f[0]=/.*value="(http:\/\/(www|[a-zA-Z]{2,6}).youtube.com.*=.)"><\/param>.*/i;f[1]=/.*href="(http:\/\/(www|[a-zA-Z]{2,6}).slideshare.net\/\w*\/\w.*?src=embed)".*/i;var h=/^(((http(s?))|(ftp))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6})(\:[0-9]+)*(\/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-\(\)]+))*$/;var d=0;for(d=0;d<a.length;d++){if(a[d].test(c)){return c;}}var b=g.exec(c);if(b&&b[4]&&b[5]){return"http://"+b[4]+".youtube.com/v/"+b[5]+"&hl=en&fs=1";}for(d=0;d<f.length;d++){b=f[d].exec(c);if(b){return b[1];}}if(h.test(c)){return/^http.*/.exec(c)?c:("http://"+c);}return"";}function validateURLBox(b){if(b==1){var a=document.getElementById("contenturl").value;a=extractURL(a);if(a!=""){document.getElementById("contenturlcheck").innerHTML="";}else{document.getElementById("contenturlcheck").innerHTML='<div><img alt="" src="'+contextRoot+'/static/images/error.png"></div><div style=" margin-top: -30px; padding-left: 25px; position: absolute; color:#990000;">Invalid or Empty URL. At present we support only YouTube/SlideShare video URLs/Embed XML</div>';return;}}var d=contextRoot+"/jsp/contentExists.do";var c=contentExists;var g="content_url="+escape(a);var f="contenturlcheck";fetchServerResponse(d,g,c,f);}function contentExists(a,b){if(trim(a)=="1"){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML='<div><img alt="" src="'+contextRoot+'/static/images/error.png"></div><div style="padding-left: 25px; position: absolute; top: 24px; color:#990000;">Content Already Exists</div>';document.getElementById("submitcontent_btn").disabled=true;return true;}else{document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML='<div><img alt="" src="'+contextRoot+'/static/images/success.png"></div><div style="position: absolute; margin-top: -20px; padding-left: 25px; color: green;">New Content</div>';document.getElementById("submitcontent_btn").disabled=false;}getAreaAndFill("catlevel1");}function getPreview(a){e=a;var d=extractURL(document.getElementById("contenturl").value);var c=extractURL(d);var f="ConnectionPopUp";if(/.*slideshare.*/.test(c)){var b="previewURL.do?content_url="+escape(c);showResultWithQueryStr(b,f,showURLinPopup,null);return true;}else{showIframe(f,d);return true;}}function sortBySelectOptions(b){var a=document.getElementById(b);var f=a.options[a.selectedIndex].value;var h=window.location.search.replace("?","");var d=h.split("&");var g="?";for(var c=0;c<d.length;c++){if(d[c]==""||d[c].indexOf("sortBy=")!=-1){continue;}g+=d[c]+"&";}g+="sortBy="+f;window.location.href=window.location.pathname+g;}function withdrawFunds(c,j){pid=j;var u;var x=document.getElementById("amtAvailable");var g=document.getElementById("amtWithdraw");var l=document.getElementById("couponid").value;var y=document.getElementById("withdrawType");var p=y.options[y.selectedIndex].value;var s=document.getElementById("withdrawTypeID").value;var z=document.getElementById("nameOnChq");var o=document.getElementById("addressLineOne");var C=document.getElementById("addressLineTwo");var f=document.getElementById("cityInfo");var v=document.getElementById("pinInfo").value;var A=document.getElementById("countryInfo");var b=document.getElementById("stateInfo");var r=document.getElementById("phoneInfo");var B=document.getElementById("agreeInfo").checked;var h=/(^\d{6}$)|(^\d{6}-\d{4}$)/;var m=removeHyphen(r.value);document.getElementById("withdrawStatusMsg").innerHTML="";if(g==null||g.options[g.selectedIndex].value=="-1"){u="Select an amount to withdraw !";document.getElementById("amtWithdraw").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(g.value>parseInt(x.value)){u="Sorry !! You have less balance, So you can not withdraw more than your balance !!";document.getElementById("amtWithdraw").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(y==null||y.options[y.selectedIndex].value=="-1"){u="Select payment method !";document.getElementById("withdrawType").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(y.options[y.selectedIndex].value=="Paypal"||y.options[y.selectedIndex].value=="Google Checkout"){if(s==""){u="Input your "+p+" ID !";document.getElementById("withdrawTypeID").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}}else{if(y.options[y.selectedIndex].value=="Cheque"){if(z==null||z.value==""){u="Specify the Name on the cheque !";document.getElementById("nameOnChq").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}}}}}}if(o==null||o.value==""){u="Fill your address line 1 !";document.getElementById("addressLineOne").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(f==null||f.value==""){u="Fill your City !";document.getElementById("cityInfo").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if((v.length>10&&!h.test(v))){u="Invalid Pin code !";document.getElementById("pinInfo").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(IsNumeric(v)==false||v==""){u="Check your Pin code !";document.getElementById("pinInfo").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(A==null||A.options[A.selectedIndex].value=="Select Country"){u="Select your Country !";document.getElementById("countryInfo").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(m==""||!IsNumeric(m)){u="Please put your valid Contact number!";document.getElementById("phoneInfo").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}else{if(!B){u="Terms and Conditions should be checked !";document.getElementById("agreeInfo").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}}}}}}}var k=g.options[g.selectedIndex].value;if(k=="Other"){k=document.getElementById("OtherAmtWithdraw").value;var w=checkForFloat(k);if(w==false){u="Please input a valid amount (like 10 or 10.34) !";document.getElementById("OtherAmtWithdraw").focus();document.getElementById("withdrawStatusMsg").innerHTML=u;return false;}}var d=A.options[A.selectedIndex].value;var q=document.getElementById("OtherThenUS");if(d=="USA"){b=b.options[b.selectedIndex].value;}else{if(d!="USA"){b=q.value;}}var a="withdraw="+escape(k)+"&coupon="+escape(l)+"&paymentmethod="+escape(p)+"&checkoutid="+escape(s)+"&name="+escape(z.value)+"&address1="+escape(o.value)+"&address2="+escape(C.value)+"&city="+escape(f.value)+"&state="+escape(b)+"&country="+escape(A.options[A.selectedIndex].value)+"&pin="+escape(v)+"&contact="+escape(m);showResultWithQueryStr(c,j,callbackcommon,a);}function removeHyphen(a){return a.split("-").join("");}function postRequirement(f,h,g,c,w,d){var p;var x=document.getElementById("id");var k=document.getElementsByName("requirement_type");var F=document.getElementById("requirement_title");var z=document.getElementById("category");var j=document.getElementById("subcategory");var q=document.getElementById("sub_subcategory");var A=document.getElementById("description1");var l=document.getElementById("joburl");var b=document.getElementById("duration");var o=document.getElementById("Reqcheckbox").checked;var G=document.getElementById("budget");var v=document.getElementById("unit");var H=document.getElementById("expires");var D=document.getElementsByName("visibility");var u=document.getElementById("tags");var s=document.getElementById("skypeidproject");var m="";if(document.getElementById("assignExpert")){m=document.getElementById("assignExpert").value;}var E="";if(document.getElementById("assignRate")){E=document.getElementById("assignRate").value;}var y="";var a="";var r="";if(x.value!="-1"){r="U";x=x.value;}else{r="I";}for(var C=0;C<k.length;C++){if(k[C].checked){y=k[C].value;}}for(var C=0;C<D.length;C++){if(D[C].checked){a=D[C].value;}}document.getElementById("reqmsg").innerHTML="";if(F==null||F.value=="Write an accurate and meaningful Name for the project"){p="Project Name is empty !";document.getElementById("requirement_title").focus();errorMsgDisplay(p);return false;}else{if(F.value.length>85){p="Project Name should not be more then 85 characters.";document.getElementById("requirement_title").focus();errorMsgDisplay(p);return false;}else{if(z==null||z.options[z.selectedIndex].value=="-1"){p="Select a category !";document.getElementById("category").focus();errorMsgDisplay(p);return false;}else{if(j==null||j.options[j.selectedIndex].value==""||j.options[j.selectedIndex].value=="-1"){p="Select a subcategory !";document.getElementById("subcategory").focus();errorMsgDisplay(p);return false;}else{if(q==null||q.options[q.selectedIndex].value==""||q.options[q.selectedIndex].value=="-1"){p="Select a sub subcategory !";document.getElementById("sub_subcategory").focus();errorMsgDisplay(p);return false;}else{if(b.value!=null&&isNaN(b.value)&&y!="Full Time Job"){p="Please specify time duration in number of units !";errorMsgDisplay(p);document.getElementById("duration").focus();return false;}else{if(y!="Full Time Job"&&(v==null||v.selectedIndex=="0")){p="Select a Duration Type !";errorMsgDisplay(p);document.getElementById("unit").focus();return false;}else{if(y!="Full Time Job"&&(G==null||G.selectedIndex=="0")){p="Select a budget !";errorMsgDisplay(p);document.getElementById("budget").focus();return false;}else{if(H==null||H.selectedIndex=="0"){p="Select an expiration period !";errorMsgDisplay(p);document.getElementById("expires").focus();return false;}else{userId=g;if(r=="I"){projectMessage="POST_PROJECT";}if(r=="U"){projectMessage="UPDATE_PROJECT";}if(A.value=="Provide a detail description of what you are looking for"){A.value=null;}if(u.value=="You must have at least one Skill"){u.value="";}if(!o){p="Terms and conditions should be agreed !";errorMsgDisplay(p);document.getElementById("Reqcheckbox").focus();return false;}var B;if(y=="Full Time Job"){B="?requirement_type="+escape(y)+"&requirement_title="+escape(F.value)+"&category="+escape(z.value)+"&subcategory="+escape(j.value)+"&sub_subcategory="+escape(q.value)+"&description="+escape(A.value)+"&expires="+escape(H.value)+"&visibility="+escape(a)+"&tags="+escape(u.value)+"&operation="+r+"&id="+x+"&skypeid="+s.value;ajaxFileUpload(f+B);}else{B="?requirement_type="+escape(y)+"&requirement_title="+escape(F.value)+"&category="+escape(z.value)+"&subcategory="+escape(j.value)+"&sub_subcategory="+escape(q.value)+"&description="+escape(A.value)+"&duration="+escape(b.value)+"&unit="+escape(v.value)+"&budget="+escape(G.value)+"&expires="+escape(H.value)+"&visibility="+escape(a)+"&tags="+escape(u.value)+"&operation="+r+"&id="+x+"&skypeid="+s.value+"&assignExpert="+escape(m)+"&assignRate="+escape(E);if(login_user==null||login_user==""){ModalPopup("NewLoginpopupdiv","");document.getElementById("login_details").value="postproject:"+f+":"+B;document.getElementById("regRedirect").value="postproject:"+f+":"+B;document.getElementById("postSimilarProjectMsg").style.display="";window.setTimeout("document.getElementById('postSimilarProjectMsg').style.display = 'none'",9000);}else{ajaxFileUpload(f+B);}}return true;}}}}}}}}}}function addDetailsToProj(c,d,v){var g=document.getElementById("tags");var u=document.getElementById("budget");var w=document.getElementById("expires");var a=document.getElementById("duration");var h=document.getElementById("unit");var b=document.getElementById("description").value;var m=document.getElementById("description1");var k=m?m.value:"";userId=d;projectId=v;if(k.length>0){if(k=="Provide a detail description of what you are looking for"||k==""||k==null){document.getElementById("errorAddingProjectDetails").innerHTML="Detail field is empty";document.getElementById("description1").focus();return false;}var r=new Date();var s=r.getMonth()+1;var o=r.getDate();var f=r.getFullYear();var p=r.getHours();var l=r.getMinutes();if(l<10){l="0"+l;}var q=s+"/"+o+"/"+f+"  "+p+":"+l+"";var j=b+"\n\n -- Revised on "+q+" -- \n"+k;j=j.ReplaceAll("’"," ");j=j.ReplaceAll("'"," ");j=j.ReplaceAll("`"," ");j=j.ReplaceAll("‘"," ");projectMessage="UPDATE_PROJECT";showResultWithQueryStr(c,"middle_div",callbackactivity,"operation=UD&description="+escape(j)+"&id="+escape(v)+"&tags="+escape(g.value)+"&budget="+escape(u.value)+"&expires="+escape(w.value)+"&duration="+escape(a.value)+"&unit="+escape(h.value));closecommonconn();}return true;}function hideFields(a,d,c,b){if(c=="hide"){document.getElementById(a).style.display="none";document.getElementById(d).style.display="none";document.getElementById("reqmsg").style.display="none";}else{document.getElementById(a).style.display="";document.getElementById(d).style.display="";document.getElementById("reqmsg").style.display="";}}function errorMsgDisplay(a){document.getElementById("reqmsg").style.display="";document.getElementById("reqmsg").focus();document.getElementById("reqmsg").innerHTML=a;}function contactExplorer(b,a,c){if(c==myuserid){document.getElementById("msg").style.display="";document.getElementById("msg").innerHTML="You can not contact yourself !!!";return false;}else{return showResultWithQueryStr(b,a,callbackcommon,null);}}function contactEx(b,a,c){if(c!=myuserid){document.getElementById("msg1").innerHTML="You can not accept this bid yourself";return false;}else{return showResultWithQueryStr(b,a,callbackcommon,null);}}function showResultActivity(h,b){var g=b;var a=new AjaxHandler();a.init(h);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var d=document.getElementById("msg_contexp").value;var c=document.getElementById("rate_contexp").value;if(d==null||d==""||c==null||c==""){b=0;a.send("message="+escape(d)+"&rate="+escape(c));}else{b=1;a.send("message="+escape(d)+"&rate="+escape(c));showResult("listActivity.do","middle_div");}return true;}function bidOnProj(m,l,c,a){pid=l;var d="Incorrect or Invalid Bid Price";var k="You can not ask more then 100% escrow";var j="Please add some message with your bid";var o="Please limit your bid message upto 1000 chars";var g="Terms and conditions should be agreed !";var f=true;var p=document.getElementById("BiddingMsg").value;var b=document.getElementById("BidPrice").value;var h=document.getElementById("ini_escrow").value;if(document.getElementById("biddingTermsChk")!=null){f=document.getElementById("biddingTermsChk").checked;}if(b==""||!IsNumeric(b)||b.length>10){errorMsgDisplay(d);document.getElementById("BidPrice").focus();return false;}if(h==""||!IsNumeric(h)||h.length>10){errorMsgDisplay(d);document.getElementById("ini_escrow").focus();return false;}if(h==""||!IsNumeric(h)||h>100){errorMsgDisplay(k);document.getElementById("ini_escrow").focus();return false;}else{if(b*1>a*1){errorMsgDisplay("Your bid amount can not be more $"+a);document.getElementById("BidPrice").focus();return false;}else{if(p.length<1){errorMsgDisplay(j);document.getElementById("BiddingMsg").focus();return false;}else{if(p.length>1000){errorMsgDisplay(o);document.getElementById("BiddingMsg").focus();return false;}else{if(!f){errorMsgDisplay(g);document.getElementById("biddingTermsChk").focus();return false;}}}}}projectId=c;projectMessage="BID_RAISED";m=m+"&rate="+escape(b)+"&msg="+escape(p)+"&ini_escrow="+h;ajaxFileUpload(m,callbackactivity);ModalPopup.Close(l,"1");return true;}function addActivityPrice(d,h,c){pid=h;var g;var b=true;var a=document.getElementById("rate_contexp").value;var f=document.getElementById("msg_contexp").value;if(document.getElementById("su_terms")!=null){b=document.getElementById("su_terms").checked;}document.getElementById("reqmsg").innerHTML="";if(a==""||!IsNumeric(a)||a.length>10){g="Incorrect or Invalid Bid Price";errorMsgDisplay(g);document.getElementById("rate_contexp").focus();return false;}else{if(f.length<1){g="Please add some message with your bid";errorMsgDisplay(g);document.getElementById("msg_contexp").focus();return false;}else{if(f.length>1000){g="Message cannot be more than 1000 characters";errorMsgDisplay(g);document.getElementById("msg_contexp").focus();return false;}else{if(!b){g="Terms and conditions should be agreed !";errorMsgDisplay(g);document.getElementById("msg_contexp").focus();return false;}}}}projectId=c;if(d.substring(0,7)=="Invoice"){document.getElementById("Invoice_On_Project_Div").style.display="none";projectMessage="INVOICE_RAISED";}else{if(d.substring(0,15)=="contactExplorer"){if(document.getElementById("Bid_On_Project_Div")==null){projectMessage="BID_RAISED";}else{document.getElementById("Bid_On_Project_Div").style.display="none";}projectMessage="BID_RAISED";}}showResultWithQueryStr(d,h,callbackactivity,"rate="+escape(a)+"&msg="+escape(f));closecommonconn();return true;}function addMessage(b,f,a){pid=f;projectId=a;var d;var c=document.getElementById("msg_contexp").value;if(c.length<1){d="Please add some message";errorMsgDisplay(d);document.getElementById("msg_contexp").focus();return false;}else{if(c.length>1000){d="Message cannot be more than 1000 characters";errorMsgDisplay(d);document.getElementById("msg_contexp").focus();return false;}}projectMessage="ADD_MESSAGE";b=b+"&msg="+escape(c);ajaxFileUpload(b,callbackactivity);ModalPopup.Close(f,"1");return true;}function declineProjectBid(b,c,a){pid=c;projectId=a;projectMessage="BID_DECLINED";showResultWithQueryStr(b,c,callbackactivity,null);closecommonconn();return true;}function declineProjectInvoice(b,c,a){pid=c;projectId=a;projectMessage="INVOICE_DECLINED";showResultWithQueryStr(b,c,callbackactivity,null);closecommonconn();return true;}function deleteProject(b,c,a){pid=c;userId=a;projectId="";projectMessage="DELETE_PROJECT";showResultWithQueryStr(b,c,callbackactivity,null);closecommonconn();return true;}function acceptOrDeclineBid(b,f,a,d,c){if(document.getElementsByName(c)[0].checked){showcommondiv(b,a,d,flag);}else{showcommondiv(f,a,d,flag);}return true;}function acceptOrDeclineInvoice(b,f,a,d,c){if(document.getElementsByName(c)[0].checked){showcommondiv(b,a,d,flag);}else{showcommondiv(f,a,d,flag);}return true;}function addFeedback(d,g,c){pid=g;projectId=c;if((document.getElementById("msg_contexp").value!=null&&document.getElementById("msg_contexp").value.length>0)&&(document.getElementById("Feedback").value!="")){var f=document.getElementById("msg_contexp").value;var a=document.MyFeed.Feedback;for(i=0;i<a.length;i++){if(a[i].checked==true){output=a[i].value;}}try{document.getElementById("Feedback_On_Project_By_Expert_Div").style.display="none";}catch(b){document.getElementById("Feedback_On_Project_By_Client_Div").style.display="none";}projectMessage="ADD_FEEDBACK";showResultWithQueryStr(d,g,callbackactivity,"msg="+escape(f)+"&Feedback="+escape(output));closecommonconn();return true;}else{document.getElementById("errorssummary").innerHTML="Please enter something in summary.";return false;}}function addCashierDetails(b,c,a){pid=c;projectId=a;projectMessage="BID_ACCEPTED";document.getElementById("Bid_Submit_Div").style.display="none";showResultWithQueryStr(b,c,callbackactivity,null);closecommonconn();}function acceptInvoiceDetails(b,c,a){pid=c;projectId=a;projectMessage="INVOICE_ACCEPTED";showResultWithQueryStr(b,c,callbackactivity,null);closecommonconn();}function onEnterGetProjectList(b,a){var c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(c==13){showResultAct(a,"middle_div",3);}}function callbackactivity(a,b){try{if(b!="output"){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;}else{document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML=a;}}catch(c){}if(projectId!=null&&projectId!=""&&projectId!="undefined"){showResultAct(contextRoot+"/jsp/ExpertActivity.do?id="+projectId,"middle_div");projectId="";}window.setTimeout("displayProjectActivityMessage()",3000);mclosecommontime();}function displayProjectActivityMessage(){var a="";if(projectMessage=="POST_PROJECT"){a='[{"response":"Project successfully posted !!"}]';}else{if(projectMessage=="UPDATE_PROJECT"){a='[{"response":"Project successfully updated !!"}]';}else{if(projectMessage=="DELETE_PROJECT"){a='[{"response":"Project successfully delete !!"}]';}else{if(projectMessage=="BID_RAISED"){a='[{"response":"Bid successfully posted !!"}]';}else{if(projectMessage=="BID_ACCEPTED"){a='[{"response":"Bid successfully accepted !!"}]';}else{if(projectMessage=="BID_DECLINED"){a='[{"response":"Bid successfully declined !!"}]';}else{if(projectMessage=="INVOICE_RAISED"){a='[{"response":"Invoice successfully posted !!"}]';}else{if(projectMessage=="INVOICE_ACCEPTED"){a='[{"response":"Invoice successfully accepted !!"}]';}else{if(projectMessage=="INVOICE_DECLINED"){a='[{"response":"Invoice successfully declined !!"}]';}else{if(projectMessage=="ADD_MESSAGE"){a='[{"response":"Your message successfully send !!"}]';}else{if(projectMessage=="ADD_FEEDBACK"){a='[{"response":"Feedback successfully added !!"}]';}else{a='[{"response":"Project successfully posted !!"}]';}}}}}}}}}}}handleGlobalResponse2(a);projectMessage="";}function purposeNewRate(a,c,b){pid=c;showResultWithQueryStr(a,c,callback,null);return true;}function purposeNewRa(b,d){pid=d;if(document.getElementById("rate_contexp").value!=null&&document.getElementById("msg_contexp").value.length>0){var a=document.getElementById("rate_contexp").value;var c=document.getElementById("msg_contexp").value;showResultWithQueryStr(b,d,callback,"rate="+escape(a)+"&msg="+escape(c));return true;}else{document.getElementById("rate_contexp").innerHTML="Please enter something in Rate.";return false;}}var previousRow;function ChangeRowColor(a){if(previousRow==a){return;}if(document.getElementById(previousRow)==null){previousRow=a;}else{if(previousRow!=null){document.getElementById(previousRow).className="billingRow";}}document.getElementById(a).className="billingRowBG";previousRow=a;}function ajaxFileUpload(b,a){$("#loading").ajaxStart(function(){$(this).show();}).ajaxComplete(function(){$(this).hide();});$.ajaxFileUpload({url:b,secureuri:false,fileElementId:"upload",dataType:"xhtml",beforeSend:function(){$("#loading").show();},complete:function(){$("#loading").hide();},success:function(d,c){if(a){a(d,pid);}else{document.getElementById("middle_div").innerHTML="";document.getElementById("middle_div").innerHTML=d;}},error:function(d,c,f){document.getElementById("middle_div").innerHTML="";document.getElementById("middle_div").innerHTML=d;}});return false;}function spamProject(a){if(!a){alert("No project id specified");}var b=confirm("Are you sure you want to mark project "+a+" as spam?");if(b==true){showResult("SpamProject.do?id="+escape(a),"globalErrorMessage");window.setTimeout("showProjectResult('RequirementsSearch.do?sortBy=status&amp;pagetype=home&amp;projectInfoType=findProject&amp;pageNo=1','middle_div')",2000);}}var catcount;function profileCompletion(g){var d="output";var c=0;var a;catcount=CategorySelection.length;for(c=0;c<CategorySelection.length;c++){if(a){a+=CategorySelection[c].categories;}else{a=CategorySelection[c].categories;}}var f=document.getElementById("prjtype");for(var c=0;c<f.length;c++){if(f.options[c].selected){f=f.options[c].value;}}var b="profile/profile_next.jsp";showResultWithQueryStr(b,d,callback,"username="+escape(userName)+"&categories="+escape(a)+"&ptype="+escape(f));return true;}function CountChar(c,b,a){if(c.value.length>a){c.value=c.value.substring(0,a);}else{b.value=a-c.value.length;}}function remove(b,a){document.getElementById(b).innerHTML="";document.getElementById(b).innerHTML="Your deleted your selected category..... ";CategorySelection.splice(a,1);}function handleGlobalResponse(result){var jsonContent=eval("("+result+")");if(jsonContent){clearErrorMessage();setErrorMessage(jsonContent[0].response);storeGlobalErrorMessage();}showResultAct("MyProfile.do?pagnum=0","middle_div",3,null,"profileparam",login_user);setTimeout(reStoreGlobalErrorMessage,2000);}function handleGlobalResponse2(result){var jsonContent=eval("("+result+")");if(jsonContent){clearErrorMessage();setErrorMessage(jsonContent[0].response);storeGlobalErrorMessage();}}function addSchools(k,g){pid=g;var a=validateSchoolProfile();if(a){var j=document.getElementById("flag").value;var c=document.getElementById("schoolid").value;var f=document.getElementById("school").value;var b=document.getElementById("state_school").value;var l=document.getElementById("fromyear").value;var h=document.getElementById("toyear").value;var m=document.getElementById("schooldesc").value;var d=document.getElementById("grade").value;showResultWithQueryStr(k,null,handleGlobalResponse,"school="+escape(f)+"&state="+escape(b)+"&fromyear="+escape(l)+"&toyear="+escape(h)+"&description="+escape(m)+"&grade="+escape(d)+"&action="+escape(j)+"&id="+escape(c));mclosecommontime1();return true;}return false;}function addColleges(o,l){pid=l;var b=validateCollegeFeilds();if(b){var q=document.getElementById("college").value;var c=document.getElementById("state").value;var f=document.getElementById("degreenew").value;var m=document.getElementById("major").value;var p=document.getElementById("fromyear").value;var j=document.getElementById("toyear").value;var h=document.getElementById("tomonth").value;h=month_name[h];var a=document.getElementById("frommonth").value;a=month_name[a];var g=document.getElementById("description").value;var k=document.getElementById("action").value;var d=document.getElementById("id").value;showResultWithQueryStr(o,null,handleGlobalResponse,"college="+escape(q)+"&state="+escape(c)+"&degree="+escape(f)+"&major="+escape(m)+"&fromyear="+escape(p)+"&toyear="+escape(j)+"&desc="+escape(g)+"&frommonth="+escape(a)+"&tomonth="+escape(h)+"&action="+escape(k)+"&id="+escape(d));mclosecommontime1();return true;}else{return false;}}function addCompanies(o,l){pid=l;var b=validateCompanyFeilds();if(b){var k=document.getElementById("company").value;var c=document.getElementById("state").value;var f=document.getElementById("position").value;var m=document.getElementById("industry_comp").value;var p=document.getElementById("fromyear").value;var h=document.getElementById("toyear").value;var a=document.getElementById("frommonth").value;a=month_name[a];var g=document.getElementById("tomonth").value;g=month_name[g];var q=document.getElementById("description").value;var j=document.getElementById("action").value;var d=document.getElementById("id").value;showResultWithQueryStr(o,null,handleGlobalResponse,"company="+escape(k)+"&state="+escape(c)+"&position="+escape(f)+"&industry="+escape(m)+"&fromyear="+escape(p)+"&toyear="+escape(h)+"&frommonth="+escape(a)+"&tomonth="+escape(g)+"&description="+escape(q)+"&id="+escape(d)+"&action="+escape(j));mclosecommontime1();return true;}else{return false;}}function profileserverresponse(a){document.getElementById("firstdiv").innerHTML="";document.getElementById("firstdiv").innerHTML=a;clearItems(new Array("subcategory","sub_subcategory"));getAreaAndFill("category");}function populatePopupData(a,b){document.getElementById(b).value=document.getElementById(a).innerHTML;}function updateStatus(c){var b=document.getElementById("status");var a=b?b.value:"";if(a.length>0){showResultWithQueryStr(c,null,handleGlobalResponse,"statusmsg="+escape(a));closecommonconn();}return true;}function addSummary(c){var d=document.getElementById("summarynew");var b=d?d.value:"";if(b.length>0){if(b.length>1000){document.getElementById("errorssummary").innerHTML="Summary cannot be more than 1000 chars.";return false;}var a=b;a=a.ReplaceAll("’"," ");a=a.ReplaceAll("'"," ");a=a.ReplaceAll("`"," ");a=a.ReplaceAll("‘"," ");showResultWithQueryStr(c,null,handleGlobalResponse,"summarynew="+escape(a));closecommonconn();}return true;}function addCertificate(g,j,b,f,a){pid=j;mid=b;var h=document.getElementById("cert_type");var c=h[h.selectedIndex].value;var d="";if(c=="Other"){d=document.getElementById(f).value;}if((c=="Other")&&(d=="")){document.getElementById("errorsnew").innerHTML="*Enter the name of other certificate.";}else{if(c=="Select"){document.getElementById("errorsnew").innerHTML="*Select the name of certificate.";}else{if(a!=0){showResultWithQueryStr(g,j,callbackprofilecomplete,"certificatename="+escape(c)+"&othercert="+escape(d));document.getElementById("successMsg").style.display="";document.getElementById("successMsg").innerHTML="Certificate successfully updated.";closecommonconn();}else{showResultWithQueryStr(g,null,handleGlobalResponse,"certificatename="+escape(c)+"&othercert="+escape(d));closecommonconn();}}}}function IsNumeric(b){var d="0123456789.";var c=true;var a;for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false;}}return c;}function addExpertiseFromProject(b,l,h,s,p){pid=l;mid=h;var o=document.getElementById("categoryadd");var j=document.getElementById("subcategoryadd1");var a=document.getElementById("sub_subcategoryadd1");var m=document.getElementById("eoexnew");if(o[o.selectedIndex].value!=-1&&j[j.selectedIndex].value!=-1&&a[a.selectedIndex].value!=-1){var f=o[o.selectedIndex].value;var d=j[j.selectedIndex].value;var r=a[a.selectedIndex].value;var g=m[m.selectedIndex].value;var v=document.getElementById("min_ratenew").value;var q=document.getElementById("detaildesc").value;var w=document.getElementById("mytitle").value;var u=document.getElementById("cert_type").value;var c=document.getElementById("id_type").value;var k=document.getElementById("profileid").value;if(p!=0){showResultWithQueryStr(b,l,callbackprofilecomplete,"category="+escape(f)+"&subcategory="+escape(d)+"&sub_subcategory="+escape(r)+"&exp="+escape(g)+"&rate="+escape(v)+"&title="+escape(w)+"&desc="+escape(q)+"&certification="+escape(u)+"&type="+escape(c)+"&profileid="+escape(k));closecommonconn();return true;}else{if(w==""||g==""||v==""||q==""||!IsNumeric(v)){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter valid data marked with [ * ]";return false;}else{if(w=="Title or a headline for your expertise"){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Title field is empty";document.getElementById("mytitle").focus();return false;}else{if(w.length>85){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Title length should not be more then 85 characters";document.getElementById("mytitle").focus();return false;}else{if(q=="A short description about your experience"){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter description about your expertise";document.getElementById("detaildesc").focus();return false;}else{q.replace(new RegExp("\\n","g"),"<br>");showResultWithQueryStr(b,null,handleGlobalResponse,"category="+escape(f)+"&subcategory="+escape(d)+"&sub_subcategory="+escape(r)+"&exp="+escape(g)+"&rate="+escape(v)+"&title="+escape(w)+"&desc="+escape(q)+"&certification="+escape(u)+"&type="+escape(c)+"&profileid="+escape(k));closecommonconn();if(s!=null||s!=""){if(userCountry==""||userCity==""||userState==""){setTimeout("showcommondiv('profile/UpdateContactDetails.jsp?country="+userCountry+"&city="+userCity+"&state="+userState+"&street="+escape(userStreet)+"&zip="+userZipCode+"&phone="+userPhone+"&phoneVerified="+userPhoneVerifiedStatus+"&skype="+userSkypeId+"&projID="+s+"','ConnectionPopUp','ConnectionPopUp')",3000);}else{setTimeout("showResultAct('"+contextRoot+"/jsp/ExpertActivity.do?id="+s+"','middle_div','','Project')",3000);}}return true;}}}}}}else{document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter valid data marked with [ * ]";return false;}}function addExpertise(b,l,h,p){pid=l;mid=h;var o=document.getElementById("categoryadd");var j=document.getElementById("subcategoryadd1");var a=document.getElementById("sub_subcategoryadd1");var m=document.getElementById("eoexnew");if(o[o.selectedIndex].value!=-1&&j[j.selectedIndex].value!=-1&&a[a.selectedIndex].value!=-1&&a[a.selectedIndex].value!=""&&j[j.selectedIndex].value!=""){var f=o[o.selectedIndex].value;var d=j[j.selectedIndex].value;var r=a[a.selectedIndex].value;var g=m[m.selectedIndex].value;var u=document.getElementById("min_ratenew").value;var q=document.getElementById("detaildesc").value;var v=document.getElementById("mytitle").value;var s=document.getElementById("cert_type").value;var c=document.getElementById("id_type").value;var k=document.getElementById("profileid").value;if(p!=0){showResultWithQueryStr(b,l,callbackprofilecomplete,"category="+escape(f)+"&subcategory="+escape(d)+"&sub_subcategory="+escape(r)+"&exp="+escape(g)+"&rate="+escape(u)+"&title="+escape(v)+"&desc="+escape(q)+"&certification="+escape(s)+"&type="+escape(c)+"&profileid="+escape(k));closecommonconn();return true;}else{if(v==""||g==""||u==""||q==""||!IsNumeric(u)){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter valid data marked with [ * ]";return false;}else{if(v=="Title or a headline for your expertise"){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Title field is empty";document.getElementById("mytitle").focus();return false;}else{if(v.length>85){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Title length should not be more then 85 characters";document.getElementById("mytitle").focus();return false;}else{if(q=="A short description about your experience"){document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter description about your expertise";document.getElementById("detaildesc").focus();return false;}else{q.replace(new RegExp("\\n","g"),"<br>");showResultWithQueryStr(b,null,callbackskill,"category="+escape(f)+"&subcategory="+escape(d)+"&sub_subcategory="+escape(r)+"&exp="+escape(g)+"&rate="+escape(u)+"&title="+escape(v)+"&desc="+escape(q)+"&certification="+escape(s)+"&type="+escape(c)+"&profileid="+escape(k));closecommonconn();if(userCountry==""||userCity==""||userState==""){setTimeout("showcommondiv('profile/UpdateContactDetails.jsp?country="+userCountry+"&city="+userCity+"&state="+userState+"&street="+escape(userStreet)+"&zip="+userZipCode+"&phone="+userPhone+"&phoneVerified="+userPhoneVerifiedStatus+"&skype="+userSkypeId+"','ConnectionPopUp','ConnectionPopUp')",3000);}return true;}}}}}}else{document.getElementById("expertise_error").style.display="";document.getElementById("expertise_error").innerHTML="Please enter valid data marked with [ * ]";return false;}}function editRequirement(p,j,b){var s;var a=document.getElementById("reqname");var h=document.getElementById("edit_activity_category");var r=document.getElementById("edit_activity_subcategory");var g=document.getElementById("edit_activity_subsubcategory");var c=document.getElementById("reqdetails");var m=document.getElementById("reqtype");var q=document.getElementById("reqduration");var k=document.getElementById("reqbudget");var f=document.getElementById("reqexpires");var l=document.getElementById("skypeName");var d=document.getElementById("skype");document.getElementById("reqmsg").innerHTML="";if(a==null||a.value.length<1){s="Requirement name is empty !";document.getElementById("reqname").focus();errorMsgDisplay(s);return false;}else{if(h==null||h.options[h.selectedIndex].value=="-1"){s="Select a category !";errorMsgDisplay(s);return false;}else{if(r==null||r.options[r.selectedIndex].value==""||r.options[r.selectedIndex].value=="-1"){s="Select a subcategory !";errorMsgDisplay(s);return false;}else{if(g==null||g.options[g.selectedIndex].value==""||g.options[g.selectedIndex].value=="-1"){s="Select a sub subcategory !";errorMsgDisplay(s);return false;}else{if(m==null||m.options[m.selectedIndex].value=="-1"){s="Select a requirement type !";errorMsgDisplay(s);document.getElementById("reqtype").focus();return false;}else{if(q==null||q.options[q.selectedIndex].value=="-1"){s="Select a duration !";errorMsgDisplay(s);document.getElementById("reqduration").focus();return false;}else{if(k==null||k.options[k.selectedIndex].value=="-1"){s="Select a budget !";errorMsgDisplay(s);document.getElementById("reqbudget").focus();return false;}else{if(f==null||f.options[f.selectedIndex].value=="-1"){s="Select an expiration period !";errorMsgDisplay(s);document.getElementById("reqexpires").focus();return false;}else{if(l==null||l.length<1){s="Skype Id is Empty !";errorMsgDisplay(s);document.getElementById("skypeName").focus();return false;}else{if(d==null||d.value==""){s="Select a Network type !";errorMsgDisplay(s);document.getElementById("network").focus();return false;}else{var o=new AjaxHandler();o.init(p);o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");o.send("profilename="+escape(a.value)+"&category="+escape(h.value)+"&subcategory="+escape(r.value)+"&sub_subcategory="+escape(g.value)+"&description="+escape(c.value)+"&requirement="+escape(m.value)+"&duration="+escape(q.value)+"&budget="+escape(k.value)+"&expires="+escape(f.value)+"&skypeid="+escape(l)+"&proj_id="+b);showResult("listActivity.do","middle_div");}}}}}}}}}}if(j){ModalPopup.Close("postRequirement","1");showResult("listActivity.do","middle_div");}else{showResult("listActivity.do","middle_div");}return true;}function postRequirementAgain(l,f){var p;var a=document.getElementById("type_from_user");var d=document.getElementById("categoryadd123");var o=document.getElementById("subcategoryadd123");var c=document.getElementById("sub_subcategoryadd123");var j=document.getElementById("reqtype123");var m=document.getElementById("reqduration123");var g=document.getElementById("reqbudget123");var b=document.getElementById("reqexpires123");var h=document.getElementById("skypeName123");document.getElementById("reqmsg123").innerHTML="";if(d==null||d.options[d.selectedIndex].value=="-1"){p="Select a category !";errorMsgDisplay123(p);return false;}else{if(o==null||o.options[o.selectedIndex].value==""||o.options[o.selectedIndex].value=="-1"){p="Select a subcategory !";errorMsgDisplay123(p);return false;}else{if(c==null||c.options[c.selectedIndex].value==""||c.options[c.selectedIndex].value=="-1"){p="Select a sub subcategory !";errorMsgDisplay123(p);return false;}else{if(j==null||j.options[j.selectedIndex].value=="-1"){p="Select a requirement type !";errorMsgDisplay123(p);document.getElementById("reqtype").focus();return false;}else{if(m==null||m.options[m.selectedIndex].value=="-1"){p="Select a duration !";errorMsgDisplay123(p);document.getElementById("reqduration").focus();return false;}else{if(g==null||g.options[g.selectedIndex].value=="-1"){p="Select a budget !";errorMsgDisplay123(p);document.getElementById("reqbudget").focus();return false;}else{if(b==null||b.options[b.selectedIndex].value=="-1"){p="Select an expiration period !";errorMsgDisplay123(p);document.getElementById("reqexpires").focus();return false;}else{if(h==null||h.length<1){p="Skype Id is Empty !";errorMsgDisplay123(p);document.getElementById("skypeid").focus();return false;}else{var k=new AjaxHandler();k.init(l);k.setRequestHeader("Content-Type","application/x-www-form-urlencoded");k.send("category="+escape(d.value)+"&subcategory="+escape(o.value)+"&sub_subcategory="+escape(c.value)+"&description=NULL &profilename="+escape(a.value)+" &requirement="+escape(j.value)+"&duration="+escape(m.value)+"&budget="+escape(g.value)+"&expires="+escape(b.value)+"&skypeid="+escape(h));showResult("listActivity.do","middle_div");}}}}}}}}if(f){ModalPopup.Close("ConnectionPopUp","1");showResult("listActivity.do","middle_div");}else{showResult("listActivity.do","middle_div");}return true;}function errorMsgDisplay123(a){document.getElementById("reqmsg123").style.display="";document.getElementById("reqmsg123").focus();document.getElementById("reqmsg123").innerHTML=a;}function updateUserInformation(f,p,l,u){pid=p;mid=l;var q=document.getElementById("email");var B=document.getElementById("name");var g=document.getElementById("company");var A=document.getElementById("position");var z=document.getElementById("new_experience1");var r=z[z.selectedIndex].value;var d=document.getElementById("new_workarea1").value;var c=document.getElementById("oldpasswd");var k=document.getElementById("newpasswd");var v=document.getElementById("retypepasswd");var w=0;if(v!=null&&v.value.length>1){v=v.value;w=1;}if(k!=null&&k.value.length>1){k=k.value;w=1;}if(c!=null&&c.value.length>1){c=c.value;w=1;}var m=document.getElementById("street");var s=document.getElementById("city");var h=document.getElementById("state");var b=document.getElementById("location");var x=document.getElementById("zip");var j=document.getElementById("phone").value;var o=document.getElementById("skypeid").value;var a=/^\s+$/;if(B==null){document.getElementById("errors").innerHTML="Error: Enter Full Name";document.getElementById("name").focus();return false;}else{if(IsNumeric(B.value)){document.getElementById("errors").innerHTML="Error: Must begin with a letter(A-z)";document.getElementById("name").focus();return false;}else{B=B.value;}}if(q==null||q.value.length<1){document.getElementById("errors").innerHTML="Error: Email is empty";document.getElementById("email").focus();return false;}else{q=q.value;}if(w==1){if((c==null||c.length<1)){document.getElementById("errors").innerHTML="Old password is empty";return false;}if((k==null||k.length<6||k.length>20)){document.getElementById("errors").innerHTML="Error: New password should be 6-20 characters long";document.getElementById("newpasswd").focus();return false;}if((v==null||v.length<6||v.length>20)){document.getElementById("errors").innerHTML="Error: Retype password should be 6-20 characters long";document.getElementById("retypepasswd").focus();return false;}if(k!=v){document.getElementById("errors").innerHTML="Error: New password and retyped password does not match";document.getElementById("errors").style.display="";document.getElementById("newpasswd").value="";document.getElementById("retypepasswd").value="";document.getElementById("newpasswd").focus();return false;}if(c==k){document.getElementById("errors").innerHTML="Error: Old password and new password are same";document.getElementById("errors").style.display="";document.getElementById("oldpasswd").value="";document.getElementById("newpasswd").value="";document.getElementById("retypepasswd").value="";document.getElementById("newpasswd").focus();return false;}}if(b==null||b.value.length<1){document.getElementById("errors").innerHTML="Error: Select your country!";document.getElementById("location").focus();return false;}else{b=b.value;}if(h==null||h.value.length<1){document.getElementById("errors").innerHTML="Error: Your State/Province is mandatory";document.getElementById("state").focus();return false;}else{if(IsNumeric(h.value)||checkSpecialChars(h.value)){document.getElementById("errors").innerHTML="Error: Special or numeric characters are not allowed here!";document.getElementById("state").focus();return false;}else{h=h.value;}}if(s==null||s.value.length<1){document.getElementById("errors").innerHTML="Error: Add your city!";document.getElementById("city").focus();return false;}else{if(IsNumeric(s.value)||checkSpecialChars(s.value)){document.getElementById("errors").innerHTML="Error: Special or numeric characters are not allowed here!";document.getElementById("city").focus();return false;}else{s=s.value;}}if(m==null||m.value.length<1){m="";}else{m=m.value;}if(x==null||x.value.length<1){x="";}else{if(isNaN(x.value)||checkSpecialChars(x.value)){document.getElementById("errors").innerHTML="Error: Only numeric value are allowed here!";document.getElementById("zip").focus();return false;}else{x=x.value;}}if(j==null||j.length<1){j="";}else{if(j!=""||j!=null){if(isNaN(j)||j.indexOf(" ")!=-1){document.getElementById("errors").innerHTML="Error: Only numeric value are allowed here!";document.getElementById("errors").style.display="";document.getElementById("phone").focus();return false;}if(j.length>20||j.length<11){document.getElementById("errors").innerHTML="Error: Phone/Mobile number should be of 11-20 characters long";document.getElementById("errors").style.display="";document.getElementById("phone").focus();return false;}}}if(g==null||g.value.length<1){g="";}else{g=g.value;}if(A==null||A.value.length<1){A="";}else{A=A.value;}if(o==null||o.length<1){o="";}else{if(o!=null||o==""){if(a.test(o)||o.indexOf(" ")!=-1){document.getElementById("errors").innerHTML="Error in Skype ID : No spaces allowed";document.getElementById("skypeid").focus();return false;}else{if(IsNumeric(o)){document.getElementById("errors").innerHTML="Error in Skype ID : Must begin with a letter(A-z)";document.getElementById("skypeid").focus();return false;}else{if(skypeValidChars(o)){document.getElementById("errors").innerHTML="Error in Skype ID : Can only contain A-z 0-9 - _ .";document.getElementById("skypeid").focus();return false;}else{if(o.length<6||o.length>32){document.getElementById("errors").innerHTML="Error in Skype ID : 6-32 characters needed";document.getElementById("skypeid").focus();return false;}}}}}}var y="name="+escape(B)+"&email="+escape(q)+"&company="+escape(g)+"&position="+escape(A)+(w?("&oldpasswd="+escape(c)+"&newpasswd="+escape(k)):"")+"&country="+escape(b)+"&state="+escape(h)+"&street="+escape(m)+"&city="+escape(s)+"&zip="+escape(x)+"&phone="+escape(j)+"&workarea="+escape(d)+"&exp="+escape(r)+"&skypeid="+escape(o);showResultWithQueryStr(f,pid,commoncallback,y);userCity=s;userCountry=b;userState=h;userStreet=m;userZipCode=x;userPhone=j;return true;}function updateUserWorkInfo(g,a,j){pid=a;mid=j;var d=document.getElementById("company");var b=document.getElementById("position");var f=document.getElementById("new_experience1");var c=f[f.selectedIndex].value;var h=document.getElementById("new_workarea1").value;if(d==null||d.value.length<1){d="";document.getElementById("errors").innerHTML="Error: Enter Current Company Name";document.getElementById("company").focus();return false;}else{d=d.value;}if(b==null||b.value.length<1){b="";document.getElementById("errors").innerHTML="Error: Enter Current Position";document.getElementById("position").focus();return false;}else{b=b.value;}if(h=="-1"){h="";document.getElementById("errors").innerHTML="Error: Select Your Work Area";document.getElementById("new_workarea1").focus();return false;}var k="company="+escape(d)+"&position="+escape(b)+"&workarea="+escape(h)+"&exp="+escape(c);showResultWithQueryStr(g,pid,commoncallback,k);window.setTimeout("showResultAct('MyProfile.do?pagnum=0', 'middle_div',2,null,'profileparam','"+username+"','editProfile');",9000);return true;}function updateContactDetails(k,c,l,p){pid=c;mid=l;var d=document.getElementById("street");var f=document.getElementById("city");var a=document.getElementById("state");var m=document.getElementById("location");var b=document.getElementById("zip");var g=document.getElementById("phone").value;var j=document.getElementById("skypeid").value;var h=/^\s+$/;if(m==null||m.value.length<1){document.getElementById("errors").innerHTML="Error: Select your country!";document.getElementById("location").focus();return false;}else{m=m.value;}if(a==null||a.value.length<1){document.getElementById("errors").innerHTML="Error: Your State/Province is mandatory";document.getElementById("state").focus();return false;}else{if(IsNumeric(a.value)||checkSpecialChars(a.value)){document.getElementById("errors").innerHTML="Error: Special or numeric characters are not allowed here!";document.getElementById("state").focus();return false;}else{a=a.value;}}if(f==null||f.value.length<1){document.getElementById("errors").innerHTML="Error: Add your city!";document.getElementById("city").focus();return false;}else{if(IsNumeric(f.value)||checkSpecialChars(f.value)){document.getElementById("errors").innerHTML="Error: Special or numeric characters are not allowed here!";document.getElementById("city").focus();return false;}else{f=f.value;}}if(d==null||d.value.length<1){d="";}else{d=d.value;}if(b==null||b.value.length<1){b="";}else{if(isNaN(b.value)||checkSpecialChars(b.value)){document.getElementById("errors").innerHTML="Error: Only numeric value are allowed here!";document.getElementById("zip").focus();return false;}else{b=b.value;}}if(g==null||g.length<1){g="";}else{if(g!=""||g!=null){if(isNaN(g)||g.indexOf(" ")!=-1){document.getElementById("errors").innerHTML="Error: Only numeric value are allowed here!";document.getElementById("errors").style.display="";document.getElementById("phone").focus();return false;}if(g.length>20||g.length<11){document.getElementById("errors").innerHTML="Error: Phone/Mobile number should be of 11-20 characters long";document.getElementById("errors").style.display="";document.getElementById("phone").focus();return false;}}}if(j==null||j.length<1){j="";}else{if(j!=null||j==""){if(h.test(j)||j.indexOf(" ")!=-1){document.getElementById("errors").innerHTML="Error in Skype ID : No spaces allowed";document.getElementById("skypeid").focus();return false;}else{if(IsNumeric(j)){document.getElementById("errors").innerHTML="Error in Skype ID : Must begin with a letter(A-z)";document.getElementById("skypeid").focus();return false;}else{if(skypeValidChars(j)){document.getElementById("errors").innerHTML="Error in Skype ID : Can only contain A-z 0-9 - _ .";document.getElementById("skypeid").focus();return false;}else{if(j.length<6||j.length>32){document.getElementById("errors").innerHTML="Error in Skype ID : 6-32 characters needed";document.getElementById("skypeid").focus();return false;}}}}}}var o="country="+escape(m)+"&state="+escape(a)+"&street="+escape(d)+"&city="+escape(f)+"&zip="+escape(b)+"&phone="+escape(g)+"&skypeid="+escape(j);showResultWithQueryStr(k,pid,commoncallback,o);userCity=f;userCountry=m;userState=a;userStreet=d;userZipCode=b;userPhone=g;if(p=="null"||p==""){}else{setTimeout("showResultAct('"+contextRoot+"/jsp/ExpertActivity.do?id="+p+"','middle_div','','Project')",3000);}return true;}function callbackOldPwd(a){var b=new AjaxHandler();var c=a;if(c.indexOf("success")!=-1){b.addCallback(handleGlobalResponse);closecommonconn();}else{document.getElementById("ConnectionPopUp").innerHTML=a;bae_showlayer("changePwd");document.getElementById("oldpasswd").focus();window.setTimeout("cleardiv('resetPwdError')",3000);return true;}}function callbackprofilecomplete(){document.getElementById(pid).innerHTML=req.responseText+"%";document.getElementById(mid).style.width=req.responseText+"px";closecommonconn();}function getProfileViewers(b,a){showResultWithQueryStr(b,a,callbackviewers,null,true);return true;}function callbackviewers(result,pid){var viewresult=result;var arrayresult=viewresult.split("#");var i;var k=0;var j=0;var html="";html+='<span style="margin-left:7%; color:#004080;">';viewresult=eval("("+arrayresult[1]+")");for(i=0;i<viewresult.length;i++){if(viewresult[i].day>=0&&viewresult[i].day<=6){if(viewresult[i].username){if(login_user==null||login_user==""||!login_user){html+='<span class="action" onclick=showviewprofile("ViewOtherProfile.do?uid='+viewresult[i].username+'&from=index","middle_div","'+escape(viewresult[i].username)+'")>'+viewresult[i].firstname+"</span>,&nbsp;";}else{html+='<span class="action" onclick=showviewprofile("ViewOtherProfile.do?uid='+viewresult[i].username+'","middle_div","'+escape(viewresult[i].username)+'")>'+viewresult[i].firstname+"</span>,&nbsp;";}k++;if(viewresult[i].day==0){j++;}}}}var date=new Date();var year=date.getYear();if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1);if(ieversion<=8){year=year;}}else{year=year+1900;}var month=date.getMonth();html+="</span>";var pidDiv=document.getElementById(pid);if(k>0){if(pidDiv!=null){pidDiv.style.display="";}html+='<span class="action" id='+pid+' style="display:none;">More >></span>';}html+='<br/><br/><span style="margin-left:7%;">This Week : <span style="color:#004080;">'+k+'</span></span><span style="margin-left:7%;">Since '+month_name[month]+" \n"+year+' : <span style="color:#004080;">'+arrayresult[0]+" views</span></span>";if(pid!="output"){if(pidDiv!=null){pidDiv.innerHTML="";pidDiv.innerHTML='<span style="color:#990000;"><b>Profile Views</b></span><br/>'+html;}}else{if(pidDiv!=null){pidDiv.innerHTML="";pidDiv.innerHTML='<span style="color:#990000;"><b>Profile Views</b></span><br/>'+html;}}}function deleteCommon(a,c,b){showResultWithQueryStr(a,null,handleGlobalResponse,null);closeDeleteConn(b);return true;}function showUserProfile(k,f,b,l,a,d,o){if(!document.getElementById("fwd_content_to").disabled){var g=document.getElementById("fwd_content_to").value;if(g!=""){if((validateMultipleEmailsCommaSeparated(g))==false){document.getElementById("Error_Forward").innerHTML="Please enter valid comma separated email strings";document.getElementById("Error_Forward").style.display="";document.getElementById("fwd_content_to").value="";document.getElementById("fwd_content_to").focus();return false;}}else{document.getElementById("Error_Forward").innerHTML="Please enter an Email Id";document.getElementById("Error_Forward").style.display="";document.getElementById("fwd_content_to").value="";document.getElementById("fwd_content_to").focus();return false;}}else{if(document.getElementById("msg_to").value==""){document.getElementById("Error_Forward").innerHTML="Please select atleast one recipient";document.getElementById("Error_Forward").style.display="";return false;}}if(document.getElementById("msg_to")!=null){var j=getMultiple();}var h=document.getElementById("msg_subject").value;var p=document.getElementById("msg_text").value;p+="\n";p+="\n";if(login_user==null||login_user==""||!login_user){p+='<span class="action" onclick=showviewprofile("ViewOtherProfile.do?uid='+d+'&from=index","middle_div","'+d+'")> click here </span>to view the profile';}else{p+='<span class="action" onclick=showviewprofile("ViewOtherProfile.do?uid='+d+'","middle_div","'+d+'")> click here </span>to view the profile';}p+="\n";p+="\n";p.replace(new RegExp("\\n","g"),"<br>");var m=document.getElementById("msg_parent_id").value;var c;if(document.getElementById("fwd_content_to").disabled){c="msgto="+escape(j)+"&msgsubject="+escape(h)+"&msgtext="+escape(p)+"&profileURL="+escape(l)+"&profileName="+escape(b)+"&summary="+escape(a)+"&profile_id="+escape(o)+"&parentmsgid="+escape(m);}else{c="&msgsubject="+escape(h)+"&mailToForward="+escape(g)+"&msgtext="+escape(p)+"&profileURL="+escape(l)+"&profileName="+escape(b)+"&summary="+escape(a)+"&profile_id="+escape(o)+"&parentmsgid="+escape(m);}showResultWithQueryStr(k,f,callbackinbox,c);closecommonconn();return true;}function validateMultipleEmailsCommaSeparated(c){c=c.replace(/\s*/g,"");var a=c.split(",");for(var b=0;b<a.length;b++){if(!echeck(a[b])){return false;}}return true;}function checkSpecialChars(d){var f="!@#$%^&*()+=-[]\\';,./{}|\":<>?";var c=true;var a;for(var b=0;b<d.length&&c==true;b++){a=d.charAt(b);if(f.indexOf(a)==-1){c=false;}}return c;}function skypeValidChars(d){var f="!@#$%^&*()+=[]\\';,/{}|\":<>?";var c=true;var a;for(var b=0;b<d.length&&c==true;b++){a=d.charAt(b);if(f.indexOf(a)==-1){c=false;}}return c;}function editEmailNotifications(){var a=getNotificationEmailStr();showResultWithQueryStr("EditNotifications.do?notificationEmailStr="+a,"InnerDiv",editNotificationsCallback,"notificationEmailStr="+a);return true;}function editNotificationsCallback(a){clearErrorMessage();setErrorMessage("Notification Settings updated successfully");storeGlobalErrorMessage();setTimeout(reStoreGlobalErrorMessage,2000);}function getNotificationEmailStr(){var b=document.getElementsByName("email_notification").length;var a="";for(var c=0;c<b;c++){if(document.getElementById("notification_check"+c).checked){a=a.concat("1");}else{a=a.concat("0");}}return(a);}function deleteProfile(c,b){if(!c){alert("No user id specified");}var a=confirm("Are you sure you want to delete prfile of user "+b+" ?");if(a==true){showResult("deleteProfile.do?username="+escape(c),"globalErrorMessage");window.setTimeout("jsonSearch('EzdiaSearch.do','2','Expert',0,'middle_div','search for: php java');",2000);}}function show_prompt(d,a,b){if(!d){alert("No user id specified");}if(b==1){alert("This user is already verified.");}else{var c=prompt("Enter the phone number of expert ",a);if(c!=""&&c!=null){showResult("phoneVerify.do?username="+escape(d)+"&phone_verified_number="+escape(c),"globalErrorMessage");window.setTimeout("jsonSearch('EzdiaSearch.do','2','Expert',0,'middle_div','search for: php java');",2000);}}}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var c=a.data(this[0],"validator");if(c){return c;}c=new a.validator(b,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=true;});this.submit(function(d){if(c.settings.debug){d.preventDefault();}function f(){if(c.settings.submitHandler){c.settings.submitHandler.call(c,c.currentForm);return false;}return true;}if(c.cancelSubmit){c.cancelSubmit=false;return f();}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false;}return f();}else{c.focusInvalid();return false;}});}return c;},valid:function(){if(a(this[0]).is("form")){return this.validate().form();}else{var c=false;var b=a(this[0].form).validate();this.each(function(){c|=b.element(this);});return c;}},removeAttrs:function(d){var b={},c=this;a.each(d.split(/\s/),function(f,g){b[g]=c.attr(g);c.removeAttr(g);});return b;},rules:function(f,b){var h=this[0];if(f){var d=a.data(h.form,"validator").settings;var k=d.rules;var l=a.validator.staticRules(h);switch(f){case"add":a.extend(l,a.validator.normalizeRule(b));k[h.name]=l;if(b.messages){d.messages[h.name]=a.extend(d.messages[h.name],b.messages);}break;case"remove":if(!b){delete k[h.name];return l;}var j={};a.each(b.split(/\s/),function(m,o){j[o]=l[o];delete l[o];});return j;}}var g=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(h),a.validator.classRules(h),a.validator.attributeRules(h),a.validator.staticRules(h)),h);if(g.required){var c=g.required;delete g.required;g=a.extend({required:c},g);}return g;}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(b.value);},filled:function(b){return !!a.trim(b.value);},unchecked:function(b){return !b.checked;}});a.format=function(b,c){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(b);return a.format.apply(this,d);};}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1);}if(c.constructor!=Array){c=[c];}a.each(c,function(d,f){b=b.replace(new RegExp("\\{"+d+"\\}","g"),f);});return b;};a.validator=function(b,c){this.settings=a.extend({},a.validator.defaults,b);this.currentForm=c;this.init();};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(b){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass);this.errorsFor(b).hide();}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b);}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b);}},onclick:function(b){if(b.name in this.submitted){this.element(b);}},highlight:function(c,b){a(c).addClass(b);},unhighlight:function(c,b){a(c).removeClass(b);}},setDefaults:function(b){a.extend(a.validator.defaults,b);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.format("Please enter no more than {0} characters."),minlength:a.format("Please enter at least {0} characters."),rangelength:a.format("Please enter a value between {0} and {1} characters long."),range:a.format("Please enter a value between {0} and {1}."),max:a.format("Please enter a value less than or equal to {0}."),min:a.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=(this.groups={});a.each(this.settings.groups,function(f,g){a.each(g.split(/\s/),function(j,h){b[h]=f;});});var d=this.settings.rules;a.each(d,function(f,g){d[f]=a.validator.normalizeRule(g);});function c(g){var f=a.data(this[0].form,"validator");f.settings["on"+g.type]&&f.settings["on"+g.type].call(f,this[0]);}a(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",c).delegate("click",":radio, :checkbox",c);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this]);}this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var b=0,c=(this.currentElements=this.elements());c[b];b++){this.check(c[b]);}return this.valid();},element:function(c){c=this.clean(c);this.lastElement=c;this.prepareElement(c);this.currentElements=a(c);var b=this.check(c);if(b){delete this.invalid[c.name];}else{this.invalid[c.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return b;},showErrors:function(c){if(c){a.extend(this.errorMap,c);this.errorList=[];for(var b in c){this.errorList.push({message:c[b],element:this.findByName(b)[0]});}this.successList=a.grep(this.successList,function(d){return !(d.name in c);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm();}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(d){var c=0;for(var b in d){c++;}return c;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name;}).length==1&&b;},elements:function(){var c=this,b={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false;}b[this.name]=true;return true;});},clean:function(b){return a(b)[0];},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.formSubmitted=false;this.currentElements=a([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b);},check:function(c){c=this.clean(c);if(this.checkable(c)){c=this.findByName(c.name)[0];}var h=a(c).rules();var d=false;for(method in h){var g={method:method,parameters:h[method]};try{var b=a.validator.methods[method].call(this,c.value.replace(/\r/g,""),c,g.parameters);if(b=="dependency-mismatch"){d=true;continue;}d=false;if(b=="pending"){this.toHide=this.toHide.not(this.errorsFor(c));return;}if(!b){this.formatAndAdd(c,g);return false;}}catch(f){this.settings.debug&&window.console&&console.log("exception occured when checking element "+c.id+", check the '"+g.method+"' method");throw f;}}if(d){return;}if(this.objectLength(h)){this.successList.push(c);}return true;},customMetaMessage:function(b,d){if(!a.metadata){return;}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d];},customMessage:function(c,d){var b=this.settings.messages[c];return b&&(b.constructor==String?b:b[d]);},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b];}}return undefined;},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>");},formatAndAdd:function(b,d){var c=this.defaultMessage(b,d.method);if(typeof c=="function"){c=c.call(this,d.parameters,b);}this.errorList.push({message:c,element:b});this.errorMap[b.name]=c;this.submitted[b.name]=c;},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parents(this.settings.wrapper));}return b;},defaultShowErrors:function(){for(var c=0;this.errorList[c];c++){var b=this.errorList[c];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass);this.showLabel(b.element,b.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var c=0;this.successList[c];c++){this.showLabel(this.successList[c]);}}if(this.settings.unhighlight){for(var c=0,d=this.validElements();d[c];c++){this.settings.unhighlight.call(this,d[c],this.settings.errorClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return a(this.errorList).map(function(){return this.element;});},showLabel:function(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass().addClass(this.settings.errorClass);b.attr("generated")&&b.html(d);}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(c),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(b).length){this.settings.errorPlacement?this.settings.errorPlacement(b,a(c)):b.insertAfter(c);}}if(!d&&this.settings.success){b.text("");typeof this.settings.success=="string"?b.addClass(this.settings.success):this.settings.success(b);}this.toShow=this.toShow.add(b);},errorsFor:function(b){return this.errors().filter("[for='"+this.idOrName(b)+"']");},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name);},checkable:function(b){return/radio|checkbox/i.test(b.type);},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(d,f){return f.form==c&&f.name==b&&f||null;});},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length;}}return c.length;},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true;},dependTypes:{"boolean":function(c,b){return c;},"string":function(c,b){return !!a(c,b.form).length;},"function":function(c,b){return c(b);}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch";},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true;}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(b,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b);},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this]);}});return d;},attributeRules:function(c){var f={};var b=a(c);for(method in a.validator.methods){var d=b.attr(method);if(d){f[method]=d;}}if(f.maxlength&&/-1|2147483647|524288/.test(f.maxlength)){delete f.maxlength;}return f;},metadataRules:function(b){if(!a.metadata){return{};}var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata();},staticRules:function(c){var d={};var b=a.data(c.form,"validator");if(b.settings.rules){d=a.validator.normalizeRule(b.settings.rules[c.name])||{};}return d;},normalizeRules:function(c,b){a.each(c,function(g,f){if(f===false){delete c[g];return;}if(f.param||f.depends){var d=true;switch(typeof f.depends){case"string":d=!!a(f.depends,b.form).length;break;case"function":d=f.depends.call(b,b);break;}if(d){c[g]=f.param!==undefined?f.param:true;}else{delete c[g];}}});a.each(c,function(d,f){c[d]=a.isFunction(f)?f(b):f;});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this]);}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])];}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max;}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength;}}if(c.messages){delete c.messages;}return c;},normalizeRule:function(c){if(typeof c=="string"){var b={};a.each(c.split(/\s/),function(){b[this]=true;});c=b;}return c;},addMethod:function(b,d,c){a.validator.methods[b]=d;a.validator.messages[b]=c;if(d.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b));}},methods:{required:function(d,c,f){if(!this.depend(f,c)){return"dependency-mismatch";}switch(c.nodeName.toLowerCase()){case"select":var b=a("option:selected",c);return b.length>0&&(c.type=="select-multiple"||(a.browser.msie&&!(b[0].attributes["value"].specified)?b[0].text:b[0].value).length>0);case"input":if(this.checkable(c)){return this.getLength(d,c)>0;}default:return a.trim(d).length>0;}},remote:function(g,c,h){if(this.optional(c)){return"dependency-mismatch";}var d=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={};}this.settings.messages[c.name].remote=typeof d.message=="function"?d.message(g):d.message;h=typeof h=="string"&&{url:h}||h;if(d.old!==g){d.old=g;var b=this;this.startRequest(c);var f={};f[c.name]=g;a.ajax(a.extend(true,{url:h,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,success:function(k){if(k){var j=b.formSubmitted;b.prepareElement(c);b.formSubmitted=j;b.successList.push(c);b.showErrors();}else{var l={};l[c.name]=k||b.defaultMessage(c,"remote");b.showErrors(l);}d.valid=k;b.stopRequest(c,k);}},h));return"pending";}else{if(this.pending[c.name]){return"pending";}}return d.valid;},minlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)>=d;},maxlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)<=d;},rangelength:function(d,b,f){var c=this.getLength(a.trim(d),b);return this.optional(b)||(c>=f[0]&&c<=f[1]);},min:function(c,b,d){return this.optional(b)||c>=d;},max:function(c,b,d){return this.optional(b)||c<=d;},range:function(c,b,d){return this.optional(b)||(c>=d[0]&&c<=d[1]);},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(c);},url:function(c,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c);},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c));},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c);},dateDE:function(c,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(c);},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c);},numberDE:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(c);},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c);},creditcard:function(g,c){if(this.optional(c)){return"dependency-mismatch";}if(/[^0-9-]+/.test(g)){return false;}var h=0,f=0,b=false;g=g.replace(/\D/g,"");for(n=g.length-1;n>=0;n--){var d=g.charAt(n);var f=parseInt(d,10);if(b){if((f*=2)>9){f-=9;}}h+=f;b=!b;}return(h%10)==0;},accept:function(c,b,d){d=typeof d=="string"?d:"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp(".("+d+")$","i"));},equalTo:function(c,b,d){return c==a(d).val();}}});})(jQuery);(function(c){var b=c.ajax;var a={};c.ajax=function(f){f=c.extend(f,c.extend({},c.ajaxSettings,f));var d=f.port;if(f.mode=="abort"){if(a[d]){a[d].abort();}return(a[d]=b.apply(this,arguments));}return b.apply(this,arguments);};})(jQuery);(function(a){a.each({focus:"focusin",blur:"focusout"},function(c,b){a.event.special[b]={setup:function(){if(a.browser.msie){return false;}this.addEventListener(c,a.event.special[b].handler,true);},teardown:function(){if(a.browser.msie){return false;}this.removeEventListener(c,a.event.special[b].handler,true);},handler:function(d){arguments[0]=a.event.fix(d);arguments[0].type=b;return a.event.handle.apply(this,arguments);}};});a.extend(a.fn,{delegate:function(d,c,b){return this.bind(d,function(f){var g=a(f.target);if(g.is(c)){return b.apply(g,arguments);}});},triggerEvent:function(b,c){return this.triggerHandler(b,[a.event.fix({type:b,target:c})]);}});})(jQuery);var prepareAudio=function(){$("#play-intro").click(function(){$(this).blur();var b=document.getElementById("player1");if(b){if(b.play){b.play();}else{b.innerHTML='<embed src="'+contextRoot+'/static/audio/ezdia.m3u" autostart="1" loop="0" type="'+getAudioMimeType()+'"></embed>';}return;}var a=document.createElement("audio");if(a.canPlayType&&a.canPlayType('audio/ogg; codecs="vorbis"')!=""){a.src=contextRoot+"/static/audio/ezdia.ogg";a.id="player1";document.body.appendChild(a);a.play();}else{var c=document.createElement("div");c.id="player1";c.style.display="none";c.innerHTML='<embed src="'+contextRoot+'/static/audio/ezdia.m3u" autostart="1" loop="0" type="'+getAudioMimeType()+'"></embed>';document.body.appendChild(c);}});};var getAudioMimeType=function(){var c="application/x-mplayer2";var b=navigator.userAgent.toLowerCase();if(navigator.mimeTypes&&b.indexOf("windows")==-1){var a=navigator.mimeTypes["audio/mpeg"].enabledPlugin;if(a){c="audio/mpeg";}}return c;};function setIntervalTopBoxes(a){children=$("> div",$(a));visible=children.filter(":visible");hidden=children.filter(":not(:visible)");visible.last().hide().prependTo($(a));hidden.last().slideDown("slow");}
