<?xml version="1.0" encoding="utf-8" ?>
<Module>

  <!--

    Design & Code: LabPixies All subsequent code and resources used are
    proprietary of LabPixies unless directly stated otherwise. Copyright (C)
    2006 LabPixies. www.labpixies.com This work is licensed under the Creative
    Commons Attribution-NonCommercial-NoDerivs 2.5 License. To view a copy of
    this license, visit http://creativecommons.org/licenses/by-nc-nd/2.5/ or
    send a letter to Creative Commons, 543 Howard Street, 5th Floor, San
    Francisco, California, 94105, USA.
  -->

  <ModulePrefs height="100" author="Labpixies" author_email="labpixie.gadgets+todo+201301281@gmail.com"
    description="__MSG_desc__" title="__MSG_gTitle__" title_url="http://www.labpixies.com/"
    screenshot="http://www.gstatic.com/ig/modules/labpixies/todo/images/screenshot_igoogle.cache.jpg"
    thumbnail="http://www.gstatic.com/ig/modules/labpixies/todo/images/thumbnail.cache.jpg"
    render_inline="never" directory_title="">

    <Locale
      messages="http://www.labpixies.com/campaigns/todo/i19_shared/all_all_igoogle.xml" />
    <Locale lang="bg" messages="http://www.labpixies.com/campaigns/todo/i20/bg_all.xml" />
    <Locale lang="ca" messages="http://www.labpixies.com/campaigns/todo/i20/ca_all.xml" />
    <Locale lang="cs" messages="http://www.labpixies.com/campaigns/todo/i20/cs_all.xml" />
    <Locale lang="da" messages="http://www.labpixies.com/campaigns/todo/i20/da_all.xml" />
    <Locale lang="de" messages="http://www.labpixies.com/campaigns/todo/i20/de_all.xml" />

    <Locale lang="el" messages="http://www.labpixies.com/campaigns/todo/i20/el_all.xml" />
    <Locale lang="es" messages="http://www.labpixies.com/campaigns/todo/i20/es_all.xml" />
    <Locale lang="fi" messages="http://www.labpixies.com/campaigns/todo/i20/fi_all.xml" />
    <Locale lang="fr" messages="http://www.labpixies.com/campaigns/todo/i20/fr_all.xml" />

    <Locale lang="hi" messages="http://www.labpixies.com/campaigns/todo/i20/hi_all.xml" />
    <Locale lang="hr" messages="http://www.labpixies.com/campaigns/todo/i20/hr_all.xml" />
    <Locale lang="hu" messages="http://www.labpixies.com/campaigns/todo/i20/hu_all.xml" />
    <Locale lang="it" messages="http://www.labpixies.com/campaigns/todo/i20/it_all.xml" />
    <Locale lang="iw" messages="http://www.labpixies.com/campaigns/todo/i20/iw_all.xml"
      language_direction="rtl" />

    <Locale lang="ko" messages="http://www.labpixies.com/campaigns/todo/i20/ko_all.xml" />
    <Locale lang="lt" messages="http://www.labpixies.com/campaigns/todo/i20/lt_all.xml" />
    <Locale lang="lv" messages="http://www.labpixies.com/campaigns/todo/i20/lv_all.xml" />
    <Locale lang="ms" messages="http://www.labpixies.com/campaigns/todo/i20/ms_all.xml" />
    <Locale lang="nl" messages="http://www.labpixies.com/campaigns/todo/i20/nl_all.xml" />

    <Locale lang="no" messages="http://www.labpixies.com/campaigns/todo/i20/no_all.xml" />
    <Locale lang="pl" messages="http://www.labpixies.com/campaigns/todo/i20/pl_all.xml" />
    <Locale lang="pt-BR"
      messages="http://www.labpixies.com/campaigns/todo/i20/pt_br_all.xml" />
    <Locale lang="pt-PT"
      messages="http://www.labpixies.com/campaigns/todo/i20/pt_pt_all.xml" />
    <Locale lang="ro" messages="http://www.labpixies.com/campaigns/todo/i20/ro_all.xml" />

    <Locale lang="ru" messages="http://www.labpixies.com/campaigns/todo/i20/ru_all.xml" />
    <Locale lang="sk" messages="http://www.labpixies.com/campaigns/todo/i20/sk_all.xml" />
    <Locale lang="sl" messages="http://www.labpixies.com/campaigns/todo/i20/sl_all.xml" />
    <Locale lang="sr" messages="http://www.labpixies.com/campaigns/todo/i20/sr_all.xml" />
    <Locale lang="sv" messages="http://www.labpixies.com/campaigns/todo/i20/sv_all.xml" />

    <Locale lang="th" messages="http://www.labpixies.com/campaigns/todo/i20/th_all.xml" />
    <Locale lang="tl" messages="http://www.labpixies.com/campaigns/todo/i20/tl_all.xml" />
    <Locale lang="tr" messages="http://www.labpixies.com/campaigns/todo/i20/tr_all.xml" />
    <Locale lang="uk" messages="http://www.labpixies.com/campaigns/todo/i20/uk_all.xml" />
    <Locale lang="vi" messages="http://www.labpixies.com/campaigns/todo/i20/vi_all.xml" />

    <Locale lang="zh-CN"
      messages="http://www.labpixies.com/campaigns/todo/i20/zh_cn_all.xml" />
    <Locale lang="zh-TW"
      messages="http://www.labpixies.com/campaigns/todo/i20/zh_tw_all.xml" />
    <Locale lang="ja" messages="http://www.labpixies.com/campaigns/todo/i20/ja_all.xml" />
    <Locale lang="en" country="US"
      messages="http://www.labpixies.com/campaigns/todo/i20/en_us.xml" />

    <Require feature="setprefs" />
    <Require feature="dynamic-height" />
    <Require feature="views" />
  </ModulePrefs>

  <UserPref name="saved_tasks" datatype="hidden" default_value="" />
  <UserPref name="todos" datatype="hidden" default_value="" />
  <UserPref name="sd" datatype="hidden" default_value="" />
  <UserPref name="wasSocial" datatype="hidden" default_value="0" />
  <UserPref name="migration_flag" datatype="hidden" default_value="false" />

  <Content type="html" view="home, profile, preview">
<![CDATA[
<title>ToDo</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<style>body{direction:ltr}body,html,span,div,td,*{font-family:arial}.sprite{overflow:hidden}.bottom_buttons{color:#d3b300;cursor:pointer;font-size:11px;font-weight:bold;height:19px;padding-left:7px;padding-top:2px;vertical-align:top}.shadow_container{background-color:#000;display:none;filter:alpha(opacity=20);position:absolute;opacity:.2;-moz-opacity:.2;z-index:2}#list_title_container{float:left;height:23px;margin-left:6px;margin-right:6px;line-height:22px;overflow:hidden}#full_screen_container{float:right;height:23px}.items{float:left;font-size:11px;font-weight:bold;height:23px;line-height:23px;margin-left:21px}.item_icon{cursor:pointer;float:right;height:11px;margin:5px 0 0 4px;overflow:hidden;width:11px}.strike{background-position:-92px -139px}.delete{background-position:-114px -139px}.color{background-position:-70px -139px}.menu_div_title,.menu_div_item,.menu_div_item_selected,.menu_div_item_updated{background-color:#52493d;color:#fbf9c4;font-size:11px;font-weight:bold;height:18px;line-height:18px;overflow:hidden;padding:0 4px 0 4px;text-align:left}.menu_div_item_selected,.menu_div_item,.menu_div_item_updated{background-color:#fffdbf;border-bottom:1px dashed #dedb95;color:#52493d}.menu_div_item{font-weight:normal}.menu_div_item_selected{color:#00928f}.new_text_style,.new_text_style_no_focus{background-color:#fcfcdb;border:1px solid #13807b;font-size:11px;font-weight:bold;line-height:12px;margin-top:2px;outline:none;overflow:hidden;resize:none;word-wrap:break-word}.new_text_style_no_focus{background-color:transparent;border-color:transparent}#top_balloon_button{background-position:0 -151px;color:#332c26;font-size:10px;height:24px;line-height:16px;padding-left:10px}.menu_div a,.menu_div a:active,.menu_div a:visited{color:#352e29;font-size:11px;text-decoration:none}#view_all_left a,#view_all_left a:active,#view_all_left a:visited{color:#00918e;font-size:11px;text-decoration:none}#view_all_left a:hover,.menu_div a:hover{text-decoration:underline}#list_title_container a:hover{background-color:#59534c}#list_title_container a,#list_title_container a:active,#list_title_container a:visited{color:#d3b300;font-size:11px;font-weight:bold;text-decoration:none}a.jScrollActiveArrowButton,a.jScrollActiveArrowButton:hover{background-position:0 -30px}.holder{float:left}.scroll_pane{float:left;height:200px;overflow:auto;width:220px}.jScrollPaneContainer{position:relative;overflow:hidden;z-index:1}.jScrollPaneTrack{background:#faf7b6;cursor:pointer;height:100%;position:absolute;right:0;top:0}.jScrollPaneDrag{cursor:pointer;position:absolute;overflow:hidden}.jScrollPaneDragTop{height:0;left:0;position:absolute;overflow:hidden;top:0}.jScrollPaneDragBottom{bottom:0;height:0;left:0;overflow:hidden;position:absolute}a.jScrollArrowUp{display:block;height:10px;overflow:hidden;position:absolute;right:0;text-indent:-2000px;top:0;z-index:1}a.jScrollArrowDown{bottom:0;display:block;height:10px;overflow:hidden;position:absolute;right:0;text-indent:-2000px;z-index:1}.td_pr_table_title{background-repeat:repeat-x;padding-top:3px;padding-right:3px}.td_pr_top_right_corner{background-color:#fff;height:41px;width:3px}.td_pr_items_table{background-color:#f3f378;font-family:arial;font-weight:bold;font-size:11px;width:100%}.td_pr_red{background-repeat:repeat-y;width:3px}.td_pr_item_text{color:#13807b;font-weight:normal;text-decoration:none}.td_pr_item_text:hover{text-decoration:underline}.td_pr_right_cell{background-repeat:repeat-y;width:3px}.td_pr_border_bottom{border-bottom:#00c5c2 solid 1px}.td_pr_bottom_left{background-repeat:no-repeat}.td_pr_bottom_right{background-repeat:repeat-x;background-position:top}.td_pr_right_blue{width:3px;height:24px}.td_pr_item_link{cursor:pointer}.td_pr_del{cursor:pointer;height:15px;width:15px}.td_pr_ctrl{display:none;font-size:1px;height:16px;line-height:1px}.td_pr_up,.td_pr_down{cursor:pointer;font-size:1px;height:6px;line-height:1px;width:10px}.td_pr_top_menu_link{font-family:arial;font-size:10px;color:#c5a618;text-decoration:none}.td_pr_top_menu_link:hover{color:#f3f378;text-decoration:none}.td_pr_top_menu_link:visited{color:#c5a618}.td_pr_add_item{color:#80795a;font-weight:bold;text-decoration:none}.td_pr_add_item:visited{color:#80795a}.td_pr_add_item:hover{text-decoration:underline}.td_pr_edit{border:1px solid #13807b;font-family:arial;font-weight:bold;font-size:11px;line-height:18px}.td_pr_btn_main{cursor:pointer;float:right;padding-top:1px}.td_pr_btn_left{background-position:-113px 0;float:left;height:15px;overflow:hidden;width:2px}.td_pr_btn_middle{background-position:-115px 0;color:#c5a618;float:left;font-family:arial;font-size:11px;font-weight:bold;height:15px;line-height:15px;padding:0 3px}.td_pr_btn_right{background-position:-261px 0;float:left;height:15px;overflow:hidden;width:2px}.td_pr_more_opt{color:#13807b;cursor:pointer;float:right;font-family:arial;font-size:11px;font-weight:bold;line-height:24px;height:24px}.td_pr_more_opt_btn{background-position:-263px -106px;float:left;height:11px;margin:6px 0 6px 0;overflow:hidden;width:11px}.download_list{cursor:pointer}</style>
<div class=shadow_container id=shadow></div>
<div id=social_container style=display:none;>
<center>
<div id=container>
<div id=color_pallete_container style="position:absolute; display:none; cursor:pointer;">
<div class=sprite id=color_pallete style="width:32px; height:32px; background-position:-20px -205px;"></div>
</div>
<div align=center class=sprite id=loading_notebook style="position:absolute; display:none; z-index:5px;">
<div style="height:85px; font-size:1px;"></div>
<table style="height:50px; width:100px; background-color:transparent;">
<tr>
<td align=center id=load_ajax_back style="height:50px; width:100px;" valign=middle>
<img height=16 id=notebook_ajax width=16 />
<div style="color:#302A25; font-size:11px; font-weight:bold; margin-top:8px;">__MSG_loading__</div>
</td>
</table>
</div>
<div id=new_lists_popup_container style="width:200px; position:absolute; z-index:3;"></div>
<div id=notebook_title_cover style="height:24px; position:absolute; background-color:#443C36; -moz-opacity:.8; opacity:.8; filter: alpha(opacity = 80); display:none; z-index:1;"></div>
<div id=notebook_cover style="height:246px; position:absolute; background-color:#FAF7AE; -moz-opacity:.8; opacity:.8; filter: alpha(opacity = 80); display:none; z-index:1;"></div>
<div style="height:10px; font-size:10px;"></div>
<div align=left id=top_balloon style=display:none;>
<table border=0 cellpadding=0 cellspacing=0 height=24>
<tr>
<td class=sprite id=top_balloon_button onclick=toggleMenu(); style=cursor:pointer; valign=top></td>
<td class=sprite id=top_balloon_button_right style="height:24px; width:34px; background-position:right -151px;" valign=top>
<div class=sprite id=updates_x_button onclick="document.getElementById('top_balloon').style.display='none'; gadgets.window.adjustHeight();" onmouseout="this.style.backgroundPosition='-180px -139px';" onmouseover="this.style.backgroundPosition='-189px -139px';" style="cursor:pointer; margin-top:5px; margin-right: 5px; background-position: -180px -139px; height:9px; width:9px; float:right;"></div>
</td>
</table>
</div>
<div class=sprite id=title_container style="height:41px; background-position:0px 0px;">
<div class=sprite id=lists_menu_icon onclick=toggleMenu(); onmouseout="changeBackPosition('lists_menu_icon','0px -139px');" onmouseover="changeBackPosition('lists_menu_icon','-8px -139px');" style="float:left; margin-left:6px; margin-top:8px; width:8px; height:7px; overflow:hidden; cursor:pointer; background-position:0px -139px;" title="__MSG_drop_menu_tooltip__"></div>
<div align=left id=list_title_container><a href=javascript:void(0); id=list_title onclick=switchToCanvas();></a></div>
<div class=sprite id=title_right style="height:41px; width:6px; float:right; background-position:right 0px;"></div>
<div id=full_screen_container style=visibility:hidden;>
<table border=0 cellpadding=0 cellspacing=0 height=15 style=margin-top:4px;>
<tr onclick=switchToCanvas(); onmouseout=fullScreenOut(); onmouseover=fullScreenOver(); style=cursor:pointer;>
<td class=sprite id=full_screen_button style="padding-left:5px; height:15px; background-position:0px -190px; font-family:arial;  font-size:11px; font-weight:bold;  color:#26221C;" valign=top>__MSG_full_screen__&nbsp;&gt;</td>
<td class=sprite id=full_screen_button_right style="height:15px; width:5px; cursor:pointer; background-position:right -190px;"></td>
</table>
</div>
</div>
<div class=sprite id=item_0 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_0></div>
<div class=sprite id=item_0_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_0_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=item_1 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_1></div>
<div class=sprite id=item_1_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_1_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=item_2 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_2></div>
<div class=sprite id=item_2_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_2_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=item_3 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_3></div>
<div class=sprite id=item_3_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_3_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=item_4 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_4></div>
<div class=sprite id=item_4_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_4_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=item_5 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_5></div>
<div class=sprite id=item_5_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_5_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=item_6 style="height:24px; background-position:0px -41px;">
<div class=items id=item_left_6></div>
<div class=sprite id=item_6_right style="background-position:right -41px; height:24px; width:12px; float:right;"></div>
<div id=item_6_icons style="height:24px; float:right;"></div>
</div>
<div class=sprite id=view_all_line style="height:24px; background-position:0px -41px;">
<div class=sprite id=view_all_right style="height:24px; width:9px; float:right; background-position:right -41px;"></div>
<div id=view_all_left style="height:23px; line-height:22px;"></div>
</div>
<div class=sprite id=buttons_line style="height:24px; background-position:0px -41px;">
<div style="float:left; margin-left:21px;">
<table border=0 cellpadding=0 cellspacing=0 height=19 style=margin-top:2px;>
<tr id=new_task onclick=switchToCanvas(NEW_TASK); onmouseout="buttonOut('new_task_s');" onmouseover="buttonOver('new_task_s');" style=display:none;>
<td class="sprite bottom_buttons" id=new_task_s_button style="background-position:0px -101px;" valign=top>+&nbsp;__MSG_new_task_profile__</td>
<td class=sprite id=new_task_s_button_right style="height:19px; width:7px; cursor:pointer; background-position:right -101px;"></td>
</table>
</div>
<div class=sprite id=buttons_right style="height:24px; width:12px; float:right; background-position:right -41px;"></div>
<div style=float:right;>
<table border=0 cellpadding=0 cellspacing=0 height=19 id=new_list_container style="margin-top:2px; visibility:hidden;">
<tr id=new_list onclick=switchToCanvas(NEW_LIST); onmouseout="buttonOut('new_list');" onmouseover="buttonOver('new_list');">
<td class="sprite bottom_buttons" id=new_list_button style="background-position:0px -101px;" valign=top>+&nbsp;__MSG_new_list__</td>
<td class=sprite id=new_list_button_right style="height:19px; width:7px; cursor:pointer; background-position:right -101px;"></td>
</table>
</div>
</div>
<div class=sprite id=bottom style="height:12px; background-position:0px -89px;"><div class=sprite id=bottom_right style="height:12px; width:10px; float:right; background-position:right -89px;"></div></div>
<table border=0 cellpadding=0 cellspacing=0 id=bottom_info style="width:100%; background:#FBF9C4;">
<tr>
<td>
</td>
</table>
</div>
</center>
<div align=left class=holder id=scroll_out style="position:absolute; display:none; border:1px solid #2F2825; background:#FFFDBF;z-index:4">
<div class=scroll_pane id=scroll_holder></div>
</div>
<div id=container_size style=width:100%;height:1px;line-height:1px;font-size:1px;></div>
<div id=width_test_div style="position:absolute; top:-400px; left:-400px; z-index:-1; visibility:hidden;"></div>
</div>
<div id=non_social_container style=display:none;>
<div align=center id=td_pr_main_container onmouseover=reportFirstInteraction(); style="width:100%; text-align:center;">
<div class=td_pr_container id=td_pr_inner_container style=padding-top:10px;width:300px;height:265px;margin-left:auto;margin-right:auto;>
<table border=0 cellpadding=0 cellspacing=0 class=td_pr_items_table>
<tr height=41>
<td class=td_pr_table_title width=5>&nbsp;</td>
<td align=left class=td_pr_table_title id=td_pr_top_menu_left style=line-height:18px;font-size:10px;font-weight:bold;font-family:Arial;color:#C5A618 valign=top>
__MSG_owner_title__
</td>
<td align=right class=td_pr_table_title id=td_pr_top_menu valign=top>
<div class=td_pr_btn_main id=td_pr_max_btn>
<div class="td_pr_btn_left td_pr_btn"></div>
<div class="td_pr_btn_middle td_pr_btn">__MSG_full_screen__ &gt;</div>
<div class="td_pr_btn_right td_pr_btn"></div>
</div>
</td>
<td width=3><div class=td_pr_top_right_corner id=td_pr_top_title_right></div></td>
</table>
<div id=td_pr_items>
</div>
<div id=empty_line>
<table border=0 cellpadding=0 cellspacing=0 class=td_pr_items_table>
<tr height=24>
<td align=center class="td_pr_last_lines td_pr_border_bottom" width=20>&nbsp;</td>
<td class="td_pr_red td_pr_border_bottom" width=3><div class=td_pr_red_cell_btm style=width:3px;height:24px></div></td>
<td align=center class=td_pr_border_bottom width=26>&nbsp;</td>
<td class=td_pr_border_bottom>&nbsp;</td>
<td class=td_pr_right_cell valign=top width=3><div class=td_pr_right_blue></div></td>
</table>
</div>
<div id=buttons_line>
<table border=0 cellpadding=0 cellspacing=0 class=td_pr_items_table>
<tr height=24>
<td align=center class="td_pr_last_lines td_pr_border_bottom" width=20><div style=width:20px;height:24px>&nbsp;</div></td>
<td class="td_pr_red td_pr_border_bottom" width=3><div class=td_pr_red_cell_btm style=width:3px;height:24px></div></td>
<td class=td_pr_border_bottom id=td_pr_more_items_out style=padding-left:6px; valign=top>
<table border=0 cellpadding=0 cellspacing=0 height=19 style=margin-top:2px;>
<tr style=cursor:pointer;>
<td id=new_task_button_left style="padding-left:4px; padding-top:2px; padding-left:18px; background-position: 0px 0px; height:19px; font-size:11px; font-weight:bold; color:#D3B300; vertical-align:top;"></td>
<td id=new_task_button_right style="background-position: right 0px; height:19px; width:6px; cursor:pointer;"></td>
</table>
</td>
<td align=right class=td_pr_border_bottom style=padding-right:6px;>
<div class=td_pr_more_opt id=td_pr_more_options>
<table border=0 cellpadding=0 cellspacing=0 height=19 style=margin-top:2px;>
<tr style=cursor:pointer;>
<td id=more_opt_button_left style="padding-left:6px; padding-top:2px; background-position: 0px -38px; height:19px; font-size:11px; font-weight:bold; color:#D3B300; vertical-align:top; direction:__BIDI_DIR__;"></td>
<td id=more_opt_button_right style="background-position: right -38px; height:19px; width:14px; cursor:pointer;"></td>
</table>
</div>
&nbsp;
<a class=td_pr_item_text href=javascript:void(0) id=td_pr_view_items></a>
</td>
<td class=td_pr_right_cell valign=top width=3><div class=td_pr_right_blue></div></td>
</table>
</div>
<table border=0 cellpadding=0 cellspacing=0 class=td_pr_items_table>
<tr>
<td align=center class=td_pr_last_lines style=height:7px;line-height:7px;font-size:1px width=20>&nbsp;</td>
<td class=td_pr_red style=height:7px;line-height:7px;font-size:1px width=3>&nbsp;</td>
<td align=center style=height:7px;line-height:7px;font-size:1px width=26>&nbsp;</td>
<td style=height:7px;line-height:7px;font-size:1px>&nbsp;</td>
<td class=td_pr_right_cell style=height:7px;line-height:7px;font-size:1px valign=top width=3><div class=td_pr_right_blue style=height:7px></div></td>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td class=td_pr_bottom_left style=height:3px;line-height:3px;font-size:1px valign=top width=26><div id=td_pr_bottom_left_div style=height:3px;width:36px;overflow:hidden;></div></td>
<td class=td_pr_bottom_right style=height:3px;line-height:3px;font-size:1px valign=top width=100%><div style=height:3px;width:100%;overflow:hidden;></div></td>
<td align=right style=height:3px;line-height:3px;font-size:1px valign=top width=3><div id=td_pr_right_corner style=height:3px;width:3px;overflow:hidden;></div></td>
</table>
</div>
</div>
<div id=td_size_cont style="width:100%;height:1px;line-height:1px; font-size:1px;"></div>
<div id=notebook_title_cover_pr style="height:24px; position:absolute; background-color:#443C36; -moz-opacity:.8; opacity:.8; filter: alpha(opacity = 80); display:none; z-index:1;"></div>
<div id=notebook_cover_pr style="height:246px; position:absolute; background-color:#FAF7AE; -moz-opacity:.8; opacity:.8; filter: alpha(opacity = 80); display:none; z-index:1;"></div>
<table border=0 cellpadding=0 cellspacing=0 id=social_disabled_popup style="display:none; direction:__BIDI_DIR__; position:absolute; background:#FBF9C4; border:1px solid #52493D; width:200px;z-index:3">
<tr>
<td style="padding:10px 0px 10px 0px; padding-__BIDI_START_EDGE__:10px; color:#3F3631; font-family:arial; font-size:11px; direction:__BIDI_DIR__;">__MSG_enable_social__</td>
</td>
<td style=width:9px; valign=top>
<div id=x_disabled_popup onclick=closeEnableSocialPopup(); onmouseout="this.style.backgroundPosition='-162px -139px';" onmouseover="this.style.backgroundPosition='-171px -139px';" style="cursor:pointer; width:9px; height:9px; overflow:hidden; margin-top: 3px; margin-__BIDI_END_EDGE__: 3px;"></div>
</td>
</table>
</div>
<div style="text-align:right; height:18px; clear:both;">
<div style=height:5px;font-size:1px;></div>
<a href=//www.labpixies.com?source=profile_footer&footer_item=logo&gadget=33 target=_blank>
<div alt="LabPixies Logo profile" border=0 class=sprite id=footer_img style="float:right; padding-right:5px; width:125px; height:13px; background-position:-82px -205px;"></div>
</a>
</div>
<script>jQuery.jScrollPane={active:[]};
jQuery.fn.jScrollPane=function(settings){settings=jQuery.extend({scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true},settings);return this.each(function(){var $this=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var currentScrollPosition=settings.maintainPosition?$this.offset({relativeTo:jQuery(this).parent()[0]}).top:0;var $c=jQuery(this).parent();
var paneWidth=$c.innerWidth();var paneHeight=$c.outerHeight();var trackHeight=paneHeight;if($c.unmousewheel)$c.unmousewheel();jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",$c).remove();$this.css({"top":0})}else{var currentScrollPosition=0;this.originalPadding=$this.css("paddingTop")+" "+$this.css("paddingRight")+" "+$this.css("paddingBottom")+" "+$this.css("paddingLeft");this.originalSidePaddingTotal=(parseInt($this.css("paddingLeft"))||0)+(parseInt($this.css("paddingRight"))||
0);var paneWidth=$this.innerWidth();var paneHeight=$this.innerHeight();var trackHeight=paneHeight;$this.wrap(jQuery("<div></div>").attr({"className":"jScrollPaneContainer"}).css({"height":paneHeight+"px","width":paneWidth+"px"}));jQuery(document).bind("emchange",function(e,cur,prev){$this.jScrollPane(settings)})}var p=this.originalSidePaddingTotal;$this.css({"height":"auto","width":paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p+"px","paddingRight":settings.scrollbarMargin+"px"});var contentHeight=
$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<0.99){var $container=$this.parent();$container.append(jQuery("<div></div>").attr({"className":"jScrollPaneTrack"}).css({"width":settings.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({"className":"jScrollPaneDrag"}).css({"width":settings.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({"className":"jScrollPaneDragTop"}).css({"width":settings.scrollbarWidth+"px"}),jQuery("<div></div>").attr({"className":"jScrollPaneDragBottom"}).css({"width":settings.scrollbarWidth+
"px"}))));var $track=jQuery(">.jScrollPaneTrack",$container);var $drag=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",$container);if(settings.showArrows){var currentArrowButton;var currentArrowDirection;var currentArrowInterval;var currentArrowInc;var whileArrowButtonDown=function(){if(currentArrowInc>4||currentArrowInc%4==0)positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);currentArrowInc++};var onArrowMouseUp=function(event){jQuery("body").unbind("mouseup",onArrowMouseUp);currentArrowButton.removeClass("jScrollActiveArrowButton");
clearInterval(currentArrowInterval)};var onArrowMouseDown=function(){jQuery("body").bind("mouseup",onArrowMouseUp);currentArrowButton.addClass("jScrollActiveArrowButton");currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100)};$container.append(jQuery("<a></a>").attr({"href":"javascript:;","className":"jScrollArrowUp"}).css({"width":settings.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){currentArrowButton=jQuery(this);currentArrowDirection=
-1;onArrowMouseDown();this.blur();return false}),jQuery("<a></a>").attr({"href":"javascript:;","className":"jScrollArrowDown"}).css({"width":settings.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){currentArrowButton=jQuery(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false}));if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;$track.css({"height":trackHeight+"px",top:settings.arrowSize+"px"})}else{var topArrowHeight=jQuery(">.jScrollArrowUp",
$container).height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-jQuery(">.jScrollArrowDown",$container).height();$track.css({"height":trackHeight+"px",top:topArrowHeight+"px"})}}var $pane=jQuery(this).css({"position":"absolute","overflow":"visible"});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=="X"?"Left":"Top";return event["page"+c]||event["client"+c]+(document.documentElement["scroll"+
p]||document.body["scroll"+p])||0};var ignoreNativeDrag=function(){return false};var initDrag=function(){ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight};var onStartDrag=function(event){initDrag();dragMiddle=getPos(event,"Y")-dragPosition-currentOffset.top;jQuery("body").bind("mouseup",onStopDrag).bind("mousemove",updateScroll);if(jQuery.browser.msie)jQuery("body").bind("dragstart",
ignoreNativeDrag).bind("selectstart",ignoreNativeDrag);return false};var onStopDrag=function(){jQuery("body").unbind("mouseup",onStopDrag).unbind("mousemove",updateScroll);dragMiddle=percentInView*paneHeight/2;if(jQuery.browser.msie)jQuery("body").unbind("dragstart",ignoreNativeDrag).unbind("selectstart",ignoreNativeDrag)};var positionDrag=function(destY){destY=destY<0?0:destY>maxY?maxY:destY;dragPosition=destY;$drag.css({"top":destY+"px"});var p=destY/maxY;$pane.css({"top":(paneHeight-contentHeight)*
p+"px"});$this.trigger("scroll")};var updateScroll=function(e){positionDrag(getPos(e,"Y")-currentOffset.top-dragMiddle)};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({"height":dragH+"px"}).bind("mousedown",onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function(){if(trackScrollInc>8||trackScrollInc%4==0)positionDrag(dragPosition-(dragPosition-trackScrollMousePos)/
2);trackScrollInc++};var onStopTrackClick=function(){clearInterval(trackScrollInterval);jQuery("body").unbind("mouseup",onStopTrackClick).unbind("mousemove",onTrackMouseMove)};var onTrackMouseMove=function(event){trackScrollMousePos=getPos(event,"Y")-currentOffset.top-dragMiddle};var onTrackClick=function(event){initDrag();onTrackMouseMove(event);trackScrollInc=0;jQuery("body").bind("mouseup",onStopTrackClick).bind("mousemove",onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll()};
$track.bind("mousedown",onTrackClick);if($container.mousewheel)$container.mousewheel(function(event,delta){initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured},false);var _animateToPosition;var _animateToInterval;function animateToPosition(){var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1)positionDrag(dragPosition+diff);else{positionDrag(_animateToPosition);ceaseAnimation()}}
var ceaseAnimation=function(){if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition}};var scrollTo=function(pos,preventAni){if(typeof pos=="string"){$e=jQuery(pos,this);if(!$e.length)return;pos=$e.offset({relativeTo:this}).top}ceaseAnimation();var destDragPosition=-pos/(paneHeight-contentHeight)*maxY;if(!preventAni||settings.animateTo){_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval)}else positionDrag(destDragPosition)};
$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta){var currentPos=-parseInt($pane.css("top"))||0;scrollTo(currentPos+delta)};initDrag();scrollTo(-currentScrollPosition,true);jQuery.jScrollPane.active.push($this[0])}else $this.css({"height":paneHeight+"px","width":paneWidth-this.originalSidePaddingTotal+"px","padding":this.originalPadding})})};jQuery(window).bind("unload",function(){var els=jQuery.jScrollPane.active;for(var i=0;i<els.length;i++)els[i].scrollTo=els[i].scrollBy=null});
function downloadData(){toggleMenu();var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.TEXT;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";gadgets.io.makeRequest(APPURL+"/export",function(obj){if(obj&&obj.text&&obj.text!="error")window.open(APPURL+"/serve/"+obj.text,"_self");else dataError()},params)}var $lp=jQuery.noConflict();
var prefs=prefs||new gadgets.Prefs;var IMAGES_BASE="//www.gstatic.com/ig/modules/labpixies/todo/images/";var owner;var currentListId=null;var APPURL="http://lpsharedlist.appspot.com";var currentList={};var currentItems=[];var myLists=[];var lists=[];var newLists=[];var textWidth=0;var listWidth=0;var responseCounter=0;var currentEditedId;var saved_tasks_v1=null;var saved_tasks_v2=null;var isNewInputOpen=false;var isDataError=false;var MISSING_ITEM_ERROR="missing item";var PERMISSION_DENIED="permission denied";
var isLoading=true;var TIMEOUT_MILLIS=15E3;var actions={"add":0,"delete":1,"update":2,"rename":3,"add_collaborator":4,"task_completed":5,"create":6};var colors=["#000000","#E22974","#DC4A20","#006CB3","#7E9D1E","#ED1C24","#662D91","#F7941D","#737373"];var MAX_OLD_TASK_LEN=70;var MAX_WIDTH=300;var MIN_WIDTH=240;var MAX_PROFILE_ITEMS=7;var MAX_FRIENDS_LID_IN_PREFS=100;var MAX_ITEM_LEN_IN_PREFS=37;var NEW_LIST="new_list";var NEW_TASK="new_task";var EDIT_TASK="edit";var gadgetOwnerId=gadgets.util.getUrlParameters().gadgetOwner;
var migrationFlag=prefs.getString("migration_flag");function isSignedInUser(){try{return _args().is_signedin}catch(ex){return false}}if(typeof lpgadgets=="undefined")lpgadgets={};lpgadgets.lp=lpgadgets.lp||{};
lpgadgets.lp.utils=function(){function checkMaxMode(){try{if(gadgets.views.getCurrentView().getName().toLowerCase()=="canvas")return true}catch(ee){}return false}function B(H,I){return String.fromCharCode(I)}return{isMaxMode:function(){return checkMaxMode()},htmlEntities:function(str){if(!str)str="";return str.replace(/</g,"&lt;").replace(/>/g,"&gt;")},isOpenSocialSupported:function(){return false},jsonStringify:function(obj){return lpgadgets.lp.utils.JSON.stringify(obj)},jsonParse:function(str){return lpgadgets.lp.utils.JSON.parse(str)},
unescapeString:function(H){return H.replace(/&#([0-9]+);/g,B)}}}();
lpgadgets.lp.utils.JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var gap,
indent,rep;var meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string")return c;return"\\u"+("0000"+(+a.charCodeAt(0)).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function")value=value.toJSON(key);
if(typeof rep==="function")value=rep.call(holder,key,value);switch(typeof value){case "string":return quote(value);case "number":return isFinite(value)?String(value):"null";case "boolean":case "null":return String(value);case "object":if(!value)return"null";gap+=indent;partial=[];if(typeof value.length==="number"&&!value.propertyIsEnumerable("length")){length=value.length;for(i=0;i<length;i+=1)partial[i]=str(i,value)||"null";v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+
"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value,rep);if(v)partial.push(quote(k)+(gap?": ":":")+v)}}}else for(k in value)if(Object.hasOwnProperty.call(value,k)){v=str(k,value,rep);if(v)partial.push(quote(k)+(gap?": ":":")+v)}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}return{stringify:function(value,replacer,
space){var i;gap="";indent="";if(typeof space==="number")for(i=0;i<space;i+=1)indent+=" ";else if(typeof space==="string")indent=space;rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number"))throw new Error("JSON.stringify");return str("",{"":value})},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object")for(k in value)if(Object.hasOwnProperty.call(value,k)){v=walk(value,
k);if(v!==undefined)value[k]=v;else delete value[k]}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text))text=text.replace(cx,function(a){return"\\u"+("0000"+(+a.charCodeAt(0)).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse");
}}}();gadgets.util.registerOnLoadHandler(function(){initHome()});var isPreview=window.gadgets&&window.gadgets.views&&window.gadgets.views.getCurrentView()&&window.gadgets.views.getCurrentView().getName().toLowerCase()=="preview";var isPartnerPage=location.href.indexOf("pid=");
function initHome(){if(!isSignedInUser()||isPreview||!gadgetOwnerId){document.getElementById("non_social_container").style.display="";deploy_todo_home();if(isPreview||isPartnerPage!=-1){document.getElementById("td_pr_more_options").style.display="none";document.getElementById("td_pr_max_btn").style.display="none"}return}document.getElementById("social_container").style.display="";loadImages();setWidth();displayLoading();setOnClickHandlers();migrationFlag=prefs.getString("migration_flag");if(migrationFlag==
"false"){saved_tasks_v1=prefs.getString("saved_tasks");saved_tasks_v1=gadgets.util.unescapeString(saved_tasks_v1);saved_tasks_v2=prefs.getString("todos");saved_tasks_v2=gadgets.util.unescapeString(saved_tasks_v2);if(saved_tasks_v1.length>0)checkForV1Data(saved_tasks_v1);if(saved_tasks_v2.length>0)checkForV2Data(saved_tasks_v2);if(saved_tasks_v2.length==0&&saved_tasks_v1.length==0)loadListsAndDefault()}else loadListsAndDefault();gadgets.window.adjustHeight()}
function savePrefsData(){var prefsData={};prefsData.o=currentList.owner;prefsData.id=currentListId;prefsData.name=currentList.name;prefsData.l=currentItems.length;prefsData.items=[];var text,cut;for(var i=0;i<MAX_PROFILE_ITEMS&&i<currentItems.length;i++){text=currentItems[i].text;cut=0;if(text.length>MAX_ITEM_LEN_IN_PREFS){text=text.substring(0,MAX_ITEM_LEN_IN_PREFS);cut=1}var item=[currentItems[i].id,currentItems[i].text,currentItems[i].color,currentItems[i].strike?1:0,cut];prefsData.items.push(item)}prefs.set("sd",
lpgadgets.lp.utils.jsonStringify(prefsData))}
function checkForV1Data(saved_tasks){var DELIMITER="_#$LAB_UDI$#_";var EXT_DELIMITER="_#$LAB_MATAN$#_";var task_arr=saved_tasks.split(EXT_DELIMITER);var itemsArray=[];var curr_task,curr_task_arr,curr_color;for(var i=1;i<task_arr.length;i++){curr_color="";curr_task=task_arr[i];curr_task_arr=curr_task.split(DELIMITER);for(var j=0;j<colors.length;j++)if(curr_task_arr[2]==colors[j])curr_color=j;if(!curr_color)curr_color=0;new_item=[curr_task_arr[1].substr(0,MAX_OLD_TASK_LEN),curr_color,false];itemsArray.push(new_item)}var listName=
prefs.getMsg("untitled_list").replace("%NUM%","1");importList(listName,itemsArray,function(data){if(data.data.success){prefs.set("saved_tasks","");loadListsAndDefault()}else dataError()})}
function checkForV2Data(saved_tasks){var tmp=lpgadgets.lp.utils.jsonParse(saved_tasks);var itemsArray=[];var colors_on_panel=[];colors_on_panel[0]=["#000000","#E22974","#DC4A20"];colors_on_panel[1]=["#006CB3","#7E9D1E","#ED1C24"];colors_on_panel[2]=["#662D91","#F7941D","#737373"];var text,color,row,col,colorFromId,strike;for(var i=0;i<tmp.items.length;i++){color="";text=tmp.items[i].t;colorFromId=tmp.items[i].a.substr(0,1);row=Math.ceil(colorFromId/3)-1;col=colorFromId-row*3-1;colorFromId=colors_on_panel[row][col];
for(var j=0;j<colors.length;j++)if(colors[j]==colorFromId)color=j;if(!color)color=0;if(tmp.items[i].a.substr(1,1)==1)strike=true;else strike=false;new_item=[text.substr(0,MAX_ITEM_LENGTH),color,strike];itemsArray.push(new_item)}var listName=prefs.getMsg("untitled_list").replace("%NUM%","1");importList(listName,itemsArray,function(data){if(data.data.success){prefs.set("todos","");loadListsAndDefault()}else dataError()})}
function changeBackPosition(id,pos){document.getElementById(id).style.backgroundPosition=pos}function changeTextColor(id,color){document.getElementById(id).style.color=color}
function displayLoading(){var position=$lp("#title_container").offset();var xPos=position.left+"px";var yPos=position.top+"px";var width=parseInt(document.getElementById("container").offsetWidth)+"px";document.getElementById("loading_notebook").style.top=yPos;document.getElementById("loading_notebook").style.left=xPos;document.getElementById("loading_notebook").style.width=width;document.getElementById("loading_notebook").style.height="270px";document.getElementById("loading_notebook").style.display=
"";isLoading=true}function hideLoading(){document.getElementById("loading_notebook").style.display="none";document.getElementById("new_list_container").style.visibility="visible";document.getElementById("full_screen_container").style.visibility="visible";isLoading=false}
function loadListFromDb(){loadListsRequest(function(data){if(data&&data.data){var responseData=data.data;lists=responseData["lists"];var dataMigrated=Boolean(responseData["success"]);if(migrationFlag=="false"&&dataMigrated)prefs.set("migration_flag","true");divideLists();migrationFlag=prefs.getString("migration_flag");if(myLists.length==0){createNewList();return}if(currentListId==null||getListIndex(currentListId)==-1)currentListId=myLists[0].id;loadSingleListById(currentListId)}else dataError()})}
function loadSingleListById(id){loadListDataRequest(id,function(listData){if(listData&&listData.data&&listData.data.success){hideLoading();currentListId=id;currentList=listData.data;currentItems=currentList.items;document.getElementById("list_title").innerHTML=gadgets.util.escapeString(cutStringToFit(currentList.name,listWidth,"11px","bold"));showItems();savePrefsData();gadgets.window.adjustHeight()}else dataError()})}
function loadListsAndDefault(){var s=prefs.getString("sd");s=gadgets.util.unescapeString(s);if(s.length==0){loadListFromDb();return}var prefListData=lpgadgets.lp.utils.jsonParse(s);if(prefListData){currentListId=prefListData.id;currentList={};currentList.name=prefListData.name;currentList.id=prefListData.id;currentList.owner=prefListData.o;currentList.is_owner=prefListData.o==gadgetOwnerId;currentList.items=[];for(var i=0;i<prefListData.items.length;i++){var item={};item.id=prefListData.items[i][0];
item.text=prefListData.items[i][1];item.color=prefListData.items[i][2];item.strike=prefListData.items[i][3]==1;item.cut=prefListData.items[i][4]==1;currentList.items.push(item)}for(var i=prefListData.items.length;i<prefListData.l;i++)currentList.items.push({});currentItems=currentList.items;hideLoading();document.getElementById("list_title").innerHTML=gadgets.util.escapeString(cutStringToFit(currentList.name,listWidth,"11px","bold"));showItems()}}
function handleMissingItem(showAlert){loadListDataRequest(currentListId,function(listData){if(listData&&listData.data&&listData.data.success){currentList=listData.data;currentItems=currentList.items;showItems();savePrefsData();if(showAlert)alert(prefs.getMsg("list_wasnt_updated"))}else if(listData.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}function handlePermissionDenied(){loadListFromDb();alert(prefs.getMsg("list_not_available"))}
function deleteItem(id){var itemIndex=getItemIndex(id);var r=confirm(prefs.getMsg("sure_delete_item"));if(r==false)return;var itemToRemove=currentItems[itemIndex];currentItems.splice(itemIndex,1);showItems();responseCounter++;removeItemRequest(id,responseCounter,function(data){if(data.data==null)dataError();else if(data.data.success){if(data.data.token==responseCounter){currentList=data.data.list;currentItems=currentList.items;showItems();savePrefsData()}}else if(data.data.error==MISSING_ITEM_ERROR)handleMissingItem(false);
else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}function getItemIndex(id){for(var index=0;index<currentItems.length;index++)if(currentItems[index].id==id)return index}
function setItemStrike(id){var itemIndex=getItemIndex(id);var strike;if(currentItems[itemIndex].strike){strike=0;currentItems[itemIndex].strike=false;document.getElementById("item_text_"+id).style.textDecoration="none"}else{strike=1;currentItems[itemIndex].strike=true;document.getElementById("item_text_"+id).style.textDecoration="line-through"}updateStrikeRequest(id,strike,function(data){if(data.data==null)dataError();else if(data.data.success)savePrefsData();else if(data.data.error==MISSING_ITEM_ERROR)handleMissingItem(true);
else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}function getImageUrl(src){return IMAGES_BASE+src}function setMenuPosition(){var element=document.getElementById("scroll_out");var position=$lp("#lists_menu_icon").offset();var xPos=position.left;var yPos=position.top+$lp("#lists_menu_icon").height()+10;element.style.left=xPos+"px";element.style.top=yPos+"px"}
function setOnClickHandlers(){document.getElementById("container").onclick=function(e){document.getElementById("scroll_out").style.display="none";document.getElementById("shadow").style.display="none";uncoverList();document.getElementById("new_lists_popup_container").style.display="none"};document.getElementById("lists_menu_icon").onclick=function(e){stopEventPropogation(e);toggleMenu()};document.getElementById("top_balloon_button").onclick=function(e){stopEventPropogation(e);toggleMenu()};document.getElementById("new_lists_popup_container").onclick=
function(e){stopEventPropogation(e)}}function stopEventPropogation(event){if(!event)window.event.cancelBubble=true;else if(event.stopPropagation)event.stopPropagation()}function displayMenu(){populateListsMenu();setMenuPosition();document.getElementById("scroll_out").style.display="";addShadowToElement("scroll_out");coverList(false);$lp("#scroll_holder").jScrollPane({showArrows:true,scrollbarMargin:0,scrollbarWidth:10,arrowSize:10});setScrollerImages()}var semaphore=false;
function toggleMenu(){if(document.getElementById("scroll_out").style.display=="none")if(lists.length==0){if(semaphore)return;semaphore=true;loadListsRequest(function(data){if(data&&data.data){var responseData=data.data;lists=responseData["lists"];var dataMigrated=Boolean(responseData["success"]);if(migrationFlag=="false"&&dataMigrated)prefs.set("migration_flag","true");divideLists();displayMenu();semaphore=false}else dataError()})}else displayMenu();else{uncoverList();$lp("#scroll_out").css("display",
"none");$lp("#shadow").css("display","none")}}
function createNewList(){var listName=prefs.getMsg("untitled_list").replace("%NUM%","1");newListRequest(listName,function(data){if(data&&data.data&&data.data.success){var newList={};newList.id=data.data.id;newList.name=listName;newList.is_owner=true;newList.is_new=false;myLists.push(newList);newList.users=[gadgetOwnerId];newList.owner=gadgetOwnerId;newList.items=[];currentList=newList;currentListId=newList.id;sortListsByModified(myLists);document.getElementById("list_title").innerHTML=gadgets.util.escapeString(cutStringToFit(currentList.name,
listWidth,"11px","bold"));hideLoading();showItems();savePrefsData()}else dataError()})}function sortListsByModified(lists){lists.sort(function(a,b){if(a.modified<b.modified)return 1;if(a.modified>b.modified)return-1;return 0})}function divideLists(){myLists=[];for(var i=0;i<lists.length;i++){lists[i].isUpdated=false;if(lists[i].is_owner)myLists.push(lists[i])}sortListsByModified(myLists)}var MAX_ITEM_LENGTH=500;
function checkInputLength(input){if(input.value.length>MAX_ITEM_LENGTH)input.value=input.value.substring(0,MAX_ITEM_LENGTH)}
function showItems(){var itemsCounter=0;var curItemHTML=[];var curItem;var itemStyle="";for(var i=0;i<currentItems.length&&i<MAX_PROFILE_ITEMS;i++){curItem=currentItems[i];if(typeof curItem.id=="undefined")continue;itemStyle="color:"+colors[curItem.color]+";";if(curItem.strike)itemStyle=itemStyle+"text-decoration:line-through;";curItemHTML.push('<div style="float:left; width:10px;">');curItemHTML.push('<div id="item_'+i+'_bullet" title="'+prefs.getMsg("open_task_tooltip")+'" style="background: url('+
getImageUrl("gadget_sprite.cache.png")+") -146px -139px; height:11px; width:5px; overflow:hidden; "+'margin-top:6px; cursor:pointer;"></div>');curItemHTML.push("</div>");curItemHTML.push('<input id="item_text_'+curItem.id+'" class="new_text_style_no_focus" style="width:'+textWidth+"px; "+itemStyle+'" onkeypress="if (checkEnter(event)) {this.blur(); return false;}"'+' onfocus="editItem('+curItem.id+","+curItem.cut+');"'+' onblur="saveItemChanges();" onkeyup="checkInputLength(this);"'+' value="'+gadgets.util.escapeString(cutStringToFit(curItem.text,
textWidth,"11px","bold"))+'" />');document.getElementById("item_left_"+i).innerHTML=curItemHTML.join("");curItemHTML=[];curItemHTML.push('<div id="item_'+i+'_delete" title="'+prefs.getMsg("delete_tooltip")+'" class="sprite item_icon delete" style="visibility:hidden;"></div>');curItemHTML.push('<div id="item_'+i+'_color" title="'+prefs.getMsg("color_tooltip")+'" class="sprite item_icon color" style="visibility:hidden;"></div>');curItemHTML.push('<div id="item_'+i+'_strike" title="'+prefs.getMsg("completed_tooltip")+
'" class="sprite item_icon strike" style="visibility:hidden;"></div>');document.getElementById("item_"+i+"_icons").innerHTML=curItemHTML.join("");curItemHTML=[];setItemEvents("item_"+i,curItem.id);itemsCounter++}$lp(".delete").css({"background":"url("+getImageUrl("gadget_sprite.cache.png")+") -114px -139px"});$lp(".strike").css({"background":"url("+getImageUrl("gadget_sprite.cache.png")+") -92px -139px"});$lp(".color").css({"background":"url("+getImageUrl("gadget_sprite.cache.png")+") -70px -139px"});
if(currentItems.length>=MAX_PROFILE_ITEMS){if(currentItems.length>MAX_PROFILE_ITEMS)document.getElementById("view_all_left").innerHTML='<a id="view_all_text" href="javascript:void(0);"'+' onclick="switchToCanvas();">'+prefs.getMsg("view_all_items")+"&nbsp;("+currentItems.length+")</a>";$lp("#new_task").css("display","")}else{if(!isNewInputOpen){clearItemEvents("item_"+itemsCounter);curItemHTML=[];curItemHTML.push('<div style="float:left; width:10px;">');curItemHTML.push("</div>");curItemHTML.push('<input id="new_item_'+
itemsCounter+'" class="new_text_style_no_focus" style="width:'+textWidth+'px; color:#80795a;"'+' onkeypress="if (checkEnter(event)) {this.blur(); return false;}"'+'onblur="addNew('+itemsCounter+');"'+' onkeyup="checkInputLength(this);"'+' value="'+prefs.getMsg("add_new_here")+"\" onfocus=\"this.className='new_text_style';"+" this.style.color='#000000'; this.value='';"+' isNewInputOpen = true;"/>');document.getElementById("item_left_"+itemsCounter).innerHTML=curItemHTML.join("")}itemsCounter++;for(var i=
itemsCounter;i<MAX_PROFILE_ITEMS;i++){document.getElementById("item_left_"+i).innerHTML="";clearItemEvents("item_"+i)}document.getElementById("view_all_left").innerHTML="";$lp("#new_task").css("display","none")}}function setSoTimeout(cb){var handler=setTimeout(cb,TIMEOUT_MILLIS);return function(){clearTimeout(handler)}}
function updateStrikeRequest(itemId,strike,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/strikeitem?item_id="+itemId+"&strike="+strike+"&username="+escape(gadgetOwnerId),function(data){f();callback(data)},params)}
function importList(name,items,callback){var post_str=[];post_str.push("items="+encodeURIComponent(lpgadgets.lp.utils.jsonStringify(items)));post_str.push("name="+encodeURIComponent(name));post_str.push("username="+encodeURIComponent(gadgetOwnerId));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params[gadgets.io.RequestParameters.POST_DATA]=
post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/importlist",function(data){f();callback(data)},params)}
function addNew(num){var text=document.getElementById("new_item_"+num).value;text=trimSpaces(text);if(text.length>0||text==prefs.getMsg("add_new_here")){setLoadingToItem(num);responseCounter++;var item={"id":"temp_"+num,"text":text,"color":0,"strike":false};currentItems.push(item);document.getElementById("new_item_"+num).className="new_text_style_no_focus";var nextNum=num+1;if(nextNum>6){isNewInputOpen=false;$lp("#new_task").css("display","")}else{var curItemHTML=[];curItemHTML.push('<div style="float:left; width:10px;">');
curItemHTML.push("</div>");curItemHTML.push('<input id="new_item_'+nextNum+'" class="new_text_style" style="width:'+textWidth+'px;" onkeypress="if (checkEnter(event)) '+'{this.blur(); return false;}" onkeyup="checkInputLength(this);"'+' onblur="addNew('+nextNum+');"'+" onfocus=\"this.className='new_text_style';\" />");document.getElementById("item_left_"+nextNum).innerHTML=curItemHTML.join("");document.getElementById("view_all_left").innerHTML="";setTimeout(function(){document.getElementById("new_item_"+
nextNum).focus()},200)}addNewItemRequest(currentListId,text,0,0,responseCounter,function(data){if(data.data==null)dataError();else if(data.data.success){if(data.data.token==responseCounter){currentList=data.data.list;currentItems=currentList.items;showItems();savePrefsData()}}else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}else{document.getElementById("new_item_"+num).value=prefs.getMsg("add_new_here");document.getElementById("new_item_"+num).style.color="#80795A";
document.getElementById("new_item_"+num).className="new_text_style_no_focus";isNewInputOpen=false}}function setLoadingToItem(num){document.getElementById("item_"+num+"_icons").innerHTML='<div style="float:right"><img src='+getImageUrl("item_loader_profile.cache.gif")+' style="width:11px; height:11px; margin-top:5px;" /></div>'}function trimSpaces(str){return str=str.replace(/^\s*|\s*$/,"")}
function loadListDataRequest(id,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/getlist?list_id="+id,function(data){f();callback(data)},params)}
function loadListsRequest(callback){migrationFlag=prefs.getString("migration_flag");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/getlists?ownerId="+escape(gadgetOwnerId),function(data){f();callback(data)},params)}
function updateItemRequest(itemId,resCounter,txt,callback){var post_str=[];post_str.push("item_id="+encodeURIComponent(itemId));post_str.push("username="+encodeURIComponent(gadgetOwnerId));post_str.push("text="+encodeURIComponent(txt));post_str.push("token="+encodeURIComponent(resCounter));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params[gadgets.io.RequestParameters.POST_DATA]=
post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/updateitem",function(data){f();callback(data)},params)}
function updateColorRequest(itemId,color,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/coloritem?item_id="+itemId+"&color="+color,function(data){f();callback(data)},params)}
function removeItemRequest(itemId,resCounter,callback){var params={};var viewerName=gadgetOwnerId;params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/deleteitem?item_id="+itemId+"&username="+escape(gadgetOwnerId)+"&token="+resCounter,function(data){f();callback(data)},params)}
function newListRequest(name,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/newlist?name="+escape(name)+"&username="+escape(gadgetOwnerId),function(data){f();callback(data)},params)}
function addNewItemRequest(listId,txt,color,strike,resCounter,callback){var post_str=[];post_str.push("list_id="+encodeURIComponent(listId));post_str.push("username="+encodeURIComponent(gadgetOwnerId));post_str.push("text="+encodeURIComponent(txt));post_str.push("color="+encodeURIComponent(color));post_str.push("strike="+encodeURIComponent(strike));post_str.push("token="+encodeURIComponent(resCounter));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params[gadgets.io.RequestParameters.POST_DATA]=post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/additem",function(data){f();callback(data)},params)}
function saveItemChanges(){var newTxt=document.getElementById("item_text_"+currentEditedId).value;newTxt=trimSpaces(newTxt);if(newTxt.length>0){document.getElementById("item_text_"+currentEditedId).value=cutStringToFit(newTxt,textWidth,"11px","bold");updateItemRequest(currentEditedId,responseCounter,newTxt,function(data){if(data.data==null)dataError();else if(data.data.success){if(data.data.token==responseCounter){currentList=data.data.list;currentItems=currentList.items;showItems();savePrefsData()}}else if(data.data.error==
MISSING_ITEM_ERROR)handleMissingItem(true);else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}else document.getElementById("item_text_"+currentEditedId).value=cutStringToFit(currentEditedOldTxt,textWidth,"11px","bold");document.getElementById("item_text_"+currentEditedId).className="new_text_style_no_focus";currentEditedOldTxt="";currentEditedId=""}
function editItem(id,cut){if(cut){document.getElementById("load_ajax_back").style.backgroundColor="#faf7ae";displayLoading();loadListDataRequest(currentListId,function(listData){if(listData&&listData.data&&listData.data.success){currentList=listData.data;currentItems=currentList.items;showItems();savePrefsData();hideLoading();var itemInput=document.getElementById("item_text_"+id);if(itemInput!=null)setTimeout(function(){itemInput.focus()},200)}else if(listData.data.error==PERMISSION_DENIED)handlePermissionDenied();
else dataError()});return}responseCounter++;document.getElementById("item_text_"+id).className="new_text_style";document.getElementById("item_text_"+id).value=currentItems[getItemIndex(id)].text;currentEditedId=id;currentEditedOldTxt=document.getElementById("item_text_"+id).value;document.getElementById("item_text_"+id).select()}
function loadImages(){$lp(".sprite").css({"background-image":"url("+getImageUrl("gadget_sprite.cache.png")+")","background-repeat":"no-repeat"});document.getElementById("color_pallete").style.backgroundPosition="-50px -205px";document.getElementById("notebook_ajax").src=getImageUrl("loader_profile.cache.gif");document.getElementById("loading_notebook").style.backgroundPosition="0px -500px"}
function clearItemEvents(elementId){document.getElementById(elementId+"_icons").innerHTML="";changeBackPosition(elementId,"0px -41px");changeBackPosition(elementId+"_right","right -41px");document.getElementById(elementId).onmouseover=function(){};document.getElementById(elementId).onmouseout=function(){}}
function setItemEvents(elmentId,itemId){$lp("#"+elmentId+"_bullet").hover(function(){changeBackPosition(elmentId+"_bullet","-136px -139px")},function(){changeBackPosition(elmentId+"_bullet","-141px -139px")});$lp("#"+elmentId+"_strike").hover(function(){changeBackPosition(elmentId+"_strike","-103px -139px")},function(){changeBackPosition(elmentId+"_strike","-92px -139px")});$lp("#"+elmentId+"_delete").hover(function(){changeBackPosition(elmentId+"_delete","-125px -139px")},function(){changeBackPosition(elmentId+
"_delete","-114px -139px")});$lp("#"+elmentId+"_color").hover(function(){changeBackPosition(elmentId+"_color","-81px -139px")},function(){changeBackPosition(elmentId+"_color","-70px -139px")});document.getElementById(elmentId+"_strike").onclick=function(){setItemStrike(itemId)};document.getElementById(elmentId+"_delete").onclick=function(){deleteItem(itemId)};document.getElementById(elmentId+"_color").onclick=function(){openColorPallete(elmentId,itemId)};document.getElementById(elmentId).onmouseover=
function(){onMouseOverItem(elmentId)};document.getElementById(elmentId).onmouseout=function(){onMouseOutItem(elmentId)};document.getElementById(elmentId+"_bullet").onclick=function(){switchToCanvas(EDIT_TASK,itemId)}}
function addShadowToElement(elmentId){var position=$lp("#"+elmentId).offset();var xPos=position.left+3+"px";var yPos=position.top+3+"px";var elementHeight=document.getElementById(elmentId).offsetHeight;var width=parseInt(document.getElementById(elmentId).offsetWidth)+"px";var height=parseInt(elementHeight)+"px";document.getElementById("shadow").style.top=yPos;document.getElementById("shadow").style.left=xPos;document.getElementById("shadow").style.width=width;document.getElementById("shadow").style.height=
height;document.getElementById("shadow").style.display=""}
function openColorPallete(elmentId,itemId){$lp("#color_pallete_container").unbind("click");var position=$lp("#"+elmentId+"_color").offset();var xPos=position.left;var yPos=position.top;document.getElementById("color_pallete_container").style.top=yPos+"px";document.getElementById("color_pallete_container").style.left=xPos+"px";document.getElementById("color_pallete_container").style.display="";$lp("#color_pallete_container").click(function(e){setItemColor(itemId,e.pageX,e.pageY)});document.getElementById("color_pallete_container").onmouseover=
function(){onMouseOverItem(elmentId)};document.getElementById("color_pallete_container").onmouseout=function(){this.style.top="-200px";this.style.left="-200px";this.style.display="none";onMouseOutItem(elmentId)}}
function setItemColor(item_id,left,top){var color=0;var panel=$lp("#color_pallete");var click_left,click_top;var i,j;click_left=left-panel.offset().left;click_top=top-panel.offset().top;i=Math.floor(click_left/10);j=Math.floor(click_top/10);color=3*j+i;var colorCode=colors[color];currentItems[getItemIndex(item_id)].color=color;updateColorRequest(item_id,color,function(data){if(data.data==null)dataError();else if(data.data.success)savePrefsData();else if(data.data.error==MISSING_ITEM_ERROR)handleMissingItem(true);
else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()});document.getElementById("item_text_"+item_id).style.color=colorCode;document.getElementById("color_pallete_container").style.display="none"}
function onMouseOverItem(elmentId){changeBackPosition(elmentId,"0px -65px");changeBackPosition(elmentId+"_right","right -65px");if(document.getElementById(elmentId+"_bullet").style.backgroundPosition=="-146px -139px")changeBackPosition(elmentId+"_bullet","-141px -139px");document.getElementById(elmentId+"_strike").style.visibility="visible";document.getElementById(elmentId+"_color").style.visibility="visible";document.getElementById(elmentId+"_delete").style.visibility="visible"}
function onMouseOutItem(elmentId){changeBackPosition(elmentId,"0px -41px");changeBackPosition(elmentId+"_right","right -41px");changeBackPosition(elmentId+"_bullet","-146px -139px");document.getElementById(elmentId+"_strike").style.visibility="hidden";document.getElementById(elmentId+"_color").style.visibility="hidden";document.getElementById(elmentId+"_delete").style.visibility="hidden"}
function setWidth(){var containerWidth=parseInt(document.getElementById("container_size").offsetWidth);var containerWidthToSet=containerWidth;if(containerWidth>MAX_WIDTH)containerWidthToSet=MAX_WIDTH;else if(containerWidth<MIN_WIDTH)containerWidthToSet=MIN_WIDTH;var fullScreenWidth=parseInt(document.getElementById("full_screen_container").offsetWidth);listWidth=containerWidthToSet-9-9-8-fullScreenWidth-12;textWidth=containerWidthToSet-21-10-12-60;containerWidthToSet=containerWidthToSet+"px";document.getElementById("container").style.width=
containerWidthToSet;document.getElementById("list_title_container").style.width=listWidth+"px";document.getElementById("notebook_cover").style.width=containerWidthToSet;document.getElementById("notebook_title_cover").style.width=containerWidthToSet}
function coverList(all){var position=$lp("#title_container").offset();var xPos=position.left+1+"px";var yPos=position.top+24+"px";document.getElementById("notebook_cover").style.top=yPos;document.getElementById("notebook_cover").style.left=xPos;document.getElementById("notebook_cover").style.display="";if(all){document.getElementById("notebook_title_cover").style.top=position.top+"px";document.getElementById("notebook_title_cover").style.left=xPos;document.getElementById("notebook_title_cover").style.display=
""}}function uncoverList(){$lp("#notebook_title_cover").css("display","none");$lp("#notebook_cover").css("display","none")}function getListIndex(id){for(var i=0;i<myLists.length;i++)if(myLists[i].id==id)return i;return-1}
function populateListsMenu(){var out=[];out.push('<div id="my_list_header" class="menu_div_title">'+prefs.getMsg("by_me")+'</div><div style="padding:0px 5px;">');for(var i in myLists)if(myLists[i].id==currentListId){var newString=cutStringToFit(myLists[i].name,176,"11px","bold");out.push('<div id="list_out_'+myLists[i].id+'" style="cursor:pointer;" class="menu_div_item_selected menu_item"'+' onclick="switchToCanvas('+myLists[i].id+');">'+gadgets.util.escapeString(newString)+"</div>")}else if(myLists[i].isUpdated){var updatedString=
cutStringToFit(myLists[i].name,176,"11px","bold");out.push('<div id="list_out_'+myLists[i].id+'" class="menu_div_item menu_item" style="cursor:pointer;"'+' onclick="switchToCanvas('+myLists[i].id+');">'+'<span id="list_'+myLists[i].id+'" style="font-weight:bold;">'+gadgets.util.escapeString(updatedString)+"</span></div>")}else{var oldString=cutStringToFit(myLists[i].name,176,"11px","bold");out.push('<div id="list_out_'+myLists[i].id+'"'+' class="menu_div_item menu_item" style="cursor:pointer;"'+' onclick="switchToCanvas('+
myLists[i].id+');">'+'<span id="list_'+myLists[i].id+'" >'+gadgets.util.escapeString(oldString)+"</span></div>")}out.push('<div id="download" class="menu_div_item menu_item download_list"'+' onclick="downloadData()">'+prefs.getMsg("download_all")+"</div>");out.push("</div>");document.getElementById("scroll_holder").innerHTML=out.join("");$lp(".menu_item").hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"})}
function setScrollerImages(){$lp("a.jScrollArrowUp").css("background-image","url("+getImageUrl("gadget_sprite.cache.png")+")");$lp("a.jScrollArrowDown").css("background-image","url("+getImageUrl("gadget_sprite.cache.png")+")");$lp("a.jScrollArrowUp").css("background-position","-40px -139px");$lp("a.jScrollArrowDown").css("background-position","-50px -139px");$lp(".jScrollPaneDrag").css("background-image","url("+getImageUrl("collaborators_bar.cache.png")+")");$lp(".jScrollPaneDrag").css("background-position",
"-29px 0px")}function checkEnter(e){var evt=e?e:window.event?window.event:null;if(evt){var key=evt.charCode?evt.charCode:evt.keyCode?evt.keyCode:evt.which?evt.which:0;if(key=="13")return true;else return false}}function fullScreenOver(){changeBackPosition("full_screen_button","0px -175px");changeBackPosition("full_screen_button_right","right -175px");changeTextColor("full_screen_button","#E1D900")}
function fullScreenOut(){changeBackPosition("full_screen_button","0px -190px");changeBackPosition("full_screen_button_right","right -190px");changeTextColor("full_screen_button","#26221C")}function buttonOver(id){changeBackPosition(id+"_button","0px -120px");changeBackPosition(id+"_button_right","right -120px");changeTextColor(id+"_button","#26221C")}
function buttonOut(id){changeBackPosition(id+"_button","0px -101px");changeBackPosition(id+"_button_right","right -101px");changeTextColor(id+"_button","#D3B300")}
function switchToCanvas(additionalParams,value){var params={};if(additionalParams!=null&&typeof additionalParams!="undefined")if(additionalParams==NEW_TASK)params["isNewTask"]=additionalParams;else if(additionalParams==NEW_LIST)params["isNewList"]=additionalParams;else if(additionalParams==EDIT_TASK)params["edit"]=value;else params["listId"]=additionalParams;var views=gadgets.views.getSupportedViews();gadgets.views.requestNavigateTo(views["canvas"],params)}
onresize=function(){if(isDataError)return;setWidth();setMenuPosition();if(typeof currentList.name!="undefined")document.getElementById("list_title").innerHTML=gadgets.util.escapeString(cutStringToFit(currentList.name,listWidth,"11px","bold"));if(!isLoading)showItems()};
function dataError(){isDataError=true;_gel("container").innerHTML='<center><div style="text-align:center;'+"width:245px;height:130px;font-family: Arial, Helvetica, sans-serif;"+'font-size:11px; line-height:15px; color:#363636"><img src="'+'//cdn.labpixies.com/images/oops_data_icon.png" width="150" '+'height="74" style="margin-top:5px;margin-bottom:5px"/><br/>'+prefs.getMsg("data_err1")+"<br/>"+prefs.getMsg("data_err2")+"</div></center>";gadgets.window.adjustHeight()}
function cutStringToFit(stringToCut,width,fontSize,fontWeight){var divElm=document.getElementById("width_test_div");divElm.style.fontSize=fontSize;divElm.style.fontWeight=fontWeight;divElm.innerHTML=stringToCut;if($lp("#width_test_div").width()<width)return stringToCut;for(var i=stringToCut.length-1;i>0;i--){divElm.innerHTML=stringToCut.substring(0,i)+"...";if($lp("#width_test_div").width()<width)return stringToCut.substring(0,i)+"..."}}var IMAGES_BASE="//www.gstatic.com/ig/modules/labpixies/todo/images/";
var MAX_WIDTH=300;var MIN_WIDTH=240;var MAX_OLD_TASK_LEN=70;var colors_on_panel=[];colors_on_panel[0]=["#000000","#E22974","#DC4A20"];colors_on_panel[1]=["#006CB3","#7E9D1E","#ED1C24"];colors_on_panel[2]=["#662D91","#F7941D","#737373"];function onKeyHandle(e,action){var keynum;var keychar;var numcheck;if(window.event)keynum=e.keyCode;else if(e.which)keynum=e.which;if(keynum==13){eval(action);return false}return true}
function removeHTMLTags(str){var ret=str.replace(/<\/?[^>]+(>|$)/g,"");return ret.replace(/[\n\r\t]/g,"")}if(typeof lpgadgets=="undefined")lpgadgets={};lpgadgets.lp=lpgadgets.lp||{};lpgadgets.lp.campaigns=lpgadgets.lp.campaigns||{};
lpgadgets.lp.campaigns.todo=function(){var todos={};var view="";var display_items=-1;var profile_text_max=25;var canvas_dflt_items=13;var profile_dflt_items=6;var PROFILE_ITEMS=7;var canvas_empty_items=1;var ownerId,ownerName;var deleted_items=[];var curr_item_id=-1;var igoogle_max_data_length=1400;var profile_left_side_width;var profile_left_bottom_width;var curr_last_item=-1;var MAX_DATA_LENGTH;var pref_name="todos";var ga;var last_key=-1;function init(){load_gui_first_profile();display_items=profile_dflt_items;
profile_left_side_width=20;profile_left_bottom_width=26;MAX_DATA_LENGTH=igoogle_max_data_length;load_todos()}function adjust_height(){gadgets.window.adjustHeight()}function sort_items(a,b){var x=a.o;var y=b.o;return x-y}function load_todos(){var saved_tasks=prefs.getString("saved_tasks");saved_tasks=gadgets.util.unescapeString(saved_tasks);if(saved_tasks.length>0)check_for_old_version(saved_tasks);else fill_todos_from_prefs(prefs.getString(pref_name))}function fill_todos_from_prefs(prefs_data){var i;
if(prefs_data.length==0)todos={};else{var prefData=gadgets.util.unescapeString(prefs_data);var tmp=lpgadgets.lp.utils.jsonParse(prefData);todos={"items":[]};for(i=0;i<tmp.items.length;i++)if(tmp.items[i]){todos.items[i]={};todos.items[i].o=tmp.items[i].o;todos.items[i].t=tmp.items[i].t;todos.items[i].c=get_color_from_id(tmp.items[i].a.substr(0,1));todos.items[i].d=tmp.items[i].a.substr(1,1);todos.items[i].p=tmp.items[i].a.substr(2,1)}}if(!todos.items)todos={"items":[]};display_todos()}function get_real_length(){var ret=
0;var i;for(i=0;i<todos.items.length;i++)if(todos.items[i])ret=ret+1;return ret}function get_color_from_id(id){var row=Math.ceil(id/3)-1;var col=id-row*3-1;return colors_on_panel[row][col]}function get_id_from_color(color){var i,j;for(i=0;i<3;i++)for(j=0;j<3;j++)if(colors_on_panel[i][j]==color)return i*3+j+1}function json_esc(a){return window.encodeURIComponent?encodeURIComponent(a):escape(a)}function save_todos(){var i;var items_to_save=[];var json_to_save={};var json_string="";var curr_item={};
for(i=0;i<todos.items.length;i++)if(todos.items[i]){curr_item={};curr_item.o=todos.items[i].o;curr_item.t=todos.items[i].t;curr_item.a=""+get_id_from_color(todos.items[i].c)+todos.items[i].d+todos.items[i].p;items_to_save.push(curr_item)}json_to_save={"items":items_to_save};json_string=lpgadgets.lp.utils.jsonStringify(json_to_save);if(json_esc(json_string).length>MAX_DATA_LENGTH)return false;else{prefs.set(pref_name,json_string);return true}}function save_task_callback(data){if(data.success);else alert("Data was not saved. Please try again. \n Error: "+
data.error)}function save_task(task_item){var string_to_save=lpgadgets.lp.utils.jsonStringify(task_item);lpgadgets.lp.data.set(task_item.k,string_to_save,lpgadgets.lp.campaigns.todo.save_callback)}function set_profile_width(){var container_width=parseInt(document.getElementById("td_size_cont").offsetWidth);var target_width;if(container_width>MAX_WIDTH)target_width=MAX_WIDTH;else if(container_width<MIN_WIDTH)target_width=MIN_WIDTH;else target_width=container_width;target_width=target_width+"px";$lp("#td_pr_inner_container").css("width",
target_width)}function is_empty_text(text){var tmp=text.replace(/ /g,"");if(tmp.length>0)return false;else return true}function create_item(text){var new_item={};var tmp_ord=-1;var last_item=-1;for(i=0;i<todos.items.length;i++)if(todos.items[i])if(parseInt(todos.items[i].o)>tmp_ord){tmp_ord=parseInt(todos.items[i].o);last_item=i}if(tmp_ord==-1)tmp_ord=0;if(!is_empty_text(text)){new_item={"o":(tmp_ord+1).toString(),"t":removeHTMLTags(text),"c":"#000000","d":"0","p":"0"};todos.items.push(new_item);
if(save_todos()){$lp("#td_pr_item_add").remove();if(get_real_length()<=PROFILE_ITEMS){display_profile_item(new_item,todos.items.length-1,true);for(i=0;i<todos.items.length;i++)if(todos.items[i])last_item=i;if(get_real_length()<PROFILE_ITEMS)profile_set_add_line(todos.items.length+1,last_item);load_gui()}update_order_display()}else{todos.items.pop();$lp("#td_pr_item_add").remove();for(i=0;i<todos.items.length;i++)if(todos.items[i])last_item=i;if(last_item==-1)profile_set_add_line(0,1);else profile_set_add_line(todos.items.length-
1,last_item);load_gui();alert_max_data_len();update_order_display()}}else{$lp("#td_pr_item_add").remove();for(i=0;i<todos.items.length;i++)if(todos.items[i])last_item=i;if(last_item==-1)profile_set_add_line(0,1);else profile_set_add_line(get_real_length()+1,last_item);load_gui();update_order_display()}adjust_height()}function alert_max_data_len(){$lp("#td_cv_edit_task_item").unbind("blur");alert(LP_max_data_length)}function update_text(item_id,text){var new_text=removeHTMLTags(text);var old_text;
old_text=todos.items[item_id].t;$lp("#td_pr_edit_task_item").remove();if(!is_empty_text(new_text)){todos.items[item_id].t=new_text;if(save_todos()){var newText=cut_long_string(new_text);$lp(".td_pr_text","#td_pr_item_"+item_id).text(newText)}else{var oldText=cut_long_string(old_text);$lp(".td_pr_text","#td_pr_item_"+item_id).text(oldText);alert_max_data_len();todos.items[item_id].t=old_text}}else{todos.items[item_id].t=old_text;$lp(".td_pr_text","#td_pr_item_"+item_id).text(old_text)}}function get_next_item(from_item){var i;
for(i=from_item+1;i<todos.items.length;i++)if(todos.items[i])return i;return-1}function remove_callback(data){if(data.success);else alert("Data was not removed. Please try again. \n Error: "+data.error)}function remove_item(item_id){var removed_order;var next_item;var real_count;var last_item;removed_order=parseInt(todos.items[item_id].o);todos.items.splice(item_id,1,null);real_count=get_real_length();for(i=0;i<todos.items.length;i++)if(todos.items[i])if(parseInt(todos.items[i].o)>removed_order)todos.items[i].o=
(parseInt(todos.items[i].o)-1).toString();$lp("#td_pr_item_"+item_id).remove();if(real_count>profile_dflt_items){if(curr_last_item==-1)next_item=get_next_item(profile_dflt_items);else next_item=get_next_item(curr_last_item);curr_last_item=next_item;display_profile_item(todos.items[next_item],next_item)}else if(real_count==PROFILE_ITEMS-1){for(i=0;i<todos.items.length;i++)if(todos.items[i])last_item=i;profile_set_add_line(PROFILE_ITEMS,last_item)}else display_profile_item(null,todos.items.length+1);
load_gui();save_todos();update_order_display();adjust_height()}function swap_rows_profile(item_id,swap_item_id){var a=$lp("#td_pr_item_"+swap_item_id)[0];var b=$lp("#td_pr_item_"+item_id)[0];var t=a.parentNode.insertBefore(document.createTextNode(""),a);b.parentNode.insertBefore(a,b);t.parentNode.insertBefore(b,t);t.parentNode.removeChild(t)}function reorder_item(item_id,dir){var i;var swap_item_id=-1;var item_order=parseInt(todos.items[item_id].o);var tmp_ord;var reorder_item,swapped_item;if(dir==
1&&item_order==1)return false;if(dir==-1&&item_order==todos.items.length)return false;if(!lpgadgets.lp.utils.isMaxMode())if(dir==-1&&item_order==7)return false;switch(dir){case 1:tmp_ord=-1;for(i=0;i<todos.items.length;i++)if(todos.items[i])if(parseInt(todos.items[i].o)<item_order&&parseInt(todos.items[i].o)>tmp_ord){swap_item_id=i;tmp_ord=parseInt(todos.items[i].o)}swap_rows_profile(item_id,swap_item_id);break;case -1:tmp_ord=99999999;for(i=0;i<todos.items.length;i++)if(todos.items[i])if(parseInt(todos.items[i].o)>
item_order&&parseInt(todos.items[i].o)<tmp_ord){swap_item_id=i;tmp_ord=parseInt(todos.items[i].o)}if(todos.items[swap_item_id])swap_rows_profile(swap_item_id,item_id);else return;break}todos.items[item_id].o=parseInt(todos.items[item_id].o)-dir;todos.items[swap_item_id].o=parseInt(todos.items[swap_item_id].o)+dir;save_todos();update_order_display();$lp(".td_pr_ctrl").css("display","none");$lp(".td_pr_del").css("display","none");$lp(".td_pr_item").css("background-color","#f3f378")}function set_reorder_arrows(){var i;
var first_item=-1;var last_item=-1;return true;for(i=0;i<todos.items.length;i++){if(todos.items[i].o==1)first_item=i;if(todos.items[i].o==todos.items.length)last_item=i}$lp(".td_cv_up","#td_cv_item_"+first_item).unbind("click");$lp(".td_cv_up","#td_cv_item_"+first_item).css("cursor","default");$lp(".td_cv_up","#td_cv_item_"+first_item).removeClass("rollover");$lp(".td_cv_down","#td_cv_item_"+last_item).unbind("click");$lp(".td_cv_down","#td_cv_item_"+last_item).css("cursor","default");$lp(".td_cv_down",
"#td_cv_item_"+last_item).removeClass("rollover")}function update_order_display(){var i;var count=0;var count_column;count_column="#td_pr_item_count_";for(i=0;i<todos.items.length;i++)if(todos.items[i]){$lp(count_column+i).text(todos.items[i].o+".");count=count+1}}function cut_long_string(str){var max_len;max_len=25;if(str.length>max_len)return str.substring(0,max_len)+"...";else return str}function display_profile_item(todo_item,i,is_new){var html=[];var order,pub,text,color,done,pub_icon,item_id;
var line_class,text_class,link_class;var more_link_text,more_items_count,curr_profile_item;var done_style="";if(todo_item){order=i+1+".";pub=todo_item.p;text=todo_item.t;color=todo_item.c;done=todo_item.d;item_id=i;line_class="td_pr_item";text_class="td_pr_text";link_class="td_pr_item_link td_item_real"}else{order="&nbsp;";pub=-1;text="&nbsp;";color="";done=-1;item_id=i+"_empty";line_class="td_pr_empty_item";text_class="";link_class=""}if(done=="1")done_style=";text-decoration: line-through";html.push('<table id="td_pr_item_'+
item_id+'" cellspacing="0" cellpadding="0"'+' border="0" class="td_pr_items_table '+line_class+'">');html.push('<tr height="24">');html.push('<td width="'+profile_left_side_width+'" class="td_pr_border_bottom" align="center">'+'<div style="font-size:1px; width:1px;">&nbsp;</div>');html.push('<div class="td_pr_ctrl" style="text-align:center;width:10px;">');html.push('<div class="td_pr_up"></div><div style="height:4px;"></div>'+'<div class="td_pr_down"></div></div>');html.push("</td>");html.push('<td width="3" class="td_pr_red td_pr_border_bottom">'+
'<img class="td_pr_red_cell"/></td>');html.push('<td width="26" class="td_pr_border_bottom '+link_class+'" id="td_pr_item_count_'+item_id+'" align="center" style="color:'+color+done_style+'">'+order+"</td>");html.push('<td class="td_pr_border_bottom '+link_class+" "+text_class+'" style="color:'+color+done_style+'">'+cut_long_string(text)+"</td>");html.push('<td width="20" align="left" class="td_pr_border_bottom"'+' style="padding-top:1px"><div style="font-size:1px; width:1px;">&nbsp;'+'</div><div class="td_pr_del del_rollover"></div></td>');
html.push('<td width="3" class="td_pr_right_cell"'+' valign="top"><div class="td_pr_right_blue"></div></td>');html.push("</tr>");html.push("</table>");curr_profile_item=$lp(html.join(""));if(is_new&&get_real_length()<PROFILE_ITEMS){$lp(".td_pr_empty_item:eq(0)").after(curr_profile_item);$lp(".td_pr_empty_item:eq(0)").remove()}else $lp("#td_pr_items").append(curr_profile_item);curr_profile_item.hover(function(){if(!$lp(this).attr("id").match("_empty")){$lp(".td_pr_del",this).show();$lp(".td_pr_ctrl",
this).show();$lp(this).css("background-color","#f7f7a1")}},function(){$lp(".td_pr_del",this).hide();$lp(".td_pr_ctrl",this).hide();$lp(this).css("background-color","#f3f378")});$lp(".td_pr_del",curr_profile_item).click(function(){remove_item(i)});$lp(".td_pr_text",curr_profile_item).click(function(){if(!document.getElementById("td_pr_edit_task_item")){curr_item_id=i;profile_edit_item(i)}});$lp(".td_pr_up",curr_profile_item).click(function(){reorder_item(i,1)});$lp(".td_pr_down",curr_profile_item).click(function(){reorder_item(i,
-1)});$lp(".td_pr_last_lines").css("width",profile_left_side_width);$lp(".td_pr_bottom_left").css("width",profile_left_bottom_width);$lp("#td_pr_bottom_left_div").css("width",profile_left_bottom_width)}function profile_edit_item(item_id){var edit_item;var holder_el,input_el;var old_text;var height_offset=2;if(jQuery.browser.mozilla)height_offset=4;$lp("#td_pr_edit_task_item").remove();edit_item=todos.items[item_id];holder_el=$lp(".td_pr_text","#td_pr_item_"+item_id);old_text=holder_el.text();input_el=
$lp('<input type="text" class="td_pr_edit" id="td_pr_edit_task_item" />');input_el.val(edit_item.t);input_el.css("width",holder_el.width()-5);input_el.css("height",holder_el.height()-height_offset);input_el.css("color",holder_el.css("color"));holder_el.html("");holder_el.append(input_el);input_el.focus();input_el.select();input_el.blur(function(){update_text(item_id,$lp("#td_pr_edit_task_item").val())});input_el.unbind("keypress");input_el.bind("keypress",function(event){onKeyHandle(event,"lpgadgets.lp.campaigns.todo.update_text("+
item_id+",$lp('#td_pr_edit_task_item').val())")})}function profile_set_add_line(order,last_item_id){var html=[];html.push('<table id="td_pr_item_add" cellspacing="0"'+' cellpadding="0" border="0" class="td_pr_items_table">');html.push('<tr height="24">');html.push('<td width="'+profile_left_side_width+'" class="td_pr_border_bottom" align="center">&nbsp;</td>');html.push('<td width="3" class="td_pr_red td_pr_border_bottom">'+'<img class="td_pr_red_cell"/></td>');html.push('<td width="26" class="td_pr_border_bottom"'+
' id="td_pr_new_task_count" align="center" '+'style="color: #80795a;">&nbsp;</td>');html.push('<td class="td_pr_border_bottom" '+'style="" id="td_pr_new_item_holder">&nbsp;</td>');html.push('<td width="20" align="left" class="td_pr_border_bottom" '+'style="padding-top:3px">&nbsp;</td>');html.push('<td width="3" class="td_pr_right_cell" valign="top">'+'<div class="td_pr_right_blue"></div></td>');html.push("</tr>");html.push("</table>");var new_line=html.join("");var m_last_item_id=last_item_id;var m_curr_order=
-1;if(order==0)$lp("#td_pr_items").prepend(new_line);if(order==1)$lp("#td_pr_items").append(new_line);else{for(i=0;i<todos.items.length;i++)if(todos.items[i])if(todos.items[i].o>m_curr_order){m_curr_order=todos.items[i].o;m_last_item_id=i}$lp("#td_pr_item_"+m_last_item_id).after(new_line)}}function display_todos(){var i,items;var real_count=get_real_length();todos.items.sort(sort_items);if(display_items==-1)if(todos.items.length<canvas_dflt_items)items=canvas_dflt_items;else items=todos.items.length+
canvas_empty_items;else items=display_items;for(i=0;i<=items;i++)if(i==todos.items.length&&i<PROFILE_ITEMS)profile_set_add_line(todos.items.length+1,todos.items.length-1);else display_profile_item(todos.items[i],i);more_items_count=todos.items.length-display_items-1;var params={};params["new_task"]="true";load_gui()}function load_gui_first_profile(){$lp(".sprite").css("background-image","url("+getImageUrl("gadget_sprite.cache.png")+")");$lp(".td_pr_red_cell_btm").css("background-image","url("+getImageUrl("red_vertical_line.cache.png")+
")");$lp("#td_pr_top_title_right").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-repeat":"no-repeat","background-position":"0px -106px"});$lp("#td_pr_right_corner").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-position":"-90px -106px"});$lp("#td_pr_bottom_left_div").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-position":"-6px -106px"});$lp(".td_pr_bottom_right").css("background-image","url("+getImageUrl("bottom_background.cache.png")+
")");$lp(".td_pr_table_title").css("background-image","url("+getImageUrl("block_title.cache.png")+")");$lp(".td_pr_red").css("background-image","url("+getImageUrl("red_vertical_line.cache.png")+")")}function load_gui(){$lp(".td_pr_btn").css("background-image","url("+getImageUrl("sprite.cache.png")+")");$lp(".td_pr_btn_left").css("background-position","0px -91px");$lp(".td_pr_btn_middle").css({"background-position":"-2px -91px","color":"#26221C"});$lp(".td_pr_btn_right").css("background-position",
"-198px -91px");$lp("#td_pr_max_btn").unbind("click");$lp("#td_pr_max_btn").click(function(){navigateToCanvas()});$lp("#td_pr_max_btn").hover(function(){$lp(".td_pr_btn_left").css("background-position","0px -76px");$lp(".td_pr_btn_middle").css({"background-position":"-2px -76px","color":"#E1D900"});$lp(".td_pr_btn_right").css("background-position","-198px -76px")},function(){$lp(".td_pr_btn_left").css("background-position","0px -91px");$lp(".td_pr_btn_middle").css({"background-position":"-2px -91px",
"color":"#26221C"});$lp(".td_pr_btn_right").css("background-position","-198px -91px")});$lp(".td_pr_more_opt_btn").css("background-image","url("+getImageUrl("sprite.cache.png")+")");$lp("#td_pr_more_options").unbind("click");var count=0;for(i=0;i<todos.items.length;i++)if(todos.items[i])count=count+1;var rightButtonText=LP_more_options;if(count>7)rightButtonText=LP_g_view_all+" ("+count+")";document.getElementById("more_opt_button_left").innerHTML=rightButtonText;document.getElementById("more_opt_button_left").style.backgroundImage=
"url("+getImageUrl("sprite.cache.png")+")";document.getElementById("more_opt_button_right").style.backgroundImage="url("+getImageUrl("sprite.cache.png")+")";document.getElementById("new_task_button_left").innerHTML=LP_new_task;document.getElementById("new_task_button_left").style.backgroundImage="url("+getImageUrl("sprite.cache.png")+")";document.getElementById("new_task_button_right").style.backgroundImage="url("+getImageUrl("sprite.cache.png")+")";$lp("#td_pr_more_items_out").click(function(){var count=
0;for(i=0;i<todos.items.length;i++)if(todos.items[i])count=count+1;if(count>6){var params={};params["new_task"]="true";navigateToCanvas(params);return}holder_el=$lp("#td_pr_new_item_holder");input_el=$lp('<input type="text"'+' class="td_pr_edit" id="td_pr_edit_item_input" />');input_el.css("width",holder_el.width()-5);input_el.css("height",holder_el.height()-2);holder_el.html("");holder_el.append(input_el);$lp("#td_pr_new_task_count").text(count+1+".");input_el.keypress(function(event){onKeyHandle(event,
"lpgadgets.lp.campaigns.todo.create_item($lp('#td_pr_edit_item_input').val())")});input_el.blur(function(){if($lp("#td_pr_edit_item_input").val().length==0){var blur_last_item=-1;var i;$lp("#td_pr_item_add").remove();for(i=0;i<todos.items.length;i++)if(todos.items[i])blur_last_item=i;if(blur_last_item==-1)profile_set_add_line(0,1);else profile_set_add_line(get_real_length()+1,blur_last_item);load_gui()}else create_item($lp("#td_pr_edit_item_input").val())});if(jQuery.browser.msie)setTimeout('$lp("#td_pr_edit_item_input").focus()',
100);else $lp("#td_pr_edit_item_input").focus()});$lp("#td_pr_more_items_out").hover(function(){$lp("#new_task_button_left").css({"background-position":"0px -19px","color":"#FFFDC2"});$lp("#new_task_button_right").css("background-position","right -19px")},function(){$lp("#new_task_button_left").css({"background-position":"0px 0px","color":"#D3B300"});$lp("#new_task_button_right").css("background-position","right 0px")});$lp("#td_pr_more_options").click(function(){var real_length=get_real_length();
navigateToCanvas()});$lp("#td_pr_more_options").hover(function(){$lp("#more_opt_button_left").css({"background-position":"0px -57px","color":"#FFFDC2"});$lp("#more_opt_button_right").css("background-position","right -57px")},function(){$lp("#more_opt_button_left").css({"background-position":"0px -38px","color":"#D3B300"});$lp("#more_opt_button_right").css("background-position","right -38px")});$lp(".td_pr_right_blue").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-position":"-87px -106px"});
$lp(".td_pr_red_cell").attr("src",getImageUrl("red_vertical_line.cache.png"));$lp(".td_pr_del").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-position":"-42px -106px"});$lp(".td_pr_del").hide();$lp(".td_pr_up").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-position":"-93px -106px"});$lp(".td_pr_up").hover(function(){$lp(this).css("background-position","-103px -106px")},function(){$lp(this).css("background-position","-93px -106px")});
$lp(".td_pr_down").css({"background-image":"url("+getImageUrl("sprite.cache.png")+")","background-position":"-93px -116px"});$lp(".td_pr_down").hover(function(){$lp(this).css("background-position","-103px -116px")},function(){$lp(this).css("background-position","-93px -116px")});$lp(".td_pr_red").css("background-image","url("+getImageUrl("red_vertical_line.cache.png")+")");$lp(".td_pr_right_cell").css("background-image","url("+getImageUrl("right_side_background.cache.png")+")");set_profile_width();
$lp(".del_rollover").hover(function(){$lp(this).css("background-position","-57px -106px")},function(){$lp(this).css("background-position","-42px -106px")});adjust_height()}function email_list(){var i;var msg_body="";var new_line="%0A%0A";var subject=LP_email_subj;var count=0;for(i=0;i<todos.items.length;i++)if(todos.items[i]){count=count+1;msg_body=msg_body+count+". "+encodeURIComponent(todos.items[i].t)+new_line}document.location.href="mailto:?subject="+subject+"&body="+msg_body}function print_list(){window.print()}
function navigateToCanvas(params){var canvas_view=new gadgets.views.View("canvas");gadgets.views.requestNavigateTo(canvas_view,params)}function check_for_old_version(saved_tasks){if(saved_tasks.length>0){convert_old_data();display_todos()}}function convert_old_data(){var DELIMITER="_#$LAB_UDI$#_";var EXT_DELIMITER="_#$LAB_MATAN$#_";var saved_tasks=prefs.getString("saved_tasks");saved_tasks=gadgets.util.unescapeString(saved_tasks);var curr_task,curr_task_arr,curr_color,curr_order;var i;var new_item;
var task_arr=saved_tasks.split(EXT_DELIMITER);todos={"items":[]};for(i=1;i<task_arr.length;i++){curr_task=task_arr[i];curr_task_arr=curr_task.split(DELIMITER);last_key=last_key+1;if(curr_task_arr[2]=="black")curr_color="#000000";else curr_color=curr_task_arr[2];curr_order=parseInt(curr_task_arr[0])+1;new_item={"o":curr_order.toString(),"t":curr_task_arr[1].substr(0,MAX_OLD_TASK_LEN),"c":curr_color,"d":"0","p":"0","k":last_key};todos.items.push(new_item)}save_todos();prefs.set("saved_tasks","")}return{deploy:function(){init()},
init_data_callback:function(data){init_data_callback(data)},load_todos_callback:function(data){load_todos_callback(data)},create_item:function(text){create_item(text)},update_text:function(item_id,text){update_text(item_id,text)},email_list:function(){email_list()},print_list:function(){print_list()},set_profile_width:function(){set_profile_width()},save_callback:function(data){save_task_callback(data)},remove_callback:function(data){remove_callback(data)}}}();var LP_email_subj=prefs.getMsg("email_subj");
var LP_owner_title=prefs.getMsg("owner_title");var LP_more_my=prefs.getMsg("more_my");var LP_add_first=prefs.getMsg("add_first");var LP_add_more=prefs.getMsg("add_more");var LP_more_first=prefs.getMsg("more_first");var LP_max_data_length=prefs.getMsg("max_data_length");var LP_add_new_task=prefs.getMsg("add_new_task");var LP_g_add_more=prefs.getMsg("g_add_more");var LP_g_view_all=prefs.getMsg("g_view_all");var LP_g_add_new=prefs.getMsg("g_add_new");var LP_more_options=prefs.getMsg("more_options");
var LP_new_task=prefs.getMsg("new_task");var LP_more_features=prefs.getMsg("more_features");function deploy_todo_home(){lpgadgets.lp.campaigns.todo.deploy();$lp(window).resize(function(){lpgadgets.lp.campaigns.todo.set_profile_width()});gadgets.window.adjustHeight()}function reportFirstInteraction(){document.getElementById("td_pr_main_container").onmouseover=function(){}};</script>
]]>
  </Content>

  <Content type="html" view="canvas">
<![CDATA[
<title>ToDo</title>
<style>body{direction:ltr}body,html,*{font-family:arial;margin:0;padding:0}#main_container{overflow:hidden;text-align:left;width:512px}.sprite{overflow:hidden}ul,li{margin:0;padding:0}ul{list-style:none}#lists_container{border:1px solid #2a2620;width:726px}#list_title_container{float:left;height:27px;line-height:26px;overflow:hidden}.side_buttons{color:#d3b300;float:left;font-size:__MSG_right_invite_button_size__;font-weight:bold;height:41px;margin:6px 0 0 46px;width:130px}.new_text_style,.new_text_style_no_focus{background-color:#fcfcdb;border:1px solid #13807b;font-size:12px;line-height:17px;outline:none;overflow:hidden;resize:none;width:370px;word-wrap:break-word}.new_text_style_no_focus{border-color:transparent;background-color:transparent}a.jScrollActiveArrowButton,a.jScrollActiveArrowButton:hover{background-position:0 -30px}.holder{float:left}.scroll_pane{float:left;height:200px;overflow:auto;width:220px}.scroll_pane_collaborators{float:left;height:300px;overflow:auto;width:198px}.jScrollPaneContainer{position:relative;overflow:hidden;z-index:1}.jScrollPaneTrack{background:#faf7b6;cursor:pointer;height:100%;position:absolute;right:0;top:0}.jScrollPaneDrag,.jScrollPaneDragTop,.jScrollPaneDragBottom,a.jScrollArrowUp,a.jScrollArrowDown{overflow:hidden;position:absolute}.jScrollPaneDrag{cursor:pointer}.jScrollPaneDragTop,.jScrollPaneDragBottom{height:0;left:0;top:0}.jScrollPaneDragBottom{bottom:0}.jScrollPaneDragTop{top:0}a.jScrollArrowUp,a.jScrollArrowDown{display:block;z-index:1;top:0;right:0;text-indent:-2000px;height:10px}.bottom_menu_div{color:#352E29;font-size:12px;height:20px;line-height:20px;overflow:hidden}.bottom_menu_selected_div{color:#00928f;font-size:12px;font-weight:bold;height:20px;line-height:20px;overflow:hidden}.menu_div_title,.menu_div_item,.menu_div_item_selected,.menu_div_item_updated{background-color:#52493d;color:#fbf9c4;font-size:11px;font-weight:bold;height:18px;line-height:18px;overflow:hidden;padding:0 4px 0 4px;text-align:left}.menu_div_item_selected,.menu_div_item,.menu_div_item_updated{color:#52493d;background-color:#fffdbf;border-bottom:1px dashed #dedb95}.menu_div_item{font-weight:normal}.menu_div_item_updated{cursor:pointer;font-weight:bold}.menu_div_item_selected{color:#00928f}.list_name_input{background-color:transparent;border-color:transparent;color:#d3b300;font-size:14px;font-weight:bold;margin-top:3px;outline:none;width:340px}.bullet{height:17px;margin-top:2px;overflow:hidden;width:9px}.td_cv_top{height:45px;width:100%}.td_cv_items{width:100%}.td_cv_empty{border:0}.td_cv_title{background-repeat:repeat-x;color:#c5a618;font-family:Arial;font-size:14px;font-weight:bold;padding-top:5px;padding-left:12px}.td_cv_title_menu{background-repeat:repeat-x;color:#80795a;font-family:Arial;font-size:12px;font-weight:bold;padding-top:5px}.td_cv_title_menu b{color:#80795a;font-family:Arial;font-size:12px;font-weight:bold;padding:0 14px 0 14px;text-decoration:none}.td_cv_title_menu_link{color:#c5a618;font-family:Arial;font-size:12px;font-weight:bold;text-decoration:none}.td_cv_title_menu_link:visited{color:#c5a618}.td_cv_title_menu_link:hover{color:#f3f378}.td_cv_title_right{background-repeat:no-repeat;width:3px}.td_cv_item{background-color:#f3f378}.td_cv_item_all{border-bottom:#00c5c2 solid 1px}.td_cv_ctrl{display:none}.td_cv_item_arrows{height:23px;padding:5px 0 0 5px;text-align:right;width:15px}.td_cv_item_eye{background-position:right;background-repeat:repeat-y;padding:9px 9px 0 9px;text-align:center}.td_cv_item_count{color:#000;font-family:Arial;font-weight:bold;font-size:14px;line-height:18px;padding-left:10px;padding-right:10px;padding-top:7px}.td_cv_item_text{color:#000;font-family:Arial;font-weight:bold;font-size:14px;line-height:18px;padding-top:7px;padding-right:20px;padding-bottom:7px;width:100%}.td_cv_item_eye_first{background-position:right;background-repeat:repeat-y}.td_cv_item_count_first{line-height:18px}.td_cv_item_text_first{line-height:18px;width:100%}.td_cv_item_eye_bottom{background-position:left;background-repeat:no-repeat}.td_cv_item_count_bottom{background-repeat:repeat-x}.td_cv_item_text_bottom{background-repeat:repeat-x;width:100%}.td_cv_item_rest_bottom{background-repeat:repeat-x}.td_cv_add{color:#80795a}.td_cv_add a{color:#80795a;text-decoration:none}.td_cv_add a:hover{color:#80795a;text-decoration:underline}.td_cv_add a:visited{color:#80795a}.td_cv_new_task{background-color:#f3f378;border:none;color:#80795a;font-family:Arial;font-weight:bold;font-size:14px}.td_cv_edit_task{background-color:#fcfcdb;border:none;color:#80795a;font-family:Arial;font-weight:bold;font-size:14px;overflow:hidden}.td_cv_item_done{padding-right:8px;padding-top:7px}.td_cv_item_color{padding-right:8px;padding-top:7px}.td_cv_item_delete{padding-right:8px;padding-top:7px}.td_cv_item_right{background-repeat:repeat-y;width:3px}.td_cv_colors_pannel{display:none;height:32px;position:absolute;width:32px}.rollover{cursor:pointer}.td_cv_edit_cont_div{background-color:#fcfcdb;border:1px solid #13807b;display:none;position:absolute;padding-top:5px}.print_icon_style,.email_icon_style{background-image:url(//www.gstatic.com/ig/modules/labpixies/todo/images/canvas_sprite.cache.png);background-position:-22px -94px;cursor:pointer;float:right;height:17px;margin-left:10px;margin-top:5px;overflow:hidden;width:19px}.print_icon_style{background-position:-60px -94px;margin-right:9px}</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script><link href=http://yui.yahooapis.com/2.9.0/build/fonts/fonts-min.css rel=stylesheet type=text/css />
<script src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script src="http://yui.yahooapis.com/2.9.0/build/animation/animation-min.js"></script>
<script src="http://yui.yahooapis.com/2.9.0/build/dragdrop/dragdrop-min.js"></script>
<div id=social_container style=display:none;>
<center>
<textarea class=new_text_style id=new_text onblur=addNewItem(); onkeypress="if (checkEnter(event)) {this.blur(); setTimeout(openNewAgain,5); return false;}" onkeyup="checkTextAreaLength(this); textareaResize(this);" style="height:20px; display:none;"></textarea>
<div id=color_pallete_container style="position:absolute; display:none; cursor:pointer;"><img height=32 id=color_pallete width=32 /></div>
<div align=left class=holder id=scroll_out style="position:absolute; display:none; border:1px solid #2F2825; background:#FFFDBF; z-index:4">
<div class=scroll_pane id=scroll_holder></div>
</div>
<div id=width_test_div style="position:absolute; top:-400px; left:-400px; z-index:-1; visibility:hidden;"></div>
<div class=new_text_style id=test_size_div style="width:350px; position:absolute; visibility:hidden; z-index:-1;"></div>
<div id=shadow style="position:absolute; background-color:#000000; -moz-opacity:.2; opacity:.2; filter: alpha(opacity = 20); display:none; z-index:2;"></div>
<div align=center id=loading_notebook style="width:512px; position:absolute; display:none;">
<div style="height:180px; font-size:1px;"></div>
<table style="height:70px; width:100px; border:1px solid #D3B300; background-color:#F7F387;">
<tr>
<td align=center style="height:70px; width:100px;" valign=middle>
<img height=32 id=notebook_ajax width=32 />
<div style="color:#3b332e; font-size:14px;margin-top:5px;">__MSG_loading__</div>
</td>
</table>
</div>
<div align=center style="margin-left:30px; width:760px;">
<div style="height:20px; font-size:1px"></div>
<div id=out style=display:none;>
<table border=0 cellpadding=0 cellspacing=0 id=container>
<tr>
<td id=td_notebook style=width:512px; valign=top>
<div id=main_container style=display:none;>
<div class=sprite id=title_container style="height:45px; width:512px; overflow:hidden; background-position:0px 0px;">
<div class=sprite id=lists_menu_icon onclick=toggleMenu(); style="float:left; margin-left:9px; margin-top:9px; width:11px; height:9px; cursor:pointer; background-position:0px -94px;" title="__MSG_drop_menu_tooltip__"></div>
<div style="width:365px; height:27px; overflow:hidden; float:left; margin-left:6px;">
<div align=left id=list_title_container></div>
<div align=left id=list_creator style="float:left; font-size:12px; color:#D3B300; margin-left:3px; height:27px; line-height:26px;"></div>
</div>
<div class=print_icon_style id=print_icon onclick=printList(); title="__MSG_print_tooltip__"></div>
<div class=email_icon_style id=email_icon onclick=emailList(); title="__MSG_email_tooltip__"></div>
</div>
<div id=items>
<ul class=draglist id=ul1 style="width:512px; display:none;">
</ul>
<div id=new_out style=width:512px;>
<div style="width:512px; height:3px; line-height:3px; overflow:hidden; font-size:1px;">
<div class=sprite style="width:3px; height:3px; overflow:hidden; font-size:1px; background-position:-319px -94px; float:right;"></div>
</div>
<table border=0 cellpadding=0 cellspacing=0 style=height:22px;>
<tr>
<td style=width:33px;font-size:1px;></td>
<td align=left id=new_main style="width:479px; height:22px;">
<table border=0 cellpadding=0 cellspacing=0 height=19 id=new_button>
<tr onclick=createNewItem(); style=cursor:pointer;>
<td id=new_item_button style="height:19px; font-size:12px; color:#80795A; font-weight:bold;" valign=middle>__MSG_add_new_here__</td>
</table>
</td>
</table>
<div style="width:512px; height:3px; line-height:3px; overflow:hidden; font-size:1px;"></div>
<div class=sprite style="width:512px; height:1px; font-size:1px; line-height:1px; overflow:hidden; background-position:0px -45px;"></div>
</div>
<div id=new_list_line_container style=width:512px;>
<div style="width:512px; height:3px; line-height:3px; overflow:hidden; font-size:1px;">
<div class=sprite style="width:3px; height:3px; overflow:hidden; font-size:1px; background-position:-319px -94px; float:right;"></div>
</div>
<table border=0 cellpadding=0 cellspacing=0 style=height:24px;>
<tr>
<td style=width:33px;font-size:1px;></td>
<td align=right id=new_list_line_button_td style="width:479px; height:24px;">
<table border=0 cellpadding=0 cellspacing=0 height=24 style=margin-right:13px;>
<tr onclick=createNewList(); onmouseout=newListButtonOut(); onmouseover=newListButtonOver(); style=cursor:pointer;>
<td class=sprite id=new_list_line_button style="background-position:0px -299px; height:24px; line-height:18px; font-size:11px; font-weight:bold; color:#D3B300; padding-top:2px; padding-left:6px;" valign=top>+ __MSG_new_list__</td>
<td class=sprite id=new_list_line_button_right style="background-position:right -299px; height:24px; width:8px; cursor:pointer;"></td>
</table>
</td>
</table>
<div style="width:512px; height:3px; line-height:3px; overflow:hidden; font-size:1px;"></div>
<div class=sprite style="width:512px; height:1px; font-size:1px; line-height:1px; overflow:hidden; background-position:0px -45px;"></div>
</div>
</div>
</div>
</td>
<td style="width:14px; font-size:1px;"></td>
<td style=width:200px; valign=top>
<div style="height:124px; width:200px; overflow:hidden;">
<a href=http://www.labpixies.com/?source=canvas_staticad&gadget=33 target=_blank><img border=0 height=124 id=right_banner width=200 /></a>
</div>
</td>
</table>
<div style="height:25px; font-size:1px;"></div>
<table border=0 cellpadding=0 cellspacing=0 id=lists_container>
<tr>
<td>
<div id=my_lists_header style="background-color:#2A2620; height:22px; line-height:20px;">
<span style="float:left; margin-left:8px; font-size:12; font-weight:bold; color:#CDAA03;">__MSG_my_lists__</span>
<span onclick="createNewList('bottom_button');" onmouseout="this.style.textDecoration='none';" onmouseover="this.style.textDecoration='underline';" style="float:right; margin-right:8px; font-size:12; font-weight:bold; color:#00B2AF; cursor:pointer;">+ __MSG_new_list__</span>
</div>
</td>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=5 style="height:5px; font-size:1px"></td>
<tr>
<td style="width:10px; font-size:1px"></td>
<td id=my_lists style=width:342px; valign=top></td>
<td style="width:9px; font-size:1px"></td>
<td id=friends_lists style=width:342px; valign=top></td>
<td style="width:10px; font-size:1px"></td>
<tr><td colspan=5 style="height:5px; font-size:1px"></td>
</table>
</td>
</table>
</div>
</div>
<div style="height:20px; font-size:1px;"></div>
</center>
</div>
<div id=non_social_container style=display:none;>
<center>
<div style="height:15px; font-size:1px;"></div>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center style=width:760px;>
<div id=td_cv_main_container style=width:520px;>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td valign=top>
<table border=0 cellpadding=0 cellspacing=0 class=td_cv_top>
<tr>
<td class=td_cv_title id=td_cv_title valign=top>__MSG_owner_title__</td>
<td align=right class=td_cv_title_menu style=padding-right:3px valign=top><a class=td_cv_title_menu_link href=javascript:lpgadgets.lp.campaigns.todo.print_list()>__MSG_print_list__</a><b>|</b><a class=td_cv_title_menu_link href=javascript:lpgadgets.lp.campaigns.todo.email_list() style=margin-right:8px;>__MSG_email_list__</a></td>
<td class=td_cv_title_right></td>
</table>
<table border=0 cellpadding=0 cellspacing=0 class=td_cv_items id=td_cv_items>
<tr class=td_cv_item height=1 id=td_cv_item_top>
<td height=1><img class=td_cv_empty height=1 /></td>
<td class=td_cv_item_eye_first height=1><img class=td_cv_empty height=1 width=37 /></td>
<td class=td_cv_item_count_first height=1 valign=top><img class=td_cv_empty height=1 width=1 /></td>
<td class=td_cv_item_text_first height=1><img class=td_cv_empty height=1 width=1 /></td>
<td height=1><img class=td_cv_empty height=1 width=25 /></td>
<td height=1><img class=td_cv_empty height=1 width=25 /></td>
<td height=1><img class=td_cv_empty height=1 width=25 /></td>
<td class=td_cv_item_right height=1><img class=td_cv_empty height=1 width=3 /></td>
</table>
<div class=td_cv_edit_cont_div id=td_cv_edit_task_container><textarea class=td_cv_edit_task id=td_cv_edit_task_item name=td_cv_edit_task_item size=70></textarea></div>
</td>
</table>
<div id=td_cv_comments></div>
</div>
</td>
</table>
</center>
</div>
<div id=footer_div style=clear:both;>
<script>var mMENU=gadgets.io.getProxyUrl("http://cdn.labpixies.com/infra/js/lp_footer.js",{refreshInterval:21600});document.write("<scr"+'ipt type="text/javascript" src="'+mMENU+'"></scr'+"ipt>");</script>
</div>
<div id=last_div style="font-size:1px; clear:both;">&nbsp;</div>
<script>jQuery.jScrollPane={active:[]};
jQuery.fn.jScrollPane=function(settings){settings=jQuery.extend({scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true},settings);return this.each(function(){var $this=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var currentScrollPosition=settings.maintainPosition?$this.offset({relativeTo:jQuery(this).parent()[0]}).top:0;var $c=jQuery(this).parent();
var paneWidth=$c.innerWidth();var paneHeight=$c.outerHeight();var trackHeight=paneHeight;if($c.unmousewheel)$c.unmousewheel();jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",$c).remove();$this.css({"top":0})}else{var currentScrollPosition=0;this.originalPadding=$this.css("paddingTop")+" "+$this.css("paddingRight")+" "+$this.css("paddingBottom")+" "+$this.css("paddingLeft");this.originalSidePaddingTotal=(parseInt($this.css("paddingLeft"))||0)+(parseInt($this.css("paddingRight"))||
0);var paneWidth=$this.innerWidth();var paneHeight=$this.innerHeight();var trackHeight=paneHeight;$this.wrap(jQuery("<div></div>").attr({"className":"jScrollPaneContainer"}).css({"height":paneHeight+"px","width":paneWidth+"px"}));jQuery(document).bind("emchange",function(e,cur,prev){$this.jScrollPane(settings)})}var p=this.originalSidePaddingTotal;$this.css({"height":"auto","width":paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p+"px","paddingRight":settings.scrollbarMargin+"px"});var contentHeight=
$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<0.99){var $container=$this.parent();$container.append(jQuery("<div></div>").attr({"className":"jScrollPaneTrack"}).css({"width":settings.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({"className":"jScrollPaneDrag"}).css({"width":settings.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({"className":"jScrollPaneDragTop"}).css({"width":settings.scrollbarWidth+"px"}),jQuery("<div></div>").attr({"className":"jScrollPaneDragBottom"}).css({"width":settings.scrollbarWidth+
"px"}))));var $track=jQuery(">.jScrollPaneTrack",$container);var $drag=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",$container);if(settings.showArrows){var currentArrowButton;var currentArrowDirection;var currentArrowInterval;var currentArrowInc;var whileArrowButtonDown=function(){if(currentArrowInc>4||currentArrowInc%4==0)positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);currentArrowInc++};var onArrowMouseUp=function(event){jQuery("body").unbind("mouseup",onArrowMouseUp);currentArrowButton.removeClass("jScrollActiveArrowButton");
clearInterval(currentArrowInterval)};var onArrowMouseDown=function(){jQuery("body").bind("mouseup",onArrowMouseUp);currentArrowButton.addClass("jScrollActiveArrowButton");currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100)};$container.append(jQuery("<a></a>").attr({"href":"javascript:;","className":"jScrollArrowUp"}).css({"width":settings.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){currentArrowButton=jQuery(this);currentArrowDirection=
-1;onArrowMouseDown();this.blur();return false}),jQuery("<a></a>").attr({"href":"javascript:;","className":"jScrollArrowDown"}).css({"width":settings.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){currentArrowButton=jQuery(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false}));if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;$track.css({"height":trackHeight+"px",top:settings.arrowSize+"px"})}else{var topArrowHeight=jQuery(">.jScrollArrowUp",
$container).height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-jQuery(">.jScrollArrowDown",$container).height();$track.css({"height":trackHeight+"px",top:topArrowHeight+"px"})}}var $pane=jQuery(this).css({"position":"absolute","overflow":"visible"});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=="X"?"Left":"Top";return event["page"+c]||event["client"+c]+(document.documentElement["scroll"+
p]||document.body["scroll"+p])||0};var ignoreNativeDrag=function(){return false};var initDrag=function(){ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight};var onStartDrag=function(event){initDrag();dragMiddle=getPos(event,"Y")-dragPosition-currentOffset.top;jQuery("body").bind("mouseup",onStopDrag).bind("mousemove",updateScroll);if(jQuery.browser.msie)jQuery("body").bind("dragstart",
ignoreNativeDrag).bind("selectstart",ignoreNativeDrag);return false};var onStopDrag=function(){jQuery("body").unbind("mouseup",onStopDrag).unbind("mousemove",updateScroll);dragMiddle=percentInView*paneHeight/2;if(jQuery.browser.msie)jQuery("body").unbind("dragstart",ignoreNativeDrag).unbind("selectstart",ignoreNativeDrag)};var positionDrag=function(destY){destY=destY<0?0:destY>maxY?maxY:destY;dragPosition=destY;$drag.css({"top":destY+"px"});var p=destY/maxY;$pane.css({"top":(paneHeight-contentHeight)*
p+"px"});$this.trigger("scroll")};var updateScroll=function(e){positionDrag(getPos(e,"Y")-currentOffset.top-dragMiddle)};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({"height":dragH+"px"}).bind("mousedown",onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function(){if(trackScrollInc>8||trackScrollInc%4==0)positionDrag(dragPosition-(dragPosition-trackScrollMousePos)/
2);trackScrollInc++};var onStopTrackClick=function(){clearInterval(trackScrollInterval);jQuery("body").unbind("mouseup",onStopTrackClick).unbind("mousemove",onTrackMouseMove)};var onTrackMouseMove=function(event){trackScrollMousePos=getPos(event,"Y")-currentOffset.top-dragMiddle};var onTrackClick=function(event){initDrag();onTrackMouseMove(event);trackScrollInc=0;jQuery("body").bind("mouseup",onStopTrackClick).bind("mousemove",onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll()};
$track.bind("mousedown",onTrackClick);if($container.mousewheel)$container.mousewheel(function(event,delta){initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured},false);var _animateToPosition;var _animateToInterval;function animateToPosition(){var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1)positionDrag(dragPosition+diff);else{positionDrag(_animateToPosition);ceaseAnimation()}}
var ceaseAnimation=function(){if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition}};var scrollTo=function(pos,preventAni){if(typeof pos=="string"){$e=jQuery(pos,this);if(!$e.length)return;pos=$e.offset({relativeTo:this}).top}ceaseAnimation();var destDragPosition=-pos/(paneHeight-contentHeight)*maxY;if(!preventAni||settings.animateTo){_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval)}else positionDrag(destDragPosition)};
$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta){var currentPos=-parseInt($pane.css("top"))||0;scrollTo(currentPos+delta)};initDrag();scrollTo(-currentScrollPosition,true);jQuery.jScrollPane.active.push($this[0])}else $this.css({"height":paneHeight+"px","width":paneWidth-this.originalSidePaddingTotal+"px","padding":this.originalPadding})})};jQuery(window).bind("unload",function(){var els=jQuery.jScrollPane.active;for(var i=0;i<els.length;i++)els[i].scrollTo=els[i].scrollBy=null});
function downloadData(){toggleMenu();var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.TEXT;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";gadgets.io.makeRequest(APPURL+"/export",function(obj){if(obj&&obj.text&&obj.text!="error")window.open(APPURL+"/serve/"+obj.text,"_self");else dataError()},params)}var $lp=jQuery.noConflict();
var prefs=prefs||new gadgets.Prefs;var owner;var currentListId=null;var responseCounter=0;var temporaryIdIndex=0;var currentEditedId;var currentEditedOldTxt;var APPURL="http://lpsharedlist.appspot.com";var IMAGES_BASE="//www.gstatic.com/ig/modules/labpixies/todo/images/";var isHttp=gadgets.util.getUrlParameters()["parent"]&&gadgets.util.getUrlParameters()["parent"].match(/http:/i);var currentList={};var currentItems=[];var myLists=[];var isLoading;var params;var renamingList=false;
var requestTimeout=0;var TIMEOUT_MILLIS=15E3;var MISSING_ITEM_ERROR="missing item";var PERMISSION_DENIED="permission denied";var MAX_PROFILE_ITEMS=7;var MAX_ITEM_LEN_IN_PREFS=37;var MAX_ITEMS_NUM=100;var MAX_LISTS_NUM=50;var MIN_LINE_NUM=12;var actions={"add":0,"delete":1,"update":2,"rename":3,"add_collaborator":4,"task_completed":5,"create":6};var colors=["#000000","#E22974","#DC4A20","#006CB3","#7E9D1E","#ED1C24","#662D91","#F7941D","#737373"];var EMAIL_LIMIT=1E3;var gadgetOwnerId=gadgets.util.getUrlParameters().gadgetOwner;
var migrationFlag=prefs.getString("migration_flag");function isSignedInUser(){try{return _args().is_signedin}catch(ex){return false}}gadgets.util.registerOnLoadHandler(function(){initCanvas()});
function initCanvas(){if(!isSignedInUser()||!gadgetOwnerId){document.getElementById("non_social_container").style.display="";deploy_todo_canvas();return}document.getElementById("social_container").style.display="";loadImages();if(isHttp)new YAHOO.util.DDTarget("ul1");setOverEvents();setOnClickHandlers();loadListsAndDefault();maintenanceRequest()}
function savePrefsData(){var prefsData={};prefsData.o=gadgetOwnerId;prefsData.id=currentListId;prefsData.name=currentList.name;prefsData.l=currentItems.length;prefsData.items=[];var text,cut;for(var i=0;i<MAX_PROFILE_ITEMS&&i<currentItems.length;i++){text=currentItems[i].text;cut=0;if(text.length>MAX_ITEM_LEN_IN_PREFS){text=text.substring(0,MAX_ITEM_LEN_IN_PREFS);cut=1}var item=[currentItems[i].id,currentItems[i].text,currentItems[i].color,currentItems[i].strike?1:0,cut];prefsData.items.push(item)}prefs.set("sd",
lpgadgets.lp.utils.jsonStringify(prefsData))}function loadListsAndDefault(){loadListsRequest(function(data){if(data&&data.data){var responseData=data.data;lists=responseData["lists"];var dataMigrated=Boolean(responseData["success"]);if(migrationFlag=="false"&&dataMigrated)prefs.set("migration_flag","true");waitingForInitialData()}else dataError()})}function setSoTimeout(cb){var handler=setTimeout(cb,TIMEOUT_MILLIS);return function(){clearTimeout(handler)}}
function loadListDataRequest(id,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/getlist?list_id="+id,function(data){f();callback(data)},params)}
function loadListsRequest(callback){migrationFlag=prefs.getString("migration_flag");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/getlists?ownerId="+escape(gadgetOwnerId),function(data){f();callback(data)},params)}
function addNewItemRequest(listId,txt,color,strike,resCounter,callback){var post_str=[];post_str.push("list_id="+encodeURIComponent(listId));post_str.push("username="+encodeURIComponent(gadgetOwnerId));post_str.push("text="+encodeURIComponent(txt));post_str.push("color="+encodeURIComponent(color));post_str.push("strike="+encodeURIComponent(strike));post_str.push("token="+encodeURIComponent(resCounter));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params[gadgets.io.RequestParameters.POST_DATA]=post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/additem",function(data){f();callback(data)},params)}
function updateItemRequest(itemId,resCounter,txt,callback){var post_str=[];post_str.push("item_id="+encodeURIComponent(itemId));post_str.push("username="+encodeURIComponent(gadgetOwnerId));post_str.push("text="+encodeURIComponent(txt));post_str.push("token="+encodeURIComponent(resCounter));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params[gadgets.io.RequestParameters.POST_DATA]=
post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/updateitem",function(data){f();callback(data)},params)}
function updateColorRequest(itemId,color,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/coloritem?item_id="+itemId+"&color="+color,function(data){f();callback(data)},params)}
function maintenanceRequest(){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";gadgets.io.makeRequest(APPURL+"/maintenance",function(){},params)}
function removeItemRequest(itemId,resCounter,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/deleteitem?item_id="+itemId+"&username="+escape(gadgetOwnerId)+"&token="+resCounter,function(data){f();callback(data)},params)}
function removeListRequest(listId,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/deletelist?list_id="+listId+"&username="+escape("")+"&name="+escape(""),function(data){f();callback(data)},params)}
function renameListRequest(listId,listName,callback){var post_str=[];post_str.push("list_id="+encodeURIComponent(listId));post_str.push("username="+encodeURIComponent(gadgetOwnerId));post_str.push("name="+encodeURIComponent(listName));post_str.push("container="+encodeURIComponent("igoogle.com"));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;
params[gadgets.io.RequestParameters.POST_DATA]=post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/renamelist",function(data){f();callback(data)},params)}
function updateStrikeRequest(itemId,strike,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/strikeitem?item_id="+itemId+"&strike="+strike+"&username="+escape(gadgetOwnerId),function(data){f();callback(data)},params)}
function updateSeqRequest(listId,order,callback){var post_str=[];var orderDetails=lpgadgets.lp.utils.jsonStringify(order);post_str.push("order="+encodeURIComponent(orderDetails));post_str.push("list_id="+encodeURIComponent(listId));post_str.push("container="+encodeURIComponent("igoogle.com"));post_str=post_str.join("&");var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;
params[gadgets.io.RequestParameters.POST_DATA]=post_str;params[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/listorder",function(data){f();callback(data)},params)}
function newListRequest(name,callback){var params={};params[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;params[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;params["OAUTH_SERVICE_NAME"]="HMAC";var f=setSoTimeout(function(){dataError()});gadgets.io.makeRequest(APPURL+"/newlist?name="+escape(name)+"&username="+escape(gadgetOwnerId),function(data){f();callback(data)},params)}
function createNewList(){if(myLists.length>=MAX_LISTS_NUM){alert(prefs.getMsg("cant_add_more_lists").replace("%NUM%",MAX_LISTS_NUM));return}if(currentListId!=null&&isLoading)return;displayLoading();var listName=getNextUntitledAvailable();newListRequest(listName,function(data){if(data&&data.data&&data.data.success){var newList={};newList.id=data.data.id;newList.name=listName;newList.is_owner=true;newList.is_new=false;myLists.push(newList);newList.users=[gadgetOwnerId];newList.owner=gadgetOwnerId;newList.modified=
data.data.modified;newList.items=[];var currTime=new Date;newList.change_log=[[currTime.getTime(),gadgetOwnerId,6,""]];currentList=newList;currentListId=newList.id;savePrefsData();sortListsByModified(myLists);hideLoading();document.getElementById("main_container").style.display="";clearPreviousList();populateBottomListsMenu(currentListId);displayCurrentList();document.getElementById("list_name_input").style.backgroundColor="#69645E";document.getElementById("list_name_input").select();document.getElementById("list_name_input").focus()}else dataError()})}
function displayLoading(){isLoading=true;var topPosition=document.getElementById("td_notebook").style.top;var leftPosition=document.getElementById("td_notebook").style.left;var position=$lp("#td_notebook").offset();var height=$lp("#td_notebook").height()-24+"px";var xPos=position.left+"px";var yPos=position.top+24+"px";document.getElementById("loading_notebook").style.top=yPos;document.getElementById("loading_notebook").style.left=xPos;document.getElementById("loading_notebook").style.height=height;
document.getElementById("loading_notebook").style.display=""}function hideLoading(){isLoading=false;document.getElementById("loading_notebook").style.display="none"}
function loadImages(){$lp(".sprite").css("background-image","url("+getImageUrl("canvas_sprite.cache.png")+")");document.getElementById("notebook_ajax").src=getImageUrl("ajax_big_loader.cache.gif");var cachedUrl=gadgets.io.getProxyUrl("http://cdn.labpixies.com/images/transparent.gif");document.getElementById("loading_notebook").style.background="url("+cachedUrl+") repeat";document.getElementById("ul1").style.background="transparent url("+getImageUrl("line_background.cache.png")+") 0px 0px repeat-y";
document.getElementById("color_pallete").src=getImageUrl("color_pallete.cache.png");document.getElementById("new_out").style.background="transparent url"+"("+getImageUrl("line_background.cache.png")+") repeat-y";document.getElementById("new_list_line_container").style.background="transparent url"+"("+getImageUrl("line_background.cache.png")+") repeat-y";document.getElementById("right_banner").src=getImageUrl("labpixies_banner_big.cache.png")}
function emailList(){if(isLoading)return;var msgBody="";var newLine="%0A%0A";var subject=prefs.getMsg("email_subject")+": "+currentList.name;if(!currentList.is_owner)subject=subject;var count=0;for(var i=0;i<currentList.items.length;i++)if(currentList.items[i]){count=count+1;msgBody=msgBody+"- "+currentList.items[i].text+newLine}if(msgBody.length+subject.length>EMAIL_LIMIT){msgBody=msgBody.substring(0,EMAIL_LIMIT);alert(prefs.getMsg("email_too_long"))}window.open("mailto:?subject="+subject+"&body="+
msgBody)}function getListIndex(id){for(var i=0;i<myLists.length;i++)if(myLists[i].id==id)return i;return-1}function setFocusToListName(elm){renamingList=true;elm.value=currentList.name;elm.select();elm.style.backgroundColor="#69645E"}
function displayCurrentList(){currentItems=currentList.items;if(currentList.is_owner){document.getElementById("list_title_container").innerHTML='<input id="list_name_input" type="text" class="list_name_input"'+' maxlength="30" value="" onblur="saveListName('+currentListId+',this.value);" onkeypress="if (checkEnter(event)) {this.blur();}"'+' onfocus="setFocusToListName(this);" '+'onmouseover="if (!renamingList)'+" {this.style.backgroundColor='#59534C';}\""+' onmouseout="if (!renamingList)'+" {this.style.backgroundColor='transparent';}\" />";
document.getElementById("list_creator").innerHTML="";document.getElementById("list_name_input").value=cutStringToFit(currentList.name,338,"14px","bold")}else{document.getElementById("list_title_container").innerHTML='<div id="list_title_name" style="float:left; font-size:14px;'+" font-weight: bold; color:#D3B300; text-decoration:none;"+' margin-left:3px;">'+gadgets.util.escapeString(currentList.name)+"</div>";document.getElementById("list_creator").innerHTML=""}showItems();for(var i=0;i<MIN_LINE_NUM-
currentItems.length-2;i++)addEmptyItem();addEmptyItem();hideLoading();gadgets.window.adjustHeight()}function updateChangesLog(action,text){var tmpLog=[];tmpLog.push([getTimestamp(),gadgetOwnerId,actions[action],text]);for(var i=0;i<currentList.change_log.length;i++)tmpLog.push(currentList.change_log[i]);tmpLog.splice(5,1);currentList.change_log=tmpLog}function getTimestamp(){var date=new Date;return date.getTime()}
function addShadowToElement(elmentId){var position=$lp("#"+elmentId).offset();var elementHeight=document.getElementById(elmentId).offsetHeight;var xPos=position.left+3+"px";var yPos=position.top+3+"px";var width=parseInt(document.getElementById(elmentId).offsetWidth)+"px";var height=parseInt(elementHeight)+"px";document.getElementById("shadow").style.top=yPos;document.getElementById("shadow").style.left=xPos;document.getElementById("shadow").style.width=width;document.getElementById("shadow").style.height=
height;document.getElementById("shadow").style.display=""}function trimSpaces(str){return str=str.replace(/^\s+|\s+$/g,"")}
function saveListName(listId,newName){newName=trimSpaces(newName);renamingList=false;document.getElementById("list_name_input").style.backgroundColor="transparent";if(newName==""){document.getElementById("list_name_input").value=cutStringToFit(currentList.name,338,"14px","bold");return}if(newName!=currentList.name){var oldName=currentList.name;currentList.name=newName;document.getElementById("list_name_input").value=cutStringToFit(currentList.name,338,"14px","bold");myLists[getListIndex(listId)].name=
newName;populateBottomListsMenu(currentListId);updateChangesLog("rename",oldName);renameListRequest(listId,newName,function(data){if(data.data==null||!data.data.success)dataError();else{savePrefsData();var currentTime=data.data.modified;setModifiedToList(listId,currentTime)}})}}function setModifiedToList(listId,modified){var listIndex=getListIndex(listId);myLists[listIndex].modified=modified;sortListsByModified(myLists);populateBottomListsMenu(currentListId)}
function setScrollerImages(){$lp("a.jScrollArrowUp").css("background-image","url("+getImageUrl("canvas_sprite.cache.png")+")");$lp("a.jScrollArrowDown").css("background-image","url("+getImageUrl("canvas_sprite.cache.png")+")");$lp("a.jScrollArrowUp").css("background-position","-243px -94px");$lp("a.jScrollArrowDown").css("background-position","-263px -94px");$lp(".jScrollPaneDrag").css("background-image","url("+getImageUrl("collaborators_bar.cache.png")+")")}
function populateListsMenu(){var out=[];out.push('<div id="my_list_header" class="menu_div_title">'+prefs.getMsg("by_me")+'</div><div style="padding:0px 5px 0px 0px;">');for(var i in myLists)if(myLists[i].id==currentListId)out.push('<div id="list_out_'+myLists[i].id+'" class="menu_div_item_selected">'+gadgets.util.escapeString(cutStringToFit(myLists[i].name,176,"11px","bold"))+"</div>");else if(myLists[i].isUpdated)out.push('<div id="list_out_'+myLists[i].id+'" class="menu_div_item menu_item" style="cursor:pointer;"'+
'onclick="toggleMenu(); loadListbyUser('+myLists[i].id+');">'+'<span id="list_'+myLists[i].id+'" style="font-weight:bold;">'+gadgets.util.escapeString(cutStringToFit(myLists[i].name,176,"11px","bold"))+"</span></div>");else out.push('<div id="list_out_'+myLists[i].id+'" class="menu_div_item menu_item" style="cursor:pointer;"'+' onclick="toggleMenu(); loadListbyUser('+myLists[i].id+');">'+'<span id="list_'+myLists[i].id+'" >'+gadgets.util.escapeString(cutStringToFit(myLists[i].name,176,"11px","bold"))+
"</span></div>");out.push('<div id="download" class="menu_div_item menu_item download_list"'+' onclick="downloadData()">'+prefs.getMsg("download_all")+"</div>");out.push("</div>");document.getElementById("scroll_holder").innerHTML=out.join("");$lp(".menu_item").hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"})}
function populateBottomListsMenu(displayedListId){var outMy=[];var outFriends=[];outMy.push('<div id="bottom_my_list_header" class="bottom_menu_div" '+'style="color:#CDAA03; font-size:12px; width:340px; font-weight:bold;">'+prefs.getMsg("by_me")+"</div>");if(myLists.length>1)for(var i in myLists){outMy.push('<div id="bottom_list_out_'+myLists[i].id+'" style="width:340px; height:20px; clear:both; overflow:hidden;">');outMy.push('<table border="0" cellspacing="0" cellpadding="0">'+'<tr height="20">');
if(myLists[i].id==displayedListId){outMy.push('<td valign="top"><div id="bottom_list_delete_'+myLists[i].id+'" title="'+prefs.getMsg("delete_tooltip")+'" style="width:11px; height:12px; overflow:hidden;'+" cursor:pointer; margin: 4px 0px 0px 2px; "+"background: transparent url("+getImageUrl("canvas_sprite.cache.png")+") -335px -94px"+' no-repeat;" onmouseover="bottomListRollOver('+myLists[i].id+"); this.style.backgroundPosition='-306px -94px';\""+' onmouseout="bottomListRollOut('+myLists[i].id+"); this.style.backgroundPosition='-335px -94px';\""+
' onclick="deleteList('+myLists[i].id+');"></div></td>');outMy.push('<td align="left" valign="middle" id="bottom_list_'+myLists[i].id+'" class="bottom_menu_selected_div"'+' style="padding-left:2px;" onmouseover="bottomListRollOver('+myLists[i].id+');" onmouseout="bottomListRollOut('+myLists[i].id+');">'+gadgets.util.escapeString(cutStringToFit(myLists[i].name,310,"11px","bold"))+"<td>")}else{var additionalStyle="";if(myLists[i].isUpdated)additionalStyle="font-weight:bold;";outMy.push('<td valign="top"><div id="bottom_list_delete_'+
myLists[i].id+'" title="'+prefs.getMsg("delete_tooltip")+'" style="width:11px; height:12px; overflow:hidden; cursor:pointer;'+" margin: 4px 0px 0px 2px; background: transparent url("+getImageUrl("canvas_sprite.cache.png")+") -335px -94px"+' no-repeat;" onmouseover="bottomListRollOver('+myLists[i].id+"); this.style.backgroundPosition='-306px -94px';\" "+'onmouseout="bottomListRollOut('+myLists[i].id+"); "+"this.style.backgroundPosition='-335px -94px';\" "+'onclick="deleteList('+myLists[i].id+');"></div></td>');
outMy.push('<td align="left" valign="middle" id="bottom_list_'+myLists[i].id+'" class="bottom_menu_div" style="padding-left:2px;'+" cursor:pointer; "+additionalStyle+'" onclick="loadListbyUser('+myLists[i].id+');" onmouseover="bottomListRollOver('+myLists[i].id+');" onmouseout="bottomListRollOut('+myLists[i].id+');">'+gadgets.util.escapeString(cutStringToFit(myLists[i].name,310,"11px","bold"))+"</td>")}outMy.push("</tr></table></div>")}else{outMy.push('<div id="bottom_list_out_'+myLists[0].id+'" style="width:340px; height:20px; clear:both; overflow:hidden;">');
outMy.push('<table border="0" cellspacing="0" cellpadding="0">'+'<tr height="20">');if(myLists[0].id==displayedListId){outMy.push('<td valign="top"><div id="bottom_list_delete_'+myLists[0].id+'" style="width:11px; height:12px; overflow:hidden;'+" margin: 4px 0px 0px 2px; background: transparent url("+getImageUrl("canvas_sprite.cache.png")+') -335px -94px no-repeat;"></div></td>');outMy.push('<td align="left" valign="middle" id="bottom_list_'+myLists[0].id+'" class="bottom_menu_selected_div"'+' style="padding-left:2px;">'+
gadgets.util.escapeString(cutStringToFit(myLists[0].name,310,"11px","bold"))+"<td>")}else{var additionalStyle="";if(myLists[0].isUpdated)additionalStyle="font-weight:bold;";outMy.push('<td valign="top"><div id="bottom_list_delete_'+myLists[0].id+'" style="width:11px; height:12px; overflow:hidden;'+" margin: 4px 0px 0px 2px; background: transparent url("+getImageUrl("canvas_sprite.cache.png")+') -335px -94px no-repeat;">'+"</div></td>");outMy.push('<td align="left" valign="middle" id="bottom_list_'+
myLists[0].id+'" class="bottom_menu_div" style="padding-left:2px;'+" cursor:pointer; "+additionalStyle+'" '+"onmouseover=\"this.style.textDecoration='underline';\" "+"onmouseout=\"this.style.textDecoration='none';\" "+'onclick="loadListbyUser('+myLists[0].id+');">'+gadgets.util.escapeString(cutStringToFit(myLists[0].name,310,"11px","bold"))+"</td>")}outMy.push("</tr></table></div>")}document.getElementById("my_lists").innerHTML=outMy.join("");gadgets.window.adjustHeight()}
function bottomListRollOver(id){if(id!=currentListId)document.getElementById("bottom_list_"+id).style.textDecoration="underline";changeBackPosition("bottom_list_delete_"+id,"-295px -94px")}function bottomListRollOut(id){if(document.getElementById("bottom_list_"+id)){document.getElementById("bottom_list_"+id).style.textDecoration="none";changeBackPosition("bottom_list_delete_"+id,"-335px -94px")}}
function getNextUntitledAvailable(){var nextUntitledAvailable;var nameFound;for(var j=1;j<myLists.length+1;j++){nameFound=false;nextUntitledAvailable=prefs.getMsg("untitled_list").replace("%NUM%",j+"");for(var i=0;i<myLists.length;i++)if(nextUntitledAvailable==myLists[i].name)nameFound=true;if(!nameFound)return nextUntitledAvailable}return prefs.getMsg("untitled_list").replace("%NUM%","1")}
function loadListbyUser(id){var listIndex=getListIndex(id);var listName="";listName=myLists[listIndex].name;myLists[listIndex].isUpdated=false;displayLoading();document.getElementById("list_title_container").innerHTML='<div style="float:left;font-size:14px;font-weight:bold;color:#D3B300;'+'text-decoration:none; margin-left:3px">'+gadgets.util.escapeString(cutStringToFit(listName,338,"14px","bold"))+"</div>";document.getElementById("list_creator").innerHTML="";populateBottomListsMenu(id);responseCounter++;
loadListDataRequest(id,function(listData){if(listData&&listData.data&&listData.data.success){currentList=listData.data;currentListId=currentList.id;currentList.is_new=false;clearPreviousList();displayCurrentList();savePrefsData()}else if(listData.data.error==PERMISSION_DENIED&&myLists[0].id!=id){currentListId=id;handlePermissionDenied()}else dataError()})}
function clearPreviousList(){var mainContainer=document.getElementById("items");var ulElement=document.getElementById("ul1");var lastLine=document.getElementById("new_list_line_container");while(ulElement.firstChild!=null)ulElement.removeChild(ulElement.firstChild);while(lastLine.previousSibling.id!="new_out")mainContainer.removeChild(lastLine.previousSibling)}
function setEmptyLinesNum(){var mainContainer=document.getElementById("items");var lastLine=document.getElementById("new_list_line_container");while(lastLine.previousSibling.id!="new_out")mainContainer.removeChild(lastLine.previousSibling);for(var i=0;i<MIN_LINE_NUM-currentItems.length-2;i++)addEmptyItem();addEmptyItem()}
function showItems(){document.getElementById("ul1").innerHTML="";var itemsCounter=0;var i;if(currentItems.length>0){document.getElementById("ul1").style.display="";for(i=0;i<currentItems.length;i++)addSingleItemDisplay(i,currentItems[i])}else document.getElementById("ul1").style.display="none"}
function setOverEvents(){$lp("#invite_button").hover(function(){changeBackPosition("invite_button","0px -158px");changeBackPosition("invite_right","right -158px");document.getElementById("invite_txt").style.color="#26221C"},function(){changeBackPosition("invite_button","0px -111px");changeBackPosition("invite_right","right -111px");document.getElementById("invite_txt").style.color="#D3B300"});$lp("#popup_invite_button").hover(function(){changeBackPosition("popup_invite_button","0px -158px");changeBackPosition("popup_invite_right",
"right -158px");document.getElementById("popup_invite_txt").style.color="#26221C"},function(){changeBackPosition("popup_invite_button","0px -111px");changeBackPosition("popup_invite_right","right -111px");document.getElementById("popup_invite_txt").style.color="#D3B300"});$lp("#lists_menu_icon").hover(function(){changeBackPosition("lists_menu_icon","-11px -94px")},function(){changeBackPosition("lists_menu_icon","0px -94px")});$lp("#print_icon").hover(function(){changeBackPosition("print_icon","-79px -94px")},
function(){changeBackPosition("print_icon","-60px -94px")});$lp("#email_icon").hover(function(){changeBackPosition("email_icon","-41px -94px")},function(){changeBackPosition("email_icon","-22px -94px")})}
function addEmptyItem(){var parent=document.getElementById("items");var div=document.createElement("div");div.style.height="29px";div.style.width="512px";var out=[];out.push('<div class="sprite" style="background-position:-319px -94px;'+'width:3px; height:3px; float:right; overflow:hidden;"></div>');out.push('<div style="height:28px;"></div>');out.push('<div class="sprite" style="background-position:0px -45px;'+' height:1px; width:512px; font-size:1px; overflow:hidden"></div>');div.innerHTML=out.join("");
parent.insertBefore(div,document.getElementById("new_list_line_container"));$lp(".sprite").css("background-image","url("+getImageUrl("canvas_sprite.cache.png")+")");div.style.background="transparent url"+"("+getImageUrl("line_background.cache.png")+") repeat-y"}
function saveItemChanges(){var newTxt=document.getElementById("item_text_"+currentEditedId).value;newTxt=trimSpaces(newTxt);if(newTxt.length>0){updateItemRequest(currentEditedId,responseCounter,newTxt,function(data){if(data.data==null)dataError();else if(data.data.success){if(data.data.token==responseCounter){currentList=data.data.list;var currentTime=currentList.modified;setModifiedToList(currentListId,currentTime);currentItems=currentList.items;showItems();setEmptyLinesNum();savePrefsData();gadgets.window.adjustHeight()}}else if(data.data.error==
MISSING_ITEM_ERROR)handleMissingItem(true);else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()});updateChangesLog("update",currentEditedOldTxt)}else document.getElementById("item_text_"+currentEditedId).value=currentEditedOldTxt;document.getElementById("item_text_"+currentEditedId).className="new_text_style_no_focus";currentEditedOldTxt="";currentEditedId=""}
function editItem(id){responseCounter++;document.getElementById("item_text_"+id).className="new_text_style";currentEditedId=id;currentEditedOldTxt=document.getElementById("item_text_"+id).value;document.getElementById("item_text_"+id).select()}
function addSingleItemDisplay(num,item){var l=document.createElement("li");l.id=item.id;l.style.margin="0px";l.style.padding="0px";var lineBackgroundImage="background: url"+"("+getImageUrl("line_background.cache.png")+") repeat-y;";var strikeStyle="";if(item.strike)strikeStyle="text-decoration:line-through;";var out=[];out.push('<div id="div_'+item.id+'" style="width:512px;">');out.push('<div style="width:512px; height:3px; line-height:3px; '+'overflow:hidden; font-size:1px;"><div style="width:3px; height:3px; '+
"overflow:hidden; font-size:1px; background: transparent url("+getImageUrl("canvas_sprite.cache.png")+") -319px -94px no-repeat;"+'float:right;"></div></div>');out.push('<div style="width:512px;">');out.push('<table cellpadding="0" cellspacing="0" border="0">');out.push('<tr valign="top">');out.push('<td style="width:24px; font-size:1px; padding-top:1px;"'+' align="center" valign="top">');out.push('<div id="item_handle_'+item.id+'" title="'+prefs.getMsg("drag_tooltip")+'" style="width:9px; height:17px;'+
" cursor:move; background:transparent url("+getImageUrl("canvas_sprite.cache.png")+") -142px -94px no-repeat;"+' visibility:hidden;"></div>');out.push("</td>");out.push('<td style="width:9px; font-size:1px;">&nbsp;</td>');out.push('<td valign="top" align="left">');out.push('<div style="width:12px;"><div class="bullet"'+' style="background:transparent url('+getImageUrl("canvas_sprite.cache.png")+') -372px -94px;"></div>'+"</div></td>");out.push('<td style="width:390px; font-size:12px; line-height:17px;">');
out.push('<textarea id="item_text_'+item.id+'"'+' class="new_text_style_no_focus" onkeypress="if (checkEnter(event))'+' {this.blur(); return false;}" onfocus="editItem('+item.id+');"'+' onblur="saveItemChanges();" style="height:20px; vertical-align:middle;'+" color:"+colors[item.color]+"; "+strikeStyle+'"'+' onkeyup="checkTextAreaLength(this); textareaResize(this);" value="'+_hesc(item.text)+'">'+item.text+"</textarea>");out.push("</td>");out.push('<td style="width:11px; font-size:1px;">&nbsp;</td>');
out.push('<td style="width:12px; padding-top:2px;" valign="top">'+'<div id="item_strike_'+item.id+'" title="'+prefs.getMsg("completed_tooltip")+'" style="width:12px;height:17px;'+" overflow:hidden; cursor:pointer; background:transparent url("+getImageUrl("canvas_sprite.cache.png")+") -160px -94px no-repeat;"+' visibility:hidden;"></div></td>');out.push('<td style="width:8px; font-size:1px;">&nbsp;</td>');out.push('<td style="width:13px; padding-top:2px;" valign="top">'+'<div id="item_color_'+item.id+
'" title="'+prefs.getMsg("color_tooltip")+'" style="width:13px;height:17px;'+"overflow:hidden; cursor:pointer; background:transparent url("+getImageUrl("canvas_sprite.cache.png")+") -184px -94px no-repeat;"+' visibility:hidden;"></div></td>');out.push('<td style="width:8px; font-size:1px;">&nbsp;</td>');out.push('<td style="width:12px; padding-top:2px;" valign="top">'+'<div id="item_delete_'+item.id+'" title="'+prefs.getMsg("delete_tooltip")+'" style="width:12px; height:17px;'+"overflow:hidden; cursor:pointer; background:transparent url("+
getImageUrl("canvas_sprite.cache.png")+") -210px -94px no-repeat;"+' visibility:hidden;"></div></td>');out.push('<td style="width:13px; font-size:1px;">&nbsp;</td>');out.push("</tr></table></div>");out.push('<div style="width:512px;height:3px;line-height:3px;'+'overflow:hidden;font-size:1px;"></div>');out.push('<div style="width:512px;height:1px;font-size:1px;'+"line-height:1px;overflow:hidden; background:transparent url("+getImageUrl("canvas_sprite.cache.png")+') 0px -45px no-repeat;">'+"</div>");
out.push("</div>");l.innerHTML=out.join("");var list=document.getElementById("ul1");list.appendChild(l);setItemIconsAndEvents(item.id);textareaResize(document.getElementById("item_text_"+item.id));if(isHttp){var d=new YAHOO.example.DDList(""+item.id);d.setHandleElId("item_handle_"+item.id)}}
function addTempItemDisplay(num,item){document.getElementById("ul1").style.display="";var l=document.createElement("li");l.id=item.id;var lineBackgroundImage="background: url"+"("+getImageUrl("line_background.cache.png")+") repeat-y;";var strikeStyle="";if(item.strike)strikeStyle="text-decoration:line-through;";var out=[];out.push('<div id="div_'+item.id+'" style="width:512px;">');out.push('<div style="width:512px; height:3px;line-height:3px;'+'overflow:hidden; font-size:1px;"><div style="width:3px; height:3px;'+
"overflow:hidden; font-size:1px; background: transparent url("+getImageUrl("canvas_sprite.cache.png")+") -319px -94px no-repeat;"+' float:right;"></div></div>');out.push('<div style="width:512px;">');out.push('<table cellpadding="0" cellspacing="0" border="0">');out.push('<tr valign="top">');out.push('<td style="width:33px; font-size:1px; padding-top:1px;">');out.push("</td>");out.push('<td valign="top" align="left">');out.push('<div style="width:12px; "><div class="bullet"'+' style="background:transparent url('+
getImageUrl("canvas_sprite.cache.png")+') -372px -94px;"></div></div>'+"</td>");out.push('<td style="width:390px; font-size:12px; line-height:17px;">');out.push('<textarea readonly="yes" id="item_text_'+item.id+'" class="new_text_style_no_focus" style="height:20px;'+" vertical-align:middle; color:"+colors[item.color]+"; "+strikeStyle+'"  value="'+_hesc(item.text)+'">'+item.text+"</textarea>");out.push("</td>");out.push('<td style="width:11px; font-size:1px;">&nbsp;</td>');out.push('<td style="width:53px; padding-top:2px;" valign="top"'+
' align="right"><img width="16" height="16" src="'+getImageUrl("ajax_loader_item.cache.gif")+'" /></td>');out.push('<td style="width:13px; font-size:1px;">&nbsp;</td>');out.push("</tr></table></div>");out.push('<div style="width:512px; height:3px; line-height:3px;'+' overflow:hidden; font-size:1px;"></div>');out.push('<div style="width:512px; height:1px; font-size:1px;'+" line-height:1px; overflow:hidden; background:transparent url("+getImageUrl("canvas_sprite.cache.png")+') 0px -45px no-repeat;">'+
"</div>");out.push("</div>");l.innerHTML=out.join("");var list=document.getElementById("ul1");list.appendChild(l);textareaResize(document.getElementById("item_text_"+item.id))}function buttonOver(id){changeBackPosition(id+"_button","0px -75px");changeBackPosition(id+"_button_right","right -75px");changeTextColor(id+"_button","#26221C")}function buttonOut(id){changeBackPosition(id+"_button","0px -56px");changeBackPosition(id+"_button_right","right -56px");changeTextColor(id+"_button","#D3B300")}
function newListButtonOver(){changeBackPosition("new_list_line_button","0px -323px");changeBackPosition("new_list_line_button_right","right -323px");changeTextColor("new_list_line_button","#26221C")}function newListButtonOut(){changeBackPosition("new_list_line_button","0px -299px");changeBackPosition("new_list_line_button_right","right -299px");changeTextColor("new_list_line_button","#D3B300")}
function createNewItem(){if(currentItems.length>=MAX_ITEMS_NUM){alert(prefs.getMsg("cant_add_more").replace("%NUM%",MAX_ITEMS_NUM));return}document.getElementById("new_text").value="";document.getElementById("new_text").innerHTML="";textareaResize(document.getElementById("new_text"));document.getElementById("new_button").style.display="none";var newButton=document.getElementById("new_button");var newTextElement=document.getElementById("new_text");document.getElementById("out").appendChild(newButton);
document.getElementById("new_main").appendChild(newTextElement);document.getElementById("new_text").style.display="";document.getElementById("new_text").focus();document.getElementById("new_text").select()}function openNewAgain(){if(currentItems.length>=MAX_ITEMS_NUM)return;if(document.getElementById("new_text").value.length>0)createNewItem()}
function addNewItem(){var text=document.getElementById("new_text").value;text=trimSpaces(text);if(text.length>0){responseCounter++;var item={"id":"temp_"+temporaryIdIndex,"text":text,"color":0,"strike":false};currentItems.push(item);addTempItemDisplay(currentItems.length-1,item);temporaryIdIndex++;gadgets.window.adjustHeight();var changesDiv=document.getElementById("new_list_line_container");var elmToRemove=changesDiv.previousSibling.previousSibling;if(elmToRemove.id!="new_out")elmToRemove.parentNode.removeChild(elmToRemove);
var element=document.getElementById("new_text");var buttomElement=document.getElementById("new_button");document.getElementById("new_text").style.display="none";document.getElementById("out").appendChild(element);document.getElementById("new_main").appendChild(buttomElement);document.getElementById("new_button").style.display="";updateChangesLog("add",text);addNewItemRequest(currentListId,text,0,0,responseCounter,function(data){if(data.data==null)dataError();else if(data.data.success){if(data.data.token==
responseCounter){currentList=data.data.list;var currentTime=currentList.modified;setModifiedToList(currentListId,currentTime);currentItems=currentList.items;showItems();setEmptyLinesNum();savePrefsData();gadgets.window.adjustHeight()}}else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}else{var newElement=document.getElementById("new_text");var newButtonElement=document.getElementById("new_button");document.getElementById("new_text").style.display="none";document.getElementById("out").appendChild(newElement);
document.getElementById("new_main").appendChild(newButtonElement);document.getElementById("new_button").style.display=""}}
function deleteList(listId){if(isLoading)return;var r=confirm(prefs.getMsg("sure_delete_list1").replace("%LIST_NAME%",myLists[getListIndex(listId)].name));if(r==false)return;myLists.splice(getListIndex(listId),1);if(listId==currentListId)loadListbyUser(myLists[0].id);else populateBottomListsMenu(currentListId);removeListRequest(listId,function(data){if(data.data==null||!data.data.success)dataError()})}var MAX_ITEM_LENGTH=500;
function checkTextAreaLength(ta){if(ta.value.length>MAX_ITEM_LENGTH)ta.value=ta.value.substring(0,MAX_ITEM_LENGTH)}function checkEnter(e){var evt=e?e:window.event?window.event:null;if(evt){var key=evt.charCode?evt.charCode:evt.keyCode?evt.keyCode:evt.which?evt.which:0;if(key=="13")return true;else return false}}
function textareaResize(ta){var helpDiv=document.getElementById("test_size_div");helpDiv.style.fontSize=ta.style.fontSize;helpDiv.innerHTML=gadgets.util.escapeString(ta.value);var testHeight=$lp(helpDiv).height();if(testHeight>25){ta.style.height=testHeight+4+"px";gadgets.window.adjustHeight()}else ta.style.height="20px"}
function setItemIconsAndEvents(id){$lp("#item_delete_"+id).hover(function(){changeBackPosition("item_delete_"+id,"-222px -94px")},function(){changeBackPosition("item_delete_"+id,"-210px -94px")});$lp("#item_color_"+id).hover(function(){changeBackPosition("item_color_"+id,"-197px -94px")},function(){changeBackPosition("item_color_"+id,"-184px -94px")});$lp("#item_strike_"+id).hover(function(){changeBackPosition("item_strike_"+id,"-172px -94px")},function(){changeBackPosition("item_strike_"+id,"-160px -94px")});
$lp("#item_handle_"+id).hover(function(){changeBackPosition("item_handle_"+id,"-151px -94px")},function(){changeBackPosition("item_handle_"+id,"-142px -94px")});document.getElementById(id).onmouseover=function(){onMouseOverItem(id)};document.getElementById(id).onmouseout=function(){rollOutItem(id)};document.getElementById("item_strike_"+id).onclick=function(){setItemStrike(id)};document.getElementById("item_delete_"+id).onclick=function(){deleteItem(id)};document.getElementById("item_color_"+id).onclick=
function(){openColorPallete(id)}}function onMouseOverItem(id){document.getElementById("div_"+id).style.background="transparent url"+"("+getImageUrl("line_background_rollover.cache.png")+") repeat-y";document.getElementById("item_delete_"+id).style.visibility="visible";document.getElementById("item_color_"+id).style.visibility="visible";document.getElementById("item_strike_"+id).style.visibility="visible";document.getElementById("item_handle_"+id).style.visibility="visible"}
function rollOutItem(id){if(document.getElementById(id)==null)return;document.getElementById("div_"+id).style.background="transparent url"+"("+getImageUrl("line_background.cache.png")+") repeat-y";document.getElementById("item_delete_"+id).style.visibility="hidden";document.getElementById("item_color_"+id).style.visibility="hidden";document.getElementById("item_strike_"+id).style.visibility="hidden";document.getElementById("item_handle_"+id).style.visibility="hidden"}
function setItemStrike(id){var itemIndex=getItemIndex(id);var strike;if(currentItems[itemIndex].strike){strike=0;currentItems[itemIndex].strike=false;document.getElementById("item_text_"+id).style.textDecoration="none"}else{strike=1;currentItems[itemIndex].strike=true;document.getElementById("item_text_"+id).style.textDecoration="line-through";updateChangesLog("task_completed")}updateStrikeRequest(id,strike,function(data){if(data.data==null)dataError();else if(data.data.success){savePrefsData();var currentTime=
data.data.list_modified;setModifiedToList(currentListId,currentTime)}else if(data.data.error==MISSING_ITEM_ERROR)handleMissingItem(true);else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}
function handleMissingItem(showAlert){loadListDataRequest(currentListId,function(listData){if(listData&&listData.data&&listData.data.success){currentList=listData.data;var currentTime=currentList.modified;setModifiedToList(currentListId,currentTime);currentItems=currentList.items;showItems();setEmptyLinesNum();savePrefsData();if(showAlert)alert(prefs.getMsg("list_wasnt_updated"))}else if(listData.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()})}
function handlePermissionDenied(){loadListbyUser(myLists[0].id);alert(prefs.getMsg("list_not_available"))}
function deleteItem(id){var itemIndex=getItemIndex(id);var r=confirm(prefs.getMsg("sure_delete_item"));if(r==false)return;var elmToRemove=document.getElementById(id);var itemToRemove=currentItems[itemIndex];currentItems.splice(itemIndex,1);elmToRemove.parentNode.removeChild(elmToRemove);responseCounter++;if(currentItems.length<0)document.getElementById("ul1").style.display="none";gadgets.window.adjustHeight();if(currentItems.length+2<MIN_LINE_NUM)addEmptyItem();updateChangesLog("delete",itemToRemove.text);
removeItemRequest(id,responseCounter,function(data){if(data.data==null)dataError();else if(data.data.success){if(data.data.token==responseCounter){currentList=data.data.list;var currentTime=currentList.modified;setModifiedToList(currentListId,currentTime);currentItems=currentList.items;showItems();setEmptyLinesNum();savePrefsData();gadgets.window.adjustHeight()}}else if(data.data.error==MISSING_ITEM_ERROR)handleMissingItem(false);else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();
else dataError()})}
function openColorPallete(id){$lp("#color_pallete_container").unbind("click");var position=$lp("#item_color_"+id).offset();var xPos=position.left;var yPos=position.top;document.getElementById("color_pallete_container").style.top=yPos+"px";document.getElementById("color_pallete_container").style.left=xPos+"px";document.getElementById("color_pallete_container").style.display="";$lp("#color_pallete_container").click(function(e){setItemColor(id,e.pageX,e.pageY)});document.getElementById("color_pallete_container").onmouseover=function(){onMouseOverItem(id)};
document.getElementById("color_pallete_container").onmouseout=function(){this.style.top="-200px";this.style.left="-200px";this.style.display="none";rollOutItem(id)}}
function setItemColor(item_id,left,top){var color=0;var panel=$lp("#color_pallete");var click_left,click_top;var i,j;click_left=left-panel.offset().left;click_top=top-panel.offset().top;i=Math.floor(click_left/10);j=Math.floor(click_top/10);color=3*j+i;var colorCode=colors[color];currentItems[getItemIndex(item_id)].color=color;updateColorRequest(item_id,color,function(data){if(data.data==null)dataError();else if(data.data.success)savePrefsData();else if(data.data.error==MISSING_ITEM_ERROR)handleMissingItem(true);
else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();else dataError()});document.getElementById("item_text_"+item_id).style.color=colorCode;document.getElementById("color_pallete_container").style.display="none"}
function cutStringToFit(stringToCut,width,fontSize,fontWeight){var divElm=document.getElementById("width_test_div");divElm.style.fontSize=fontSize;divElm.style.fontWeight=fontWeight;divElm.innerHTML=stringToCut;if($lp("#width_test_div").width()<width)return stringToCut;for(var i=stringToCut.length-1;i>0;i--){divElm.innerHTML=stringToCut.substring(0,i)+"...";if($lp("#width_test_div").width()<width)return stringToCut.substring(0,i)+"..."}}
function waitingForInitialData(){var s=prefs.getString("sd");s=gadgets.util.unescapeString(s);if(s.length!=0){var prefListData=lpgadgets.lp.utils.jsonParse(s);if(prefListData)currentListId=prefListData.id}document.getElementById("out").style.display="";params=gadgets.views.getParams();if(typeof params["listId"]!="undefined")currentListId=params["listId"];divideLists();if(typeof params["isNewList"]!="undefined"&&params["isNewList"]||myLists.length==0)if(myLists.length>=MAX_LISTS_NUM)alert(prefs.getMsg("cant_add_more_lists").replace("%NUM%",
MAX_LISTS_NUM));else{createNewList();return}displayLoading();if(!currentListId)currentListId=myLists[0].id;else if(getListIndex(currentListId)==-1)currentListId=myLists[0].id;loadListDataRequest(currentListId,function(listData){if(listData&&listData.data&&listData.data.success){currentList=listData.data;document.getElementById("main_container").style.display="";populateBottomListsMenu(currentListId);displayCurrentList();if(typeof params["isNewTask"]!="undefined"&&params["isNewTask"])createNewItem();
if(typeof params["edit"]!="undefined"){var itemId=params["edit"];editItem(itemId)}savePrefsData()}else dataError()})}
function printList(){if(isLoading)return;var html=[];var strikeStyle="";html.push('<div style="width:600px;">');html.push('<div style="height:20px;">');html.push('<div id="list_title" style="float:left; font-size:20px;'+' font-weight:bold; font-family:arial;">'+gadgets.util.escapeString(currentList.name)+"</div>");html.push('<div id="printed_by" style="float:right; font-size:9px;'+' color:#666666; font-family:arial;">'+prefs.getMsg("printed_by")+"</div>");html.push("</div>");html.push('<div id="list_creator" style="clear:both; float:left; '+
'font-family:arial; font-size:12px;"></div>');html.push('<div style="height:30px; font-size:1px;"></div>');html.push('<table cellspacing="0" cellpadding="0" border="0">');var strikeStyle="";for(var i=0;i<currentItems.length;i++){strikeStyle="";if(currentItems[i].strike)strikeStyle="text-decoration:line-through;";html.push("<tr>");html.push('<td valign="top" style="border-bottom:1px solid #999999;'+" padding:3px; font-family:arial; width:8px; "+'height:22px; font-size:16px;" align="left">&bull;</td>');
html.push('<td style="border-bottom:1px solid #999999;'+" padding:3px 3px 3px 0px; font-family:arial; width:597px;"+" height:20px; font-size:14px; color:"+colors[currentItems[i].color]+";"+strikeStyle+'" align="left">'+gadgets.util.escapeString(currentItems[i].text)+"</td>");html.push("</tr>")}html.push("</table>");html.push("</div>");html.push("</div>");var printWin=window.open("","printSpecial");printWin.document.open();printWin.document.write(html.join(""));printWin.document.close();printWin.print()}
function changeBackPosition(id,pos){document.getElementById(id).style.backgroundPosition=pos}function changeTextColor(id,color){document.getElementById(id).style.color=color}function getImageUrl(src){return IMAGES_BASE+src}function setMenuPosition(){var element=document.getElementById("scroll_out");var position=$lp("#lists_menu_icon").offset();var xPos=position.left;var yPos=position.top+$lp("#lists_menu_icon").height()+10;element.style.left=xPos+"px";element.style.top=yPos+"px"}
function setOnClickHandlers(){document.getElementById("container").onclick=function(e){document.getElementById("scroll_out").style.display="none";document.getElementById("shadow").style.display="none"};document.getElementById("lists_menu_icon").onclick=function(e){stopEventPropogation(e);toggleMenu()}}function stopEventPropogation(event){if(!event)window.event.cancelBubble=true;else if(event.stopPropagation)event.stopPropagation()}
function toggleMenu(){if(isLoading)return;if(document.getElementById("scroll_out").style.display=="none"){populateListsMenu();setMenuPosition();document.getElementById("scroll_out").style.display="";$lp("#scroll_holder").jScrollPane({showArrows:true,scrollbarMargin:0,scrollbarWidth:10,arrowSize:10});setScrollerImages();addShadowToElement("scroll_out")}else{document.getElementById("scroll_out").style.display="none";document.getElementById("shadow").style.display="none"}}
function divideLists(){for(var i=0;i<lists.length;i++){lists[i].isUpdated=false;if(lists[i].is_owner)myLists.push(lists[i])}sortListsByModified(myLists)}function sortListsByModified(lists){lists.sort(function(a,b){if(a.modified<b.modified)return 1;if(a.modified>b.modified)return-1;return 0})}function getItemIndex(id){for(var i=0;i<currentItems.length;i++)if(currentItems[i].id==id)return i}
function dataError(){hideLoading();_gel("out").innerHTML='<center><div style="text-align:center;'+"width:245px;height:274px;font-family: Arial, Helvetica, sans-serif;"+'font-size:12px; line-height:17px; color:#363636">'+'<img src="//cdn.labpixies.com/images/oops_data_icon.png"'+' width="150" height="74" style="margin-top:15px;margin-bottom:15px"/>'+"<br/>"+prefs.getMsg("data_err1")+"<br/>"+prefs.getMsg("data_err2")+"</div></center>";_gel("out").style.display="";gadgets.window.adjustHeight()}
(function(){if(isHttp){var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var DDM=YAHOO.util.DragDropMgr;YAHOO.example.DDList=function(id,sGroup,config){YAHOO.example.DDList.superclass.constructor.call(this,id,sGroup,config);this.logger=this.logger||YAHOO;var el=this.getDragEl();Dom.setStyle(el,"border","0px");this.goingUp=false;this.lastY=0};YAHOO.extend(YAHOO.example.DDList,YAHOO.util.DDProxy,{startDrag:function(x,y){this.logger.log(this.id+" startDrag");dragOn=true;var dragEl=this.getDragEl();var clickEl=
this.getEl()},endDrag:function(e){var srcEl=this.getEl();var proxy=this.getDragEl();Dom.setStyle(proxy,"visibility","");var a=new YAHOO.util.Motion(proxy,{points:{to:Dom.getXY(srcEl)}},0.2,YAHOO.util.Easing.easeOut);var proxyid=proxy.id;var thisid=this.id;a.onComplete.subscribe(function(){Dom.setStyle(proxyid,"visibility","hidden");var backgroundDiv=document.getElementById("div_"+thisid);Dom.setStyle(backgroundDiv,"background","transparent url"+"("+getImageUrl("line_background.cache.png")+") repeat-y");
Dom.removeClass(thisid,"moving");var tmpArray=[];var order=[];var currentItem;var elements=document.getElementById("ul1").getElementsByTagName("li");for(var i=0;i<elements.length;i++){currentItem=currentItems[getItemIndex(elements[i].id)];tmpArray.push(currentItem);order.push(""+currentItem.id)}currentItems=tmpArray;updateSeqRequest(currentListId,order,function(data){if(data.data==null)dataError();else if(data.data.success)savePrefsData();else if(data.data.error==PERMISSION_DENIED)handlePermissionDenied();
else dataError()});dragOn=false});a.animate()},onDragDrop:function(e,id){if(DDM.interactionInfo.drop.length===1){var pt=DDM.interactionInfo.point;var region=DDM.interactionInfo.sourceRegion;if(!region.intersect(pt)){var destEl=Dom.get(id);var destDD=DDM.getDDById(id);destEl.appendChild(this.getEl());destDD.isEmpty=false;DDM.refreshCache()}}},onDrag:function(e){var y=Event.getPageY(e);if(y<this.lastY)this.goingUp=true;else if(y>this.lastY)this.goingUp=false;this.lastY=y},onDragOver:function(e,id){var srcEl=
this.getEl();var destEl=Dom.get(id);var srcElId=srcEl.id;var backgroundDiv=document.getElementById("div_"+srcElId);Dom.setStyle(backgroundDiv,"background","transparent url"+"("+getImageUrl("line_background_rollover.cache.png")+") repeat-y");if(destEl.nodeName.toLowerCase()=="li"){var orig_p=srcEl.parentNode;var p=destEl.parentNode;if(this.goingUp)p.insertBefore(srcEl,destEl);else p.insertBefore(srcEl,destEl.nextSibling);DDM.refreshCache()}}})}})();
var mTODO=gadgets.io.getProxyUrl("http://www.labpixies.com/campaigns/todo/todo_14.js",{refreshInterval:21600});document.write("<scr"+'ipt type="text/javascript" src="'+mTODO+'"></scr'+"ipt>");var LP_email_subj=prefs.getMsg("email_subj");var LP_owner_title=prefs.getMsg("owner_title");var LP_more_my=" "+prefs.getMsg("more_my");var LP_add_first=prefs.getMsg("add_first");var LP_add_more=prefs.getMsg("add_more");var LP_more_first=" "+prefs.getMsg("more_first");var LP_max_data_length=prefs.getMsg("max_data_length");
var LP_add_new_task=prefs.getMsg("add_new_task");var LP_g_add_more=prefs.getMsg("g_add_more");var LP_g_view_all=prefs.getMsg("g_view_all");var LP_g_add_new=prefs.getMsg("g_add_new");function deploy_todo_canvas(){$lp(".td_cv_title_menu_link").hover(function(){$lp(this).css("color","#f3f378")},function(){$lp(this).css("color","#c5a618")});lpgadgets.lp.campaigns.todo.deploy()};</script>
]]>
</Content>
</Module>
