
var baseUrl="http://localhost/trendv2/";function ajaxLoad(ct,params,injectionPoint,injectionType,successCallback,errorCallback,globalEvents)
{if(successCallback==null)successCallback=function(){};if(errorCallback==null)errorCallback=function(){};if(globalEvents==null)globalEvents=false;return $.ajax({type:"POST",url:JSURL+"ajax/"+ct+"/",global:globalEvents,data:params,success:function(msg)
{if(injectionType=='w')
injectionPoint.html(msg);else
injectionPoint.append(msg);successCallback(msg);},error:errorCallback});}
function ajaxCall(ct,params,successCallback,errorCallback,globalEvents)
{if(successCallback==null)successCallback=function(){};if(errorCallback==null)errorCallback=function(){};if(globalEvents==null)globalEvents=false;return $.ajax({type:"POST",url:JSURL+"ajax/"+ct+"/",global:globalEvents,data:params,success:successCallback,error:errorCallback});}
function ajaxCallJSON(ct,params,successCallback,errorCallback,globalEvents)
{if(successCallback==null)successCallback=function(){};if(errorCallback==null)errorCallback=function(){};if(globalEvents==null)globalEvents=false;return $.ajax({type:"POST",url:JSURL+"ajax/"+ct+"/",global:globalEvents,data:params,dataType:'json',success:successCallback,error:errorCallback});}
function normalize(point,size){return(point/size);}
function denormalize(point,size){return(point*size);}
function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
return new Array(xScroll,yScroll)}
function upload_photos(){$("#pic_file").change(function(){$(this).hide();$(this).next(".response").show();$(this).parent("form").submit();});}
function showResponse(action){action.hide();action.next(".response").removeClass("response");$("#messages").slideUp("fast");}
function hideMessageFeedback(msg){msg.children(".msg_buttons").hide();msg.children(".msg_text").hide();msg.children(".msg_response").show();setTimeout("hideMessage('"+msg.attr('id')+"');",1000);}
function hideMessage(id){$("#"+id).slideUp("fast");$("#messages").slideUp("slow");$("#"+id+" .msg_accept").unbind("click");}
function hideContent(id){$("#"+id).slideUp("fast",function()
{if($("#"+id).is(".response"))
{if($("#"+id).parent().children(":visible").length==0)
{$("#"+id).parent().parent().slideUp("fast");$("#"+id).parent().parent().nextAll(".comment_actions").children(".idle").removeClass("idle").addClass("respond");}}});}
function loadPopups()
{if($('#dashboard_signup').length>0){var href=$('#dashboard_signup').attr('href');var start=href.indexOf("sut_s=")+6;var end=href.indexOf("&",start);var cv_section=href.substring(start,end);}else{var cv_section="undefined";}
if($(".awc_friend").length)
ajaxLoad("addHTML",{"block":"user_friend","cv_section":cv_section},$("#messages"),'a');if($(".awc_follow").length)
ajaxLoad("addHTML",{"block":"user_follow","cv_section":cv_section},$("#messages"),'a');if($(".awc_brand_fan").length)
ajaxLoad("addHTML",{"block":"brand_fan","cv_section":cv_section},$("#messages"),'a');if($(".awc_brand_comment_del").length)
ajaxLoad("addHTML",{"block":"brand_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_user_brand_del").length)
ajaxLoad("addHTML",{"block":"user_brand_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_shop_fan").length)
ajaxLoad("addHTML",{"block":"shop_fan","cv_section":cv_section},$("#messages"),'a');if($(".awc_shop_comment_del").length)
ajaxLoad("addHTML",{"block":"shop_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_user_comment_del").length)
ajaxLoad("addHTML",{"block":"user_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_modernas_comment_del").length)
ajaxLoad("addHTML",{"block":"modernas_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_user_friend_del").length)
ajaxLoad("addHTML",{"block":"user_friend_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_user_follow_del").length)
ajaxLoad("addHTML",{"block":"user_follower_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_user_brand_del").length)
ajaxLoad("addHTML",{"block":"user_brand_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_user_shop_del").length)
ajaxLoad("addHTML",{"block":"user_shop_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_pic_unlike").length)
ajaxLoad("addHTML",{"block":"pic_unlike","cv_section":cv_section},$("#messages"),'a');if($(".awc_pic_del").length)
ajaxLoad("addHTML",{"block":"pic_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_pic_comment_del").length)
ajaxLoad("addHTML",{"block":"pic_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_promo_comment_del").length||$(".awc_promo_comment_block").length)
ajaxLoad("addHTML",{"block":"user_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_tip_comment_del").length)
ajaxLoad("addHTML",{"block":"user_comment_del","cv_section":cv_section},$("#messages"),'a');if($(".awc_visibility_all").length)
ajaxLoad("addHTML",{"block":"visibility_changeto_all","cv_section":cv_section},$("#messages"),'a');if($(".awc_visibility_users").length)
ajaxLoad("addHTML",{"block":"visibility_changeto_users","cv_section":cv_section},$("#messages"),'a');}
function showMessage(type,attr,link){var params=new Array();params=attr.split(",");$("#messages").css("top",getPageScroll()[1]);$("#messages").show();switch(type){case"friend":if($("#msg_user_friend").length)
{$("#msg_user_friend .username").html(" "+params[0]);$("#msg_user_friend .msg_avatar").attr("src",params[1]);$("#msg_user_friend .msg_comment").val("");if(params[3]==''){$("#msg_user_friend .msg_comment").hide();$("#msg_user_friend .msg_comment_text").hide();}else{$("#msg_user_friend .msg_comment").show();$("#msg_user_friend .msg_comment_text").show();}
$("#msg_user_friend").slideDown("fast");$("#msg_user_friend .msg_accept").click(function(){var msg=$(this).parent().parent();var comment=msg.children("form").children(".msg_comment").val();hideMessage(msg.attr("id"));showResponse(link.parent("li"));ajaxCall("friend",{"action":"request","id":params[2],"comment":comment});$(this).unbind("click");});}else $("#messages").hide();break;case"follow":if($("#msg_user_follow").length)
{$("#msg_user_follow .username").html(" "+params[0]);$("#msg_user_follow .msg_avatar").attr("src",params[1]);$("#msg_user_follow .msg_comment").val("");if(params[3]==''){$("#msg_user_follow .msg_comment").hide();$("#msg_user_follow .msg_comment_text").hide();}else{$("#msg_user_follow .msg_comment").show();$("#msg_user_follow .msg_comment_text").show();}
$("#msg_user_follow").slideDown("fast");$("#msg_user_follow .msg_accept").click(function(){var msg=$(this).parent().parent();var comment=msg.children("form").children(".msg_comment").val();hideMessage(msg.attr("id"));showResponse(link.parent("li"));ajaxCall("follow",{"action":"add","type":"u","id":params[2],"comment":comment});$(this).unbind("click");});}else $("#messages").hide();break;case"brand_fan":if($("#msg_brand_fan").length)
{$("#msg_brand_fan .brandname").html(" "+params[0]);$("#msg_brand_fan .msg_avatar").attr("src",params[1]);$("#msg_brand_fan .msg_comment").val("");$("#msg_brand_fan").slideDown("fast");$("#msg_brand_fan .msg_accept").click(function(){var msg=$(this).parent().parent();var comment=msg.children("form").children(".msg_comment").val();hideMessage(msg.attr("id"));showResponse(link.parent());ajaxCall("brand_fan",{"action":"add","id":params[2],"comment":comment});$(this).unbind("click");});}else $("#messages").hide();break;case"brand_comment_del":if($("#msg_brand_comment_del").length)
{$("#msg_brand_comment_del .comment").html(link.parent().siblings(".snippet").val());$("#msg_brand_comment_del .msg_avatar").attr("src",link.parent().siblings("a").children(".avatar").attr("src"));$("#msg_brand_comment_del").slideDown("fast");$("#msg_brand_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"del","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"user_brand_del":if($("#msg_user_brand_del").length)
{$("#msg_user_brand_del .brandname").html(" "+params[0]);$("#msg_user_brand_del .msg_avatar").attr("src",params[1]);$("#msg_user_brand_del").slideDown("fast");$("#msg_user_brand_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent("b_"+params[2]);ajaxCall("brand_fan",{"action":"delete","id":params[2]});$(this).unbind("click");});}else $("#messages").hide();break;case"shop_fan":if($("#msg_shop_fan").length)
{$("#msg_shop_fan .shopname").html(" "+params[0]);$("#msg_shop_fan .msg_comment").val("");$("#msg_shop_fan").slideDown("fast");$("#msg_shop_fan .msg_accept").click(function(){var msg=$(this).parent().parent();var comment=msg.children("form").children(".msg_comment").val();hideMessage(msg.attr("id"));showResponse(link.parent("li"));ajaxCall("shop_fan",{"action":"add","id":params[1],"comment":comment});$(this).unbind("click");});}else $("#messages").hide();break;case"shop_comment_del":if($("#msg_shop_comment_del").length)
{$("#msg_shop_comment_del .comment").html(link.parent().siblings(".snippet").val());$("#msg_shop_comment_del").slideDown("fast");$("#msg_shop_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"del","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"friend_accept":ajaxCall("friend",{"action":"accept","id":params[0]});link.parent("li").parent(".actions").children(".ignore").hide();showResponse(link.parent("li"));break;case"friend_ignore":ajaxCall("friend",{"action":"ignore","id":params[0]});link.parent("li").parent(".actions").children(".ignore").hide();showResponse(link.parent("li"));break;case"user_comment_del":if($("#msg_user_comment_del").length)
{$("#msg_user_comment_del .comment").html(link.parent().siblings(".snippet").val());$("#msg_user_comment_del .msg_avatar").attr("src",link.parent().siblings("a").children(".avatar").attr("src"));$("#msg_user_comment_del").slideDown("fast");$("#msg_user_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"del","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"modernas_comment_del":if($("#msg_modernas_comment_del").length)
{$("#msg_modernas_comment_del .comment").html(link.parent().siblings(".snippet").val());$("#msg_modernas_comment_del .msg_avatar").attr("src",link.parent().siblings("a").children(".avatar").attr("src"));$("#msg_modernas_comment_del").slideDown("fast");$("#msg_modernas_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"del","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"user_friend_del":if($("#msg_user_friend_del").length)
{$("#msg_user_friend_del .username").html(" "+params[0]);$("#msg_user_friend_del .msg_avatar").attr("src",params[1]);$("#msg_user_friend_del").slideDown("fast");$("#msg_user_friend_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent("u_"+params[2]);ajaxCall("friend",{"action":"delete","id":params[2]});$(this).unbind("click");});}else $("#messages").hide();break;case"user_follow_del":if($("#msg_user_follow_del").length)
{$("#msg_user_follow_del .username").html(" "+params[0]);$("#msg_user_follow_del .msg_avatar").attr("src",params[1]);$("#msg_user_follow_del").slideDown("fast");$("#msg_user_follow_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent("u_"+params[2]);ajaxCall("follow",{"action":"delete","id":params[2]});$(this).unbind("click");});}else $("#messages").hide();break;case"user_brand_del":if($("#msg_user_brand_del").length)
{$("#msg_user_brand_del .brandname").html(" "+params[0]);$("#msg_user_brand_del .msg_avatar").attr("src",params[1]);$("#msg_user_brand_del").slideDown("fast");$("#msg_user_brand_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent("b_"+params[2]);$.post("/?ct=usuario_fan_marca",{idm:params[2],eliminar:"marca"});$(this).unbind("click");});}else $("#messages").hide();break;case"user_shop_del":if($("#msg_user_shop_del").length)
{$("#msg_user_shop_del .shopname").html(" "+params[0]);$("#msg_user_shop_del").slideDown("fast");$("#msg_user_shop_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent("s_"+params[1]);ajaxCall("shop_fan",{"action":"delete","id":params[1]});$(this).unbind("click");});}else $("#messages").hide();break;case"pic_unlike":if($("#msg_pic_unlike").length)
{$("#msg_pic_unlike .msg_thumbnail").attr("src",params[1]);$("#msg_pic_unlike").slideDown("fast");$("#msg_pic_unlike .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent("p_"+params[0]);ajaxCall("photo",{"action":"unlike","id":params[0]});$(this).unbind("click");});}else $("#messages").hide();break;case"pic_del":if($("#msg_pic_del").length)
{$("#msg_pic_del .msg_thumbnail").attr("src",params[1]);$("#msg_pic_del").slideDown("fast");$("#msg_pic_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));$(this).unbind("click");ajaxCall("photo",{"action":"delete","id":params[0]},function()
{if(params[2]!=""){window.location.href=params[2];}});});}else $("#messages").hide();break;case"pic_comment_del":if($("#msg_pic_comment_del").length)
{$("#msg_pic_comment_del .comment").html(link.parent().siblings(".snippet").val());$("#msg_pic_comment_del .msg_thumbnail").attr("src",$("#msg_thumbnail").val());$("#msg_pic_comment_del").slideDown("fast");$("#msg_pic_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"del","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"promo_comment_del":if($("#msg_user_comment_del").length)
{$("#msg_user_comment_del .comment").html(" "+params[0]);$("#msg_user_comment_del .msg_avatar").attr("src",link.parent().siblings("a").children(".avatar").attr("src"));$("#msg_user_comment_del").slideDown("fast");$("#msg_user_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"delPromo","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"promo_comment_block":if($("#msg_user_comment_del").length)
{$("#msg_user_comment_del .comment").html(" "+params[0]);$("#msg_user_comment_del .msg_avatar").attr("src",link.parent().siblings("a").children(".avatar").attr("src"));$("#msg_user_comment_del").slideDown("fast");$("#msg_user_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"blockPromo","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"tip_comment_del":if($("#msg_user_comment_del").length)
{$("#msg_user_comment_del .comment").html(link.parent().siblings(".snippet").val());$("#msg_user_comment_del .msg_avatar").attr("src",link.parent().siblings("a").children(".avatar").attr("src"));$("#msg_user_comment_del").slideDown("fast");$("#msg_user_comment_del .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));hideContent(link.parent().parent().attr("id"));ajaxCall("comments",{"action":"del","id":link.parent().parent().attr("id").substring(2)});$(this).unbind("click");});}else $("#messages").hide();break;case"visibility_changeto_all":if($("#msg_visibility_changeto_all").length)
{$("#msg_visibility_changeto_all").slideDown("fast");$("#msg_visibility_changeto_all .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));$("#select_visibility option").removeAttr("selected");$("#select_all").attr("selected","selected");$(".visibility_explain").hide();$("#ve_all").show();$("#portability tr").removeClass("disabled");$("#portability input").removeAttr("disabled");$("#portability .requires").hide();$("#portability .op_yes").attr("checked","checked");$("#profile_privacy").submit();$(this).unbind("click");});}else $("#messages").hide();break;case"visibility_changeto_users":if($("#msg_visibility_changeto_users").length)
{$("#msg_visibility_changeto_users").slideDown("fast");$("#msg_visibility_changeto_users .msg_accept").click(function(){var msg=$(this).parent().parent();hideMessage(msg.attr("id"));$("#select_visibility option").removeAttr("selected");$("#select_users").attr("selected","selected");$(".visibility_explain").hide();$("#ve_users").show();$("#portability tr").removeClass("disabled");$("#portability input").removeAttr("disabled");$("#portability .requires").hide();$("#portability .op_yes").attr("checked","checked");$(".all_required").addClass("disabled");$(".all_required input").attr("disabled","disabled");$(".all_required .requires").show();$(".all_required .op_no").attr("checked","checked");$("#profile_privacy").submit();$(this).unbind("click");});}else $("#messages").hide();break;case"ask_join_group":grp_ask_join(params);break;case"del_topic":grp_del_topic(params);break;case"del_topic_msg":grp_del_topic_msg(params);break;}
return false;}
function comments(){$("#comments .default_text").each(function(i){var comment=$(this);var text=$(this).val();$(this).focus(function(){$(this).css('color','#1a2632');if($(this).val()==text)$(this).val("");});$(this).blur(function(){$(this).css('color','#77848e');if($(this).val()==""){$(this).next('.submit').hide();$(this).val(text);}});$(this).parent().parent("form").submit(function(){if(comment.val()==""||comment.val()==text)return false;})});$("#comments .respond").live("click",function(){$resp=$(this).parent().prev(".responses");$link=$(this);$resp.children("form").hide();$resp.show();$resp.children("form").slideDown();$link.hide();$('body').click(function(){if($resp.find('.response').length==0)
$resp.slideUp();else
$resp.children("form").slideUp();$link.show();$('body').unbind('click');});$(this).parent().prev(".responses").click(function(event){event.stopPropagation();});return false;});$("#comments .idle").live("click",function(){return false;});$("#comments textarea").focus(function(){$(this).next('.submit').show();});$("#comments form").submit(function(){if($(this).find('textarea.default_val').length>0)return false;});}
function inputFieldBehaviors()
{$("input[type='text'].focushere:first").focus();$("input.auto_select,textarea.auto_select").each(function(i)
{$(this).focus(function(){$(this).select();});$(this).click(function(){$(this).select();});$(this).mouseup(function(e){e.preventDefault();});});}
function messages(){$(".msg_close").live("click",function(){hideMessage($(this).parent(".msg").attr("id"));});$(".msg_ok").live("click",function(){hideMessage($(this).parent(".msg_buttons").parent(".msg").attr("id"));});$(".msg_cancel").live("click",function(){hideMessage($(this).parent(".msg_buttons").parent(".msg").attr("id"));});}
function like(attr,obj){if(attr!='')
{ajaxCall("likeit",{"action":"like","id":attr});}
obj.hide();obj.next(".response").fadeIn();return false;}
function actions(){$(".awc_join_group").click(function(){return showMessage('join_group',$(this).attr("name"),$(this));});$(".awc_ask_join_group").click(function(){return showMessage('ask_join_group',$(this).attr("name"),$(this));});$(".logReg").click(function(){return showMessage('logReg',$(this).attr("name"),$(this));});$(".awc_friend").click(function(){return showMessage('friend',$(this).attr("name"),$(this));});$(".awc_follow").click(function(){return showMessage('follow',$(this).attr("name"),$(this));});$(".awc_brand_fan").live('click',function(){return showMessage('brand_fan',$(this).attr("name"),$(this));});$(".awc_brand_comment_del").click(function(){return showMessage('brand_comment_del',$(this).attr("name"),$(this));});$(".awc_shop_fan").click(function(){return showMessage('shop_fan',$(this).attr("name"),$(this));});$(".awc_shop_comment_del").click(function(){return showMessage('shop_comment_del',$(this).attr("name"),$(this));});$(".anc_like_pic").click(function(){return like($(this).attr("name"),$(this).parent());});$(".awc_pic_unlike").click(function(){return showMessage('pic_unlike',$(this).attr("name"),$(this));});$(".awc_friend_accept").click(function(){return showMessage('friend_accept',$(this).attr("name"),$(this));});$(".awc_friend_ignore").click(function(){return showMessage('friend_ignore',$(this).attr("name"),$(this));});$(".awc_user_comment_del").click(function(){return showMessage('user_comment_del',$(this).attr("name"),$(this));});$(".awc_user_friend_del").click(function(){return showMessage('user_friend_del',$(this).attr("name"),$(this));});$(".awc_user_follow_del").click(function(){return showMessage('user_follow_del',$(this).attr("name"),$(this));});$(".awc_user_block").click(function(){return showMessage('user_block',$(this).attr("name"),$(this));});$(".awc_user_brand_del").click(function(){return showMessage('user_brand_del',$(this).attr("name"),$(this));});$(".awc_user_shop_del").click(function(){return showMessage('user_shop_del',$(this).attr("name"),$(this));});$(".awc_pic_del").click(function(){return showMessage('pic_del',$(this).attr("name"),$(this));});$(".awc_pic_comment_del").click(function(){return showMessage('pic_comment_del',$(this).attr("name"),$(this));});$(".awc_modernas_comment_del").click(function(){return showMessage('modernas_comment_del',$(this).attr("name"),$(this));});$(".awc_promo_comment_del").click(function(){return showMessage('promo_comment_del',$(this).attr("name"),$(this));});$(".awc_promo_comment_block").click(function(){return showMessage('promo_comment_block',$(this).attr("name"),$(this));});$(".awc_tip_comment_del").click(function(){return showMessage('tip_comment_del',$(this).attr("name"),$(this));});$(".awc_visibility_all").click(function(){return showMessage('visibility_changeto_all','',$(this));});$(".awc_visibility_users").click(function(){return showMessage('visibility_changeto_users','',$(this));});$(".deletefeed").click(function(){var params=new Array();params=$(".deletefeed").attr("name").split(",");ajaxCall("activity",{"action":"deletefeed","id":params[0]});$(this).unbind("click");$(this).parent().parent().slideUp();return false;});$(".deletefeedhome").click(function(){alert($(this).parent())
var params=new Array();params=$(".deletefeedhome").attr("name").split(",");ajaxCall("activity",{"action":"deletefeedhome","id":params[0]});$(this).unbind("click");$(this).parent().parent().slideUp();return false;});}
function default_val(){$(".default_val").live('focus',function(){var value=$(this).val();$(this).removeClass("default_val");$(this).val("");$(this).blur(function(){if($(this).val()==""){$(this).addClass("default_val");$(this).val(value);}else{$(this).unbind("focus");}
$(this).unbind("blur");});});}
function search(){if($('#search_box_query').val()==""){$('#search_box_query').val($('#search_box_default').val());}
$('#search_box_query').live('focus',function(){$('#search_box_submit').show();});$('#search_box_query').live('blur',function(){$('#search_box_submit').hide();});}
function search_box(){if($('#g_search_query').val()==""){$('#g_search_query').val($('#g_search_default').val());}
$('#g_search_query').focus(function(){$('#g_search_button').addClass('hover');});$('#g_search_button').focus(function(){$(this).addClass('hover');});$('#g_search_query').live('blur',function(){$('#g_search_button').removeClass('hover')});$('#g_search_button').live('blur',function(){$(this).removeClass('hover');});}
function smooth_scroll()
{$('.smooth_scroll').click(function()
{$.scrollTo($(this).attr('href'),1000);return false;});}
function share(){$('.share_box_shorten').click(function(){$link=$(this);$url=$link.parents('.share_box').children('.share_box_url');$link.hide();$link.next().show();if(!$link.hasClass('short'))
{longUrl=encodeURIComponent($url.val());ajaxCall('share',{'longUrl':longUrl},function(data)
{$link.next().hide();$link.addClass('short');$url.val(data);$url.focus();});}
return false;});}
function notifications(){$('#notification_close').click(function()
{ajaxCall("set_flag",{flag:$(this).attr('data-flag'),val:'1'},function()
{$('#notification').slideUp('fast');});return false;});}
function namePars(str){var parts=str.split(":");return parts;}
function ajx_getHighlightedBrand(data){ajaxLoad('brand',data.name,$('#didyouknow'),'w');}
function ajx_getBrandFollowers(data){ajaxLoad('brand',data.name,$('#followers'),'w');}
function newAjax(){$(".ajx").live('click',function(){var data=new Object;var name=$(this).attr('name');if(name.length>0){data.name=jQuery.parseJSON(name);}
else data.name=new Object();data.obj=$(this);data.name.action=$(this).attr('class').split(' ').slice(1,2)[0];var functionString="ajx_"+data.name.action;window[functionString](data);return false;});}
function fixed_call(){if(($.browser.msie&&$.browser.version<7))
{$('#fixed_call').hide();}
$('#fixed_call_close').click(function(){$('#fixed_call').hide();var exdate=new Date();exdate.setDate(exdate.getDate()+500);document.cookie="trendtation_call=true;expires="+exdate.toUTCString();return false;});}
$(document).ready(function(){newAjax();loadPopups();actions();messages();comments();inputFieldBehaviors();upload_photos();search();default_val();smooth_scroll();search_box();share();notifications();fixed_call();});