function hidePubProfileSquawkPrompt(A){if(A.value=="Write something..."){A.value="";A.style.color="#000000"}}function showPubProfileSquawkPrompt(A){if(trim(A.value)==""){A.value="Write something...";A.style.color=""}}function public_profile_squawk_action(C,E,A){var B=base_url+"/index.php/login/islogin";var D={success:function(F){if(F.responseText=="yes"){switch(C){case"add_squawk":public_profile_addSquawk_ajax();break;case"delete_squawk":public_profile_deleteSquawk_ajax(E,A);break;default:break}}else{login_window()}},failure:function(F){}};YAHOO.util.Connect.asyncRequest("GET",B,D)}function public_profile_addSquawk_ajax(){var A=base_url+"index.php/squawks/public_profile_squawk_ajax";var B={success:function(C){},failure:function(C){},upload:function(F){if(F.responseText!=""){var D=YAHOO.util.Dom.getFirstChild(document.getElementById("today_div"));if(D!=null){var C=document.createElement("div");C.innerHTML=F.responseText;var E=D.getAttribute("class");if(E=="odd"){C.setAttribute("class","even")}else{C.setAttribute("class","odd")}YAHOO.util.Dom.insertBefore(C,D)}else{if(document.getElementById("today_div")!=null){document.getElementById("today_div").innerHTML="<div class='odd'>"+F.responseText+"</div>";document.getElementById("today_div").style.display=""}if(document.getElementById("today_h4")!=null){document.getElementById("today_h4").style.display=""}}document.getElementById("squawk").value="Write something...";document.getElementById("squawk").style.color=""}}};YAHOO.util.Connect.setForm("squawk_form",true);YAHOO.util.Connect.asyncRequest("POST",A,B)}function show_more_ajax(H,F,C,B){if(B==1){var D=0;var E=document.getElementById("mywigix_activity_type");if(E!=null){D=E.value}var A=base_url+"index.php/myprofile/recentActivity_ajax/"+H+"/"+F+"/"+C+"/"+D}else{var A=base_url+"index.php/myprofile/publicProfile/"+H+"/recent_activities/"+F+"/"+C}var G={success:function(K){if(K.responseText!=""){document.getElementById("pub_profile_middle_container").innerHTML=K.responseText;var J=YAHOO.util.Dom.getElementsByClassName("pub_profile_comment");for(var I=0;I<J.length;I++){YAHOO.util.Event.addListener(J[I],"focus",showPubProfileComment);YAHOO.util.Event.addListener(J[I],"blur",hidePubProfileComment)}}},failure:function(I){}};YAHOO.util.Connect.asyncRequest("GET",A,G)}function public_profile_deleteSquawk_ajax(D,A){var B=base_url+"index.php/squawks/delete_ajax/"+D+"/"+A;var C={success:function(E){},failure:function(E){},upload:function(H){var E=YAHOO.util.Dom.get("squawk_index_"+D);var I=YAHOO.util.Dom.getAncestorByTagName(E,"div");var F=YAHOO.util.Dom.getAncestorByTagName(I,"div");F.removeChild(I);var G=YAHOO.util.Dom.getChildren(F);if(G!=null&&G.length<1){F.style.display="none";YAHOO.util.Dom.getPreviousSibling(F).style.display="none"}}};YAHOO.util.Connect.setForm("squawk_form",true);YAHOO.util.Connect.asyncRequest("POST",B,C)}function hideOrDisplayComment(B){var D="comments_list_"+B;var C=document.getElementById(D);var A=document.getElementById("comment_text_"+B);if(C!=null){if(C.style.display==""){C.style.display="none";A.style.height="20px";A.value="Write a Comment...";A.style.color="#CCCCCC";YAHOO.util.Dom.getNextSibling(A).style.display="none"}else{C.style.display="";if(A.value=="Write a Comment..."){A.value=""}A.style.height="50px";A.style.color="#000";YAHOO.util.Dom.getNextSibling(A).style.display="block"}}}function deleteComment(D,B){var C=base_url+"index.php/login/islogin";var A={success:function(E){if(E.responseText!="error"){var F={success:function(J){document.getElementById("comments_list_"+B).innerHTML=J.responseText;var I=document.getElementById("comment_count_"+B).value;document.getElementById("comment_total_str_"+B).innerHTML=I+" Comments";var H=YAHOO.util.Dom.getElementsByClassName("pub_profile_comment");for(var G=0;G<H.length;G++){YAHOO.util.Event.addListener(H[G],"focus",showPubProfileComment);YAHOO.util.Event.addListener(H[G],"blur",hidePubProfileComment)}}};YAHOO.util.Connect.asyncRequest("GET",base_url+"index.php/publicprofile/commentOwnerRemoveComment_ajax/"+D+"/"+B,F)}else{login_window()}},failure:function(E){login_window()}};YAHOO.util.Connect.asyncRequest("GET",C,A)}function writeComment(B){var E="comment_text_"+B;var D=document.getElementById(E);if(D!=null){if(D.value==""){return }}document.getElementById("post_comment_text").value=D.value;var C=base_url+"index.php/login/islogin";var A={success:function(F){if(F.responseText!="error"){var G={upload:function(K){document.getElementById("comments_list_"+B).innerHTML=K.responseText;var J=document.getElementById("comment_count_"+B).value;document.getElementById("comment_total_str_"+B).innerHTML=J+" Comments";var I=YAHOO.util.Dom.getElementsByClassName("pub_profile_comment");for(var H=0;H<I.length;H++){YAHOO.util.Event.addListener(I[H],"focus",showPubProfileComment);YAHOO.util.Event.addListener(I[H],"blur",hidePubProfileComment)}}};YAHOO.util.Connect.setForm("post_comment_form",true);YAHOO.util.Connect.asyncRequest("POST",base_url+"index.php/publicprofile/postComment_ajax/"+B,G)}else{login_window()}},failure:function(F){login_window()}};YAHOO.util.Connect.asyncRequest("GET",C,A)}function item_for_sale(A,F,D,E,C){var B=base_url+"index.php/publicprofile/itemForSale_ajax/"+A+"/"+F+"/"+D+"/"+E+"/"+C;var G={success:function(H){if(H.responseText!=""){document.getElementById("item_for_sale_container").innerHTML=H.responseText}},failure:function(H){}};YAHOO.util.Connect.asyncRequest("GET",B,G)}function item_i_want(A,F,D,E,C){var B=base_url+"index.php/publicprofile/itemIWant_ajax/"+A+"/"+F+"/"+D+"/"+E+"/"+C;var G={success:function(H){if(H.responseText!=""){document.getElementById("item_i_want_container").innerHTML=H.responseText}},failure:function(H){}};YAHOO.util.Connect.asyncRequest("GET",B,G)}function public_portfolio(I,D,E,C,F,B,G){var A=base_url+"index.php/publicprofile/portfolio_ajax/"+I+"/"+D+"/"+E+"/"+C+"/"+F+"/"+B+"/"+G;var H={success:function(J){if(J.responseText!=""){document.getElementById("portfolio_container").innerHTML=J.responseText}},failure:function(J){}};YAHOO.util.Connect.asyncRequest("GET",A,H)}function public_profile_deleteUpdate(D){var A=base_url+"index.php/login/islogin";var B="myprofile";var C={success:function(F){if(F.responseText=="yes"){var E={success:function(I){var K=YAHOO.util.Dom.get("comments_list_"+D);var J=YAHOO.util.Dom.getAncestorByTagName(K,"div");var G=YAHOO.util.Dom.getAncestorByTagName(J,"div");G.removeChild(J);var H=YAHOO.util.Dom.getChildren(G);if(H!=null&&H.length<1){G.style.display="none";YAHOO.util.Dom.getPreviousSibling(G).style.display="none"}},failure:function(G){}};YAHOO.util.Connect.asyncRequest("GET",base_url+"index.php/myprofile/deleteUpdate/"+D+"/0/0",E)}else{login_window()}},failure:function(E){}};YAHOO.util.Connect.asyncRequest("GET",A,C)}function public_watchlist(I,D,E,C,F,B,G){var A=base_url+"index.php/publicprofile/watchlist_ajax/"+I+"/"+D+"/"+E+"/"+C+"/"+F+"/"+B+"/"+G;var H={success:function(J){if(J.responseText!=""){document.getElementById("watchlist_container").innerHTML=J.responseText}},failure:function(J){}};YAHOO.util.Connect.asyncRequest("GET",A,H)}function public_giftregistry(A,F,D,E,C){var B=base_url+"index.php/publicprofile/giftregistry_ajax/"+A+"/"+F+"/"+D+"/"+E+"/"+C;var G={success:function(H){if(H.responseText!=""){document.getElementById("giftregistry_container").innerHTML=H.responseText}},failure:function(H){}};YAHOO.util.Connect.asyncRequest("GET",B,G)}
