var Evernote=(typeof Evernote=="object"&&Evernote!=null)?Evernote:{};Evernote.logger={debug:function(a){if(typeof console=="object"&&console!=null&&typeof console.log=="function"){console.log(a)}},isDebugEnabled:function(){return false}};Evernote.detectCharacterEncoding=function(b){var c=(b)?b:document;var a=null;if(typeof c.characterSet=="string"){a=c.characterSet}else{if(typeof c.charset=="string"){a=c.charset}else{if(typeof c.inputEncoding=="string"){a=c.inputEncoding}else{if(typeof c.defaultCharset=="string"){a=c.defaultCharset}}}}return a};if(typeof Array.prototype.indexOf!="function"){Array.prototype.indexOf=function(b){for(var a=0;a0){var f=arguments.callee(g[c],e);if(f&&f.length>0){d=Evernote.concatArrays(d,f)}}}}return d};Evernote.findParent=function(a,b){if(typeof a=="object"&&a!=null&&typeof a.nodeType=="number"){if(a.nodeName=="BODY"){return a}else{if(a.parentNode=="BODY"){return a}else{var c=a;while(c.parentNode.nodeName!="BODY"){if(typeof b=="function"&&b(c.parentNode)){return c.parentNode}else{if(typeof b!="function"){return c.parentNode}}c=c.parentNode}}}}return null};Evernote.hasElementClass=function(c,d,a){if(!this.isHtmlElement(c)){return false}try{var b=c.getAttribute("class");if(typeof b!="string"){return false}if(!a){b=b.toLowerCase();d=d.toLowerCase()}var g=b.replace(/\s+/," ").split(" ");return g.indexOf(d)>=0}catch(f){}return false};Evernote.containsElementClass=function(c,d,a){if(!this.isHtmlElement(c)){return false}try{var b=c.getAttribute("class");if(typeof b!="string"){return false}if(!a){b=b.toLowerCase();d=d.toLowerCase()}return b.indexOf(d)>=0}catch(f){}return false};Evernote.hasElementId=function(b,f,a){if(!this.isHtmlElement(b)){return false}try{var d=b.getAttribute("id");if(typeof d!="string"){return false}if(!a){d=d.toLowerCase();f=f.toLowerCase()}return d==f}catch(c){}return false};Evernote.containsElementId=function(b,f,a){if(!this.isHtmlElement(b)){return false}try{var d=b.getAttribute("id");if(typeof d!="string"){return false}if(!a){d=d.toLowerCase();f=f.toLowerCase()}return d.indexOf(f)>=0}catch(c){}return false};Evernote.isElementVisible=function(a){if(!this.isHtmlElement(a)){return false}try{var b=a.ownerDocument.defaultView.getComputedStyle(a);if(b){if(b.getPropertyValue("display")!="none"&&b.getPropertyValue("visibility")!="none"){return true}}}catch(c){}return false};Evernote.getElementClassNames=function(a){if(!this.isHtmlElement(a)){return false}return a.getAttribute("class").replace(/\s+/," ").split(" ")};Evernote.getElementSortedClassName=function(a){if(!this.isHtmlElement(a)){return null}return Evernote.getElementClassNames().sort().join(" ")};Evernote.Clip=function(b,a){this.initialize(b,a)};Evernote.Clip.constants={isIE:(navigator.appVersion.indexOf("MSIE",0)!=-1),isSafari:(navigator.appVersion.indexOf("WebKit",0)!=-1),isFirefox:(navigator.userAgent.indexOf("Firefox",0)!=-1),isIpad:(navigator.userAgent.indexOf("WebKit")>0&&navigator.userAgent.indexOf("iPad")>0),isIphone:(navigator.userAgent.indexOf("WebKit")>0&&navigator.userAgent.indexOf("iPhone")>0)};Evernote.Clip.contentMarkers=["article","post","content","story","body"];Evernote.Clip.filterMarkers=["comment","feedback","breadcrumb","share","sharing","social","sociable","tools","links","extra","related","sponsor","ads","adsense","banner","chat","shout","module"];Evernote.Clip.NOKEEP_NODE_ATTRIBUTES={style:null,"class":null,id:null,onclick:null,onsubmit:null,onmouseover:null,onmouseout:null};Evernote.Clip.NOKEEP_NODE_NAMES={style:null,script:null,input:null,select:null,option:null,textarea:null};Evernote.Clip.SELF_CLOSING_NODE_NAMES={base:null,basefont:null,frame:null,link:null,meta:null,area:null,br:null,col:null,hr:null,img:null,input:null,param:null};Evernote.Clip.NODE_NAME_TRANSLATIONS={body:"div",form:"div"};Evernote.Clip.LIST_NODE_NAMES={ul:null,ol:null};Evernote.Clip.HTMLEncode=function(e){var b="";for(var d=0;d127){b+="&#"+c+";"}else{if(a==">"){b+=">"}else{if(a=="<"){b+="<"}else{if(a=="&"){b+="&"}else{b+=e.charAt(d)}}}}}return b};Evernote.Clip.unicodeEntities=function(d){var a="";if(typeof d=="string"){for(var b=0;b127){a+="&#"+e+";"}else{a+=d.charAt(b)}}}return a};Evernote.Clip.isHtmlElement=function(a){return Evernote.isHtmlElement(a)};Evernote.Clip.trimString=function(a){return Evernote.trimString(a)};Evernote.Clip.collapseString=function(a){return Evernote.collapseString(a)};Evernote.Clip.nodeFilter=null;Evernote.Clip.prototype.title=null;Evernote.Clip.prototype.location=null;Evernote.Clip.prototype.window=null;Evernote.Clip.prototype.selectionFinder=null;Evernote.Clip.prototype.deep=true;Evernote.Clip.prototype.content=null;Evernote.Clip.prototype.range=null;Evernote.Clip.prototype._stylingStrategy=null;Evernote.Clip.prototype._verboseLog=false;Evernote.Clip.prototype.initialize=function(b,a){this.title=(typeof b.document.title=="string")?b.document.title:"";this.title=Evernote.Clip.collapseString(this.title);this.location=b.location;this.window=b;this.selectionFinder=new Evernote.SelectionFinder(b.document);this.range=null;if(a){this.setStylingStrategy(a)}};Evernote.Clip.prototype.isFullPage=function(){return !this.hasSelection()};Evernote.Clip.prototype.hasSelection=function(){if(this.selectionFinder.hasSelection()){return true}else{this.findSelection();return this.selectionFinder.hasSelection()}};Evernote.Clip.prototype.findSelection=function(){this.selectionFinder.find(this.deep)};Evernote.Clip.prototype.getSelection=function(){if(this.hasSelection()){return this.selectionFinder.selection}return null};Evernote.Clip.prototype.getRange=function(){if(this.hasSelection()){return this.selectionFinder.getRange()}return null};Evernote.Clip.prototype.getBody=function(){return this.window.document.getElementsByTagName("body")[0]};Evernote.Clip.prototype.hasBody=function(){try{var a=this.getBody();return a?true:false}catch(b){return false}};Evernote.Clip.prototype.hasContentToClip=function(){return(this.hasBody()||this.hasSelection())};Evernote.Clip.prototype.clipBody=function(){if(!this.hasBody()){Evernote.logger.debug("Document has no body...");return false}return this.clipElement(this.getBody())};Evernote.Clip.prototype.clipElement=function(a){if(a&&Evernote.Clip.isHtmlElement(a)){var b=0;var c=0;if(this._verboseLog){Evernote.logger.debug("Getting element contents: "+this);b=new Date().getTime()}this.content=this.serializeDOMNode(a,null,true);if(this._verboseLog){c=new Date().getTime();Evernote.logger.debug("Clipped element contents in "+(c-b)+" seconds")}if(typeof this.content!="string"){return false}return true}else{Evernote.logger.debug("Nothing to clip...");return false}};Evernote.Clip.prototype.clipSelection=function(){if(!this.hasSelection()){Evernote.logger.debug("No selection to clip");return false}if(Evernote.Clip.constants.isIE){this.content=this.selectionFinder.selection.htmlText;return true}var a=0;var b=0;this.range=this.getRange();if(this.range){if(this._verboseLog){var a=new Date().getTime()}this.content=this.serializeDOMNode(this.range.commonAncestorContainer);if(this._verboseLog){var b=new Date().getTime()}this.range=null;if(this._verboseLog){Evernote.logger.debug("Success...");Evernote.logger.debug("Clipped selection in "+(b-a)+" seconds")}return true}this.range=null;Evernote.logger.debug("Failed to clip selection");return false};Evernote.Clip.prototype.clipLink=function(a,b){if(typeof a!="string"){a=this.window.document.location.href}if(typeof b!="string"){b=Evernote.Clip.collapseString(this.window.document.title)}this.content=""+b+"";return true};Evernote.Clip.prototype.rangeIntersectsNode=function(a){if(this.range){var c=a.ownerDocument.createRange();try{c.selectNode(a)}catch(b){c.selectNodeContents(a)}return this.range.compareBoundaryPoints(Range.START_TO_END,c)==1&&this.range.compareBoundaryPoints(Range.END_TO_START,c)==-1}return false};Evernote.Clip.prototype.serializeDOMNode=function(g,i,c){if(this._verboseLog){Evernote.logger.debug("Clip.serializeDOMNode")}var k="";if(!c){if(this.range&&!this.rangeIntersectsNode(g)){if(this._verboseLog){Evernote.logger.debug("Skipping serialization of node: "+g.nodeName+" cuz it's not in range...")}return k}if(!this.keepNode(g)){if(this._verboseLog){Evernote.logger.debug("Skipping seralization of node: "+g.nodeName+" cuz it's a no-keeper")}return k}}if(this._verboseLog){Evernote.logger.debug("SerializeDOMNode: "+g.nodeName)}if(g.nodeType==3){if(this._verboseLog){Evernote.logger.debug("Serializing text node...")}if(this.range){if(this.range.startContainer==g&&this.range.startContainer==this.range.endContainer){k+=this.constructor.HTMLEncode(g.nodeValue.substring(this.range.startOffset,this.range.endOffset))}else{if(this.range.startContainer==g){k+=this.constructor.HTMLEncode(g.nodeValue.substring(this.range.startOffset))}else{if(this.range.endContainer==g){k+=this.constructor.HTMLEncode(g.nodeValue.substring(0,this.range.endOffset))}else{if(this.range.commonAncestorContainer!=g){k+=this.constructor.HTMLEncode(g.nodeValue)}}}}}else{k+=this.constructor.HTMLEncode(g.nodeValue)}}else{if(g.nodeType==1){if(this.range&&this.range.commonAncestorContainer==g&&this.range.startContainer!=this.range.commonAncestorContainer&&!this.isListNode(g)){if(this._verboseLog){Evernote.logger.debug("Ignoring range ancestor: "+g.nodeName)}}else{if(this._verboseLog){Evernote.logger.debug("Serializing node: "+g.nodeName)}var d=this.translateNodeName(g);k+="<"+d;var b=this.nodeAttributesToString(g);if(b.length>0){k+=" "+b}if(this.getStylingStrategy()){if(this._verboseLog){Evernote.logger.debug("Styling node: "+g.nodeName)}var l=this.getStylingStrategy().styleForNode(g,i);if(this._verboseLog){Evernote.logger.debug(l)}if(l instanceof Evernote.ClipStyle&&l.length>0){k+=' style="'+l.toString()+'"'}else{if(this._verboseLog){Evernote.logger.debug("Empty style...")}}}if(!g.hasChildNodes()&&this.isSelfClosingNode(g)){if(this._verboseLog){Evernote.logger.debug("Closing self-closing tag: "+g.nodeName)}k+="/>"}else{k+=">"}}if(g.nodeName.toLowerCase()!="iframe"&&g.hasChildNodes()){var f=g.childNodes;for(var h=0;h0&&e.nodeName!="SCRIPT"&&e.nodeName!="IFRAME"){var a=this.serializeDOMNode(e,g);if(a&&a.length>0){k+=a}}}}if(this.range&&this.range.commonAncestorContainer==g&&!this.isListNode(g)){if(this._verboseLog){Evernote.logger.debug("Ignoring range ancestor: "+g.nodeName)}}else{if(g.hasChildNodes()||!this.isSelfClosingNode(g)){k+=""}}}}return k};Evernote.Clip.prototype.keepNodeAttr=function(a){return(typeof a=="string"&&typeof Evernote.Clip.NOKEEP_NODE_ATTRIBUTES[a.toLowerCase()]=="undefined")};Evernote.Clip.prototype.keepNode=function(a){if(a){if(a.nodeType==3){return true}else{if(a.nodeType==1){if(a.nodeName.indexOf("#")==0||!this.isNodeVisible(a)){return false}return(typeof Evernote.Clip.NOKEEP_NODE_NAMES[a.nodeName.toLowerCase()]=="undefined"&&this.nodeFilter(a))}}}return false};Evernote.Clip.prototype.nodeFilter=function(a){if(typeof Evernote.Clip.nodeFilter=="function"){return Evernote.Clip.nodeFilter(a)}return true};Evernote.Clip.prototype.isNodeVisible=function(a){var b=this.getNodeStylePropertyValue(a,"display");return(b&&b!="none")};Evernote.Clip.prototype.isSelfClosingNode=function(a){return(a&&typeof Evernote.Clip.SELF_CLOSING_NODE_NAMES[a.nodeName.toLowerCase()]!="undefined")};Evernote.Clip.prototype.isListNode=function(a){return(a&&a.nodeType==1&&typeof Evernote.Clip.LIST_NODE_NAMES[a.nodeName.toLowerCase()]!="undefined")};Evernote.Clip.prototype.nodeAttributesToString=function(f){var g="";var d=f.attributes;if(d!=null){for(var e=0;e0){g+=b+'="'+c+'" '}}}return g.replace(/\s+$/,"")};Evernote.Clip.prototype.translateNodeName=function(a){if(typeof Evernote.Clip.NODE_NAME_TRANSLATIONS[a.nodeName.toLowerCase()]!="undefined"){return Evernote.Clip.NODE_NAME_TRANSLATIONS[a.nodeName.toLowerCase()]}return a.nodeName};Evernote.Clip.prototype.getNodeStyle=function(c,b,a){return Evernote.ClipStyle.getNodeStyle(c,b,a)};Evernote.Clip.prototype.getNodeStylePropertyValue=function(c,d){if(c&&typeof c.nodeType=="number"&&c.nodeType==1&&typeof d=="string"){var g=c.ownerDocument;var a=null;try{a=(g.defaultView)?g.defaultView:this.window}catch(f){if(this._verboseLog){Evernote.logger.debug("Could not obtain parent window. Using default.")}a=this.window}if(typeof a.getComputedStyle=="function"){var b=a.getComputedStyle(c,null);return b.getPropertyValue(d)}else{if(typeof c.currentStyle=="object"&&c.currentStyle!=null){return c.currentStyle[d]}}}return null};Evernote.Clip.prototype.setStylingStrategy=function(a){if(typeof a=="function"&&Evernote.inherits(a,Evernote.ClipStylingStrategy)){this._stylingStrategy=new a(this.window)}else{if(a instanceof Evernote.ClipStylingStrategy){this._stylingStrategy=a}else{if(a==null){this._stylingStrategy=null}}}};Evernote.Clip.prototype.getStylingStrategy=function(){return this._stylingStrategy};Evernote.Clip.prototype.toString=function(){return"Clip["+this.location+"] "+this.title};Evernote.Clip.prototype.getLength=function(){var b=0;var c=this.toDataObject();for(var a in c){b+=(""+c[a]).length+a.length+2}b-=1;return b};Evernote.Clip.prototype.toDataObject=function(){return{content:this.content,title:this.title,url:this.location.href,fullPage:this.isFullPage()}};Evernote.ClipStyle=function(a,b){this.initialize(a,b)};Evernote.ClipStyle.stylePrefix=function(b){if(typeof b=="string"){var a=0;if((a=b.indexOf("-"))>0){return b.substring(0,a)}}return b};Evernote.ClipStyle.prototype.length=0;Evernote.ClipStyle.prototype.filter=null;Evernote.ClipStyle.prototype._verboseLog=false;Evernote.ClipStyle.prototype.initialize=function(b,c){if(c){this.setFilter(c)}try{if(CSSRuleList&&b instanceof CSSRuleList){if(b.length>0){for(var a=0;a0){for(var a=0;a0){for(var b=0;b0){for(var e in d){f(e,d[e])}}}};Evernote.ClipStyle.prototype.removeStyleIgnoreValue=function(a){this.removeStyle(a,function(d,c,b){return true})};Evernote.ClipStyle.styleInArray=function(c,b){if(typeof c!="string"||!(b instanceof Array)){return false}var a=-1;var c=c.toLowerCase();var d=((a=c.indexOf("-"))>0)?c.substring(0,a).toLowerCase():c.toLowerCase();for(var a=0;a0){for(var a in this){if(typeof this[a]!="string"||typeof this.constructor.prototype[a]!="undefined"||this[a].length==0){continue}b+=a+":"+this[a]+";"}}return b};Evernote.ClipStyle.getNodeStyle=function(f,d,c){var b=new Evernote.ClipStyle();if(f&&typeof f.nodeType=="number"&&f.nodeType==1){var h=f.ownerDocument;var a=null;try{a=(h.defaultView)?h.defaultView:window}catch(g){Evernote.logger.debug("Could not obtain default view... using default window");a=window}if(d){if(typeof a.getComputedStyle=="function"){b=new Evernote.ClipStyle(a.getComputedStyle(f,null),c)}else{if(typeof f.currentStyle=="object"&&f.currentStyle!=null){b=new Evernote.ClipStyle(f.currentStyle,c)}}}else{if(typeof a.getMatchedCSSRules=="function"){b=new Evernote.ClipStyle(a.getMatchedCSSRules(f),c)}else{try{if(typeof CSSStyleDeclaration!="undefined"&&f.style instanceof CSSStyleDeclaration&&f.style.length>0){b=new Evernote.ClipStyle(f.style,c)}}catch(g){}}}}return b};Evernote.SelectionFinder=function(a){this.initDocument=a;this.document=a};Evernote.SelectionFinder.prototype.initDocument=null;Evernote.SelectionFinder.prototype.document=null;Evernote.SelectionFinder.prototype.selection=null;Evernote.SelectionFinder.prototype.findNestedDocuments=function(g){var c=new Array();var h=null;var f=null;try{h=g.getElementsByTagName("frame")}catch(d){Evernote.logger.debug("Could not get all the frames in the document")}if(h.length>0){for(var b=0;b0){for(var b=0;b0)}var a=this.getRange();if(a&&(a.startContainer!=a.endContainer||(a.startContainer==a.endContainer&&a.startOffset!=a.endOffset))){return true}return false};Evernote.SelectionFinder.prototype.find=function(a){var b=this._findSelectionInDocument(this.document,a);this.document=b.document;this.selection=b.selection};Evernote.SelectionFinder.prototype.getRange=function(){if(!this.selection||this.selection.rangeCount==0){return null}if(typeof this.selection.getRangeAt=="function"){return this.selection.getRangeAt(0)}else{var a=this.document.createRange();a.setStart(this.selection.anchorNode,this.selection.anchorOffset);a.setEnd(this.selection.focusNode,this.selection.focusOffset);return a}return null};Evernote.SelectionFinder.prototype._findSelectionInDocument=function(j,k){var b=null;var h=false;var f=null;try{f=(j.defaultView)?j.defaultView:window}catch(g){Evernote.logger.debug("Could not retrieve default view... using default window");f=window}if(typeof f.getSelection=="function"){b=f.getSelection();if(b&&typeof b.rangeCount!="undefined"&&b.rangeCount>0){h=true}}else{if(f.selection&&typeof f.selection.createRange=="function"){b=f.selection.createRange();if(typeof f.selection.type=="Text"&&typeof b.htmlText=="string"&&b.htmlText.length>0){h=true}}else{if(j.selection&&j.selection.createRange){b=j.selection.createRange();if(typeof j.selection.type=="Text"&&typeof b.htmlText=="string"&&b.htmlText.length>0){h=true}}}}if(b&&!h&&k){Evernote.logger.debug("Empty range, trying frames");var c=this.findNestedDocuments(j);Evernote.logger.debug("# of nested docs: "+c.length);if(c.length>0){for(var d=0;d0){return a}}}}}return{document:j,selection:b}};Evernote.ClipStylingStrategy=function(a){this.initialize(a)};Evernote.ClipStylingStrategy.prototype._verboseLog=false;Evernote.ClipStylingStrategy.prototype.initialize=function(a){this.window=a};Evernote.ClipStylingStrategy.prototype.styleForNode=function(b,a){return null};Evernote.ClipStylingStrategy.prototype.getNodeStyle=function(c,b,a){return Evernote.ClipStyle.getNodeStyle(c,b,a)};Evernote.ClipTextStylingStrategy=function(a){this.initialize(a)};Evernote.inherit(Evernote.ClipTextStylingStrategy,Evernote.ClipStylingStrategy);Evernote.ClipTextStylingStrategy.FORMAT_NODE_NAMES={b:null,big:null,em:null,i:null,small:null,strong:null,sub:null,sup:null,ins:null,del:null,s:null,strike:null,u:null,code:null,kbd:null,samp:null,tt:null,"var":null,pre:null,listing:null,plaintext:null,xmp:null,abbr:null,acronym:null,address:null,bdo:null,blockquote:null,q:null,cite:null,dfn:null};Evernote.ClipTextStylingStrategy.STYLE_ATTRS={font:null,text:null,color:null};Evernote.ClipTextStylingStrategy.prototype.isFormatNode=function(a){return(a&&a.nodeType==1&&typeof Evernote.ClipTextStylingStrategy.FORMAT_NODE_NAMES[a.nodeName.toLowerCase()]!="undefined")};Evernote.ClipTextStylingStrategy.prototype.hasTextNodes=function(b){if(b&&b.nodeType==1&&b.childNodes.length>0){for(var a=0;ac.name})}}};Evernote.CSSSelector.prototype.getAttributeMap=function(){var a={};if(this.attributes){for(var b=0;b0){b+="."+this.classes.join(".")}if(this.attributes&&this.attributes.length>0){for(var a=0;a=-90&&m<=90&&typeof c=="number"&&!isNaN(c)&&c>=-180&&c<=180){g.latitude=m;g.longitude=c}if(h&&h instanceof Evernote.Clip){g.content=h.content}for(var j in g){var l=document.createElement("input");l.setAttribute("type","hidden");l.setAttribute("name",j);l.value=g[j];Evernote.logger.debug(l);f.appendChild(l)}return f};Evernote.createClip=function(options){var opts=Evernote.extend({},Evernote.CLIP_OPTIONS,(typeof options=="object"&&options!=null)?options:{});if(typeof opts.styling=="string"){switch(opts.styling.toLowerCase()){case"none":opts.styling=null;break;case"text":opts.styling=Evernote.ClipTextStylingStrategy;break;case"full":opts.styling=Evernote.ClipFullStylingStrategy;break;default:opts.styling=Evernote.ClipTextStylingStrategy}}var clip=new Evernote.Clip(window,opts.styling);if(typeof opts.filter=="function"){clip.nodeFilter=opts.filter}else{if(typeof opts.filter=="string"){try{var _noteit_temp_F=undefined;eval("var _noteit_temp_F = "+opts.filter);if(typeof _noteit_temp_F=="function"){clip.nodeFilter=_noteit_temp_F}}catch(e){}}}var contentElement=null;if(typeof opts.content=="string"){clip.content=opts.content}else{if(Evernote.Clip.isHtmlElement(opts.content)){clip.clipElement(opts.content)}else{if(typeof opts.contentId=="string"&&(contentElement=window.document.getElementById(opts.contentId))){clip.clipElement(contentElement)}else{if(typeof opts.contentUrl=="string"){Evernote.Ajax.get({url:opts.contentUrl,async:false,success:function(data,status,xhr){clip.content=data},error:function(xhr,status,error){alert("Error retrieving clip content!");clip.content=""}})}else{contentElement=document.getElementsByTagName("BODY")[0];if(contentElement){clip.clipElement(contentElement)}else{clip.clipLink(opts.url,opts.title)}}}}}if(opts.signature){if(typeof opts.signature=="string"){clip.content+="
"+opts.signature}else{if(Evernote.Clip.isHtmlElement(opts.signature)){var signatureClip=new Evernote.Clip(window,opts.styling);signatureClip.clipElement(opts.signature);if(signatureClip.content){clip.content+="
"+signatureClip.content}}}}if(opts.header){if(typeof opts.header=="string"){clip.content=opts.header+clip.content}else{if(Evernote.Clip.isHtmlElement(opts.header)){var headerClip=new Evernote.Clip(window,opts.styling);headerClip.clipElement(opts.header);if(headerClip.content){clip.content=headerClip.content+clip.content}}}}if(opts.footer){if(typeof opts.header=="string"){clip.content+=opts.footer}else{if(Evernote.Clip.isHtmlElement(opts.footer)){var footerClip=new Evernote.Clip(window,opts.styling);footerClip.clipElement(opts.footer);if(footerClip.content){clip.content+=footerClip.content}}}}return clip};Evernote.doClip=function(m){var b=(typeof m=="object"&&m!=null)?m:{};if(typeof b.content=="undefined"&&typeof b.contentId=="undefined"&&typeof b.contentUrl=="undefined"){if(typeof b.filter!="function"){b.filter=function(n){if(typeof event=="object"&&event!=null&&event.target&&n==event.target){return false}for(var e=0;e0){b.content=l[l.length-1]}else{if(l.length>0){var h=l[l.length-1];var d=Evernote.getElementClassNames(h);var j=Evernote.findChildren(b.content,function(n){for(var e=0;e1){b.content=h}}}}var g=Evernote.createClip(b);var f=document.getElementById(Evernote.CLIP_FORM_ATTRIBUTES.id);if(f){f.parentNode.removeChild(f)}var c=Evernote.createClipForm(g,b);var i=document.getElementsByTagName("body")[0];var a=window.open(Evernote.CLIP_WINDOW_ATTRIBUTES.windowUrl,Evernote.CLIP_WINDOW_ATTRIBUTES.windowName,Evernote.CLIP_WINDOW_ATTRIBUTES.windowOptions);if(i){var f=document.getElementById(Evernote.CLIP_FORM_ATTRIBUTES.id);if(typeof f=="object"&&f!=null&&typeof f.parentNode=="object"&&typeof f.parentNode!=null){f.parentNode.removeChild(f)}i.appendChild(c);c.submit();try{a.window.focus()}catch(k){}}};