var ILP={Message:{},Util:{},EIP:{settings:{defaultTitleText:"<span class=\"empty\">click here to add a title</span>",defaultDescText:"<p>Click here to add a description&hellip;</p>"}},Events:{QUEUE:[],settings:{delay:3000}},PuppetMini:{},Debug:{enabled:false,initialized:false},Misc:{},Settings:{messageTimeout:false,messageFadeout:false},Tagging:{},Uploader:{},GLOBAL:{}};
ILP.Message.clearAll=function(_1){
if(_1){
$(".ilpMessage").remove();
}else{
$(".ilpMessage:not(.keepalive)").remove();
}
};
ILP.Message.create=function(_2,_3,_4){
ILP.Message.clearAll();
if(!_3){
_3="The internet is a funny place.";
}
var _5=(_4)?" keepalive":"";
if(_2.split("_")[0]!="puppet"){
$(".ilpMessages").append("<div class=\"ilpMessage "+_2+_5+"\">"+"<a class=\"closeMessage\" href=\"#\">[X]</a>"+"<div class=\"nw\"><div class=\"ne\"><div class=\"sw\">"+"<div class=\"se\"><div class=\"ilpMessageContent\"><p>"+_3+"</p></div></div></div></div></div></div>");
}else{
_2=_2.split("_")[1];
$("#puppet .dialogWrapper").append("<div class=\"dialogBox "+_2+"\"><div class=\"inner\">"+"<p>"+_3+"</p></div></div>");
}
ILP.Message.bind();
};
ILP.Message.bind=function(){
$(".ilpMessages a.closeMessage").bind("click",function(_6){
$(this).parent().remove();
return false;
});
};
ILP.Util.validEmail=function(_7){
var _8=/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i;
if(_8.test(_7)){
return true;
}else{
return false;
}
};
ILP.Util.getID=function(_9,_a){
return $(_9).attr(_a).split("-")[1];
};
ILP.Util.getDimensions=function(_b){
return {top:$(_b).offset().top,left:$(_b).offset().left,height:$(_b).height(),width:$(_b).width(),center:{x:this.left+this.width/2,y:this.top+this.height/2}};
};
ILP.Util.getRelativeOffset=function(_c,_d){
var _e=_c.offset();
var _f=_d.offset();
return {top:(_e.top-_f.top),left:(_e.left-_f.left)};
};
ILP.Util.formatBytes=function(_10){
var _11=[[1024*1024*1024,"gb"],[1024*1024,"mb"],[1024,"kb"],[1,"b"]];
for(var i=0;i<_11.length;i++){
var _13=_11[i][0];
var _14=_11[i][1];
if(_10>=_13){
_10=_10/_13;
_10=Math.ceil(_10*10)/10;
return _10+_14;
}
}
};
ILP.Util.preload=function(){
for(var i=0;i<arguments.length;i++){
$("<img>").attr("src",arguments[i]);
}
};
ILP.Util.intComma=function(i){
i=parseInt(i,10);
if(isNaN(i)){
throw "i is not a number";
}else{
i=i.toString().split("").reverse();
result="";
for(iterCounter=0;iterCounter<=i.length;iterCounter++){
if(((iterCounter%3)===0)&iterCounter!=i.length&iterCounter!==0){
result=","+i[iterCounter-1]+result;
}else{
if(iterCounter!==0){
result=i[iterCounter-1]+result;
}
}
}
return result;
}
};
ILP.Util.friendlyInt=function(i){
i=parseInt(i,10);
if(isNaN(i)){
throw "i is not a number";
}else{
if(i<=13){
return i.apnumber();
}else{
return ILP.Util.intComma(i);
}
}
};
String.prototype.shorten=function(n,i){
var _1a=i||"…";
return (this.length>n)?String(this.substr(0,n)+_1a):this;
};
String.prototype.interpolateSequence=function(){
var _1b=arguments;
var _1c=this.split(/(%s)/g);
var _1d=0;
_1c=$.map(_1c,function(_1e,_1f){
if(_1e.match(/%s/g)!==null){
_1e=(_1d+1)<=_1b.length?_1b[_1d].toString():_1e;
_1d++;
}
return _1e;
});
return _1c.join("");
};
String.prototype.interpolateMapping=function(_20){
var _21=/(%\([\-\w]+?\)s)/g;
var _22=this.split(_21);
_22=$.map(_22,function(_23,_24){
var _25=(/%\(([\-\w]+?)\)s/g).exec(_23);
if(_25!==null){
_23=_20[_25[1]];
}
return _23;
});
return _22.join("");
};
String.prototype.interpolate=function(){
if(arguments.length==1&&(typeof arguments[0])=="object"){
return this.interpolateMapping(arguments[0]);
}else{
return this.interpolateSequence.apply(this,arguments);
}
};
Number.prototype.apnumber=function(){
var _26=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen"];
return (13>=this)?_26[this]:this;
};
Number.prototype.pluralize=function(_27,_28){
var a="",b="s";
if(_27&&_28){
a=_27;
b=_28;
}
return (this==1)?a:b;
};
ILP.EIP.init=function(_2b){
if(_2b){
ILP.EIP.settings.gridView=false;
$(".eip-editable").each(function(i){
ILP.EIP.makeEditable(this,_2b);
});
}else{
ILP.EIP.settings.gridView=true;
$(".eip-editable").each(function(i){
ILP.EIP.makeEditable(this);
});
}
};
ILP.EIP.makeEditable=function(_2e,_2f){
$(_2e).bind("click",function(_30){
var _31={};
_31.target=$(this);
_31.backup_text=$(this).html();
_31.field=null;
_31.isTitle=false;
_31.isDesc=false;
if($(this).hasClass("title")){
_31.field="title";
_31.isTitle=true;
}else{
if($(this).hasClass("description")){
_31.field="description";
_31.isDesc=true;
}else{
_31.field=$(this).attr("class")[1];
}
}
if(_2f){
_31.media_type=_2f.media_type;
_31.media_id=_2f.media_id;
_31.current_text=(_31.isDesc)?_2f.media_description:_2f.media_title;
_31.pageinfo=_2f;
}else{
_31.media_type=$(this).parent().attr("id").split("-")[0];
_31.media_id=$(this).parent().attr("id").split("-")[1];
_31.current_text=$(this).parent().data("photo_title");
}
ILP.Debug.fire(_31.current_text);
var _32={};
if(_31.isDesc){
_32.input="<div class=\"eip-desc-wrapper clearfix\"><textarea class=\"eip-input\">"+_31.current_text+"</textarea>";
_32.buttons="<ul class=\"buttonBar clean\"><li><a href=\"#\" id=\"save-eip-"+_31.media_id+"\" class=\"smallButton target saveButton\"><span>Save</span></a></li><li><a href=\"#\" id=\"cancel-eip-"+_31.media_id+"\" class=\"smallButton cancelButton\"><span>Cancel</span></a></li></div>";
$(this).after(_32.input+_32.buttons).hide();
}else{
if(_31.isTitle){
_32.input="<input class=\"eip-input\" id=\"eip-input-"+_31.media_id+"\" type=\"text\" value=\""+_31.current_text+"\" />";
_32.buttons="<a href=\"#\" id=\"save-eip-"+_31.media_id+"\" class=\"smallButton target saveButton\"><span>Save</span></a><a href=\"#\" id=\"cancel-eip-"+_31.media_id+"\" class=\"smallButton cancelButton\"><span>Cancel</span></a>";
if(ILP.EIP.settings.gridView){
ILP.PuppetMini.create(_31.media_id,_32.input+_32.buttons,$(this).parent().parent(),false,{left:-4,top:-10});
}else{
ILP.PuppetMini.create(_31.media_id,_32.input+_32.buttons,$(this).parent().parent(),false,{left:-10,top:15});
}
}
}
$("#eip-input-"+_31.media_id).focus().select().keydown(function(e){
if(e.keyCode==13&&!_31.isDesc){
ILP.EIP.save(this,_31);
}
if(e.keyCode==27){
ILP.EIP.cancel(this,_31);
}
});
$("#save-eip-"+_31.media_id).click(function(){
ILP.EIP.save(this,_31);
return false;
});
$("#cancel-eip-"+_31.media_id).click(function(){
ILP.EIP.cancel(_31);
return false;
});
}).bind("mouseover",function(_34){
$(this).addClass("eip-highlight");
$(this).siblings(".eip-notice").show();
if($(this).hasClass("empty")){
$(this).children("span.empty").css("visibility","visible");
}
}).bind("mouseout",function(_35){
$(this).removeClass("eip-highlight");
$(this).siblings(".eip-notice").hide();
if($(this).hasClass("empty")){
$(this).children("span.empty").css("visibility","hidden");
}
});
};
ILP.EIP.save=function(_36,_37){
_37.new_text=$(".eip-input").val();
$.ajax({url:"/ajax/edit/",type:"POST",data:{"type":_37.media_type,"id":_37.media_id,"field":_37.field,"text":_37.new_text},dataType:"json",beforeSend:function(){
if(_37.isTitle){
$(_37.target).html("Saving…").show();
}else{
$(_37.target).html("<p>Saving…</p>").show();
}
ILP.PuppetMini.hide(_37.media_id);
},success:function(r){
if(r.response=="success"){
if(r.field_value===""){
if(_37.isTitle){
$(_37.target).html(ILP.EIP.settings.defaultTitleText);
}else{
if(_37.isDesc){
$(_37.target).html(ILP.EIP.settings.defaultDescText);
}
}
$(_37.target).addClass("empty").children("span.empty").css("visibility","hidden");
}else{
$(_37.target).html(r.field_value);
if($(_37.target).hasClass("empty")){
$(_37.target).removeClass("empty");
}
}
if(_37.isTitle){
ILP.PuppetMini.destroy(_37.media_id);
if(ILP.EIP.settings.gridView){
$(_37.target).parent().data("photo_title",r.field_value);
}else{
ILP.GLOBAL.pageinfo.media_title=r.field_value;
ILP.EIP.updateTitle(r.field_value);
}
}else{
if(_37.isDesc){
$(".eip-desc-wrapper").remove();
ILP.GLOBAL.pageinfo.media_description=_37.new_text;
}
}
}else{
ILP.Message.create("error","An error occured saving your title. Please try again in a moment.");
ILP.PuppetMini.show(_37.media_id);
$("#eip-input-"+_37.media_id).select();
}
},error:function(e){
ILP.Message.create("error","An error occured saving your title. Please try again in a moment.");
ILP.PuppetMini.show(_37.media_id);
$("#eip-input-"+_37.media_id).select();
}});
};
ILP.EIP.cancel=function(_3a){
ILP.Message.clearAll();
if(_3a.isTitle){
$(_3a.target).html(_3a.backup_text);
ILP.PuppetMini.destroy(_3a.media_id);
}else{
if(_3a.isDesc){
$(_3a.target).show();
$(".eip-desc-wrapper").remove();
}
}
};
ILP.EIP.updateTitle=function(_3b){
document.title="iLovePhotos » Photos » "+_3b;
};
ILP.Events.init=function(){
$(".dialogBox a.eventUndo").bind("click",function(_3c){
ILP.Events.destroy();
return false;
});
};
ILP.Events.create=function(_do,_3e,_3f,msg){
msg=msg+" &bull; <a href=\"#\" class=\"eventUndo\">Undo</a>";
ILP.Message.create("notice",msg);
ILP.Events.init();
ILP.Events.QUEUE.push([_do,_3e,_3f]);
};
ILP.Events.destroy=function(){
var _41=ILP.Events.QUEUE.pop();
var _42,_43;
_42=_41[1];
_43=_41[2];
ILP.Message.create("clear");
_42(_43);
};
ILP.Events.unloadQueue=function(){
for(var i=0;i<ILP.Events.QUEUE.length;i++){
ILP.Events.QUEUE[i][0](ILP.Events.QUEUE[i][2]);
}
};
ILP.Puppetmaster=function(_45){
$(_45).click(function(){
var _46=$(_45).attr("class").split(" ")[1];
var _47="/puppet/";
var _48={"yourAccount":"account/","invite":"invite/","rotatePhoto":_45.attr("href")};
if(_48[_46]){
ILP.Puppet(_47+_48[_46]);
}else{
ILP.Debug.fire("The class-to-url mapping for this puppet has not been created yet!");
}
return false;
});
};
ILP.PuppetMini.create=function(_49,_4a,_4b,_4c,_4d){
var _4e="<div class=\"puppetMini\" id=\"puppetMini-"+_49+"\" style=\"display: none;\">"+"<table><tbody><tr><td class=\"tl\"/><td class=\"b\"/><td class=\"tr\"/></tr>"+"<tr><td class=\"b\"/><td class=\"body\"><div class=\"inner\">"+_4a+"</div></td><td class=\"b\"/></tr><tr><td class=\"bl\"/><td class=\"b\"/>"+"<td class=\"br\"/></tr></tbody></table></div>";
$("body").prepend(_4e);
var _4f=ILP.Util.getDimensions(_4b);
var _50=ILP.Util.getDimensions("#puppetMini-"+_49);
if(_4d){
_4f.top=(_4d.top)?_4f.top+_4d.top:_4f.top;
_4f.left=(_4d.left)?_4f.left+_4d.left:_4f.left;
}
if(_4c){
$("#puppetMini-"+_49).css({top:_4f.top-(_50.height/2)+_4f.height/2,left:_4f.left-(_50.width/2)+_4f.width/2}).show();
}else{
$("#puppetMini-"+_49).css({top:(_4d&&_4d.top)?_4f.top+_4d.top:_4f.top,left:(_4d&&_4d.left)?_4f.left+_4d.left:_4f.left}).show();
}
};
ILP.PuppetMini.hide=function(_51){
$("#puppetMini-"+_51).hide();
};
ILP.PuppetMini.show=function(_52){
$("#puppetMini-"+_52).show();
};
ILP.PuppetMini.destroy=function(_53){
if(_53){
$("#puppetMini-"+_53).remove();
}else{
$(".puppetMini").remove();
}
};
ILP.Puppet=function(url){
ILP.Puppet.init();
loadingTimer=setInterval(ILP.Puppet.loading,100);
$.get(url,function(_55){
ILP.Puppet.reveal(_55);
});
};
ILP.Puppet.settings={puppetSkeleton:"<table id=\"puppet\" style=\"display:none;\"><tbody><tr><td class=\"tl\"/><td class=\"b\"/>"+"<td class=\"tr\"/></tr><tr><td class=\"b\"/><td class=\"body\"><div class=\"content\"></div></td>"+"<td class=\"b\"/></tr><tr><td class=\"bl\"/><td class=\"b\"/><td class=\"br\"/></tr></tbody></table>",animationSkeleton:"<div id=\"puppetLoading\"><img id=\"zoomSpinner\" src=\"/img/puppet/zoomSpinner-1.png\" alt=\"Loading...\"/>",loadingFrame:1};
ILP.Puppet.init=function(){
if(ILP.Puppet.settings.initialized){
return true;
}else{
ILP.Puppet.settings.initialized=true;
}
$("body").prepend(ILP.Puppet.settings.animationSkeleton);
$("body").prepend(ILP.Puppet.settings.puppetSkeleton);
$(document).bind("keydown.puppet",function(e){
if(e.keyCode==27){
ILP.Puppet.close();
}
});
};
ILP.Puppet.loading=function(){
if(ILP.Puppet.settings.loaded!==true){
$("#puppetLoading").show();
$("#zoomSpinner").attr("src","/img/puppet/zoomSpinner-"+ILP.Puppet.settings.loadingFrame+".png");
ILP.Puppet.settings.loadingFrame++;
if(ILP.Puppet.settings.loadingFrame>12){
ILP.Puppet.settings.loadingFrame=1;
}
}else{
$("#puppetLoading").hide();
clearInterval(loadingTimer);
ILP.Puppet.settings.loadingFrame=1;
}
};
ILP.Puppet.reveal=function(_57){
ILP.Puppet.settings.loaded=true;
$("#puppet .content").empty().append(_57);
var _58={h:$("#puppet").height()/2,w:$("#puppet").width()/2};
$("#puppet").css({marginTop:-_58.h,marginLeft:-_58.w}).fadeIn(200);
$(".closePuppet").bind("click",function(_59){
ILP.Puppet.close();
return false;
});
$("ul.puppetNav li a").each(function(e){
ILP.Puppet.toggleModule($(this));
});
$("#puppet form").bind("submit",function(_5b){
return false;
});
};
ILP.Puppet.close=function(){
$(document).trigger("close.puppet");
return false;
};
ILP.Puppet.toggleModule=function(tab){
$(tab).bind("click",function(_5d){
var _5e=$(this).attr("href");
$(_5e).siblings(".enabled").removeClass("enabled").addClass("disabled");
$(this).parent().siblings("li.active").removeClass("active");
ILP.Message.clearAll();
$(_5e).removeClass("disabled").addClass("enabled");
$(this).parent().addClass("active");
return false;
});
};
$(document).bind("close.puppet",function(){
$(document).unbind("keydown.puppet");
$("#puppet").fadeOut(200,function(){
$("#puppet .content").empty();
ILP.Puppet.settings.loaded=false;
});
});
ILP.Debug.init=function(){
var _5f="<div id=\"debugWrapper\"><a href=\"#\" id=\"toggleDebugLog\">Show Log</a>"+"<div id=\"debugWindow\" style=\"display: none;\"></div>"+"<div id=\"debugLog\" style=\"display: none;\">"+"<span class=\"empty\">Log is empty</span></div></div>";
$("body").prepend(_5f);
ILP.Debug.initialized=true;
$("a#toggleDebugLog").bind("click",function(_60){
ILP.Debug.expand();
return false;
});
};
ILP.Debug.fire=function(msg){
if(ILP.Debug.enabled===true){
if(!ILP.Debug.initialized){
ILP.Debug.init();
}
if(msg===""){
return;
}
clearTimeout(ILP.Debug.t2);
$("#debugWindow").html(msg);
$("#debugWindow").show().animate({opacity:0.6},200);
$("a#toggleDebugLog").hide();
ILP.Debug.log(msg);
ILP.Debug.t1=setTimeout(ILP.Debug.bind,700);
ILP.Debug.t2=setTimeout(ILP.Debug.kill,5000);
}
};
ILP.Debug.log=function(msg){
var _63=$("#debugLog span.message");
if(_63.length===0){
$("#debugLog").empty();
}
$("#debugLog").prepend("<span class=\"message\">"+msg+"</span>");
if($("#_firebugConsole").offset()||$("html").hasClass("safari")){
console.log("ILP Debug: "+msg);
}
};
ILP.Debug.consoleLog=function(){
if(ILP.Debug.enabled){
if($("#_firebugConsole").offset()){
if(!$.browser.safari){
console.log.apply(this,arguments);
}
}
}
};
ILP.Debug.expand=function(){
if($("#debugLog").css("display")==="none"){
$("#debugLog").show();
$("a#toggleDebugLog").html("Hide Log");
}else{
$("#debugLog").hide();
$("a#toggleDebugLog").html("Show Log");
}
};
ILP.Debug.bind=function(){
$(window).click(ILP.Debug.kill).keypress(ILP.Debug.kill);
};
ILP.Debug.kill=function(){
$(window).unbind("click",ILP.Debug.kill).unbind("keypress",ILP.Debug.kill);
$("#debugWindow").animate({opacity:0},500,function(){
$(this).hide();
$("a#toggleDebugLog").show();
});
};
ILP.Misc.setupDismiss=function(){
$.ajax({url:"/ajax/dismiss-setup/",method:"GET",dataType:"json",success:function(j){
if(j.response=="success"){
$(".welcomeSetup").animate({height:0,opacity:0},undefined,undefined,function(){
$(this).remove();
});
}else{
ILP.Message.create("error","An error occured while trying to hide the Setup box. Please try again momentarily.");
}
},error:function(j){
ILP.Message.create("error","An error occured while trying to hide the Setup box. Please try again momentarily.");
}});
};
(function(){
jQuery.ilpRequest=function(_66,_67){
$.ajax({type:_66,url:_67.url,data:_67.data,dataType:_67.dataType||"json",beforeSend:function(){
_67.pre();
},success:function(r){
if(!r){
ILP.Debug.fire("Success. No response.");
_67.success();
}
if(r.response==="success"){
ILP.Debug.fire("Success.");
_67.success(r);
}else{
if(r.response==="error"){
ILP.Debug.fire("Application error.");
_67.failure(r);
}
}
},error:function(r){
ILP.Debug.fire("Server error.");
_67.failure(r);
}});
};
})(jQuery);
$(document).ready(function(){
$(window).unload(function(){
ILP.Events.unloadQueue();
});
ILP.Debug.enabled=$("body").hasClass("debug");
ILP.Message.bind();
$("a.closeAlert").click(function(){
ILP.Message.destroy($(this).parent());
return false;
});
$("#searchInput, .search_input").click(function(){
var _6a=$(this).val();
if(_6a=="Search iLovePhotos"||_6a=="Track that page down&hellip;"){
$(this).val("");
}else{
$(this).select();
}
$(this).blur(function(){
if($(this).val()===""){
$(this).val(_6a);
}
});
}).mouseover(function(){
if(!$(this).hasClass("focus")){
$(this).addClass("hover");
$("#searchSubmit").attr("src","/img/base/search/searchSubmitHover.png");
}
}).mouseout(function(){
if(!$(this).hasClass("focus")){
$(this).removeClass();
$("#searchSubmit").attr("src","/img/base/search/searchSubmitOff.png");
}
}).focus(function(){
$(this).addClass("focus");
$("#searchSubmit").attr("src","/img/base/search/searchSubmitOn.png");
}).blur(function(){
$(this).removeClass();
$("#searchSubmit").attr("src","/img/base/search/searchSubmitOff.png");
});
$("#upperBar input.loginField").hover(function(){
if(!$(this).hasClass("focus")){
$(this).addClass("hover");
}
},function(){
if(!$(this).hasClass("focus")){
$(this).removeClass();
}
}).focus(function(){
if($(this).attr("value")=="Email"||$(this).attr("value")=="Password"){
$(this).attr("value","");
}
$(this).addClass("focus");
}).blur(function(){
if($(this).attr("value")===""){
if($(this).attr("type")=="text"){
$(this).attr("value","Email");
}else{
if($(this).attr("type")=="password"){
$(this).attr("value","Password");
}
}
}
$(this).removeClass();
});
$("#loginSubmit").hover(function(){
$(this).attr("src","/img/base/topBar/loginEnabled.png");
},function(){
$(this).attr("src","/img/base/topBar/loginDisabled.png");
});
$("li.subnav .arrow").bind("click",function(_6b){
var _6c=$(this);
var _6d=_6c.siblings(".dropdown");
var _6e=_6c.siblings(".curvy");
function _6f(_70){
var _71=$("li.subnav .arrow");
var _72=_71.siblings(".dropdown");
var _73=_71.siblings(".curvy");
_72.hide();
_73.hide();
_71.removeClass("enabled");
_71.parent().removeClass("enabled");
};
if(!$(this).hasClass("enabled")){
_6f();
$(_6d).show();
$(_6e).show();
$(this).addClass("enabled");
$(this).parent().addClass("enabled");
}else{
_6f();
}
$(document).bind("click",function(_74){
var _75=$(_74.target).attr("class");
if(_75!="dropdown"){
_6f();
}
});
return false;
}).hover(function(){
$(this).addClass("hover");
},function(){
$(this).removeClass("hover");
});
$("a.puppet").each(function(_76){
ILP.Puppetmaster($(this));
});
ILP.Util.preload("/img/global/nav/dropdownTop.png","/img/global/nav/dropdownBottom.png","/img/global/nav/curvy.png","/img/puppet/b.png","/img/puppet/tl.png","/img/puppet/tr.png","/img/puppet/buttons/mini.png","/img/puppet/bl.png","/img/puppet/br.png","/img/puppet/tlMini.png","/img/puppet/trMini.png","/img/puppet/blMini.png","/img/puppet/brMini.png","/img/base/search/searchSubmitHover.png","/img/base/search/searchSubmitOn.png","/img/base/topBar/loginDisabled.png");
});


ILP.Photo={};
ILP.Photo.updateMediaCount=function(_1,_2){
var _3="span.count."+_1;
var _4=parseInt($(_3).html(),10);
if(_2=="decrease"){
_4--;
}else{
if(_2=="increase"){
_4++;
}
}
if(_4=="0"){
_4="No";
}
$(_3).html(_4);
};
ILP.Photo.deleteBoxDo=function(_5){
$.ajax({type:"POST",url:"/ajax/box/delete/"+_5.box_id+"/",data:{},dataType:"json",error:function(r){
ILP.Message.create("error","An error occured deleting the face, please try again momentarily.");
},success:function(r){
if(r.response=="error"){
ILP.Message.create("error","An error occured deleting the face, please try again momentarily.");
}else{
ILP.PuppetMini.destroy(_5.media_id);
$(_5.box).fadeOut();
$("div#overlay-"+_5.tag_id+"-"+_5.box_id).fadeOut("normal",function(){
$(this).remove();
});
$("#overlay-"+_5.tag_id+"-"+_5.box_id).fadeOut();
}
}});
};
ILP.Photo.deleteBoxUndo=function(_8){
$(_8.box).fadeIn();
$("#overlay-"+_8.tag_id+"-"+_8.box_id).fadeIn();
};
ILP.Photo.deleteBoxHandler=function(_9){
args={box:$(_9).parent(),tag_id:$(_9).parent().attr("id").split("-")[1],box_id:$(_9).parent().attr("id").split("-")[2]};
ILP.PuppetMini.create(args.media_id,"<p>Are you sure you would like to delete this face?</p><a class=\"smallButton target performBoxDelete\" href=\"delete/?delete\"><span>Yes, Delete It</span><a/> <a class=\"smallButton cancelBoxDelete\" href=\"#\"><span>Cancel</span></a>",$(_9),true,{left:-100});
$("a.performBoxDelete").click(function(){
ILP.Photo.deleteBoxDo(args);
return false;
});
$("a.cancelBoxDelete").click(function(){
ILP.PuppetMini.destroy(args.media_id);
return false;
});
};
ILP.Photo.deleteMediaDo=function(_a){
ILP.Debug.fire("Media ID to delete is "+_a.media_id);
$.ajax({type:"POST",url:"/ajax/photo/delete/"+_a.media_id+"/",data:{},error:function(){
ILP.Message.create("error","An error occured deleting your photo, please try again momentarily.");
ILP.PuppetMini.destroy(_a.media_id);
},success:function(){
ILP.PuppetMini.destroy(_a.media_id);
$("#media-"+_a.media_id).parent().remove();
}});
};
ILP.Photo.deleteMediaUndo=function(_b){
$(_b.media).fadeIn();
ILP.Photo.updateMediaCount("photo","increase");
};
ILP.Photo.deleteMediaHandler=function(_c){
if(ILP.GLOBAL.pageinfo){
ILP.Photo.singleMedia=true;
}
args={};
args.media=$(_c).parent().parent();
args.media_id=ILP.Util.getID(args.media,"id");
ILP.PuppetMini.create(args.media_id,"<p>Are you sure you would like to delete this photo?</p><a class=\"smallButton target performPhotoDelete\" href=\"delete/?delete\"><span>Yes, Delete It</span><a/> <a class=\"smallButton cancelPhotoDelete\" href=\"#\"><span>Cancel</span></a>",$(_c),true);
$("a.performPhotoDelete").click(function(){
if(grid_view){
ILP.Photo.deleteMediaDo(args);
return false;
}
});
$("a.cancelPhotoDelete").click(function(){
ILP.PuppetMini.destroy(args.media_id);
return false;
});
};
ILP.Photo.Sort={};
ILP.Photo.Sort.init=function(_d){
ILP.Photo.Sort.active=false;
$(_d).bind("click",function(_e){
if(ILP.Photo.Sort.active){
ILP.Photo.Sort.closeSorting(_d);
}else{
ILP.Photo.Sort.activateSorting(_d);
}
return false;
});
};
ILP.Photo.Sort.activateSorting=function(_f){
ILP.Photo.Sort.active=true;
$(_f).addClass("active");
$(document).bind("click",function(_10){
if($(_10.target).attr("class")!="changeSortItem"){
ILP.Photo.Sort.closeSorting(_f);
}
});
$("ul.sortBy_list").show();
};
ILP.Photo.Sort.closeSorting=function(_11){
ILP.Photo.Sort.active=false;
$(_11).removeClass("active");
$(document).unbind("click");
$("ul.sortBy_list").hide();
};
ILP.Photo.sharingModule={};
ILP.Photo.sharingModule.init=function(_12){
ILP.Debug.fire("Initializing the sharingModule...");
$(_12).children("li").each(function(_13){
$(this).children("a").bind("click",function(_14){
$(this).parent().siblings("li.active").removeClass("active");
$(this).parent().addClass("active");
var _15=$(this).parent().attr("id").split("-")[0]+"-module";
$("#sharingModule .subModule").removeClass("active");
$("#"+_15).addClass("active");
return false;
});
});
};
ILP.Comment={settings:{defaultText:"Write your comment here..."},init:function(){
if(this.settings.initialized){
return true;
}else{
this.settings.skeleton="<div class=\"comment new\" id=\"new-comment\">"+"<div class=\"cIcon\"><a href=\"#\"><img src=\""+ILP.GLOBAL.pageinfo.user_icon+"\" alt=\"\" /></a></div>"+"<div class=\"cComment\">"+"<div class=\"cText\">"+"<textarea id=\"new-commentText\" cols=\"30\" rows=\"4\">"+this.settings.defaultText+"</textarea>"+"</div>"+"</div>"+"<div class=\"cMeta\">"+"<img class=\"loadingIndicator\" src=\"/img/misc/rotatingArrows.gif\" style=\"display: none;\" />"+"<a class=\"roundButton save target disabled\" href=\"#\"><span>Save Comment</span></a>"+"<a class=\"roundButton cancel\" href=\"#\"><span>Cancel</span></a>"+"<span class=\"info\">You are currently editing your comment&hellip;&nbsp;&nbsp;</span>"+"</div>"+"</div>";
$("a.deleteComment").click(function(){
ILP.Comment.remove($(this));
return false;
});
$("a.addComment").click(function(){
ILP.Comment.add();
return false;
});
this.settings.initialized=true;
}
},add:function(){
var _16=this;
if($("a.addComment").hasClass("disabled")){
return false;
}
$("a.addComment").addClass("disabled");
$("#comments h3").after(this.settings.skeleton);
$("textarea#new-commentText").focus(function(){
if(this.value==this.defaultValue){
this.value="";
}
}).blur(function(){
if(!this.value.length){
this.value=this.defaultValue;
}
}).keyup(function(){
_16.observeTextarea($(this));
});
$(".noComments").hide();
$("#new-comment a.save").bind("click",function(_17){
if(!$(this).hasClass("disabled")){
$(this).addClass("disabled");
ILP.Comment.save();
}
return false;
});
$("#new-comment a.cancel").bind("click",function(_18){
ILP.Comment.cancel();
return false;
});
},save:function(){
var _19=this;
$.ilpRequest("POST",{url:"/ajax/comment/add/"+ILP.GLOBAL.pageinfo.media_type+"/"+ILP.GLOBAL.pageinfo.media_id+"/",data:{"text":$("#new-comment textarea").val()},pre:function(){
$("#new-comment textarea").addClass("disabled");
$("#new-comment .cMeta span.info").text("Submitting comment...");
$("#new-comment .cMeta img.loadingIndicator").show();
},success:function(r){
_19.util.updateCount();
$("#new-comment .cText").html(r.extra.html_comment_text);
$("#new-comment .cMeta").html("Posted just now by you &bull; <a href=\"#\" class=\"deleteComment\"><strong>Delete</strong></a>");
$("#new-comment .cMeta a.deleteComment").click(function(){
_19.remove($(this));
return false;
});
$("#new-comment").removeClass("new");
$("#new-comment").attr("id",("comment-"+r.extra.comment_id));
$("a.addComment").removeClass("disabled");
},failure:function(r){
$("#new-comment .cText").html("<p>An error occured while trying to save your comment. Please try again later.</p>").parent().parent().addClass("error").removeClass("new");
$("#new-comment .cMeta").remove();
$("#new-comment .cMeta img.loadingIndicator").hide();
setTimeout(function(){
$("#new-comment").fadeOut("fast");
$(".noComments").show();
},5000);
$("a.addComment").removeClass("disabled");
}});
},cancel:function(){
$("#new-comment").remove();
$(".noComments").show();
$("a.addComment").removeClass("disabled");
},remove:function(_1c){
var _1d=this;
var _1e=$(_1c).parent().parent();
var _1f=ILP.Util.getID(_1e,"id");
$.ajax({type:"POST",url:"/ajax/comment/delete/"+_1f+"/",data:{},beforeSend:function(){
$(_1c).parent().html("<img class=\"loadingIndicator\" src=\"/img/misc/rotatingArrows.gif\" style=\"display: block;\" />Deleting comment...").parent().addClass("error");
},success:function(){
$(_1e).fadeOut("fast",function(){
$(this).remove();
_1d.util.updateCount();
});
},error:function(){
ILP.Comment.error("There was an error deleting the comment. Please try again later.",_1e);
}});
},empty:function(){
var val=$("#new-comment textarea").val();
return (val===""||val==ILP.Comment.settings.defaultText)?true:false;
},observeTextarea:function(_21){
var _22=this;
var _23=$(_21).val();
var _24=$("#new-comment a.save");
if(_23===_22.settings.defaultText||(_23).replace(/^\s*|\s*$/g,"").length<2){
if(_24.hasClass("disabled")){
return false;
}
_24.addClass("disabled");
}else{
if(!_24.hasClass("disabled")){
return false;
}
_24.removeClass("disabled");
}
},util:{updateCount:function(){
var _25=$("#comments .comment").length;
if(_25>0){
$(".noComments").remove();
}
$("#comments h3 span").text(_25.apnumber()+" comment"+_25.pluralize());
}}};
ILP.BB={};
ILP.BB.get_ids=function(_26){
var _27=$(_26).attr("id").split("-",3);
var _28={};
_28.tag=_27[1];
_28.bb=_27[2];
return _28;
};
ILP.BB.core=function(_29,_2a,_2b,_2c,_2d){
var bb,sb,_30;
if(_2a=="bound"){
bb="#overlay-"+_2c+"-"+_2d+"";
sb="#sb-"+_2c+"-"+_2d+"";
_30="#overlay-"+_2c+"-"+_2d+" .meta";
}else{
if(_2a=="unbound"){
bb="#overlay-ub-"+_2d+"";
sb="#sb-ub-"+_2d+"";
_30="#overlay-ub-"+_2d+" .meta";
}
}
$(_29).hover(function(){
$(bb).fadeIn(150);
$(_30).show();
$(sb).addClass("highlight");
},function(){
if(!_2b){
$(bb).fadeOut(150);
}
$(_30).hide();
$(sb).removeClass("highlight");
});
};
var carousel;
ILP.Carousel={settings:{noPhotoHTML:"<li class=\"end\"><p class=\"endNotice\">No more photos!</p></li>",scrollDuration:150},init:function(_31,_32,_33,_34){
_31=$(_31).get(0);
ILP.Carousel.state.unlock(_31);
ILP.Carousel.handles.previous.set(_31,_32[0],_33[0]);
ILP.Carousel.handles.next.set(_31,_32[1],_33[1]);
var _35=$("li",_31).index($(_34).get(0));
ILP.Carousel.photos.right.set(_31,$("li",_31).get(_35+1));
ILP.Carousel.photos.left.set(_31,$("li",_31).get(_35-1));
$.data(_31,"original_media_id",parseInt($(_34).attr("id").split("-")[1],10));
},dimensions:{width:{get:function(_36){
return $(_36).width();
},set:function(_37,_38){
$(_37).width(_38+"px");
},resize:function(_39,_3a){
_3a=parseInt(_3a,10);
ILP.Carousel.dimensions.width.set(_39,(ILP.Carousel.dimensions.width.get(_39)+_3a));
}}},state:{lock:function(_3b){
$.data($(_3b).get(0),"locked",true);
},unlock:function(_3c){
$.data($(_3c).get(0),"locked",false);
},locked:function(_3d){
return $.data($(_3d).get(0),"locked");
}},handles:{previous:{get:function(_3e){
return $($.data($(_3e),"previous_handle"));
},set:function(_3f,_40,_41){
$.data($(_3f).get(0),"previous_handle",$(_40).get(0));
$.data($(_3f).get(0),"previous_handle_inactive",$(_41).get(0));
$.data($(_40).get(0),"carousel",$(_3f).get(0));
$.data($(_41).get(0),"carousel",$(_3f).get(0));
$(_40).click(function(){
ILP.Carousel.photos.left.navigate($(this).data("carousel"));
return false;
});
},enable:function(_42){
$($.data($(_42).get(0),"previous_handle")).removeClass("disabled");
},disable:function(_43){
$($.data($(_43).get(0),"previous_handle")).addClass("disabled");
}},next:{get:function(_44){
return $($.data($(_44),"next_handle"));
},set:function(_45,_46,_47){
$.data($(_45).get(0),"next_handle",$(_46).get(0));
$.data($(_45).get(0),"next_handle_inactive",$(_47).get(0));
$.data($(_46).get(0),"carousel",$(_45).get(0));
$.data($(_47).get(0),"carousel",$(_45).get(0));
$(_46).click(function(){
ILP.Carousel.photos.right.navigate($(this).data("carousel"));
return false;
});
},enable:function(_48){
$($.data($(_48).get(0),"next_handle")).removeClass("disabled");
},disable:function(_49){
$($.data($(_49).get(0),"next_handle")).addClass("disabled");
}}},scroll:function(_4a,px,_4c){
var _4d=parseInt($(_4a).css("left").split("px")[0],10);
ILP.Carousel.state.lock(_4a);
if(!_4c){
$(_4a).animate({left:(_4d+px)+"px"},{duration:ILP.Carousel.settings.scrollDuration,complete:function(){
ILP.Carousel.state.unlock(_4a);
}});
}else{
$(_4a).css({left:(_4d+px)+"px"});
ILP.Carousel.state.unlock(_4a);
}
},photos:{left:{get:function(_4e){
return $.data($(_4e).get(0),"left_photo");
},set:function(_4f,_50){
return $.data($(_4f).get(0),"left_photo",_50);
},index:function(_51){
return $("li",_51).index($($.data(_51,"left_photo")).get(0));
},photoID:function(_52){
return parseInt($(ILP.Carousel.photos.left.get(_52)).attr("id").split("-")[1],10);
},scroll:function(_53){
var _54=ILP.Carousel.photos.left.index(_53);
var _55=ILP.Carousel.photos.getByIndex(_53,(_54-1));
ILP.Carousel.scroll(_53,$(_55).outerWidth({margin:true}));
ILP.Carousel.handles.next.enable(_53);
ILP.Carousel.photos.left.set(_53,_55);
ILP.Carousel.photos.right.set(_53,ILP.Carousel.photos.getByIndex(_53,(_54+1)));
},hasMoreCached:function(_56){
if(ILP.Carousel.photos.left.index(_56)<=0){
return false;
}else{
return true;
}
},navigate:function(_57){
if(ILP.Carousel.state.locked(_57)){
return false;
}
ILP.Carousel.state.lock(_57);
if(ILP.Carousel.photos.left.hasMoreCached(_57)){
ILP.Carousel.photos.left.scroll(_57);
if($(ILP.Carousel.photos.left.get(_57)).hasClass("end")){
ILP.Carousel.handles.previous.disable(_57);
}
}else{
ILP.Carousel.state.lock(_57);
$.ajax({url:"/ajax/photo/get-previous/"+ILP.Carousel.photos.left.photoID(_57)+"/",data:{context:$.data($(_57).get(0),"original_media_id")},dataType:"json",success:function(_58){
var _59;
if(_58.extra.object){
_59=$("<li class=\"previous\" id=\"photo-"+_58.extra.object.id+"\"><a href=\""+_58.extra.object.url+"\" title=\""+_58.extra.object.title+"\" class=\"thumbWrapper\"><img src=\""+_58.extra.object.thumbnail_url+"\" alt=\"Thumbnail Preview\" width=\"65\" height=\"65\" /></a></li>");
}else{
_59=$(ILP.Carousel.settings.noPhotoHTML);
ILP.Carousel.handles.previous.disable(_57);
}
_59.prependTo($(_57));
ILP.Carousel.scroll(_57,-$(_59).outerWidth({margin:true}),true);
ILP.Carousel.dimensions.width.resize(_57,$(_59).outerWidth({margin:true}));
ILP.Carousel.photos.left.scroll(_57);
},error:function(_5a){
ILP.Carousel.state.unlock(_57);
}});
}
return false;
}},right:{get:function(_5b){
return $.data($(_5b).get(0),"right_photo");
},set:function(_5c,_5d){
return $.data($(_5c).get(0),"right_photo",_5d);
},index:function(_5e){
return $("li",_5e).index($(ILP.Carousel.photos.right.get(_5e)).get(0));
},photoID:function(_5f){
return parseInt($(ILP.Carousel.photos.right.get(_5f)).attr("id").split("-")[1],10);
},scroll:function(_60){
var _61=ILP.Carousel.photos.right.index(_60);
var _62=ILP.Carousel.photos.getByIndex(_60,(_61+1));
ILP.Carousel.scroll(_60,-$(_62).outerWidth({margin:true}));
ILP.Carousel.handles.previous.enable(_60);
ILP.Carousel.photos.right.set(_60,_62);
ILP.Carousel.photos.left.set(_60,ILP.Carousel.photos.getByIndex(_60,(_61-1)));
},hasMoreCached:function(_63){
if((ILP.Carousel.photos.right.index(_63)+1)==$("li",_63).length){
return false;
}else{
return true;
}
},navigate:function(_64){
if(ILP.Carousel.state.locked(_64)){
return false;
}
ILP.Carousel.state.lock(_64);
if(ILP.Carousel.photos.right.hasMoreCached(_64)){
ILP.Carousel.photos.right.scroll(_64);
if($(ILP.Carousel.photos.right.get(_64)).hasClass("end")){
ILP.Carousel.handles.next.disable(_64);
}
}else{
$.ajax({url:"/ajax/photo/get-next/"+ILP.Carousel.photos.right.photoID(_64)+"/",data:{context:$.data($(_64).get(0),"original_media_id")},dataType:"json",success:function(_65){
var _66;
if(_65.extra.object){
_66=$("<li class=\"next\" id=\"photo-"+_65.extra.object.id+"\"><a href=\""+_65.extra.object.url+"\" title=\""+_65.extra.object.title+"\" class=\"thumbWrapper\"><img src=\""+_65.extra.object.thumbnail_url+"\" alt=\"Thumbnail Preview\" width=\"65\" height=\"65\" /></a></li>");
}else{
_66=$(ILP.Carousel.settings.noPhotoHTML);
ILP.Carousel.handles.next.disable(_64);
}
_66.appendTo($(_64));
ILP.Carousel.dimensions.width.resize(_64,$(_66).outerWidth({margin:true}));
ILP.Carousel.photos.right.scroll(_64);
},error:function(_67){
ILP.Carousel.state.unlock(_64);
}});
}
return false;
}},getIndex:function(_68,_69){
return $("li",_68).index(_69);
},getByIndex:function(_6a,_6b){
return $($("li",_6a).get(_6b));
}}};
$(document).ready(function(){
$(".boundingBox").each(function(_6c){
if(!$(this).hasClass("unbound")){
var _6d=ILP.BB.get_ids(this);
ILP.BB.core(this,"bound",true,_6d.tag,_6d.bb);
}else{
return false;
}
});
$("ul.boundingBoxes li.bb").each(function(_6e){
if(!$(this).hasClass("unbound")){
var _6f=ILP.BB.get_ids(this);
ILP.BB.core(this,"bound",false,_6f.tag,_6f.bb);
}else{
return false;
}
});
$(".boundingBox.unbound").each(function(_70){
var _71=ILP.BB.get_ids(this);
ILP.BB.core(this,"unbound",true,false,_71.bb);
});
$("ul.boundingBoxes li.ubb").each(function(_72){
var _73=ILP.BB.get_ids(this);
ILP.BB.core(this,"unbound",false,false,_73.bb);
});
$("#photoWrapper").hover(function(){
$(".boundingBox").show();
},function(){
$(".boundingBox").hide();
});
});


ILP.userSettings={};
ILP.userSettings.email={settings:{defaultEmailString:"Enter an address here..."},init:function(){
var _1=this;
this.bindObservers();
$("input#email_address").bind("click",function(_2){
var _3=$(this).val();
if(_3==_1.settings.defaultEmailString){
$(this).val("");
}else{
$(this).select();
}
$(this).blur(function(){
if($(this).val()==""){
$(this).val(_3);
}
});
});
$("form#addEmailForm").bind("submit",function(_4){
var _5=$("input#email_address").val();
if(ILP.Util.validEmail(_5)){
_1.add(_5);
}else{
ILP.Message.create("error","Please enter a valid email address.");
}
return false;
});
},add:function(_6){
var _7=this;
if(this.util.doesEmailExist(_6)){
ILP.Message.create("error","Sorry, You're already using that email address!");
}else{
$.ajax({url:"/ajax/meta_person/add_email/",type:"GET",data:{"meta_person_id":ILP.GLOBAL.metaPersonID,"email":_6},dataType:"json",beforeSend:function(){
$("form#addEmailForm").addClass("loading");
},success:function(e){
if(e.response=="error"){
if(e.extra.email=="Email already exists"){
ILP.Message.create("error",_6+" already exists in our system. Please <a href=\"/help/tickets/new/\">contact support</a> for further assistance.");
}else{
ILP.Message.create("error","An error occured adding "+_6+" to your account.<br />Please try again momentarily.");
}
}else{
if(e.response=="success"){
ILP.Message.create("success",_6+" has been successfully added to your account.");
var _9="<li id=\"email-"+e.extra.email_id+"\" class=\"makePri\"><span class=\"email\">"+_6.shorten(65)+"</span></span> &bull; <a href=\"#\" class=\"deleteEmail\">Delete</a><span class=\"makePri\"> &bull; <a href=\"#\" class=\"makePrimary\">Make Primary</a></span></li>";
$("ul.addressList").append(_9);
_7.bindObservers(e.extra.email_id);
_7.util.clearEmailInput();
}
}
},error:function(){
ILP.Message.create("error","An error occured adding '"+_6+"' to your account.<br />Please try again momentarily.");
},complete:function(){
$("form#addEmailForm").removeClass("loading");
}});
}
},remove:function(_a){
var _b=this.util.emailConstructor(_a);
if(_b.row.hasClass("primary")){
ILP.Message.create("error","You cannot remove a primary email address. Please choose a new primary email address before removing the current one.");
}else{
$.ajax({url:"/ajax/meta_person/delete_email/",type:"GET",data:{"meta_person_id":ILP.GLOBAL.metaPersonID,"email":_b.toString},dataType:"json",success:function(_c){
if(_c.response=="success"){
ILP.Message.create("success",_b.toString+" has been successfully removed!");
$(_b.row).remove();
}else{
ILP.Message.create("error","An error occured removing "+_b.toString.shorten("40")+" from your account. "+_c.extra.email+". Please try again momentarily.");
}
},error:function(){
ILP.Message.create("error","An error occured removing "+_b.toString+" from your account. Please try again momentarily.");
}});
}
},makePrimary:function(_d){
var _e=this;
var _f=this.util.emailConstructor(_d);
$.ajax({url:"/ajax/meta_person/set_primary_email/",type:"GET",data:{"meta_person_id":ILP.GLOBAL.metaPersonID,"email_id":_f.id},success:function(){
ILP.Message.create("success",_f.toString+" is now the primary address on your account! You will now use "+_f.toString+" to login.");
_e.togglePrimaryRow(_f.id);
},error:function(){
ILP.Message.create("error","An error occured while changing your primary email address. Please try again momentarily.");
}});
},togglePrimaryRow:function(_10){
var _11=$("#email-"+_10).siblings("li.primary");
_11.children("span.pri").remove();
_11.append("<span class=\"makePri\"> &bull; <a href=\"#\" class=\"makePrimary\">Make Primary</a></span>");
_11.attr("class","makePri");
this.bindObservers(ILP.Util.getID(_11,"id"));
var _12=$("#email-"+_10);
_12.children("span.makePri").remove();
_12.append("<span class=\"pri\"><strong>Primary</strong></span>");
_12.attr("class","primary");
this.bindObservers(_10);
},bindObservers:function(_13){
var _14=this;
var _15=(_13)?"#email-"+_13+" ":"";
$(_15+"a.deleteEmail").bind("click",function(_16){
var _17=ILP.Util.getID($(this).parent(),"id");
_14.remove(_17);
return false;
});
$(_15+"a.makePrimary").bind("click",function(_18){
var _19=ILP.Util.getID($(this).parent().parent(),"id");
if(!$(this).parent().parent().hasClass("primary")){
_14.makePrimary(_19);
}
return false;
});
},util:{clearEmailInput:function(){
$("input#email_address").val(ILP.userSettings.email.settings.defaultEmailString);
},doesEmailExist:function(_1a){
var _1b=$("ul.addressList").children("li").children("span.email");
for(var i=0,l=_1b.length;i<l;i++){
if($(_1b[i]).html()==_1a){
return true;
}
}
return false;
},emailConstructor:function(_1e){
return {id:_1e,row:$("#email-"+_1e),toString:$("#email-"+_1e).children("span.email").text()};
}}};


