
(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options){$.extend(settings,options);}
var elements=this;if("scroll"==settings.event){$(settings.container).bind("scroll",function(event){var counter=0;elements.each(function(){if($.abovethetop(this,settings)||$.leftofbegin(this,settings)){}else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);});}
this.each(function(){var self=this;if(undefined==$(self).attr("original")){$(self).attr("original",$(self).attr("src"));}
if("scroll"!=settings.event||undefined==$(self).attr("src")||settings.placeholder==$(self).attr("src")||($.abovethetop(self,settings)||$.leftofbegin(self,settings)||$.belowthefold(self,settings)||$.rightoffold(self,settings))){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");}
self.loaded=false;}else{self.loaded=true;}
$(self).one("appear",function(){if(!this.loaded){$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).attr("original"))
[settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).attr("original"));};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});$(settings.container).trigger(settings.event);return this;};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.container).offset().top+$(settings.container).height();}
return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft();}else{var fold=$(settings.container).offset().left+$(settings.container).width();}
return fold<=$(element).offset().left-settings.threshold;};$.abovethetop=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollTop();}else{var fold=$(settings.container).offset().top;}
return fold>=$(element).offset().top+settings.threshold+$(element).height();};$.leftofbegin=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollLeft();}else{var fold=$(settings.container).offset().left;}
return fold>=$(element).offset().left+settings.threshold+$(element).width();};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});})(jQuery);(function($,$$){$(document).ready(function(){function find_newsfeed_type(){var val="";if(typeof(newsfeed_type)==="undefined"){return val;}
switch(newsfeed_type){case 0:val="";break;case 1:val="History_";break;case 2:val="Featured_";break;default:val="Unknown_";}
return val;}
function adjust_height(){$('.leftColumn').css('height','');$('.rightColumn').css('height','');var sidebar_total_height=$('.leftColumn').outerHeight();var main_content_total_height=$('.rightColumn').outerHeight();if(sidebar_total_height>main_content_total_height){var main_padding=main_content_total_height-$('.rightColumn').height();$('.rightColumn').height(sidebar_total_height-main_padding);}else{var sidebar_padding=sidebar_total_height-$('.leftColumn').height();$('.leftColumn').height(main_content_total_height-sidebar_padding);}}
function register_onload_GA_event(){register_ga_event("page_load");}
function show_profile_hovercard(){hide_hover=true;show_hover_loading_box($(this));var actor_image=$(this);var profile_box=$('.j-cardbaloon');var loading_box=$('.cardBaloonLoading');var user_login=$(this).attr('href');user_login=user_login.replace("/","");var arrow_offset=loading_box.children('span').css('top');arrow_offset=arrow_offset.replace('px','');arrow_offset=parseInt(arrow_offset,10);var loading_box_height=loading_box.children('span').height();$.ajax({url:"/newsfeed/profile_hovercard",type:'GET',dataType:'json',data:{'login':user_login},success:function(data){reset_hover_card();var card_left=profile_box.children('div').children('ul.cardLeft');card_left.children('li.userImageHoverCard').children('img').attr('src',data.information.userimage);if(data.information.show_follow_cta===true){card_left.children('li.follow').children('a.hovercard_follow_cta').show();card_left.children('li.follow').children('span.hovercard_followed_cta').hide();}else{card_left.children('li.follow').children('a.hovercard_follow_cta').hide();card_left.children('li.follow').children('span.hovercard_followed_cta').show();}
var card_right=profile_box.children('div').children('ul.cardRight');var user_information=card_right.children('li.username').children('a');user_information.html(data.information.name);user_information.attr('href','/'+data.information.login);card_right.children('li.userMeta').children('ul').children('li.designation').html(data.information.occupation_and_organization);card_right.children('li.userMeta').children('ul').children('li.location_info').html(data.information.address);var metaInfo=card_right.children('li.userMeta').children('ul').children('li');metaInfo.children('span.followers_count').text("Followers "+data.information.followers);metaInfo.children('span.seperator').removeClass('hide');metaInfo.children('span.following_count').text("Following "+data.information.following);card_left.children('li.follow').children('a.hovercard_follow_cta').attr('data-contactee',user_login);card_left.children('li.follow').children('a.hovercard_follow_cta').text('Follow');card_left.children('li.follow').children('span.hovarcard_followed_cta').text('Following');loading_box.addClass('hide');profile_box.removeClass('hide');var top=calculate_top_offset_for_hovercard(actor_image,profile_box);var left=calculate_left_offset_for_hovercard(actor_image,profile_box);profile_box.css({top:top+"px",left:left+"px"});},error:function(jqXHR){loading_box.addClass('hide');}});}
function calculate_top_offset_for_hovercard(current_element,hover_card_type){var hover_card_arrow_height=hover_card_type.children('span').height();return current_element.children().offset().top-hover_card_type.height()-hover_card_arrow_height/2-20;}
function calculate_left_offset_for_hovercard(current_element,hover_card_type){var hover_image_width=current_element.width();var arrow_offset_left=hover_card_type.children('span').css('left');arrow_offset_left=arrow_offset_left.replace('px','');arrow_offset_left=parseInt(arrow_offset_left,10);var arrow_offset_width=hover_card_type.children('span').width();return current_element.offset().left+hover_image_width/2-arrow_offset_left-arrow_offset_width/2;}
function hideHovercard(){var profile_box=$('.j-cardbaloon');if(hide_hover===true){profile_box.addClass('hide');}
$('.j-cardbaloon').children('div.card').children('ul.cardLeft').children('li.userImageHoverCard').children('img').attr('src',"");}
function doNothingFunction(){window.hide_hover=false;}
function hideBaloonCard(){$(this).addClass('hide');}
function bind_hover_card(){$('a.actor-image-link-aggregated').hoverIntent(hoverIntent_profile_hovercard_config);$('a.j-actor-image-follower-following').hoverIntent(hoverIntent_profile_hovercard_config);$('.j-cardbaloon').hoverIntent(hoverIntent_baloon_config);$('a.actor-image-link').hoverIntent(hoverIntent_profile_hovercard_config);}
var current_newsfeed_type=find_newsfeed_type();adjust_height();if(typeof(is_newsfeed_page)!=="undefined"){_gaq.push(['_setAccount','UA-2330466-1']);_gaq.push(['_setDomainName','.slideshare.net']);_gaq.push(['_trackPageview']);register_onload_GA_event();}
var page_number=1;var auto_scroll_in_progress=false;var hoverIntent_profile_hovercard_config={over:show_profile_hovercard,timeout:500,out:hideHovercard};var hoverIntent_baloon_config={over:doNothingFunction,timeout:5,out:hideBaloonCard};bind_hover_card();var placeHolderText="Share an update with friends...";$('#wallMessage').val(placeHolderText);$('#wallMessage').bind('focus',function(){var ele=$(this);if(ele.val()==placeHolderText){ele.val('').css('color','#222');}});$('#wallMessage').bind('blur',function(){var ele=$(this);if(ele.val()===""){ele.val(placeHolderText).css('color','#bbb');}});$('#activity_submit').live("click",function(e){e.preventDefault();var activity_submit=$(this);activity_submit.siblings('img').show();register_ga_event('PostOnWall');var textarea=$(this).parents('span').siblings('textarea');var wallpost_text=textarea.val();if(wallpost_text.length===0||wallpost_text===placeHolderText){activity_submit.siblings('img').hide();return false;}
if(wallpost_text.length>400){alert("Maximum input characters allowed are 400");activity_submit.siblings('img').hide();return false;}
if((wallpost_text!=="")){$.ajax({url:"/"+$$.user.login+"/wall/post",type:'POST',dataType:'json',data:{'wallpost_text':wallpost_text},success:function(data){if(data.success===true){register_ga_event('PostOnWall_Successful');wallpost_text=data.wallpost_text;var wallpost_form=activity_submit.parents('div.wallPostForm');var wallpost_view="";var first_child="";if(window.location.search==="?experiment=true"){wallpost_view=wallpost_form.siblings('ul.rightpanel').children('li#wallpost_partial:first-child');first_child=wallpost_form.siblings('ul').children('li#wallpost_partial:first-child').next();}
else{var right_col=wallpost_form.parent('div.leftColumn').siblings('div.rightColumn');wallpost_view=right_col.children().children('ul.rightpanel').children('li#wallpost_partial:first-child');first_child=right_col.children().children('ul.rightpanel').children('li#wallpost_partial:first-child').next();}
var wallpost_view_clone=wallpost_view.clone();wallpost_view_clone.removeClass('hide');wallpost_view_clone.children('div.feedInfo').children('span').children('span.wallpost_text').append(wallpost_text);$(first_child).before(wallpost_view_clone);activity_submit.siblings('img').hide();$('#wallMessage').val(placeHolderText).css('color','#bbb');}else{alert("Something went wrong with the posting. \nMake sure your character limit is less than 400.");activity_submit.siblings('img').hide();}},error:function(jqXHR){activity_submit.siblings('img').hide();}});}});$('a.j-commentEntry').live("click",function(){register_ga_event("comment_anchor");var comment=$(this).parents('ul.newsFeedCTA').siblings('div.commentInput');if(comment.is(':visible')){comment.hide();}else{comment.show();}});$('.j-PostCommentButton').live("click",function(){var $commentButton=$(this);$commentButton.siblings('img').show();var commentText=$commentButton.prev().val();if(commentText!==""){register_ga_event("Post_Comment_Button");}
var stripped_title=$commentButton.attr('data-stripped-title');$.ajax({url:"/comment/create",type:'POST',data:{'slide_title':stripped_title,'comment[text]':commentText},success:function(data){register_ga_event("Post_Comment_Button_Successful");$commentButton.siblings('img').hide();var commentEntry=$commentButton.parents('div.commentInput');commentEntry.hide();var commentHTML=$commentButton.parents('div.commentInput').siblings('ul.newsFeedCTA');$('<span/>').addClass('commentText').html(commentText).appendTo(commentHTML);},error:function(jqXHR){$commentButton.siblings('img').hide();register_ga_event("Post_Comment_Button_Failed");}});});$('.linkedin-cta').click(function(e){IN.User.authorize();});if((typeof(is_newsfeed_page)!=="undefined")&&(typeof(IN)!=="undefined")){IN.Event.on(IN,'auth',function(){$('.linkedin-cta-container img').removeClass('hide');var fn="firstName";var ln="lastName";var twitter="primaryTwitterAccount";var industry="industry";var dob="dateOfBirth";var positions="positions";var loc="location";var pic_url="pictureUrl";var summary="summary";var url="memberUrlResources";IN.API.Profile("me").fields([fn,ln,twitter,industry,dob,positions,loc,pic_url,summary,url]).result(linkedinSuccess).error(linkedInError);});}
function linkedinSuccess(me){register_ga_event("Linkedin_CTA_clicked");var id=me.values[0].id;$('.linkedin-cta-container').children('img').removeClass('hide');$('.linkedin-error').addClass('hide');$.ajax({url:"/newsfeed/update_linkedin_info",type:'POST',dataType:'json',data:{'linkedin_data':JSON.stringify(me.values[0])},success:function(data){register_ga_event("Linkedin_import_successful");$('.linkedin-cta-container').children('img').addClass('hide');if(data.success===true){var user_login=slideshare_object.user.login;var edit_profile="/edit_myinformation?from_linkedin";var slideshare="http://www.slideshare.net/";var redirect_url=slideshare+user_login+edit_profile;window.location.replace(redirect_url);}
else{register_ga_event("Linkedin_import_failed");$('.linkedin-cta-container').children('img').addClass('hide');$('.linkedin-error').removeClass('hide');}},error:function(jqXHR){register_ga_event("Linkedin_import_error");$('.linkedin-cta-container').children('img').addClass('hide');$('.linkedin-error').removeClass('hide');}});}
function linkedInError(error){$('.linkedin-error').removeClass('hide');}
$('.j-followNewsfeed').live("click",function(){var $temp=$(this);$temp.siblings('img').show();$contactee=$temp.attr('data-contactee');register_ga_event("Follow_anchor_clicked");var follow_type="Follow";follow($temp,$contactee,follow_type);});$('.j-aggregated_follow').live("click",function(){var $temp=$(this);$temp.siblings('img').show();var event_type=$temp.text();if(event_type==='Follow'){aggregate_follow($temp);}});$('.j-favoriteNewsfeed').live("click",function(){register_ga_event("Favorite_anchor_clicked");var $temp=$(this);$temp.siblings('img').show();var stripped_title=$temp.attr('title');favorite($temp,stripped_title,'Favorite');});$('.j-followNewsfeed').live("click",function(){var $temp=$(this);$temp.siblings('img').show();$contactee=$temp.attr('data-contactee');register_ga_event("Follow_anchor_clicked");$.ajax({url:"/contact/create",type:'POST',dataType:'json',data:{'contactee':$contactee},success:function(data){if(data.success===true){$temp.siblings('img').hide();$temp.hide();$temp.parents('li.newsfeedfollow').siblings('li.newsfeedfollow').show();register_ga_event("Follow_successful");}else{$temp.siblings('img').hide();}},error:function(jqXHR){$temp.siblings('img').hide();register_ga_event("Follow_Failed");}});});$(".actor-image-link").live('click',function(){register_ga_event("actor_image_clicked");});$(".slideshow-image-link").live('click',function(){register_ga_event("slideshow_image_clicked");});$(".fbconnect_cta").live('click',function(){register_ga_event("fbconnect_cta_clicked");});$(".actor-link").live('click',function(){register_ga_event("actor_link_clicked");});$(".slideshow-link").live('click',function(){register_ga_event("slideshow_link_clicked");});$(".user-followed-link").live('click',function(){register_ga_event("user_followed_link_clicked");});if($("h-prompt-complete-profile-title").length){slideshare_object.ga("Newsfeed","complete_profile");}
if(getUrlVar('followed',location.href)){slideshare_object.ga("Newsfeed","autologin_follow_dialogue");}
$(window).load(function(){if(slideshare_object.user.su===true&&typeof(is_newsfeed_page)!=="undefined"){var login=window.location.pathname.split("/")[1];var wrapper=$('#j-latest-profile-views')[0];$.ajax({url:"/newsfeed/recent_profile_visitors",type:'GET',dataType:'json',async:true,data:{'login':login},success:function(data){if(data.success===true){wrapper.innerHTML=data.html;adjust_height();$('.j-actor-image-recent-visitor').hoverIntent(hoverIntent_profile_hovercard_config);}},error:function(jqXHR){}});}});if(find_newsfeed_type()===""&&typeof(is_newsfeed_page)!=="undefined"){$(window).scroll(function(){var last_child=$("ul.rightpanel").children(':last-child');var footerWrapper=$('div.footerWrapper');var docViewTop=$(window).scrollTop();var docViewBottom=docViewTop+$(window).height();var elemTop=footerWrapper.offset().top;var elemBottom=elemTop+last_child.offset().top;var condition_1=(elemBottom>=docViewTop)&&(elemTop<=docViewBottom+200)&&(elemTop>=(docViewBottom-50));var condition_2=$(window).scrollTop()==$(document).height()-$(window).height();if(condition_1||condition_2){if(auto_scroll_in_progress===false){auto_scroll_in_progress=true;register_ga_event('Infinite_Newsfeed');if(!last_child.hasClass('no-updates')){last_child.show();adjust_height();page_number=page_number+1;var pathname=window.location.pathname.split("/");var login=pathname[1];var newsfeed_wrapper=$('ul.rightpanel');$.ajax({url:"/newsfeed/infinite_scroll",type:'GET',dataType:'json',async:true,data:{'page_number':page_number,'login':login},success:function(data){last_child.hide();if((data.success===false)&&(!last_child.hasClass('no-updates'))){register_ga_event('Infinite_Newsfeed_No_Updates');$(data.html).appendTo(newsfeed_wrapper);}else{register_ga_event('Infinite_Newsfeed_More_Updates');$(data.html).appendTo(newsfeed_wrapper);}
auto_scroll_in_progress=false;bind_hover_card();adjust_height();},error:function(jqXHR){last_child.hide();register_ga_event('Infinite_Newsfeed_failed');auto_scroll_in_progress=false;}});}}}});}
function show_hover_loading_box(current_element){var hover_box=$('.j-cardbaloon');var top_condition=(hover_box.css('top')!=((current_element.offsetTop-130)+"px"));var left_condition=(hover_box.css('left')!=((current_element.offsetLeft+10)+"px"));if(top_condition||left_condition){if(hover_box.is(':visible')){hover_box.addClass('hide');}
var loading_box=$('.cardBaloonLoading');loading_box.removeClass('hide');var top=calculate_top_offset_for_hovercard(current_element,loading_box);var left=calculate_left_offset_for_hovercard(current_element,loading_box);loading_box.css({top:top+"px",left:left+"px"});}}
function follow(current_item,$contactee,follow_type){$.ajax({url:"/contact/create",type:'POST',dataType:'json',data:{'contactee':$contactee},success:function(data){if(data.success===true){current_item.siblings('img').hide();current_item.hide();current_item.parents('li').children('span').show();register_ga_event(follow_type+"_successful");}else{current_item.siblings('img').hide();}},error:function(jqXHR){current_item.siblings('img').hide();register_ga_event(follow_type+"_Failed");}});}
function favorite(current_item,stripped_title,favorite_type){$.ajax({url:"/favorite/create",type:'POST',data:{'stripped_title':stripped_title,'source':'newsfeed','favorite[tag_text]':' '},success:function(data){register_ga_event(favorite_type+"_successful");current_item.siblings('img').hide();current_item.parents('li').children('a.follow_cta').hide();current_item.parents('li').children('span').show();},error:function(jqXHR){current_item.siblings('img').hide();register_ga_event("Favorite_Failed");}});}
function reset_hover_card(){var profile_box=$('.j-cardbaloon');profile_box.removeClass('uploadCardBaloon');var list=profile_box.children('div').children('ul');list.children('li.designation').children('span').html("");var metaInfo=list.children('li.userMeta').children('ul').children('li');metaInfo.children('span.followers_count').text("");metaInfo.children('span.following_count').text("");metaInfo.children('span.seperator').addClass('hide');}
function aggregate_follow(current_variable){var $contactee=current_variable.attr('data-contactee');register_ga_event("Follow_anchor_clicked");var follow_type="Follow_aggregated";follow(current_variable,$contactee,follow_type);}
function register_ga_event(event){if(_gaq&&_gaq.push){event=current_newsfeed_type+event;_gaq.push(['_trackEvent','Newsfeed',event]);}}});})(jQuery,slideshare_object);(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);var set_window_location=function(url){try{window.location.href=url;}catch(e){window._gaq=_gaq||[];_gaq.push(["_trackEvent","Profiles","Orchestra: Iframe communication error in accordion",window.location.href]);}};(function($$,$){var unfollow_confirmed=function(e){slideshare_object.ga('Profiles','slidespace_orchestra_unfollow');$(e.target).parent().next().next().show();$(e.target).parent().hide();var url="/contact/delete";$.post(url,{contactee:slideshare_object.owner.id,frm_source:'profilepage'},function(response){$(e.target).parent().next().next().hide();if(response.success){$(e.target).parent().next().show();}else{$(e.target).parent().show();}},'json');};var confirm_box=function(title,message,callback){title=title||"Confirm";message=message||"Are you sure you want to proceed?";dialog='<div id="dialog" style="display:none;" title="'+
title+'"><p><span class="ui-icon ui-icon-info" style="float:left; margin:0 7px 20px 0;"></span>'+
message+'</p></div>';$('body').append(dialog);$("#dialog").dialog({bgiframe:true,resizable:false,height:140,modal:false,overlay:{backgroundColor:'#000',opacity:0.5},closeOnEscape:true,dialogClass:'confirm',close:function(){$(this).dialog('destroy');},buttons:{'Unfollow':function(){$(this).dialog('close');callback();},'Close':function(){$(this).dialog('close');}}});};var orchestra={register_listeners:function(){$('a.j-follow').live('click',function(e){slideshare_object.ga('Profiles','slidespace_orchestra_follow');$(e.target).parent().next().show();$(e.target).parent().hide();var url="/contact/create";$.post(url,{contactee:slideshare_object.owner.id,frm_source:'profilepage'},function(response){if(response.suspended){window.location.replace('/login');}else if(response.follow_limit_reached){window.location.reload();}else{$(e.target).parent().next().hide();if(response.success){$(e.target).parent().prev().show();}else{$(e.target).parent().show();}}},'json');return false;});$('a.j-unfollow').live('click',function(e){var message="You are following "+slideshare_object.owner.login;confirm_box("Following",message,function(){unfollow_confirmed(e);});return false;});$('.j-tooltip').tooltip();},private_message_interaction:function(){$('.j-private_message').fancybox({'hideOnContentClick':false,'enableEscapeButton':true,'centerOnScroll':false,'dontShowFancyTitle':false,'overlayOpacity':0.85,'padding':0,'margin':0,'overlayColor':"#000"});$('#fancy_div #composeForm').live('click',function(e){var params={};params.recipient=slideshare_object.owner.login;params.subject=$('#fancy_div #subject').val();params.message=$('#fancy_div #message').val();$(e.target).next().show();$(e.target).hide();$.ajax({url:'/message/send_message',data:params,type:'POST',dataType:'json',cache:false,success:function(response){$(e.target).next().hide();$(e.target).show();if(response.success){$('#fancy_div #compose').hide();$('#fancy_div #j-compose_success').show();$('div#fancy_content').css('padding','0px');$('div#fancy_close').css({color:'#fff',top:'9px'});$('div#fancy_outer').height(38);setTimeout('$.fn.fancybox.close()',4*1000);}else{$('#fancy_div .j-pvtMessage #error').parent().show();if(response.error!==null){$('#fancy_div .j-pvtMessage #error').html(response.error);}}}});});},adjust_height:function(){$('.sidebar').css('height','');$('.mainContent').css('height','');var sidebar_total_height=$('.sidebar').outerHeight();var main_content_total_height=$('.mainContent').outerHeight();if(sidebar_total_height>main_content_total_height){var main_padding=main_content_total_height-$('.mainContent').height();$('.mainContent').height(sidebar_total_height-main_padding);}else{var sidebar_padding=sidebar_total_height-$('.sidebar').height();$('.sidebar').height(main_content_total_height-sidebar_padding);}}};var profile={cache:{},tags_interaction:function(){$('#showMoreTags,#showLessTags').click(function(e){if(e.target.id=='showMoreTags'){$('#tagsLess').hide().siblings('#tagsMore').show();$('#search_uploaded_tags').show();if(typeof(orchestra)!=='undefined'){orchestra.adjust_height();}}
else{$('#tagsMore').hide().siblings('#tagsLess').show();$('#search_uploaded_tags').hide();if(typeof(orchestra)!=='undefined'){orchestra.adjust_height();}}
return false;});},removeFavorites:function(){var e=profile.cache.removeFavoriteElement,element=$(e.target),parent=element.parents('li'),slideshow_id=element.attr('href').split('#')[1],user_id=slideshare_object.owner.id;delete profile.cache.removeFavoriteElement;$('.j-fav_count').html(parseInt($('.j-fav_count').html(),10)-1);element.next().show();$.post('/favorite/delete',{slideshow_id:slideshow_id,user_id:user_id},function(){var siblings=parent.siblings();parent.hide(1000,function(){parent.remove();$.each(siblings,function(i,j){var element=$(j);element.removeClass('last');if((i+1)%4===0){element.addClass('last');}});});});return false;},confirmRemoveFavorites:function(e){profile.cache.removeFavoriteElement=e;if($$.confirm("Confirm","Are you sure want to remove this from favorites ?",profile.removeFavorites)){delete profile.cache.removeFavoriteElement;}},updateFavoriteTags:function(value){var element=profile.cache.editTag,url="/favorite/update?user_id="+
slideshare_object.owner.id+"&slideshow_id="+element.attr('href').split('#')[1]+"&favorite%5Btag_text%5D="+value;$.get(url,function(){window.location.reload();});},editFavoriteTags:function(e){var element=$(e.target),tags_array=element.parent().parent().children('.tags'),tags_text="";profile.cache.editTag=element;$.each(tags_array,function(i,j){tags_text+=$(j).html()+",";});tags_text=tags_text.slice(0,-1);$$.prompt("Please update the tags","Tags :",tags_text,profile.updateFavoriteTags);var elem=$('#prompt_value');$$.tagTextBoxInteraction(elem);return false;},searchUploadedTags:function(e){var element=$(e.target),value=element.val();if(value!==""){$('#tagsMore span').hide().filter('[id*='+value+']').show();}else{$('#tagsMore span').show();}},pixel_tracker:function(){try{if($$.pixel_tracker){$('body').append($$.pixel_tracker);}}catch(e){window._gaq=_gaq||[];_gaq.push(["_trackEvent","Pixel tracker errors",e.toString(),window.location.href]);}},fb_app_tracker:function(){var fb_source=getUrlVar('fb_source');if(getUrlVar('code')||fb_source){if(fb_source){slideshare_object.ga('fb_opengraph','profile_visit_'+fb_source);}else{slideshare_object.ga('fb_opengraph','profile_visit');}}},showToolTip:function(){jQuery('.getToolTip').hover(function(){jQuery(this).siblings('span.tooltip').show();},function(){jQuery(this).siblings('span.tooltip').hide();});},subscriptionCta:function(){window._gaq=_gaq||[];_gaq.push(["_trackEvent","subscription","subscriptionCtaProfile"]);},proCtaTracker:function(){$('.j-ad_remove').click(function(){window._gaq=_gaq||[];_gaq.push(['_trackEvent','Profiles','remove_ad_cta_clicked']);});},search_interaction:function(){$('#search_uploaded_tags').keyup(profile.searchUploadedTags);$('#search_uploaded_tags').focus(function(e){var element=e.target,type="search_favorite_tags";if(element.value==="search"){element.value="";}
$$.ga('Profiles','slidespace_'+type);});$('#search_uploaded_tags').blur(function(e){var element=e.target;if(element.value===""){element.value="search";}});$('#search_content').focus(function(){if((!profile.cache.search_content||profile.cache.search_content==this.value)&&this.value.match("Search content from ")){profile.cache.search_content=this.value;this.value="";}
$$.ga('Profiles','slidespace_search_content');}).blur(function(){this.value=this.value===""?profile.cache.search_content:this.value;});},async_thumbnails_load:function(){var items=[{selector:'.thumbnailFollowGrid>li a>span>img.nickname',options:{effect:'fadeIn',placeholder:slideshowPlaceholder}}];$(items).each(function(i,item){$(item.selector).lazyload(item.options);});}};$(document).ready(function(){profile.tags_interaction();$('.remove_favorited').click(profile.confirmRemoveFavorites);$('.edit_tags').click(profile.editFavoriteTags);profile.search_interaction();profile.pixel_tracker();profile.fb_app_tracker();if($('.upgrade_subscription').length>0){profile.showToolTip();profile.subscriptionCta();}
profile.proCtaTracker();if(typeof(innerpage)==="undefined"){profile.async_thumbnails_load();}
orchestra.register_listeners();orchestra.private_message_interaction();var delay_in_secs=(typeof(innerpage)==="undefined"?5:0);window.setTimeout(orchestra.adjust_height,delay_in_secs*1000);});})(slideshare_object,jQuery);(function(){var Tinycon={};var currentFavicon=null;var originalFavicon=null;var originalTitle=document.title;var faviconImage=null;var canvas=null;var options={};var defaults={width:7,height:9,font:'10px arial',colour:'#ffffff',background:'#F03D25',fallback:true};var ua=(function(){var agent=navigator.userAgent.toLowerCase();return function(browser){return agent.indexOf(browser)!==-1}}());var browser={chrome:ua('chrome'),webkit:ua('chrome')||ua('safari'),safari:ua('safari')&&!ua('chrome'),mozilla:ua('mozilla')&&!ua('chrome')&&!ua('safari')};var getFaviconTag=function(){var links=document.getElementsByTagName('link');for(var i=0,len=links.length;i<len;i++){if((links[i].getAttribute('rel')||'').match(/\bicon\b/)){return links[i]}}return false};var removeFaviconTag=function(){var links=document.getElementsByTagName('link');var head=document.getElementsByTagName('head')[0];for(var i=0,len=links.length;i<len;i++){if(links[i].getAttribute('rel')==='icon'){head.removeChild(links[i])}}};var getCurrentFavicon=function(){if(!originalFavicon||!currentFavicon){var tag=getFaviconTag();originalFavicon=currentFavicon=tag?tag.getAttribute('href'):'/favicon.ico'}return currentFavicon};var getCanvas=function(){if(!canvas){canvas=document.createElement("canvas");canvas.width=16;canvas.height=16}return canvas};var setFaviconTag=function(url){removeFaviconTag();var link=document.createElement('link');link.type='image/x-icon';link.rel='icon';link.href=url;document.getElementsByTagName('head')[0].appendChild(link)};var log=function(message){if(window.console)window.console.log(message)};var drawFavicon=function(num,colour){if(!getCanvas().getContext||browser.safari||options.fallback==='force'){return updateTitle(num)}var context=getCanvas().getContext("2d");var colour=colour||'#000000';var num=num||0;faviconImage=new Image();faviconImage.crossOrigin='anonymous';faviconImage.onload=function(){context.clearRect(0,0,16,16);context.drawImage(faviconImage,0,0,faviconImage.width,faviconImage.height,0,0,16,16);if(num>0)drawBubble(context,num,colour);refreshFavicon()};faviconImage.src=getCurrentFavicon()};var updateTitle=function(num){if(options.fallback){if(num>0){document.title='('+num+') '+originalTitle}else{document.title=originalTitle}}};var drawBubble=function(context,num,colour){var len=(num+"").length-1;var width=options.width+(6*len);var w=16-width;var h=16-options.height;context.font=(browser.webkit?'bold ':'')+options.font;context.fillStyle=options.background;context.strokeStyle=options.background;context.lineWidth=1;context.fillRect(w,h,width-1,options.height);context.beginPath();context.moveTo(w-0.5,h+1);context.lineTo(w-0.5,15);context.stroke();context.beginPath();context.moveTo(15.5,h+1);context.lineTo(15.5,15);context.stroke();context.beginPath();context.strokeStyle="rgba(0,0,0,0.3)";context.moveTo(w,16);context.lineTo(15,16);context.stroke();context.fillStyle=options.colour;context.textAlign="right";context.textBaseline="top";context.fillText(num,15,browser.mozilla?7:6)};var refreshFavicon=function(){if(!getCanvas().getContext)return;setFaviconTag(getCanvas().toDataURL())};Tinycon.setOptions=function(custom){options={};for(var i in defaults){options[i]=custom[i]?custom[i]:defaults[i]}return this};Tinycon.setImage=function(url){currentFavicon=url;refreshFavicon();return this};Tinycon.setBubble=function(num,colour){if(isNaN(num))return log('Bubble must be a number');drawFavicon(num,colour);return this};Tinycon.reset=function(){Tinycon.setImage(originalFavicon)};Tinycon.setOptions(defaults);window.Tinycon=Tinycon})();