




if (typeof(disqus_iframe_css) == 'undefined') {
	disqus_iframe_css = '';
}
if (typeof(disqus_def_name) == 'undefined') {
	disqus_def_name = '';
}
if (typeof(disqus_def_email) == 'undefined') {
	disqus_def_email = '';
}
if (typeof(disqus_skip_auth) == 'undefined') {
	disqus_skip_auth = false;
}
if (typeof(disqus_default_text) == 'undefined') {
	disqus_default_text = 'Type your comment here.';
}

(function(){
	
	var ie = document.uniqueID
		&& document.compatMode
		&& !window.XMLHttpRequest
		&& document.execCommand ;

	try {
		if(!!ie) {
			document.execCommand("BackgroundImageCache", false, true);
		}
	} catch(e) {};
})();

var Dsq = new function() {
	this.container = document.getElementById('dsq-content');
	this.jsonData = {"reactions": [{"body": "Great webinar, Robert, I posted some of my thoughts here http://cli.gs/L4bDzV", "author_name": "Jorge Escobar", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064332, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#ddfb9d00-4917-4dbb-9bcb-af4174ad6fe6", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/jungleg/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "Where are your users and where are your servers? Scaling globally. When did you move away from managed hosting and run your own racks? What do you consider successful site responsiveness? Have you noticed positive correlation between really quick page loads and user engagement?", "author_name": "Niall Kennedy", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064331, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#f7166730-4778-40b6-8614-6b36d6130275", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/niall/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "Just posted some comments on FF for you on scalability here http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839/Help-I-m-clueless-about-Web-Service/", "author_name": "Susan Beebe", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064294, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/b8ac2625-bd00-8b95-6fd7-6eb5dea44227#330755e5-aa3e-4c33-a488-d2820d1c89e6", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/susanbeebe/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "SCALABILITY actually refers to the concept of a Production Application running withing acceptable SLA limits without downtime or performance degradation, which can be caused by a slew of offending issues.  Volumes have been written about scalability.  Focus on key bottlenecks: bandwidth, infrastructure hardware, application design, data storage, especially as it pertains to database / query design.   Sometimes large queries, reports, sprocs, batch jobs can hose a good app (needs smart devs to op...", "author_name": "Susan Beebe", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064330, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#5d6f5b62-4c36-4433-97c8-8d1433f87772", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/susanbeebe/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "Cont'd:  CAPACITY PLANNING involves all 7 layers of the OSI model.  GO from the electrical plug in the wall to the \"presentation\" layer (screen) of the customer's view of your product.  Now consider all the potential SPF (single points of failure) along the way; whether that be core infrastructure issues like bandwidth, load balancing (web servers handling the load), memory caching, DNS, optimized O/S, application design, database design, well structured queries, smart technologies like Java and...", "author_name": "Susan Beebe", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064329, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#bcac7c90-7c23-44e7-8c06-1ec9248c83db", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/susanbeebe/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "Scalability is all about CAPACITY PLANNING.  Numerous aspects of systems design (and potential failure) must be examined and well planned in order to avert potential future failures.  In an ideal world, you'd know the limits your system will need to scale to.  But we don't live in a perfect world now do we.  So product managers must work with IT architects to build a system that can \"scale\" to meet burgeoning demands as their product \"takes off\".   Get your crystal ball out to start forecasting ...", "author_name": "Susan Beebe", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064328, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#8f4c2eb3-71f2-4bb0-8dd3-f0dccc043ed7", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/susanbeebe/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "Scoble: get them to talk about each of their stacks and why they like them, with as much detail as possible. I know ff, for example, uses a lot of python and java, for which parts of the system do they use java? what do they use as datastore/db? etc.. In any case, sounds like an interesting panel.", "author_name": "Mario Romero", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064296, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/0010e774-1add-c8ad-5eb5-ec8f438b9be7#e6144629-e0a6-4af6-9ae8-ddb58d9280f8", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/mariorz/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "3. I\u2019m not the only interviewer here. You will take over and fill in the pothole in my own knowledge (we\u2019ll get you involved via Skype). It\u2019s free. It\u2019s open to you.", "author_name": "Erhan Erdogan", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064295, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/edf46117-2daf-d9a6-0b41-033f79353ce6#921ea8ed-b7f3-4b0a-b96c-50ce543cd400", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/erhan/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "My main interest in scalability (and the most problematic in my 10 years of experience) is always the database. I'd ask if there's a rule of thumb for the design of databases to support a truly scalable application.", "author_name": "Jorge Escobar", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064327, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#ba1d5cf1-0dfe-446e-8fc1-4fbf027d0ca1", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/jungleg/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}, {"body": "I'd suggest that database sharding is a bandaid solution for the wrong up-front architecture.", "author_name": "Jason Carreira", "source_url": "http://www.ubervu.com/conversations/scobleizer.com/2008/10/05/help-im-clueless-about-web-service-scalability/", "id": 1064326, "get_service_url": "http://friendfeed.com/", "title": "", "url": "http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839#7a08b4c4-bd76-429d-90b8-31b6aa6a7bcd", "source": "ubervu", "get_service_name": "friendfeed", "avatar_url": "http://friendfeed.com/jasoncarreira/picture?size=large", "author_url": "", "date_created": "1 year ago", "retweets": []}], "has_more_reactions": true, "users": {"3c280fb67445c07899bca40ec5863ec8": {"username": "svetainiu kurimas", "tumblr": "", "display_name": "svetainiu kurimas", "url": "http://disqus.com/guest/3c280fb67445c07899bca40ec5863ec8/", "registered": false, "linkedin": "", "blog": "http://www.adf.lt/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "ba7f01ec9e8334f6a376aaa90b34d320": {"username": "frederic sidler", "tumblr": "", "display_name": "frederic sidler", "url": "http://disqus.com/guest/ba7f01ec9e8334f6a376aaa90b34d320/", "registered": false, "linkedin": "", "blog": "http://www.mixin.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/49/1796/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "76bec4a07dd0fbf7ae96718a4c7f2ee1": {"username": "Ryan", "tumblr": "", "display_name": "Ryan", "url": "http://disqus.com/guest/76bec4a07dd0fbf7ae96718a4c7f2ee1/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "afca891739c061109a271ce34ab93f4e": {"username": "Palaniappan C", "tumblr": "", "display_name": "Palaniappan C", "url": "http://disqus.com/guest/afca891739c061109a271ce34ab93f4e/", "registered": false, "linkedin": "", "blog": "http://twitter.com/palam", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "3553f5e0db0fd1ec4e40a932a2d8f5b3": {"username": "Robert Scoble", "tumblr": "", "display_name": "Robert Scoble", "url": "http://disqus.com/guest/3553f5e0db0fd1ec4e40a932a2d8f5b3/", "registered": false, "linkedin": "", "blog": "http://scobleizer.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/4069/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "861717d5514c0b985ffe918dcbe5ab79": {"username": "Hillel Glazer", "tumblr": "", "display_name": "Hillel Glazer", "url": "http://disqus.com/guest/861717d5514c0b985ffe918dcbe5ab79/", "registered": false, "linkedin": "", "blog": "http://www.agilecmmi.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "b6c1028fc3f24edb78ebcd4255940f16": {"username": "danielmcvicar", "tumblr": "", "display_name": "danielmcvicar", "url": "http://disqus.com/guest/b6c1028fc3f24edb78ebcd4255940f16/", "registered": false, "linkedin": "", "blog": "http://www.magmawave.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "ed34ded19e6a757f6668d31da178180c": {"username": "Fredrik Wennberg", "tumblr": "", "display_name": "Fredrik Wennberg", "url": "http://disqus.com/guest/ed34ded19e6a757f6668d31da178180c/", "registered": false, "linkedin": "", "blog": "http://fwennber.blogspot.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "04d6b8e8d3c68899ac88eb8623392150": {"username": "Eric Florenzano", "tumblr": "", "display_name": "Eric Florenzano", "url": "http://disqus.com/guest/04d6b8e8d3c68899ac88eb8623392150/", "registered": false, "linkedin": "", "blog": "http://www.eflorenzano.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/12/4469/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "ca071ac11e05d98b7b7ef767e14f07eb": {"username": "Guest", "tumblr": "", "display_name": "Guest", "url": "http://disqus.com/guest/ca071ac11e05d98b7b7ef767e14f07eb/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "5bb6071aabc72f0a8e2236ddd078b3f0": {"username": "Glen", "tumblr": "", "display_name": "Glen", "url": "http://disqus.com/guest/5bb6071aabc72f0a8e2236ddd078b3f0/", "registered": false, "linkedin": "", "blog": "http://glencampbell.name/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/16/6688/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "be437fe04fc3c2e02c913389781c1da1": {"username": "Eric", "tumblr": "", "display_name": "Eric", "url": "http://disqus.com/guest/be437fe04fc3c2e02c913389781c1da1/", "registered": false, "linkedin": "", "blog": "http://startuplessonslearned.blogspot.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "b4da2c7629bef12da09f08aeb0d07528": {"username": "Girish", "tumblr": "", "display_name": "Girish", "url": "http://disqus.com/guest/b4da2c7629bef12da09f08aeb0d07528/", "registered": false, "linkedin": "", "blog": "http://giri.sh/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "b94043c391f82e81f5778f72e0caaca7": {"username": "Robert Sanchez", "tumblr": "", "display_name": "Robert Sanchez", "url": "http://disqus.com/guest/b94043c391f82e81f5778f72e0caaca7/", "registered": false, "linkedin": "", "blog": "http://www.createoddjobs.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "aaf1d1eb153f80b12ac522593dce5967": {"username": "ecokind", "tumblr": "", "display_name": "ecokind", "url": "http://disqus.com/guest/aaf1d1eb153f80b12ac522593dce5967/", "registered": false, "linkedin": "", "blog": "http://www.ecokinddesign.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "c37958825ac63d002592cd83dc89d3ee": {"username": "Kent Langley", "tumblr": "", "display_name": "Kent Langley", "url": "http://disqus.com/guest/c37958825ac63d002592cd83dc89d3ee/", "registered": false, "linkedin": "", "blog": "http://www.productionscale.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "1849b9ffc5d24ae540b9a461a2e41a3f": {"username": "Frank Mashraqi", "tumblr": "", "display_name": "Frank Mashraqi", "url": "http://disqus.com/guest/1849b9ffc5d24ae540b9a461a2e41a3f/", "registered": false, "linkedin": "", "blog": "http://mashraqi.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "6bd21bc30fabdb5b2cdd6d494531cc27": {"username": "Simon", "tumblr": "", "display_name": "Simon", "url": "http://disqus.com/guest/6bd21bc30fabdb5b2cdd6d494531cc27/", "registered": false, "linkedin": "", "blog": "http://www.800px.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "82d02c809cba556e1d88970c8613cdfc": {"username": "paul", "tumblr": "", "display_name": "paul", "url": "http://disqus.com/guest/82d02c809cba556e1d88970c8613cdfc/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "c4ae93a360b5e88752f9c7f5791d8605": {"username": "Ted Murphy", "tumblr": "", "display_name": "Ted Murphy", "url": "http://disqus.com/guest/c4ae93a360b5e88752f9c7f5791d8605/", "registered": false, "linkedin": "", "blog": "http://www.speak-tome.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/100/2322/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "0c8097e888667353e77f8f4b95f2adcb": {"username": "Bob Dole", "tumblr": "", "display_name": "Bob Dole", "url": "http://disqus.com/guest/0c8097e888667353e77f8f4b95f2adcb/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "324e880d3eb0789bf551ab987bd0fa06": {"username": "Steve Borsch", "tumblr": "", "display_name": "Steve Borsch", "url": "http://disqus.com/guest/324e880d3eb0789bf551ab987bd0fa06/", "registered": false, "linkedin": "", "blog": "http://www.iconnectdots.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "03841a5c4bf91b1170056af1121a9dd9": {"username": "sidereal", "tumblr": "", "display_name": "sidereal", "url": "http://disqus.com/guest/03841a5c4bf91b1170056af1121a9dd9/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "219fe3f8deb82ab58eec9e43891dd2cc": {"username": "maa", "tumblr": "", "display_name": "maa", "url": "http://disqus.com/guest/219fe3f8deb82ab58eec9e43891dd2cc/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "04e841b03cf536824a37370d64fb4928": {"username": "penguinsix", "tumblr": "", "display_name": "penguinsix", "url": "http://disqus.com/guest/04e841b03cf536824a37370d64fb4928/", "registered": false, "linkedin": "", "blog": "http://www.penguinsix.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/14/3814/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "d770907b1cbd63c5011d66cad680d952": {"username": "mike ashworth", "tumblr": "", "display_name": "mike ashworth", "url": "http://disqus.com/guest/d770907b1cbd63c5011d66cad680d952/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "f1f189dc759b92b6bd9509d3ad70b1d7": {"username": "Tuomas Tanner", "tumblr": "", "display_name": "Tuomas Tanner", "url": "http://disqus.com/guest/f1f189dc759b92b6bd9509d3ad70b1d7/", "registered": false, "linkedin": "", "blog": "http://iki.fi/tksu", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "152c0f18b3ee8b0e455da18ab0181aa0": {"username": "Stephen Pierzchala", "tumblr": "", "display_name": "Stephen Pierzchala", "url": "http://disqus.com/guest/152c0f18b3ee8b0e455da18ab0181aa0/", "registered": false, "linkedin": "", "blog": "http://newestindustry.org/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "59514f082a71183dcc5288041abb2a04": {"username": "Molly Scofield", "tumblr": "", "display_name": "Molly Scofield", "url": "http://disqus.com/guest/59514f082a71183dcc5288041abb2a04/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "e7886aae84b3fbee39cf5b35effa24d7": {"username": "Jon Hancock", "tumblr": "", "display_name": "Jon Hancock", "url": "http://disqus.com/guest/e7886aae84b3fbee39cf5b35effa24d7/", "registered": false, "linkedin": "", "blog": "http://shellshadow.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "86c7434de2782172a2a0ffe251032f23": {"username": "Eric Lorentz", "tumblr": "", "display_name": "Eric Lorentz", "url": "http://disqus.com/guest/86c7434de2782172a2a0ffe251032f23/", "registered": false, "linkedin": "", "blog": "http://unholyknight.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "c660216c96c1b958ac35ef565da27573": {"username": "Robert Accettura", "tumblr": "", "display_name": "Robert Accettura", "url": "http://disqus.com/guest/c660216c96c1b958ac35ef565da27573/", "registered": false, "linkedin": "", "blog": "http://robert.accettura.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/24800/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "alistairc": {"username": "alistairc", "tumblr": "", "display_name": "alistairc", "url": "http://disqus.com/alistairc/", "registered": true, "linkedin": "", "blog": "http://www.bitcurrent.com/", "remote_domain": null, "points": 1, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": true, "flickr": "", "twitter": "", "remote_domain_name": ""}, "afd03476557a6734de899cd772038396": {"username": "robw", "tumblr": "", "display_name": "robw", "url": "http://disqus.com/guest/afd03476557a6734de899cd772038396/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "5246b2005d0372f80582a01ed26453d6": {"username": "Geoffrey Wiseman", "tumblr": "", "display_name": "Geoffrey Wiseman", "url": "http://disqus.com/guest/5246b2005d0372f80582a01ed26453d6/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "29fb65f2660b15a0553f4f8b723d55e6": {"username": "Niall Kennedy", "tumblr": "", "display_name": "Niall Kennedy", "url": "http://disqus.com/guest/29fb65f2660b15a0553f4f8b723d55e6/", "registered": false, "linkedin": "", "blog": "http://www.niallkennedy.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/uploads/anonusers/36/9776/avatar92.jpg", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "f7e7ee4998d2b852ec3dd1de3f4cc038": {"username": "Pete Austin", "tumblr": "", "display_name": "Pete Austin", "url": "http://disqus.com/guest/f7e7ee4998d2b852ec3dd1de3f4cc038/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "ff9a4779476c368c280ae4dec7dec0ed": {"username": "Tim Shisler", "tumblr": "", "display_name": "Tim Shisler", "url": "http://disqus.com/guest/ff9a4779476c368c280ae4dec7dec0ed/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "304394e850deab862833a76c9c641009": {"username": "Matt M.", "tumblr": "", "display_name": "Matt M.", "url": "http://disqus.com/guest/304394e850deab862833a76c9c641009/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "0b5b0b62c913c5b0e33641050e746bcc": {"username": "David Sifry", "tumblr": "", "display_name": "David Sifry", "url": "http://disqus.com/guest/0b5b0b62c913c5b0e33641050e746bcc/", "registered": false, "linkedin": "", "blog": "http://www.sifry.com/alerts/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "450d5f580c17d4c98b1e68402b66cc3a": {"username": "Robert", "tumblr": "", "display_name": "Robert", "url": "http://disqus.com/guest/450d5f580c17d4c98b1e68402b66cc3a/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "b4c3ffb5bf1dc58676ee4d427cb250da": {"username": "Freeman", "tumblr": "", "display_name": "Freeman", "url": "http://disqus.com/guest/b4c3ffb5bf1dc58676ee4d427cb250da/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "d899b035c4414c1b03a8943c7f5ff9c0": {"username": "matt m", "tumblr": "", "display_name": "matt m", "url": "http://disqus.com/guest/d899b035c4414c1b03a8943c7f5ff9c0/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "014e8d024a4b9e03046892b321d12cbc": {"username": "epiquest", "tumblr": "", "display_name": "epiquest", "url": "http://disqus.com/guest/014e8d024a4b9e03046892b321d12cbc/", "registered": false, "linkedin": "", "blog": "http://fred67.com/", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}, "f3b41bc009a402017febfab746770bc5": {"username": "jonas", "tumblr": "", "display_name": "jonas", "url": "http://disqus.com/guest/f3b41bc009a402017febfab746770bc5/", "registered": false, "linkedin": "", "blog": "", "remote_domain": null, "points": null, "facebook": "", "avatar": "http://media.disqus.com/images/noavatar92.png", "delicious": "", "is_remote": false, "verified": false, "flickr": "", "twitter": "", "remote_domain_name": ""}}, "forum": {"use_media": true, "name": "Scobleizer", "streaming_realtime": true, "url": "scobleizer", "allow_anon_post": true, "reactions_enabled": true, "reply_position": 1, "show_avatar": true, "allow_anon_votes": false, "disqus_auth_disabled": false}, "realtime_enabled": true, "request": {"username": "", "is_global_moderator": false, "sharing": {}, "sort": 4, "forum": "scobleizer", "is_initial_load": true, "is_authenticated": false, "timestamp": "2009-12-17_09:52:42", "remote_domain": "", "page": 1, "is_moderator": false, "display_username": "", "points": null, "subscribe_on_post": 2, "moderator_can_edit": false, "is_remote": false, "is_verified": false, "missing_perm": "locked"}, "realtime_paused": false, "posts": {"9710523": {"up_voted": false, "ip": "", "has_replies": false, "message": "I'd definitely include a question of how the issue of scalability \"showed up\" for each of them.  It is likely different.<br>- What were the symptoms?<br>- What part of the architecture or system was the most limiting factor?<br>- What did they do about it that wasn't just volume/capacity adjustments with more boxes?<br>- What was the most innovative thing that was created to deal with scale?  Did they make any new/interesting algorithms, techniques, methods, etc.?<br>- They're probably not done dealing with scalability, what are their ongoing efforts to improve?<br>- Was scalability always/only about technology?  What about processes and people scalability?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_09:03:41", "killed": false, "user_key": "861717d5514c0b985ffe918dcbe5ab79", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710524": {"up_voted": false, "ip": "", "has_replies": false, "message": "Hi Robert,<br><br>Sounds like an amazingly interesting webinar. I guess the question I would ask is, how exactly do you test your efficiency and scalability before hand, so that you can be modestly prepared for that overnight 6 million user count?<br><br>Also, will this be available after the conference? I registered on Fast Company, but I will have to working as the conference is live. Thank you Scobleizer", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_11:09:13", "killed": false, "user_key": "b94043c391f82e81f5778f72e0caaca7", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710525": {"up_voted": false, "ip": "", "has_replies": false, "message": "Hi Scoble,<br><br>I regularly speak at conferences about scalability including 4 sessions this year at MySQL Conference. In the past I helped scale Fotolog (then the 13th largest website on the Internet) to achieve a 10x growth without adding any database server. Most recently I presented a session at Dave McClure's Startonomics about Startup Scalability Strategies: How to grow up without blowing up. I regularly help candidates preparing for their interviews. You can reach me at 5 5 1 6 5 5 5 5 9 0 and within 30 minutes I can help you cover major ground in terms of strategies, approaches and tools to become scalable.<br><br>Regarding at what point a Startup should consider scalability:<br><a href=\"http://startonomics.com/blog/startup-scalability-strategies-how-important-is-being-scalable/\" rel=\"nofollow\">http://startonomics.com/blog/startup-scalabilit...</a><br><a href=\"http://mashraqi.com/2008/09/startonomics-startup-scalability.html\" rel=\"nofollow\">http://mashraqi.com/2008/09/startonomics-startu...</a><br><a href=\"http://startonomics.com/blog/scalability-for-start-ups-how-to-grow-up-without-blowing-up/\" rel=\"nofollow\">http://startonomics.com/blog/scalability-for-st...</a><br><br>Talk to you soon,<br><br>thanks,<br>Frank", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_09:37:18", "killed": false, "user_key": "1849b9ffc5d24ae540b9a461a2e41a3f", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710526": {"up_voted": false, "ip": "", "has_replies": false, "message": "High Scalability is a good website to keep up with. They recently had a post on the \"7 stages of scaling web apps.\" The problem is that so many of these smaller websites simply keep reinventing the wheel; very few of the problems they face are new, and there are known ways of scaling sites, especially at places like Yahoo! and Google that have been doing it for years.<br><br>I wrote a blog post on this issue last month at <a href=\"http://blog.broadpool.com/2008/09/23/it-goes-to-11/\" rel=\"nofollow\">http://blog.broadpool.com/2008/09/23/it-goes-to...</a> .  I guess the biggest questions for most listeners would be, \"How do I get there? I can't start from where Yahoo! starts, so how do I build a site so that it can grow over time?\" The other question would be, \"How do I handle success? What do I need to do to ensure that, should my web app be wildly successful, we don't die because of it?\"", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_09:37:48", "killed": false, "user_key": "5bb6071aabc72f0a8e2236ddd078b3f0", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710527": {"up_voted": false, "ip": "", "has_replies": false, "message": "Thanks for reaching out on this interview prep. I can't think of anything more important to the future of cloud computing, user experience and lower blood pressure globally than scalability!<br><br>Ironic that tomorrow is the 3 year anniversary of a post I did entitled, \"Web 2.0 Conference: The Dirty Little Secret\": <a href=\"http://www.iconnectdots.com/ctd/2005/10/web_20_conferen.html\" rel=\"nofollow\">http://www.iconnectdots.com/ctd/2005/10/web_20_...</a> where I talked about the complete and utter lack of ANY discussion of scalability or latency. It was all about \"just build it\" which made me shudder.<br><br><br><br>Here are some key questions to ask:<br><br>1) There are two audiences for scalability, developers and users, but they have one shared goal, performance. Are there any best practices or benchmarks for how fast a web app or page SHOULD parse? Is there a min-max window of performance developers should target?<br><br>- Developers want application performance but balanced with a need to optimize conflicting priorities (e.g., delivering fast web apps but needing to wait for an ad server to deliver a personalized advertisement).<br><br>- Users don't care about the monetization demands...they just want the app to work and be nearly as good an experience as a desktop app (though willing to make a trade-off for having stuff in the cloud accessible from anywhere with different device types)<br><br><br>2) We all know there are accelerating internet loads from an ever-increasing number of broadband users, apps in the cloud, and data types like video. We've seen wildly conflicting estimates of internet capacity as well.  Are there *any* definitive internet infrastructure numbers that'll help developers, I.T. professionals or anyone creating 'net-centric strategies, to get a clue about latency, capacity and so forth going forward?<br><br>(Need to tell you that this is THE #1 biggest issue with all the startups we cover at <a href=\"http://Minnov8.com\" rel=\"nofollow\">Minnov8.com</a>. Without a PhD in network topology and infrastructure, how the hell is a handful of geeks to build and deliver a strategically sound platform or application-set?).<br><br><br>3) \"To API or not API: That is the question\". One could argue that the root cause of Twitter being the poster whale for fail was the API. It's almost comical how many have leapt on the API and are using it for all sorts of apps. So the question might not be \"API or not\", but \"when to API\"?<br><br>Good luck.<br><br>--<br>Steve", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_10:18:49", "killed": false, "user_key": "324e880d3eb0789bf551ab987bd0fa06", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710528": {"up_voted": false, "ip": "", "has_replies": false, "message": "I think you should ask whether a startup should plan to scale from the beginning, or concentrate instead of building growth and dealing with scalability later.<br><br>You have to bring up the Twitter scenario--ask them there thoughts on why Twitter failed (db scalability).<br><br>You should also ask about 'the cloud' and the future of scalability.  Is what was once a major purchase and commitment (new servers, configing and coordinating) soon to be replaced by 'cycles on the cloud'?<br><br>Ask them about scaling on LAMP vs. scaling on Windows.  :-)", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_10:11:02", "killed": false, "user_key": "04e841b03cf536824a37370d64fb4928", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710529": {"up_voted": false, "ip": "", "has_replies": false, "message": "Following the pareto principle (80% rule) what is in your opinion(s) the hitlist of tasks to scale a LAMP application on the web?  When do you feel the deadline is in terms of development and launch?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_10:19:52", "killed": false, "user_key": "c660216c96c1b958ac35ef565da27573", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710530": {"up_voted": false, "ip": "", "has_replies": false, "message": "Hi Robert,<br><br>I've picked up on one of the words you just used \"glue\". Perhaps ask them how they can build a credible, trusted Brand when they glue bits of applications together to create something for the end-user.<br><br>How, as a Brand will they cope when these services fail, how will they manage that Brand Experience. Sure, a lot of these products are free to the end user yet that doesn't mean that they should receive a shoddy or  poor or failing service.<br><br>If they choose free services in the cloud from places like Amazon and Google with no real uptime guarantees, how can they manage that?<br><br>Lots of people love twitter, yet people are having to now change their ways to use it well, de-follow, use Friendfeed, Twitter turned off sms in UK as well. All these are actually people problems and not technical problems. They impact upon the way people go about their lives.<br><br>I'd also be interested in how they plan (or if they can at all) for people using the product in ways they never imagine that impact upon their initial scope? That's kinda what happened to Twitter as well.<br><br>Mike Ashworth<br>Marketing Coach and Consultant<br>Brighton and Hove, Sussex, UK", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_03:28:22", "killed": false, "user_key": "d770907b1cbd63c5011d66cad680d952", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710531": {"up_voted": false, "ip": "", "has_replies": false, "message": "Great points raised by all.  I'd also love to know, in the face of rapid scale, what success looks like to these guys.<br><br>Fast and big can be great (and usually commands attention) but may or may not be a good indicator of success.  Likewise, how do they measure success and then revise/redeploy on the fly in response to the data.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_12:22:27", "killed": false, "user_key": "59514f082a71183dcc5288041abb2a04", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710533": {"up_voted": false, "ip": "", "has_replies": false, "message": "How can you complain about folks not being prepared to send in a job resume and turn around the next day and say you can go into something underprepared and be okay about it?<br><br>I know there is a stark difference, but really, come on. If you're allowed to ask help, why not give folks the benefit of the doubt if they flub a resume and ask them why?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_12:06:22", "killed": false, "user_key": "ff9a4779476c368c280ae4dec7dec0ed", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710534": {"up_voted": false, "ip": "", "has_replies": false, "message": "For someone that is serious about rejecting job applications if they have spelling errors, you sure don't care as much about your own blog concerning the same issue now, do ya? ;)<br><br>Admonishion? You mean admonition?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_11:37:56", "killed": false, "user_key": "b4da2c7629bef12da09f08aeb0d07528", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710535": {"up_voted": false, "ip": "", "has_replies": false, "message": "There are a number of tools out there for monitoring the efficiency and effectiveness of the web services layer, which, if any, do they use and why?<br><br>Amberpoint is the one I'm most familiar with. (<a href=\"http://www.amberpoint.com\" rel=\"nofollow\">www.amberpoint.com</a>).  I'd love to know if there are others that are different/better.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_08:30:07", "killed": false, "user_key": "450d5f580c17d4c98b1e68402b66cc3a", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710536": {"up_voted": false, "ip": "", "has_replies": false, "message": "Do you think the new more \"sexy\" interpreted languages such as Python, Ruby or PHP are more difficult to scale than the arguably faster compiled languages such as .NET and Java?<br><br>Are there some features in a language / framework that make it better suited for scaling?<br><br>Which language / platform would be ideal for building a robust easily scalable web application?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_06:16:00", "killed": false, "user_key": "f1f189dc759b92b6bd9509d3ad70b1d7", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710537": {"up_voted": false, "ip": "", "has_replies": false, "message": "I would like to know;<br><br>  * What technical infrastructure scalability models did they try (horizontal, vertical or perhaps a combination?<br>  * Scalability and resilience often go hand in hand... was resilience considered to be a known factor or a bonus when they decided to scale up or scale out?<br>  * Have they encountered any geographical scalability problems?<br>  * On what OSI-level have they concentrated the most, when trying to solve scalability issues?<br>  * How are they pro actively monitoring performance problems and on what OSI-levels are they monitoring?<br>  * From a scalability perspective \"the cloud\" can look like a good idea, but what are their thoughts on resilience in \"the cloud\"?<br><br>Fredrik Wennberg<br>IT Solution Architect", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_06:17:53", "killed": false, "user_key": "ed34ded19e6a757f6668d31da178180c", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710538": {"up_voted": false, "ip": "", "has_replies": false, "message": "Thanks for post like this!!!", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_13:33:47", "killed": false, "user_key": "3c280fb67445c07899bca40ec5863ec8", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710539": {"up_voted": false, "ip": "", "has_replies": false, "message": "Scalability is another word for saying \"how do you engineer something well\".  If you're a software engineer with enough experience, the answer is that making something scalable has no silver bullet.  You just \"write good software\".  So what does that mean?<br><br>In part it means, encapsulating your design and code at a mid to low level of granularity.  If you are strict with encapsulation techniques (following pure OO and message passing design is a solid method) it doesn't matter what languages or libraries o databases you use in each part as you simply rewrite/replace components as they become bottlenecks.<br><br>This approach allows you to get a full system bootstrapped without need to optimize components ahead of time.<br><br>The whole point of a web service is that you have a simple API and others don't care about how you implement internals.  So taking an API-centric design approach is key.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_04:37:26", "killed": false, "user_key": "e7886aae84b3fbee39cf5b35effa24d7", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710540": {"up_voted": false, "ip": "", "has_replies": false, "message": "\"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.\" Knuth, Donald<br><br>Discuss.<br><br>Do you build an application and make it scalable, or do you build a scalable application from the beginning?<br><br>Is scalability more important than functionality sometimes?<br><br>Simon.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_04:28:47", "killed": false, "user_key": "6bd21bc30fabdb5b2cdd6d494531cc27", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710541": {"up_voted": false, "ip": "", "has_replies": false, "message": "Hi Robert<br>I would use your lack of knowledge about scalability as an asset...you are a curious person, and can help someone like me who wants to learn about scalability through you.<br><br>It is sometimes better not to know too much so that you can find out.<br><br>So find out for me!<br>D", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_04:15:03", "killed": false, "user_key": "b6c1028fc3f24edb78ebcd4255940f16", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710542": {"up_voted": false, "ip": "", "has_replies": false, "message": "There are more comments on this post over on FriendFeed, including some good suggestions: <a href=\"http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839/Help-I-m-clueless-about-Web-Service/\" rel=\"nofollow\">http://friendfeed.com/e/ad1a6d75-56de-1139-792e...</a>", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_03:32:55", "killed": false, "user_key": "3553f5e0db0fd1ec4e40a932a2d8f5b3", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710543": {"up_voted": false, "ip": "", "has_replies": false, "message": "Robert,<br><br>Come up and visit us in San Francisco this week - having gone through a LOT of scalability issues with the growth of Technorati, I can give you lots of grounding on the basics, so you won't feel uncomfortable with these very smart guys.  There's a set of basic rules and principles that help out in building scalable systems - but it'd take an entire book to really talk about them all in detail. Come on up and visit - and if you want, I'll give you a sneak peek into the depths of Offbeat Guides, and how we're building to scale as well... :-)<br><br>You've got my number/email, drop me a line. It'd be great to catch up as well!!!<br><br>Dave", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_03:35:44", "killed": false, "user_key": "0b5b0b62c913c5b0e33641050e746bcc", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710545": {"up_voted": false, "ip": "", "has_replies": false, "message": "Schoobie!......I can't believe that there's 'any' on-line subject you're not well versed in, (but I love the 'magnetic' tag).<br><br>This is a work of art and you must be congratulated. It's no wonder you're everywhere we turn.<br><br>Good luck with your interview, I'm sure it'll be a great success.<br><br>Pete.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_03:43:31", "killed": false, "user_key": "014e8d024a4b9e03046892b321d12cbc", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710546": {"up_voted": false, "ip": "", "has_replies": false, "message": "I'd like to know: what metrics do you consider key to determining whether your system is scaling well? Do you run a consistent set of requests through and measure latency over time? Do you look at aggregate loads or throughput?<br><br>How do you think about ROI for time and energy invested in making your architecture more scalable?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_03:53:42", "killed": false, "user_key": "be437fe04fc3c2e02c913389781c1da1", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710547": {"up_voted": false, "ip": "", "has_replies": false, "message": "I'd take a 3 part approach:<br><br>1) Start with something very restrictive.  App Engine is somewhat close to where you should start.  You get .2 seconds to handle each request, you have no state on the server, you can't do joins or complex queries on the database, and you can't persist anything outside of the database.  At no point should you assume that any two requests will hit the same front end server, and at no point should you assume that any two database entries will be on the same DB server.<br><br>2) Ignore everything in step 1 *when necessary for your application*.  This important request needs to do a lot of heavy lifting and a few joins?  Fine.  You need to do a database query that takes 2 seconds on an empty database for a feature of marginal use?  No.  Make your application unscalable if it is necessary, but only as a conscious choice.<br><br>3) Now you've hit the big time, and your system is melting.  Add front end servers and throw session info into the database.  Federate and replicate the heck out of the database, and do everything you can to get rid of the expensive queries you added in step 2.  Generally, this will involve de-normalizing and caching as much as possible.  Add caching at every point in your app.  You should be able to hire people to help at this point.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_05:34:10", "killed": false, "user_key": "0c8097e888667353e77f8f4b95f2adcb", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710548": {"up_voted": false, "ip": "", "has_replies": false, "message": "At which point in the process of building your app do you think about scalability? For what kind of apps is it important that scalability is taken into consideration from the get go, when you're making your data model? And for what kind of apps is it not all that critical?<br><br>Also, how difficult is it to alter your data model and architecture without screwing up when you are live? Does everyone have to get an expensive DBA? Or is it mostly common sense?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_02:53:22", "killed": false, "user_key": "afca891739c061109a271ce34ab93f4e", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710549": {"up_voted": false, "ip": "", "has_replies": false, "message": "I would ask them how they develop their databases functions.<br><br>I usually develop in stages, with the first stage being very bloated with repetitive functions and calls.  After I get all of my functionality in order I work through everything and consolidate functions to make them as dynamic as I possibly can.  I've tried to plan things on paper ahead of time, but it never works out.<br><br>Do they have a development process that addresses this from the beginning, or do they go through the same stages?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_02:54:05", "killed": false, "user_key": "86c7434de2782172a2a0ffe251032f23", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710550": {"up_voted": false, "ip": "", "has_replies": false, "message": "It seems like the pain point of everybody's scalability right now lies in the database layer.  Did you use traditional methods of scaling the database (clustering, replication, etc.) or have you turned to alternatives like CouchDB and HBase, and what have been the benefits/drawbacks of your decisions in that area?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_02:57:29", "killed": false, "user_key": "04d6b8e8d3c68899ac88eb8623392150", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710551": {"up_voted": false, "ip": "", "has_replies": false, "message": "Also, how effective do you think Amazon's web services are at being a worry-free solution for this problem? What kind of apps make sense on this kind of database?<br><br>Thanks!", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_02:58:19", "killed": false, "user_key": "afca891739c061109a271ce34ab93f4e", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710552": {"up_voted": false, "ip": "", "has_replies": false, "message": "Holy smokes!  That's a bigtime interview!  Looks like you have some good answers generating.<br><br>Have a great time!<br>Amy Woidtke<br>green interior decorator<br>Seattle, WA", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_03:21:24", "killed": false, "user_key": "aaf1d1eb153f80b12ac522593dce5967", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710553": {"up_voted": false, "ip": "", "has_replies": false, "message": "Lots of the questions posed above are rather direct.  If your looking to get a conversation going amongst them, I'd ask questions which encourage some \"give-and-take\" rather than give direction to their answers.  You want to hear what these very smart dudes think is most important/relevant about the topic.  Being modest, I'd start by assuming they would ask better questions of each other than I could ask of them - after all, we are interviewing them because of their successful expertise.<br><br>Questions:<br><br>\"Individually looking at each others past projects like iLike and Friendfeed, what items in their development do you think were key to the projects success?  In a similar vein, what would you have done differently and how would it have made things better?\"<br><br>\"In hindsight, were there key players beneath the surface in these projects which played a large part in making them a success, or was the project so well defined that everyone came together equally in making it a success?  If there were key people, what did they provide to the project that you couldn't provide personally?\"", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_12:41:34", "killed": false, "user_key": "ca071ac11e05d98b7b7ef767e14f07eb", "has_been_anonymized": true, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710554": {"up_voted": false, "ip": "", "has_replies": false, "message": "First off, you need to have Katie Couric interview you on the subject.  Do whatever you can to look as clueless as possible during this interview.  This will sharply lower everybody's expectations of your performance during the real interview.<br><br>Then it should be easy to show remarkable improvement when the real interview comes around.  Everyone will be commenting about how you aced it, regardless of the fact that you will still be the least-informed individual in the room on the subject.<br><br>It's all about perception management.  Instead of comparing you to the more-informed subjects of your interview, most people will compare you to your even-less-informed previous performance.<br><br>I'm not going to tell you where I got this idea.  Just suffice it to say that political strategists are genius!", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_13:11:10", "killed": false, "user_key": "b4c3ffb5bf1dc58676ee4d427cb250da", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710555": {"up_voted": false, "ip": "", "has_replies": false, "message": "Tim: &gt;&gt;How can you complain about folks not being prepared to send in a job resume and turn around the next day and say you can go into something underprepared and be okay about it?<br><br>Who is going in unprepared. Seems this blog post just prepared me in a BIG way for Thursday!", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_14:11:57", "killed": false, "user_key": "3553f5e0db0fd1ec4e40a932a2d8f5b3", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710556": {"up_voted": false, "ip": "", "has_replies": false, "message": "Very true Robert. It was more of a gut reaction that I should've thought more about. Thanks for replying.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_15:20:52", "killed": false, "user_key": "ff9a4779476c368c280ae4dec7dec0ed", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710557": {"up_voted": false, "ip": "", "has_replies": false, "message": "I have had my share of building scalable systems in the past -- and the one thing that always came back to me was the question: is the chosen application architecture adequate to support the needs?<br><br>There are some basic topologies that everybody uses:<br><br>a) \"the sink\" uses the database as repository of every message -- write it first, let it be read second; parallelize/cluster the db server and you easily crank up the volume. This model is very popular amongst web 2.0 systems. It is limited though, as adding a db server only brings 0.75 more power.<br><br>b) \"the network\" uses pipes to distribute messages between writers and readers -- very popular in the telco industry, where speed is master and geography plays an important role. Parallelize writers and readers and you get a linear scale that depends alone on the number of servers you put in. Big disadvantage is that distributed persistence needs to be consolidated at some point -- can generate some difficult to tame data flows.<br><br>Now, ask yourself: which model was chosen by google? and which by twitter?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_15:24:07", "killed": false, "user_key": "219fe3f8deb82ab58eec9e43891dd2cc", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710558": {"up_voted": false, "ip": "", "has_replies": false, "message": "Robert,<br><br>Services are fascinating, for a couple of reasons. Sure, there are technical \"service scaling\" issues, which the other folks on the panel will know all about. Matt has great stories on the scaling of Akismet. But far more interesting are the human scaling issues. I always find more thoughtful discussions there.<br><br>First, there are terms-of-use issues. When you get to a certain size, you need to have policies for appropriate use. You wind up creating competitors, and an ecosystem emerges around your service. Look at Twitter, and the emergence of complementary products like Summize. Then look at what happened when Notchup exploited Linkedin to grab a bunch of users. How you monitor use and enforce terms of use is a big question, and it goes far beyond simple APIs and scaing.<br><br>Second, there's the fact that we're building human APIs. APIs and web services are typically focused on letting machines talk to one another. But by tying realtime activity feeds to our mobile devices, or location-based services that report our coordinates, we're plugging humans into applications, Amazon Turk style. As humans start to interact with applications via web services, through mobile devices and so on, a whole new set of scaling issues emerge.<br><br>Since you're the higher-level, human-angle participant on the panel, I'd elevate things beyond bits and bytes and into humans, policies, exploitation, and startup ecosystems.<br><br>Not sure that helps... sounds like it'll be a great panel!<br><br>A.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_15:48:01", "killed": false, "user_key": "alistairc", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": false, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710559": {"up_voted": false, "ip": "", "has_replies": false, "message": "There's a few areas I'd want to cover:<br>- Where does scalability cross paths with standards (WS-*, WSDL, UDDI) vs. simplicity (REST, POX+HTTP).<br>- Do these people think that ESB has a place in their view of scalable services?<br>- How should you look at databases differently in a service-oriented model?  (There's all sorts of sub-topics here; do services share a database, or have their own, does it vary?  2PC vs. other kinds of synchronization?  Clustered caches vs. RDBMS?)<br>- What mechanisms are important to keep instances in synch and sharing work without tripping over each other or creating new bottlenecks (messaging, database, clustered caches, etc.)?<br>- Are location-transparency/routing and directory/discovery services important to scalable SOA, or is this simply the job for DNS and load balancers?<br><br>There's tons of interesting things to talk about here, really.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_17:19:33", "killed": false, "user_key": "5246b2005d0372f80582a01ed26453d6", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710560": {"up_voted": false, "ip": "", "has_replies": false, "message": "Everyone has the internal component covered. I come at it from the outside.<br><br>How do you measure and monitor the external performance of your Web API to proactively deal with loading, connectivity, and application issues?<br><br>What is the issue you run up against most: bandwidth bottlenecks or application loads?<br><br>smp", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_17:31:10", "killed": false, "user_key": "152c0f18b3ee8b0e455da18ab0181aa0", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710561": {"up_voted": false, "ip": "", "has_replies": false, "message": "?: It seems like a lot of problems with scalability start with the current Database Server architecture.  Should a new startup looking to scale start with an alternate?  Are there production ready open source or commercially supported alternatives?  What would it take for an alternate to be considered \"safe\" like a SQL Database Server?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-06_21:02:40", "killed": false, "user_key": "304394e850deab862833a76c9c641009", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710562": {"up_voted": false, "ip": "", "has_replies": false, "message": "How do you provide guaranteed failover when ultimately your service has one IP address, cached inside the world's network of DNS servers? Anyone know, by the way?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_06:31:02", "killed": false, "user_key": "82d02c809cba556e1d88970c8613cdfc", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710563": {"up_voted": false, "ip": "", "has_replies": false, "message": "@paul: One easy thing you can do is high-availability failover where a separate server takes over the IP address (and other characteristics) of your failed server.  Check out <a href=\"http://www.linux-ha.org\" rel=\"nofollow\">www.linux-ha.org</a>.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_10:05:02", "killed": false, "user_key": "76bec4a07dd0fbf7ae96718a4c7f2ee1", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710564": {"up_voted": false, "ip": "", "has_replies": false, "message": "You need to decide how scalable you want it to be, because the architecture gets trickier with each power of 10 and the bugs subtler. You can give up on getting any sensible advice on the InterWeb for a start. With massive systems, the principle is to design your service as a cluster of sites which are as independent as possible in normal use, but which provide disaster-recovery for each other. The bottlenecks are in things like assigning a user to a site and passing messages between sites.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_12:31:52", "killed": false, "user_key": "f7e7ee4998d2b852ec3dd1de3f4cc038", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710565": {"up_voted": false, "ip": "", "has_replies": false, "message": "follow this blog if you want to know more :)<br><br><a href=\"http://highscalability.com/\" rel=\"nofollow\">http://highscalability.com/</a>", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_13:26:45", "killed": false, "user_key": "f3b41bc009a402017febfab746770bc5", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710566": {"up_voted": false, "ip": "", "has_replies": false, "message": "( <a href=\"http://highscalability.com/start-here\" rel=\"nofollow\">http://highscalability.com/start-here</a> )", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_13:27:29", "killed": false, "user_key": "f3b41bc009a402017febfab746770bc5", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710567": {"up_voted": false, "ip": "", "has_replies": false, "message": "What are your current bottlenecks? If you could install a new piece of software or rack a new piece of hardware tomorrow to solve key pain points, what would it do?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_14:06:58", "killed": false, "user_key": "29fb65f2660b15a0553f4f8b723d55e6", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710568": {"up_voted": false, "ip": "", "has_replies": false, "message": "Ask them for one scary example in their past where they screwed up and the app hit the wall.  And ask them how they fixed it.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_14:39:14", "killed": false, "user_key": "c4ae93a360b5e88752f9c7f5791d8605", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710569": {"up_voted": false, "ip": "", "has_replies": false, "message": "1) At what point in the lifecycle of your product do you start to focus on high scalability. How willing should you be to compromise performance or development time to reach it before it's strictly necessary?<br><br>2) Is true horizontal scalability ever achievable or will there always be some shared resources?<br><br>3) Is designing for scalability a reactive or proactive process?<br><br>4) Are we too eager to abandon the benefits of normalization to achieve scalability?<br><br>5) Traffic patterns, especially for smaller sites, can be extremely volatile and unpredictable. How to you design for that?<br><br>6) What's the time horizon on scalability becoming a commodity that's provided by hosting providers alongside power and ethernet?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_15:03:34", "killed": false, "user_key": "03841a5c4bf91b1170056af1121a9dd9", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710570": {"up_voted": false, "ip": "", "has_replies": false, "message": "How much consideration was given to scalability issues in your initial design?<br><br>What decisions, from your initial design, presented the largest hurdles to scaling?<br><br>What issues will you ensure are taken into consideration in your next version 0 design?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_15:46:09", "killed": false, "user_key": "d899b035c4414c1b03a8943c7f5ff9c0", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710571": {"up_voted": false, "ip": "", "has_replies": false, "message": "My Question:<br><br>How have you changed the way you develop software to improve scalability?", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_15:46:51", "killed": false, "user_key": "c37958825ac63d002592cd83dc89d3ee", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710572": {"up_voted": false, "ip": "", "has_replies": false, "message": "A good conversation starter would be to ask them about which dimensions they found to be the most challenging to scale along.<br><br>Software/system architecture is only one aspect of successfully building a scalable system. Operations, development/deployment processes, monitoring and so on all make a big different to the scalability of any system.", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-07_15:53:45", "killed": false, "user_key": "afd03476557a6734de899cd772038396", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}, "9710573": {"up_voted": false, "ip": "", "has_replies": false, "message": "Hosting<br>Which provider would they choose today if they would need to built a new service that could face a scalability problem.<br><br>Limitation/Marketing<br>Is an invitation procedure a good way to manage the number of users accessing the platform. Would it frustrate the people not authorized to access the system or would it force them to find alternative ways to beta test it ;-)", "is_last_child": false, "can_reply": false, "down_voted": false, "real_date": "2008-10-08_17:35:46", "killed": false, "user_key": "ba7f01ec9e8334f6a376aaa90b34d320", "has_been_anonymized": false, "edited": false, "author_is_moderator": false, "from_request_user": null, "votable": true, "date": "1 year ago", "approved": true, "num_replies": 0, "is_first_child": false, "email": "", "parent_post_id": null, "depth": 0, "points": 0, "author_is_creator": false, "is_realtime": false}}, "integration": {"receiver_url": "", "theme": 4, "reply_position": true, "disqus_logo": false}, "timer": {"timer_url": "http://localhost:8005", "thread_id": "18360842", "user_id": "anonymous", "forum_id": "125200", "hash": 6161982678535184281}, "thread": {"total_posts": 0, "paginate": false, "per_page": 0, "slug": "help_i8217m_clueless_about_web_service_scalability", "num_pages": 1, "days_alive": 0, "realtime_paused": true, "id": 18360842, "num_posts": 49, "closed": true, "queued": false, "killed": false}, "reactions_limit": 10, "context": {"show_reply": false, "use_fb_connect": true, "forum_facebook_key": "faaf467d0f47abde553c3b8e0e1b3570", "use_yahoo": false, "subscribed": false, "use_twitter_signin": true, "use_openid": false, "realtime_speed": 5000}, "reactions_start": 0, "settings": {"debug": false, "disqus_url": "http://disqus.com", "media_url": "http://media.disqus.com"}, "media_url": "http://media.disqus.com"};
	/* */ this.jsonData.cookie_messages = {"user_created": null, "post_has_profile": null, "post_twitter": null, "post_not_approved": null}; this.jsonData.session = {"url": null, "name": null, "email": null}; /* */

	
	this.curPageId = 'dsq-comments';

	this.frames = {};
};

var disqus_popup_reference = null;

if(typeof DsqLocal == 'undefined') {
	DsqLocal = {};
}



/**
 * Dsq.Strings: UI strings
 */
Dsq.Strings = new function() {
	this.ADD_NEW_COMMENT = "Add New Comment";
	this.LOG_INTO_DISQUS = "Log into DISQUS";
	this.USE_MEDIA = "Use Media";
	this.LOGOUT = "Logout";
	this.SHARING_OPTIONS = "Sharing options";
	this.SHARE_ON = "Share on";
	this.TWEET_THIS_COMMENT = "Tweet this comment";
	this.SHARE_ON_NEWSFEED = "Share on news feed";
	this.SEND_UPDATE_TO_YAHOO = "Send update to Yahoo!";
	this.REBLOG_ON = "Reblog on";
	this.CONFIGURE_OPTIONS = "Configure options";
	this.POST_AS = "Post as";
	this.SORT_BY = "Sort by";
	this.SUBSCRIBE_BY_EMAIL = "Subscribe by email";
	this.SUBSCRIBE_BY_RSS = "Subscribe by RSS";
	this.POPULAR_NOW = "Popular now";
	this.BEST_RATING = "Best Rating";
	this.NEWEST_FIRST = "Newest first";
	this.OLDEST_FIRST = "Oldest first";
	this.HIGHLIGHTED = "Highlighted";
	this.UNSUBSCRIBE = "Unsubscribe";
	this.REQUIRED = "Required";
	this.OPTIONAL = "Optional";
	this.YOU_ARE_COMMENTING_AS_A = "You are commenting as a";
	this.LOGIN_BELOW = "Login below";
	this.PLEASE_LOGIN_BELOW_TO_COMMENT = "Please login below to comment.";
	this.SUBSCRIBE_TO_ALL_COMMENTS_BY_EMAIL = "Subscribe to all comments by email";
	this.DO_NOT_SUBSCRIBE_TO_COMMENTS = "Do not subscribe to comments";
	this.REALTIME_UPDATING_IS = "Real-time updating is";
	this.ENABLED = "enabled";
	this.PAUSED = "paused";
	this.PAUSE = "Pause";
	this.RESUME = "Resume";
	this.SHOW = "Show";
	this.JUST_NOW = "Just now";
	this.REPLY = "Reply";
	this.EDIT = "Edit";
	this.FLAG = "Flag";
	this.MODERATE = "Moderate";
	this.CANCEL = "Cancel";
	this.REPLYING_TO = "Replying to";
	this.REPORT_MISSING_REACTIONS = "Report missing reactions";
	this.POST_A_COMMENT = "Post a comment";
	this.FLAG_INAPPROPRIATE_COMMENT = "Flag inappropriate comment";
	this.FLAGGED = "Flagged";
	this.NO = "No";
	this.YES = "Yes";
	this.NEVER_MIND = "Never mind";
	this.ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPORT_THIS_COMMENT_TO_A_MODERATOR = "Are you sure you would like to report this comment to a moderator";
	this.THIS_WILL_FLAG_COMMENTS_FOR_MODERATORS_TO_TAKE_ACTION = "This will flag comments for moderators to take action";
	this.TO_RATE_PLEASE_LOG_IN = "To rate, please log in";
	this.JUST_A_MOMENT = "Just a moment...";
	this.GUEST = "Guest";
	this.NAME = "Name";
	this.EMAIL = "Email";
  this.WEBSITE = "Website";
  this.SETTINGS = "Settings";
  this.MODERATOR_OPTIONS = "Moderator options: ";
  this.MODERATE_OPTIONS = "Moderate Options";

  // Thread moderator actions
  this.CLOSE_THREAD = "Close thread";
  this.OPEN_THREAD = "Open thread";
  this.REMOVE_THREAD = "Remove thread";
  this.RESTORE_THREAD = "Restore thread";
  this.ACTIONS = "Actions";
};
// Dsq.Strings

/**
 * Dsq.FmtStrings: functions that return interpolated UI strings
 */
Dsq.FmtStrings = new function() {
	// Seems we have to use named interpolation for Django to translate. Investigate more.
	this.LOGGED_IN_AS = function(username) {
		return Dsq.Utils.interpolate('Logged in as %(username)s', {username:username});
	};

	this.LOGOUT_FROM = function(disqus) {
		return Dsq.Utils.interpolate('Logout from %(disqus)s', {disqus:disqus});
	};

	this.SHOWING_COMMENTS_FULL = function(total, num) {
		if (num === 1) {
			return Dsq.Utils.interpolate("Showing <span id='dsq-num-posts'>%(num)s</span> of <span id='dsq-total-posts'>%(total)s</span> comment", {num:num, total:total});
		} else {
			return Dsq.Utils.interpolate("Showing <span id='dsq-num-posts'>%(num)s</span> of <span id='dsq-total-posts'>%(total)s</span> comments", {num:num, total:total});
		}
	};

	this.SHOWING_COMMENTS_WITHOUT_PAGINATION = function(num) {
		if (num === 1) {
			return Dsq.Utils.interpolate("Showing <span id='dsq-num-posts'>%(num)s</span> comment", {num:num});
		} else {
			return Dsq.Utils.interpolate("Showing <span id='dsq-num-posts'>%(num)s</span> comments", {num:num});
		}
	};

	this.NUMBER_OF_COMMENTS = function(num) {
		return Dsq.Utils.interpolate(
			(num == 1
				? '%(num)s comment'
				: '%(num)s comments'
			), {num:num});
	};

	this.NUMBER_OF_LIKES = function(num) {
		return Dsq.Utils.interpolate(
			(num == 1
				? '%(num)s like'
				: '%(num)s likes'
			), {num:num});
	};

	this.NUMBER_OF_POINTS = function(num) {
		return Dsq.Utils.interpolate(
			(num == 1
				? '%(num)s point'
				: '%(num)s points'
			), {num:num});
	};
};
// Dsq.FmtStrings





Dsq.CSRF_TOKEN = 'a2d140c59df8cd4ce27a20e0829cacd8';
Dsq.COMMENTS_RE = /(<li.*?id="?dsq-comment-(\d+)"?.*?>)((?:.|\s)*?)(<\/li>)/gim;
Dsq.POST_RE = /(<div.*?id="?dsq-comment-header-(\d+)"?.*?>)((?:.|\s)*?)(<\/div>)\s*(<div.*?class="?dsq-comment-body"?.*?>)((?:.|\s)*)(<\/div>)/gim;
Dsq.POST_BODY_RE = /\s*(<div.*?id="?dsq-comment-message-(\d+)"?.*?>)((?:.|\s)*)(<\/div>)/gim;
// HACK: Safari ends with "-->" while other browsers end with "--&gt;" as expected.
Dsq.MEDIA_POST_RE = /&lt;!--\[(.*?)\]--(?:>|&gt;)/gim;



var FragmentPacket = function(reader, writer, writer_url, is_child, receiveCallback) {
	var that = this;
	this.reader = reader;
	this.writer = writer;
	this.writer_url = writer_url;

	this.is_child = is_child || false;
	this.receiveCallback = receiveCallback;

	this._lastHash = null;

	this._accumMsg = '';

	this._lastSeqno = 0;

	this.MAX_DATA_LEN	= 1024;

	this.WAIT_TIME		= 10;

	this.READY		= 0x1;
	this.WRITING	= 0x2;
	this.FIN		= 0x4;
	this.ACK		= 0x8;

};

FragmentPacket.prototype.createListener = function() {
	var that = this;
	var listener = function() {
		that.recv();
	};
	return window.setInterval(listener, 10);
};

FragmentPacket.prototype.log = function(msg) {



};

FragmentPacket.prototype.recv = function() {
	var hash;
	if (/MSIE/.test(navigator.userAgent)) {

		hash = this.reader.name;
	} else {

		var hashIndex = this.reader.location.href.indexOf('#');
		if (hashIndex == -1) {
			return;
		}
		hash = this.reader.location.href.substring(hashIndex+1);
	}
	var flags = parseInt(hash.substring(0, 4), 10);
	var seqno = parseInt(hash.substring(4, 24), 10);
	var data  = hash.substring(24);

	if (this._lastHash !== hash) {
		this._lastHash = hash;
		this.log('recv: ' + hash);

		this.log(' flags: ' + flags);
		this.log(' seqno: ' + seqno + ' len: ' + hash.substring(4, 24).length + ' (' + hash.substring(4, 24) + ')');
		this.log(' data: ' + data + ' len: ' + data.length);

		this._lastSeqno = seqno;

		if (flags & this.WRITING) {
			this._accumMsg += data;
			this.sendFlag(this.ACK, seqno);
			if (flags & this.FIN) {
				this.log('recv finished: ' + decodeURIComponent(this._accumMsg));
				this.receiveCallback(decodeURIComponent(this._accumMsg));

				this._accumMsg = '';

				this.sendFlag(this.READY | this.ACK, this._lastSeqno);
			}
		}
	}

	return {
		flags: flags,
		seqno: seqno,
		data: data
	};
};

FragmentPacket.prototype.sendRawPacket = function(packet) {
	if (/MSIE/.test(navigator.userAgent)) {
		this.writer.name = packet;
	} else {

		this.writer.location.href = this.writer_url + '#' + packet;
	}

};

FragmentPacket.prototype.sendFlag = function(flag, seqno) {
	this.sendRawPacket(this._zerofill(flag, 4) + this._zerofill(seqno, 20));
};

FragmentPacket.prototype.send = function(msg) {
	this._send(0, encodeURIComponent(msg));
};

FragmentPacket.prototype._send = function(packetNum, msg) {
	var that = this;
	var recvBuf = this.recv();

	if (packetNum === 0) {

		if (!(recvBuf.flags & this.READY)) {
			this.log('client is not ready, waiting...');
			window.setTimeout(function() { that._send(packetNum, msg); }, this.WAIT_TIME);
			return;
		}
	} else {

		if (!( (recvBuf.flags & this.ACK) && (recvBuf.seqno === this._lastSeqno) )) {
			this.log('waiting for ack from client...');
			window.setTimeout(function() { that._send(packetNum, msg); }, this.WAIT_TIME);
			return;
		} else {
			this.log('received ack: ' + this._lastSeqno + ' ' + recvBuf.seqno);
		}
	}

	var flags = this.WRITING;
	var num_packets = Math.ceil(msg.length / this.MAX_DATA_LEN);
	this.log('num_packets: ' + num_packets);

	if (num_packets === packetNum) {

		this.log('message successfully sent!');
		this.sendFlag(this.READY | this.ACK, this._lastSeqno);
		return true;
	}

	this._lastSeqno++;

	if (packetNum == num_packets-1) {
		flags |= this.FIN;
	}

	var data = msg.substring(packetNum * this.MAX_DATA_LEN, (packetNum+1) * this.MAX_DATA_LEN);
	var packet = this._zerofill(flags, 4) + this._zerofill(this._lastSeqno, 20) + data;

	this.log('sending raw packet: ' + packet);
	this.sendRawPacket(packet);

	return this._send(packetNum + 1, msg);
};

FragmentPacket.prototype._zerofill = function(num, width) {
	var retval = num.toString();
	var retval_len = retval.length;
	for (var i = 0; i < width - retval_len; i++) {
		retval = '0' + retval;
	}
	return retval;
};

var PostMessagePacket = function(receiver, receiveCallback, id, receiverId) {
	var that = this;
	this.receiver = receiver;
	this.receiveCallback = receiveCallback;
	this.id = id;


	this.receiverId = receiverId;
};

PostMessagePacket.prototype.createListener = function() {
	var that = this;

	var listener = function(e) {

		if (!that.id) {
			that.id = e.data;
			return;
		}


		var id = e.data.split(';')[0];
		if (id !== that.id) {
			return;
		}
		var data = e.data.substring(e.data.indexOf(';') + 1);

		that.receiveCallback(data);
	};

	if (typeof window.attachEvent == 'function') {
		window.attachEvent('onmessage', listener);
	} else if (typeof window.addEventListener == 'function') {
		window.addEventListener('message', listener, false);
	} else {
		throw new Error('No method found to create event listener for PostMessagePacket.');
	}
};

PostMessagePacket.prototype.send = function(msg) {



	var needs_reget = false;
	try {
		if (typeof this.receiver.id == 'undefined' || typeof this.receiver.postMessage == 'undefined') {
			needs_reget = true;
		}
	} catch(e) {


	}
	if (needs_reget && typeof this.receiverId != 'undefined') {
		this.receiver = document.getElementById(this.receiverId).contentWindow;
	}

	var packet;
	if (!msg) {

		packet = this.id;
	} else {
		packet = this.id + ';' + msg;
	}
	this.receiver.postMessage(packet, '*');
};

PostMessagePacket._last_unique_id = null;
PostMessagePacket._get_unique_id = function() {
	var id = (new Date()).getTime();
	if (id == PostMessagePacket._last_unique_id) {
		id++;
	}
	PostMessagePacket._last_unique_id = id;
	return id.toString();
};

var JsonRpc = function() {

	this.ids = {};

	this.objectToJSON = function(obj) {
		var json = '';
		var results = [];

		if (obj === undefined || obj === null) {
			return 'null';
		}

		switch (obj.constructor) {
			case Object:
				for (var property in obj) {
					if (obj.hasOwnProperty(property)) {
						results.push(this.objectToJSON(property) + ': ' + this.objectToJSON(obj[property]));
					}
				}
				json = '{' + results.join(', ') + '}';
				break;
			case Array:
				for (var i = 0; i < obj.length; i++) {
					results.push(this.objectToJSON(obj[i]));
				}
				json = '[' + results.join(', ') + ']';
				break;
			case Number:
			case Boolean:
				json = obj.toString();
				break;
			case String:

				var specialChars = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\'};

				json = obj.replace(/[\x00-\x1f\\]/g, function(match) {
					var ch = specialChars[match];
					return ch ? ch : '\\u00' + match.charCodeAt().toPaddedString(2, 16);
				});

				json = '"' + json.replace(/"/g, '\\"') + '"';
				break;
			default:

				json = 'null';
				break;
		}

		return json;
	};

	this.createHandler = function(send_func, registered_funcs) {
		var that = this;
		var handler = function(message) {

			try {
				var rpc = eval('(' + message + ')');
			} catch(e) {
				alert('bad JSON: ' + message);
				return;
			}
			if (rpc.method) {

				if (!registered_funcs[rpc.method]) {
					return;
				}

				var retval = registered_funcs[rpc.method].apply(null, rpc.params);
				if (rpc.id) {
					var response = {
						result: retval,
						error: null,	// TODO
						id: rpc.id
					};
					send_func(that.objectToJSON(response));
				}
			} else if(rpc.result) {

				if (!that.ids[rpc.id]) {
					return;
				}

				that.ids[rpc.id](rpc.result);
				delete that.ids[rpc.id];
			}
		};
		return handler;
	};

	this.execute = function(send_func, method, params, response_callback) {
		response_callback = response_callback || null;
		var id = (response_callback) ? (new Date()).getTime() : null;

		var request = {
			method: method,
			params: params,
			id: id
		};

		send_func(this.objectToJSON(request));

		if (id) {
			this.ids[id] = response_callback;
		}
	};
};
JsonRpc = new JsonRpc();

var ParentMessenger = function(childUrl, receiverUrl, container, receiveCallback) {


	if (navigator.userAgent.indexOf('Safari') >= 0 && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf('Version/') + 8), 10) == 3) {
		throw new Error("unsupported.");
	} else if (window.opera) {
		throw new Error("unsupported.");
	}



	if (!receiverUrl &&
		navigator.userAgent.indexOf('Gecko') >= 0 &&
		parseFloat(navigator.userAgent.slice(navigator.userAgent.indexOf('rv:') + 3, navigator.userAgent.indexOf('rv:') + 6)) < 1.9) {
		throw new Error("unsupported.");
	}


	if (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)) {


		if (document.domain == window.location.hostname) {
			receiverUrl = '';
		}
	}

	var that = this;
	this.childUrl = childUrl;
	this.receiverUrl = receiverUrl;
	this.container = container || document.body;

	this.packetHandler = null;


	this._ready = false;
	this._error = false;


	var _createReceiverForFragmentPacket = function() {

		that.receiver = document.createElement('iframe');
		that.receiver.src = receiverUrl;
		that.receiver.id = 'receiver_' + (new Date()).getTime();
		that.receiver.name = that.receiver.id;

		that.receiver.frameBorder = '0';
		that.receiver.frameSpacing = '0';
		that.receiver.style.borderStyle = 'none';

		var receiver_onload = function() {
			var receiver = document.getElementById(that.receiver.id).contentWindow;

			try {
				receiver.document.body.innerHTML = '';
			} catch(e) {

				that._error = true;
			}
			receiver.document.body.style.padding = '0px';
			receiver.document.body.style.margin = '0px';

			var child = receiver.document.createElement('iframe');
			child.id = 'child';
			child.name = 'child';
			child.src = that.childUrl;

			child.frameBorder = '0';
			child.frameSpacing = '0';
			child.style.borderStyle = 'none';
			child.style.width = '100%';
			child.style.height = '100%';
			receiver.document.body.appendChild(child);

			that.child = receiver.document.getElementById('child').contentWindow;
			that.receiver = receiver;

			that.packetHandler = new FragmentPacket(that.receiver, that.child, that.childUrl, false, receiveCallback);

			that._listener = that.packetHandler.createListener();

			that.packetHandler.sendFlag(that.packetHandler.READY, 0);

			that._ready = true;
		};

		that.receiver.onreadystatechange = function() {
			if (this.readyState == 'complete') {
				receiver_onload();
			}
		};

		that.receiver.onload = receiver_onload;







		if (Dsq.Utils.ie) {
			if (that.container.clientWidth === 0) {

				var _waitForWidth = function() {
					if (that.container.clientWidth > 0) {
						Dsq.Utils.fixIframesIE(that.container.id);
					} else {
						window.setTimeout(_waitForWidth, 100);
					}
				};
				_waitForWidth();

				that._once = false;
				that.receiver.onresize = function() {
					if (!that._once) {
						Dsq.Utils.fixIframesIE(that.container.id);
					}
					that._once = true;
				};
			}
		}

		that.container.appendChild(that.receiver);
	};


	var _createReceiverForPostMessage = function() {

		var receiver_onload = function() {

			that.packetHandler.send();
			that._ready = true;
		};

		var id = PostMessagePacket._get_unique_id();
		var receiverId = 'child_' + id;


		ParentMessenger['_receiver_onload_' + receiverId] = receiver_onload;

		that.container.innerHTML += '<iframe ' +
			'src="' + childUrl + '" ' +
			'id="' + receiverId + '" ' +
			'name="' + receiverId + '" ' +
			'onload="ParentMessenger._receiver_onload_' + receiverId +'();" ' +
			'></iframe>';

		that.receiver = document.getElementById(receiverId).contentWindow;
		that.packetHandler = new PostMessagePacket(that.receiver, receiveCallback, id, receiverId);
		that._listener = that.packetHandler.createListener();
	};

	if (typeof window.postMessage == 'function') {
		_createReceiverForPostMessage();
	} else {
		_createReceiverForFragmentPacket();
	}

};

ParentMessenger.prototype.sendMessage = function(message) {
	var that = this;
	if (!this._ready) {

		window.setTimeout(function() { that.sendMessage(message); }, 10);
		return;
	}
	this.packetHandler.send(message);
	return true;
};

Dsq.NewFrames = function(url) {
	this.url = url;
};

Dsq.NewFrames.prototype.init = function(onFailure) {
	var that = this;

	try {
		this.messenger = new ParentMessenger(this.url, Dsq.jsonData.integration.receiver_url, this.container, this.receive_callback);
	} catch(e) {
		if (typeof onFailure == 'function') {
			onFailure();
		}
	}

	if (typeof onFailure == 'function') {
		var iId = window.setInterval(function() {
			if (typeof that.messenger == 'undefined') {
				window.clearInterval(iId);
				return;
			}
			if (that.messenger._ready) {
				window.clearInterval(iId);
			} else if (that.messenger._error) {
				window.clearInterval(iId);
				onFailure();
			}
		}, 10);
	}
};

Dsq.NewFrames.prototype._execute = function(method, args, callback) {
	var that = this;
	if (typeof that.messenger == 'undefined') {
		return false;
	}
	JsonRpc.execute(
		function(msg) { that.messenger.sendMessage(msg); },
		method,
		args || [],
		callback);
	return true;
};

Dsq.ReplyFrame = function(container, parent_post_id) {
	var that = this;
	this.container = container;
	this.parent_post_id = parent_post_id;

	var sendFunc = function(msg) {

		Dsq.Debug.log('Dsq.ReplyFrame.sendFunc');
		that.messenger.sendMessage(msg);
	};


	var postComment_onSuccess = function(response) {
		Dsq.jsonData.posts[response.message.id] = response.message.post_meta;
		if (!Dsq.jsonData.users[response.message.post_meta.user_key]) {
			Dsq.jsonData.users[response.message.post_meta.user_key] = response.message.user_meta;
		}


		var reply_position = (typeof(disqus_insert_wrt_sort) == 'undefined' 
			? (Dsq.jsonData.forum.reply_position ? -1 : null) 
			: (Dsq.jsonData.request.sort == 2 ? null : -1));
		
		if (response.message.post_meta.approved) {
			Dsq.Post.insert(response.message.post_meta.parent_post_id || reply_position, response.message.id, response.message.post_meta.message);
		}

		Dsq.Templates.postComment_onSuccess(response, parent_post_id, response.message.id);
	};

	var postComment_onFailure = function(response) {
		Dsq.Popup.popModal(response.message, 'Error');
		Dsq.Templates.postComment_onFailure(response, parent_post_id, response.message.id);
	};

	var editComment_onSuccess = function(response) {
		var post_id = parent_post_id;
		var message = Dsq.$('dsq-comment-message-' + post_id);
		
		message.innerHTML = response.message;
		Dsq.Templates.toggleEdit(post_id);
		Dsq.Templates.setLoadingButton(false);
	};
	
	var editComment_onFailure = function(response) {
		var post_id = parent_post_id;
		
		Dsq.Popup.popModal('Sorry, there was an error editing this comment.', 'Edit Error');
		Dsq.Templates.toggleEdit(post_id);
		Dsq.Templates.setLoadingButton(false);
	};

	var getUserByEmail_onSuccess = function(response) {
		var msg = response.message;
		var fields = Dsq.Templates.getFormFields(parent_post_id);

		if (msg.username) {

			Dsq.Templates.lightboxAuthenticate(parent_post_id, 'login', {
				'username': msg.username,
				'display_name': msg.display_name,
				'avatar_url': msg.avatar_url,
				'verified': msg.verified,
				'email': fields.email.value
			});
		} else {

			Dsq.Templates.lightboxAuthenticate(parent_post_id, 'register');
		}
	};

	var validateAuth_onSuccess = function(response, auth_choice) {
		Dsq.Templates.postComment(parent_post_id, null, true, auth_choice);
	};

	var validateAuth_onFailure = function(response, auth_choice) {
		var pid = parent_post_id ? '-' + parent_post_id : '';
		var msg = response.message;

		if (auth_choice == 'register') {
			var fields = ['email', 'username', 'password'];

			for (var i = 0; i < fields.length; i++) {
				var field = fields[i];
				var errorDiv = Dsq.$('dsq-' + field + '-errors' + pid);

				if (msg[field]) {
					errorDiv.innerHTML = msg[field];
				} else {
					errorDiv.innerHTML = '';
				}
			}
		} else if (auth_choice == 'login') {
			Dsq.$('dsq-lightbox-errors' + pid).innerHTML = '<p>We couldn\'t log you in. Please verify your login.</p>';
		}
		
		Dsq.Templates.setLoadingButton(false);
	};

	this.receive_callback = JsonRpc.createHandler(sendFunc, {
		'postComment.onSuccess': postComment_onSuccess,
		'postComment.onFailure': postComment_onFailure,
		'editComment.onSuccess': editComment_onSuccess,
		'editComment.onFailure': editComment_onFailure,		
		'getUserByEmail.onSuccess': getUserByEmail_onSuccess,
		'validateAuth.onSuccess': validateAuth_onSuccess,
		'validateAuth.onFailure': validateAuth_onFailure,
		'reload': function() { window.location.reload(); }
	});

	this.url = Dsq.Urls.REPLY +
		'?' + (new Date()).getTime() +
		'&f=scobleizer' +
		'&t=help_i8217m_clueless_about_web_service_scalability' +
		'&ff=' + Dsq.Thread.ff +
		'&default_text=' + encodeURIComponent(disqus_default_text) +
		'&ifrs=' + encodeURIComponent(disqus_iframe_css);
	if (this.parent_post_id) {
		this.url += '&parent_post=' + this.parent_post_id;
	}
};

Dsq.ReplyFrame.prototype = new Dsq.NewFrames(Dsq.ReplyFrame.url);

Dsq.ReplyFrame.prototype.post = function(author_name, author_email, author_url, authenticate, sharing_services, subscribe) {
	this._execute('postComment', [author_name, author_email, author_url, authenticate, sharing_services, subscribe]);
};

Dsq.ReplyFrame.prototype.edit = function(post_id, message) {
	this._execute('editComment', [post_id, message]);
};

Dsq.ReplyFrame.prototype.setState = function(parent_post_id, depth) {
	this._execute('setState', [parent_post_id, depth]);
};

Dsq.ReplyFrame.prototype.getUserByEmail = function(email) {
	this._execute('getUserByEmail', [email]);
};

Dsq.ReplyFrame.prototype.validateAuth = function(auth_choice, email, username, password) {
	this._execute('validateAuth', [auth_choice, email, username, password]);
};

Dsq.ReplyFrame.prototype.authenticateFacebook = function(session, forum_url) {
	this._execute('authenticateFacebook', [session, forum_url]);
};

	Dsq.Facebook = function() {
	var that = this;

	var handleSessionData = function(session) {

		var forum_url = Dsq.jsonData.forum.url;




		if (typeof disqus_facebook_forum != 'undefined') {
			forum_url = disqus_facebook_forum;
		}
		Dsq.frames.reply_0.authenticateFacebook(session, forum_url);
	};

	var onLogin = function() {
		FB.Connect.getSignedPublicSessionData(handleSessionData);
	};

	this.login = function() {
		FB.Connect.requireSession(onLogin, true);
	};
};
Dsq.Facebook = new Dsq.Facebook();


	






Dsq.Themes = {};

Dsq.Themes.narcissus = new function() {
	this.addPostContainer = 'dsq-form-area';
	this.textareaContainer = 'dsq-textarea-wrapper';



	
	this.header = function() {
		var comments_count, total_posts, num_posts;
		var html = '';
		var missing_perm_tmpl;

		if (Dsq.jsonData.request.missing_perm) {
			missing_perm_tmpl = Dsq.Templates.missingPermissions();
			if (missing_perm_tmpl) {
				html += '<div class="dsq-missing-permissions">' + missing_perm_tmpl + '</div>';
			}
		}

		total_posts = Dsq.jsonData.thread.total_posts;
		num_posts = Dsq.jsonData.thread.num_posts;

		if (total_posts) {
			comments_count = Dsq.FmtStrings.SHOWING_COMMENTS_FULL(total_posts, num_posts);
		} else {
			comments_count = Dsq.FmtStrings.SHOWING_COMMENTS_WITHOUT_PAGINATION(num_posts);
		}

		html += ' \
		<div id="dsq-comments-title"> \
			<h3>' + comments_count + '</h3> \
		</div> \
		';

		html += ' \
		<div class="dsq-options"> \
			<span class="dsq-item-sort">'
				+ Dsq.Strings.SORT_BY + ' \
				<select id="dsq-sort-select" onchange="Dsq.Thread.sortBy(this.value);"> \
					<option value="hot" ' + (Dsq.jsonData.request.sort == 4 ? 'selected="selected"' : '') + '>' + Dsq.Strings.POPULAR_NOW + '</option> \
					<option value="best" ' + (Dsq.jsonData.request.sort == 3 ? 'selected="selected"' : '') + '>' + Dsq.Strings.BEST_RATING + '</option> \
					<option value="newest" ' + (Dsq.jsonData.request.sort == 2 ? 'selected="selected"' : '') + '>' + Dsq.Strings.NEWEST_FIRST + '</option> \
					<option value="oldest" ' + (Dsq.jsonData.request.sort == 1 ? 'selected="selected"' : '') + '>' + Dsq.Strings.OLDEST_FIRST + '</option> \
				</select> \
				&nbsp; \
			</span> \
			<span class="dsq-subscribe-email"> \
				<img src="http://media.disqus.com/images/embed/email.png" style="width:12px;height:12px;vertical-align:middle"> \
				<span id="dsq-subscribe">'
					+ (Dsq.jsonData.context.subscribed
						? '<a href="#" onclick="Dsq.Thread.subscribe(0); return false">' + Dsq.Strings.UNSUBSCRIBE + '</a>'
						: '<a href="#" onclick="Dsq.Thread.subscribe(1); return false">' + Dsq.Strings.SUBSCRIBE_BY_EMAIL + '</a>')
				+ '</span> \
			</span> \
			<span class="dsq-subscribe-rss" style="width:12px;height:12px;vertical-align:middle"> \
				<img src="http://media.disqus.com/images/embed/bullet-feed.png" alt="" /> \
				<a href="http://scobleizer.disqus.com/help_i8217m_clueless_about_web_service_scalability/latest.rss">' + Dsq.Strings.SUBSCRIBE_BY_RSS + '</a> \
			</span> \
		</div> \
		';

		
		

		return html;

	};
	
	this.footer = function() {
		var html = '';

		html += Dsq.Templates.pagination();

		
		
			html += Dsq.Templates.realtime();
			html += Dsq.Templates.showThreadSettings();
			html += Dsq.Templates.postBox();

		html += Dsq.Templates.reactions();

		
			html += Dsq.Templates.trackbacks();
		


		if (Dsq.jsonData.request.is_global_moderator) {
 			html += ' \
				<div class="dsq-global-moderator-extras">'
					+ '<strong>shortname:</strong> ' + Dsq.jsonData.forum.url
					+ '<strong>thread id:</strong> ' + Dsq.jsonData.thread.id
					+ '<strong>thread slug:</strong> ' + Dsq.jsonData.thread.slug
				+ '</div> \
			';
		}

		return html;
	};
	
	this.realtime = function() {
		var html = '';
		
		if (Dsq.jsonData.realtime_enabled) {
			html += '<div id="dsq-realtime-options" class="dsq-options">'
					 + Dsq.Strings.REALTIME_UPDATING_IS + ' <strong id="dsq-realtime-status" style="text-transform: lowercase">' + Dsq.Strings.ENABLED + '</strong>. \
					 <a href="#" id="dsq-realtime-toggle" style="text-transform: capitalize"></a> \
					</div>';
		}

		if (!Dsq.jsonData.forum.streaming_realtime) {
			html += ' \
				<div style="display: none" id="dsq-realtime-alert" class="dsq-realtime-alert"><span id="dsq-realtime-queued"></span> <a href="#" id="dsq-realtime-show"></a></div> \
			';
		}
		
		return html;
	};

	this.showThreadSettings = function() {
		if (!Dsq.jsonData.request.is_moderator) {
			return '';
		}

		html = '<div id="dsq-thread-settings" class="dsq-thread-settings">' + Dsq.Strings.MODERATOR_OPTIONS;
		html += '<a href="#" onclick="Dsq.Thread.showSettings(); return false;">' + Dsq.Strings.SETTINGS + '</a>';
		html += '<a href="#" onclick="Dsq.Thread.showModeratorActions(); return false;">' + Dsq.Strings.MODERATE + '</a>';
		if (Dsq.jsonData.forum.reactions_enabled && Dsq.jsonData.reactions.length === 0) {
			html += '<a href="#" onclick="Dsq.Reaction.reportMissingReactions(); return false;">'
						+ Dsq.Strings.REPORT_MISSING_REACTIONS
						+ '</a>';
		}
		html +='</div>';

		return html;
	};

	this.postBox = function(post_id, use_fallback_iframe) {


		var html;
		var display_sharing_options = Dsq.jsonData.request.is_authenticated;

		if (!Dsq.jsonData.request.is_authenticated && Dsq.jsonData.forum.disqus_auth_disabled && !Dsq.jsonData.forum.allow_anon_post) {
			return '';
		}
		
		if (Dsq.jsonData.request.is_remote) {


			if (!Dsq.jsonData.request.sharing.hasOwnProperty(Dsq.jsonData.request.remote_domain)) {
				display_sharing_options = false;
			}
		}
		
		if (post_id) {
			var _meta = Dsq.jsonData.posts[post_id];
			var userData = Dsq.jsonData['users'][_meta.user_key];				
		}
		
		var pid = post_id ? '-' + post_id : '';

		var _requestUserInfo = function() {
			var html;



			var user_has_email = false;

			html = '<div class="dsq-request-user-info"> <!-- // If authenticated --> \
				<a href="' + Dsq.jsonData.settings.disqus_url + Dsq.Urls.LOGOUT + '?ctkn=' + Dsq.CSRF_TOKEN + '" class="dsq-request-user-logout">' + Dsq.Strings.LOGOUT + '</a> \
				<table> \
					<tr> \
						<td rowspan="2">'
							+ (!Dsq.jsonData.forum.disqus_auth_disabled ? '<a href="' + Dsq.jsonData.settings.disqus_url + Dsq.Urls.REQUEST_USER_PROFILE + '">' : '')
								+ '<img src="' + Dsq.Urls.REQUEST_USER_AVATAR + '" width="48" height="48" class="dsq-request-user-avatar">'
							+ (!Dsq.jsonData.forum.disqus_auth_disabled ? '</a>' : '')
						+ '</td> \
						<td class="dsq-request-user-name">'
								+ (Dsq.jsonData.request.is_remote
									 ? '<span class="dsq-badge-small dsq-badge-' + Dsq.jsonData.request.remote_domain + '">' + Dsq.jsonData.request.remote_domain + '</span>'
									 : (Dsq.jsonData.request.is_verified
											? '<span class="dsq-badge-small dsq-badge-verified">Verified</span>'
											: '<span class="dsq-badge-small dsq-badge-registered">Registered</span>'))
							+ (!Dsq.jsonData.forum.disqus_auth_disabled ? ' <a href="' + Dsq.jsonData.settings.disqus_url + Dsq.Urls.REQUEST_USER_PROFILE + '">' : '') 
								+ Dsq.jsonData.request.display_username 
							+ (!Dsq.jsonData.forum.disqus_auth_disabled ? '</a>' : '')
							+  (Dsq.jsonData.request.is_remote && user_has_email ? ' <small>(<a href="#" onclick="Dsq.Popup.remoteAccountSettings(); return false;">change settings</a>)</small>' : '')
							+  (!Dsq.jsonData.request.is_remote && !Dsq.jsonData.forum.disqus_auth_disabled ? ' <small>(<a href="' + Dsq.jsonData.settings.disqus_url + '/profile/info/" target="_blank">change name</a> or <a href="' + Dsq.jsonData.settings.disqus_url + '/profile/avatar/" target="_blank">picture</a>)</small>' : '')
						+ '</td> \
					</tr> \
					<tr> \
						<td class="dsq-request-user-stats"> \
							<span><big>' + Dsq.jsonData.request.comments_count + '</big> ' + (Dsq.jsonData.request.comments_count == 1 ? 'comment' : 'comments') + '</span> \
							<span><big>' + Dsq.jsonData.request.likes_count + '</big> ' + (Dsq.jsonData.request.likes_count == 1 ? 'like' : 'likes') + '</span> \
							<span><big>' + Dsq.jsonData.request.points + '</big> ' + (Dsq.jsonData.request.points == 1 ? 'point' : 'points') + '</span> \
						</td> \
					</tr> \
				</table> \
			</div> \
			';
			return html;
		};

		var _loginOptions = function() {
			var html;
			html = ' \
			<div class="dsq-authenticate"> \
				<p class="dsq-autheneticate-copy">'
				+ (Dsq.jsonData.forum.allow_anon_post
					? Dsq.Strings.YOU_ARE_COMMENTING_AS_A + ' <a class="dsq-help" title="Click for more information" href="#" onclick="Dsq.Popup.helpBadges(); return false">Guest</a>. ' + Dsq.Strings.OPTIONAL + ': ' + Dsq.Strings.LOGIN_BELOW + '.'
					: Dsq.Strings.REQUIRED + ': ' + Dsq.Strings.PLEASE_LOGIN_BELOW_TO_COMMENT + '.')
				+ '</p> \
				<ul class="dsq-login-buttons">'
					+ (!Dsq.jsonData.forum.disqus_auth_disabled ? '<li class="dsq-login-button"><a href="#" onclick="Dsq.Popup.login(); return false"><img src="http://media.disqus.com/images/themes/narcissus/login-disqus.gif" /></a></li>' : '')
					+ (Dsq.jsonData.context.use_fb_connect ? '<li class="dsq-login-button"><a href="#" onclick="Dsq.Facebook.login(); return false;"><img src="http://media.disqus.com/images/themes/narcissus/login-facebook.gif" /></a></li>' : '')
					+ (Dsq.jsonData.context.use_twitter_signin ? '<li class="dsq-login-button"><a href="#" onclick="Dsq.Twitter.startTwitterConnect(); return false"><img src="http://media.disqus.com/images/themes/narcissus/login-twitter.gif" /></a></li>' : '')
					+ (Dsq.jsonData.context.use_openid ? '<li class="dsq-login-button"><a href="#" onclick="Dsq.OpenID.requestURL(); return false" ><img src="http://media.disqus.com/images/themes/narcissus/login-openid.gif" /></a></li>' : '')
					+ (Dsq.jsonData.context.use_yahoo ? '<li class="dsq-login-button"><a href="#" onclick="Dsq.Yahoo.startYahooConnect(); return false"><img src="http://media.disqus.com/images/themes/narcissus/login-yahoo.gif" /></a></li>' : '')
				+ '</ul> \
			</div> \
			';
			return html;
		};

		if (!Dsq.jsonData.context.show_reply) {


			if (!Dsq.jsonData.request.is_authenticated) {



				return '<div id="dsq-form-area" style="display:none"><div id="dsq-textarea-wrapper"></div></div>' + _loginOptions();
			} else {
				return '';
			}
		}

		html = ' \
		<div id="' + (post_id 
			? 'dsq-reply-post-' + post_id
			: 'dsq-new-post')
		 	+ '" class="dsq-post-area"> \
			<div class="dsq-dc-logo"> \
				<a href="http://disqus.com/comments" target="_blank"><img src="http://media.disqus.com/images/themes/narcissus/disqus-logo.png"></a> \
			</div>'
			+ (post_id 
				? '<h3>' + Dsq.Strings.REPLYING_TO + ' ' + userData.display_name + '</h3>'
				: '<h3>' + Dsq.Strings.ADD_NEW_COMMENT + '</h3>')
			+ (Dsq.jsonData.request.is_authenticated 
				? _requestUserInfo()
				: _loginOptions() )
			+ '<div id="dsq-form-area' + pid + '">'
			+ '<div class="dsq-textarea"> \
				<div class="dsq-textarea-wrapper" id="dsq-textarea-wrapper' + pid + '"></div> \
			</div>'
			+ (!Dsq.jsonData.request.is_authenticated
			? ' \
			<div class="dsq-post-fields"> \
				<table> \
					<tr> \
						<td class="dsq-post-fields-left"><div class="dsq-input-wrapper"><input id="dsq-field-name' + pid + '" type="text" value="' + (disqus_def_name ? disqus_def_name : (Dsq.jsonData.session.name ? Dsq.jsonData.session.name : Dsq.Strings.NAME + '" class="dsq-placeholder')) + '" onfocus="Dsq.Templates.handlePlaceholder(event, this, \'name\')" onblur="Dsq.Templates.handlePlaceholder(event, this, \'name\')" /></div></td> \
						<td class="dsq-post-fields-right"><div class="dsq-input-wrapper"><input id="dsq-field-website' + pid + '" type="text" value="' + (Dsq.jsonData.session.url ? Dsq.jsonData.session.url : Dsq.Strings.WEBSITE + ' (' + Dsq.Strings.OPTIONAL.toLowerCase() + ')" class="dsq-placeholder') + '" onfocus="Dsq.Templates.handlePlaceholder(event, this, \'website\')" onblur="Dsq.Templates.handlePlaceholder(event, this, \'website\')" /></div></td> \
					</tr> \
					<tr> \
						<td class="dsq-post-fields-left"><div class="dsq-input-wrapper"><input id="dsq-field-email' + pid + '" type="text" value="' + (disqus_def_email ? disqus_def_email : (Dsq.jsonData.session.email ? Dsq.jsonData.session.email : Dsq.Strings.EMAIL + '" class="dsq-placeholder')) + '" onfocus="Dsq.Templates.handlePlaceholder(event, this, \'email\')" onblur="Dsq.Templates.handlePlaceholder(event, this, \'email\')" /></div></td> \
						<td class="dsq-post-fields-right"> \
							<div class="dsq-subscribe"> \
								<a href="#" onclick="Dsq.Templates.chooseSubscribe(' + post_id + '); return false" class="dsq-subscribe-menu"><span id="dsq-subscribe-select' + pid + '">' + (Dsq.jsonData.request.subscribe_on_post ? Dsq.Strings.SUBSCRIBE_TO_ALL_COMMENTS_BY_EMAIL : Dsq.Strings.DO_NOT_SUBSCRIBE_TO_COMMENTS) + '</span> <small>&#9660;</small></a> \
								<ul class="dsq-panel" id="dsq-subscribe-menu' + pid + '"> \
									<li><a href="#" onclick="Dsq.Templates.setSubscribe(2, this, ' + post_id + '); return false">' + Dsq.Strings.SUBSCRIBE_TO_ALL_COMMENTS_BY_EMAIL + '</a></li> \
									<li><a href="#" onclick="Dsq.Templates.setSubscribe(0, this, ' + post_id + '); return false">' + Dsq.Strings.DO_NOT_SUBSCRIBE_TO_COMMENTS + '</a></li> \
								</ul> \
								<input id="dsq-subscribe-on-post' + pid + '" type="hidden" value="' + Dsq.jsonData.request.subscribe_on_post + '" /> \
							</div> \
						</td> \
					</tr> \
				</table> \
			</div>'
			: '')
			+ '<div class="dsq-post-footer"> \
				<div class="dsq-sharing-options" ' + (!display_sharing_options ? 'style="display:none;"' : '') + '> \
					<button type="button" class="dsq-button-small" onfocus="document.getElementById(\'dsq-post-button' + pid + '\').focus();"><span>' + Dsq.Strings.SHARING_OPTIONS + ' <small>&#9660;</small></span></button> \
					<div class="dsq-panel"> '
						+ (Dsq.jsonData.request.sharing.twitter !== undefined
								&& Dsq.jsonData.request.sharing.twitter.enabled === true
							? '<div><input type="checkbox" id="dsq-sharing-twitter' + pid + '"'
								  + (Dsq.jsonData.request.sharing.twitter.auto === true ? 'checked=true' : '') + '/> \
									<label for="dsq-sharing-twitter' + pid + '">' + Dsq.Strings.SHARE_ON + ' Twitter</label> \
								 </div>'
							: '')
						+ (Dsq.jsonData.request.sharing.facebook
								&& (Dsq.jsonData.request.sharing.facebook.enabled === true ||
										(Dsq.jsonData.request.is_remote && Dsq.jsonData.request.remote_domain == 'facebook'))
							? '<div><input type="checkbox" id="dsq-sharing-facebook' + pid + '"'
									+ (Dsq.jsonData.request.sharing.facebook.auto === true ? 'checked=true' : '') + '/> \
									<label for="dsq-sharing-facebook' + pid + '">' + Dsq.Strings.SHARE_ON + ' Facebook</label> \
								 </div>'
							: '')
						+ (Dsq.jsonData.request.sharing.yahoo !== undefined
								&& Dsq.jsonData.request.sharing.yahoo.enabled === true
							? '<div><input type="checkbox" id="dsq-sharing-yahoo' + pid + '"'
									+ (Dsq.jsonData.request.sharing.yahoo.auto === true ? 'checked=true' : '') + '/> \
									<label for="dsq-sharing-yahoo' + pid + '">' + Dsq.Strings.SHARE_ON + ' Yahoo!</label> \
								</div>'
							: '')
						+ (Dsq.jsonData.request.sharing.tumblr !== undefined
								&& Dsq.jsonData.request.sharing.tumblr.enabled === true
							? '<div><input type="checkbox" id="dsq-sharing-tumblr' + pid + '"'
									+ (Dsq.jsonData.request.sharing.tumblr.auto === true ? 'checked=true' : '') + '/> \
									<label for="dsq-sharing-tumblr' + pid + '">' + Dsq.Strings.SHARE_ON + ' Tumblr</label> \
								 </div>'
							: '')
						+ (Dsq.jsonData.request.sharing.wordpress !== undefined
								&& Dsq.jsonData.request.sharing.wordpress.enabled === true
							? '<div><input type="checkbox" id="dsq-sharing-wordpress' + pid + '"'
									+ (Dsq.jsonData.request.sharing.wordpress.auto === true ? 'checked=true' : '') + '/> \
									<label for="dsq-sharing-wordpress' + pid + '">' + Dsq.Strings.SHARE_ON + ' Wordpress</label> \
								 </div>'
							: '')
						+ (Dsq.jsonData.request.sharing.movabletype !== undefined
							  && Dsq.jsonData.request.sharing.movabletype.enabled === true
							? '<div><input type="checkbox" id="dsq-sharing-movabletype' + pid + '"'
									+ (Dsq.jsonData.request.sharing.movabletype.auto === true ? 'checked=true' : '') + '/> \
									<label for="dsq-sharing-movabletype' + pid + '">' + Dsq.Strings.SHARE_ON + ' Movable Type</label> \
							   </div>'
							: '')
						+ (Dsq.jsonData.request.sharing.typepad !== undefined
							  && Dsq.jsonData.request.sharing.typepad.enabled === true
							? '<div><input type="checkbox" id="dsq-sharing-typepad' + pid + '"'
									+ (Dsq.jsonData.request.sharing.typepad.auto === true ? 'checked=true' : '') + '/> \
								  <label for="dsq-sharing-typepad' + pid + '">' + Dsq.Strings.SHARE_ON + ' TypePad</label> \
							   </div>'
							: '')
						+ '<div><a href="' + Dsq.jsonData.settings.disqus_url + '/profile/connections/" target="_blank" class="dsq-configure-options">' + Dsq.Strings.CONFIGURE_OPTIONS + '</a></div>'
					+ '</div> \
				</div>'
				+ '<button type="button" class="dsq-button" id="dsq-post-button' + pid + '" onclick="Dsq.Templates.postComment(' + post_id + ', this, false)"><span>' + Dsq.Strings.POST_AS + ' '
				+ (Dsq.jsonData.request.display_username
					? Dsq.jsonData.request.display_username
					: Dsq.Strings.GUEST)
				+ '</span></button>'
				+ (post_id
					? '<button type="button" class="dsq-button" id="dsq-cancel-button' + pid + '" onclick="Dsq.Post.toggleReply(' + post_id +', this)"><span>' + Dsq.Strings.CANCEL + '</span></button>'
					: '')
			+ '</div>'
			+ '</div>' // end dsq-form-area
		+ '</div> \
		';
		
		return html;
	};




	this.appendPost = function(post_id) {
		var html = '<div id="dsq-append-post-' + post_id + '"></div>';
		return html;
	};

	this.postPrependHeader = function(post_id) {
		var html;
		var _meta = Dsq.jsonData.posts[post_id];
		var userData = Dsq.jsonData['users'][_meta.user_key];
		
		html = ' \
		<table> \
			<tr> \
				<td id="dsq-header-avatar-' + post_id + '" class="dsq-header-avatar" onmouseover="Dsq.Post.dropProfile(' + post_id + ')"> \
					<a id="dsq-avatar-' + post_id + '" class="dsq-avatar" href="' + userData.url + '" onclick="Dsq.Popup.popProfile(' + post_id + '); return false;">'
					+ (Dsq.jsonData.forum.show_avatar
					? '<img src="' + Dsq.jsonData.users[_meta.user_key].avatar + '" alt="" />'
					: '')
				+ '</a> \
				</td> \
				<td class="dsq-comment-header-meta"> \
		';

		
		return html;
	};
	
	this.postAppendHeader = function(post_id) {
		var _meta = Dsq.jsonData.posts[post_id];
		var html;
		var parent_display_name = '';
		
		if(_meta.parent_post_id) {

			var _parent_meta = Dsq.jsonData.posts[_meta.parent_post_id];

			if (_parent_meta) {
				var parentUserData = Dsq.jsonData['users'][_parent_meta.user_key];
				parent_display_name = parentUserData.display_name;
			}
		}

		html = ' \
		<img src="http://media.disqus.com/images/themes/narcissus/moderator.png" class="dsq-moderator-star" title="Moderator" /> \
		<span class="dsq-comment-header-time"><a href="#comment-' + post_id + '" onclick="Dsq.Popup.permalink(' + post_id + ')" title="Permalink">' + (_meta.is_realtime ? Dsq.Strings.JUST_NOW : _meta.date) + '</a></span> '
		+ (_meta.parent_post_id && parent_display_name
			? '<a href="#comment-' + _meta.parent_post_id + '" title="Jump to comment">in reply to ' + parent_display_name + '</a>'
			: '')
		+ '</td> \
		<td id="dsq-like-pts-' + post_id + '" class="dsq-comment-header-likes">'
		+ (_meta.points
			? _meta.points + Dsq.Utils.pluralize(_meta.points, ' person', ' people') + ' liked this.'
			: '')
		+ '</td> \
		</tr> \
		</table> \
		';
		return html;
	};

	this.preBody = function(post_id) {
		var html = '';
		return html;
	};

	this.postFooter = function(post_id) {
		var html;
		var _meta = Dsq.jsonData.posts[post_id];
		if(_meta.killed || !_meta.approved) { return ''; }
		
		html = ' \
		<div class="dsq-comment-footer" id="dsq-comment-footer-' + post_id + '"> \
			<div class="dsq-comment-footer-left">'
				+ (Dsq.jsonData.request.is_moderator || Dsq.jsonData.request.is_global_moderator
					? '<a href="#" onclick="Dsq.Templates.moderateOptions(' + post_id+ '); return false">' + Dsq.Strings.MODERATE + '</a>'
					: '')
				+ '<a href="#" id="dsq-post-report-' + post_id + '" class="dsq-post-report" onclick="Dsq.Post.report(' + post_id + ', false); return false;">' + Dsq.Strings.FLAG + '</a> \
			</div> \
			<div class="dsq-comment-footer-right">'
				+ (_meta.votable 
					? '<span id="dsq-like-' + post_id + '" class="dsq-like">'
					+ (!_meta.up_voted
						? '<button type="button" class="dsq-button-small" onclick="Dsq.Post.rate(this, ' + post_id + ', 1)" >Like</button>'
						: 'You liked this.&nbsp;&nbsp;')
					+ '</span>'
					: '')
				+ (_meta.can_reply && !_meta.has_replies && _meta.from_request_user
					? '<button type="button" class="dsq-button-small dsq-post-edit" onclick="Dsq.Post.edit(this, ' + post_id + ')" >' + Dsq.Strings.EDIT + '</button>'
					: '')
				+ (_meta.can_reply
					? '<span class="dsq-comment-footer-reply" id="dsq-comment-footer-reply-' + post_id + '" onclick="Dsq.Post.toggleReply(' + post_id +', this)"> \
						<button type="button" class="dsq-button-small">' + Dsq.Strings.REPLY + '</button> \
						<button type="button" class="dsq-comment-footer-reply-tab">' + Dsq.Strings.REPLY + '</button><span></span> \
					</span>'
					: '')
			+ '</div> \
		</div> \
		';
		
		return html;
	};



	
	this.showRetweets = function(id, limit, element_id /* Optional */) {
		var source, html = '';

		for (var i = 0, reaction; reaction = Dsq.jsonData.reactions[i]; i++) {
			if (reaction.id === id) {
				source = reaction.retweets;
			}
		}

		if (source) {
			if (limit === 0) {
				limit = source.length;
			}

			for (var j = 0; j < limit; j++) {
				var rt = source[j];
				html += '<a href="' + rt.url + '">' + rt.author_name + '</a>'	+ ((j === (limit - 1)) ? '.' : ', ');
			}
		}

		if (element_id === undefined) {
			return html;
		}

		var element = document.getElementById(element_id);
		element.innerHTML = html;
		return element;
	};

	this.showMoreReactions = function(reactions, has_more, start, limit) {
		var link = document.getElementById('dsq-show-more-reactions');
		var container = link.parentNode;
		container.removeChild(link);

		for (var i = 0, reaction; reaction = reactions[i]; i++) {
			var el = Dsq.Templates.generateReactionHTML(reaction);
			if (el) {
				container.innerHTML += el;
			}
		}

		if (has_more) {
			var d = Dsq.jsonData.settings.disqus_url;
			var f = Dsq.jsonData.forum.url;
			var t = Dsq.jsonData.thread.id;
			var s = start;
			var l = limit;

			var handler = 'Dsq.Utils.execScript(\'' + d + '/forums/' + f + '/more_reactions.js?t=' + t + '&s=' + s + '&l=' + l + '\', true); return false;';
			container.innerHTML += '<li id="dsq-show-more-reactions" class="dsq-show-more-reactions"><button type="button" class="dsq-button-small" onclick="' + handler + '">Show more reactions</button></li>';
		}
	};

	this.generateReactionHTML = function(reaction) {
		if (reaction.body === null || reaction.body == '') {
			return;
		}

		if (reaction.author_name === '') {
			reaction.author_name = '&nbsp;';
		}

		if (reaction.url === '') {
			reaction.url = reaction.get_service_url;
		}

		var item = '<li class="dsq-comment dsq-reaction" id="dsq-reaction-' + reaction.id + '">'
			+ '<div class="dsq-comment-header"> \
			<table> \
			<tr> \
			<td class="dsq-header-avatar"> \
			';

		if (reaction.author_url && reaction.author_url !== '') {
			item += '<a target="_blank" href="' + reaction.author_url +'" class="dsq-avatar">';
		}

		if (reaction.avatar_url && reaction.avatar_url !== '') {
			item += '<img src="' + reaction.avatar_url + '"/>';
		} else {

			item += '<img src="' + Dsq.jsonData.media_url + '/images/noavatar92.png"/>';
		}

		var service_icon = (reaction.get_service_name == 'trackback' || reaction.get_service_name == 'pingback' ? 'rss' : reaction.get_service_name.replace(' ', ''));
		item += (reaction.author_url && reaction.author_url !== ''
				? '</a>'
				: '')
			+ '</td>'
			+ '<td><cite class="dsq-comment-cite">' + reaction.author_name + '</cite> <span class="dsq-comment-header-time">' + reaction.date_created + '</span></td>'
			+ '<td class="dsq-comment-header-likes"></td>'
			+ '</tr></table></div>' // end dsq-comment-header
			+ '<div class="dsq-reaction-header" \
				<table> \
					<tr> \
						<td class="dsq-reaction-header-left">'
							+ '<img class="dsq-service-icon" src="' + Dsq.jsonData.media_url + '/images/reactions/services/' + service_icon + '.png" />'
							+ ' From <a class="dsq-service-name" target="_blank" href="' + reaction.url + '">' + reaction.get_service_name + '</a> '
							+ 'via <a href="' + reaction.source_url + '">' + (reaction.source == 'backtype' ? 'BackType' : 'UberVU') + '</a>'
						+ '</td>'
						+ '<td class="dsq-reaction-header-right">';

			if(reaction.retweets) {
				var num_retweets = reaction.retweets.length;
				if (num_retweets > 0) {
					if (num_retweets == 1) {
						item += 'One more retweet from <a href="' + reaction.retweets[0].url + '">'  + reaction.retweets[0].author_name + '</a>';
					} else {
						item += (num_retweets + ' more retweets from ');
						item += '<span id="dsq-reaction-retweets-' + reaction.id + '">';
						var n_tweets = (num_retweets > 3) ? 3 : num_retweets;
						item += Dsq.Templates.showRetweets(reaction.id, n_tweets);
						if (n_tweets != num_retweets) {
							item += '</span> <a onclick="Dsq.Templates.showRetweets(' + reaction.id + ', 0, \'dsq-reaction-retweets-' + reaction.id + '\');'
								+ 'this.parentNode.removeChild(this); return false;" href="#">Show all</a>';
						}
					}
				}
			}	
			item += '</td></tr> \
			</table> \
			</div>' // end dsq-reaction-header
			+ '<div class="dsq-comment-body"> \
				<div class="dsq-comment-message">' + reaction.body + '</div>'
			+ '</div> \
			<div class="dsq-comment-footer"> \
				<div class="dsq-comment-footer-left"> \
				</div>'
				+ (Dsq.jsonData.request.is_moderator || Dsq.jsonData.request.is_global_moderator 
					? ' \
					<div class="dsq-comment-footer-right"> \
						<button type="button" class="dsq-button-small dsq-hide-reaction" onclick="Dsq.Reaction.hide(' + reaction.id + ')">Hide</button> \
					</div>'
					: '')
			+ '</div>'
		item += '</li>'; /* Reaction HTML ends */
		return item;
	};

	this.reactions = function() {
		var html, reaction;

		if (Dsq.jsonData.reactions === undefined || Dsq.jsonData.reactions.length === 0) {
			return '';
		}

		html = '';
		for (var i = 0; reaction = Dsq.jsonData.reactions[i]; i++) {
			var item = Dsq.Templates.generateReactionHTML(reaction);
			if (item) {
				html += item;
			}
		}

		if (Dsq.jsonData.has_more_reactions) {
			var d = Dsq.jsonData.settings.disqus_url;
			var f = Dsq.jsonData.forum.url;
			var t = Dsq.jsonData.thread.id;
			var s = Dsq.jsonData.reactions_start;
			var l = Dsq.jsonData.reactions_limit;

			var handler = 'Dsq.Utils.execScript(\'' + d + '/forums/' + f + '/more_reactions.js?t=' + t + '&s=' + s + '&l=' + l + '\', true); return false;';
			html += '<li id="dsq-show-more-reactions" class="dsq-show-more-reactions"><button type="button" class="dsq-button-small" onclick="' + handler + '">Show more reactions</button></li>';
		}

		return '<h3 id="dsq-reactions-title" class="dsq-h3-reactions">Reactions</h3><ul id="dsq-reactions" class="dsq-reactions">' + html + '</ul>';
	};
	
	this._popupGeneric = function(content) {
		return ' \
		<div class="dsq-popup-container"> \
			<table> \
				<tbody> \
					<tr> \
						<td class="dsq-popup-tl"></td><td class="dsq-popup-b"></td><td class="dsq-popup-tr"></td> \
					</tr> \
					<tr> \
						<td class="dsq-popup-b"></td> \
						<td class="dsq-popup-body"> \
							<div class="dsq-popup-content"> \
								<div class="dsq-popup-title"> \
									<button type="button" class="dsq-button-small" style="float:right" onclick="Dsq.Popup._closePopup(null, true)">Close</button>'
									+ content['header'] 
								+ '</div>'
								+ content['body']
							+ '</div> \
							<div class="powered-by"><a href="http://disqus.com/comments/">Powered by <img src="http://media.disqus.com/images/embed/disqus-logo.png" alt="Disqus Comments" style="margin-bottom:-5px" /></a></div> \
						</td> \
						<td class="dsq-popup-b"></td> \
					</tr> \
					<tr> \
						<td class="dsq-popup-bl"></td><td class="dsq-popup-b"></td><td class="dsq-popup-br"></td> \
					</tr> \
				</tbody> \
			</table> \
		</div> \
		';
	};



	
	this.chooseSubscribe = function(post_id) {

		var pid = post_id ? '-' + post_id : '';
		var menu = Dsq.$('dsq-subscribe-menu' + pid);
		
		menu.style.display = menu.style.display == 'block' ? 'none' : 'block';
		
	};
	
	this.setSubscribe = function(value, el, post_id) {

		var pid = post_id ? '-' + post_id : '';
		var input = Dsq.$('dsq-subscribe-on-post' + pid);
		var select = Dsq.$('dsq-subscribe-select' + pid);
		var menu = Dsq.$('dsq-subscribe-menu' + pid);
		
		select.innerHTML = el.innerHTML;
		input.value = value;
		this.chooseSubscribe(post_id);
	};
	
	this.getFormFields = function(post_id) {

		var fields = {};
		var pid = post_id ? '-' + post_id : '';
		var name = Dsq.$('dsq-field-name' + pid);
		var email = Dsq.$('dsq-field-email' + pid);
		var website = Dsq.$('dsq-field-website' + pid);
		var username = Dsq.$('dsq-field-username' + pid);
		var password = Dsq.$('dsq-field-password' + pid);

		fields = {
			'name': name,
			'email': email,
			'website': website,
			'username': username,
			'password': password
		}
		
		return fields;
	}
	
	this.validateFields = function(post_id) {
		
		if(Dsq.jsonData.request.is_authenticated) { return true; }
		
		var fields = Dsq.Templates.getFormFields(post_id);
		
		var nameField = fields.name;
		var websiteField = fields.website;
		var emailField = fields.email;
		
		websiteField.value = (websiteField.value == Dsq.Templates.placeholder['website']) ? '' : websiteField.value;
		
		var v = [{

			validator: Dsq.Validators.name,
			value: nameField.value
		}, {

			validator: Dsq.Validators.email,
			value: emailField.value
		}, {

			validator: Dsq.Validators.url,
			value: websiteField.value
		}];
		
		return Dsq.Validators.validate(v, function(e) { Dsq.Popup.popModal(e, 'Oops...') } );
	};
	
	this.checkExistingUser = function(post_id) {
		var fields = Dsq.Templates.getFormFields(post_id);		
		Dsq.Popup.loading(post_id);
		
		if (post_id) {
			Dsq.frames['reply_' + post_id].getUserByEmail(fields.email.value);
		} else {
			Dsq.frames['reply_0'].getUserByEmail(fields.email.value);
		}
	};

	this.validateAuth = function(el_clicked, post_id, auth_choice) {
		var fields = Dsq.Templates.getFormFields(post_id);
		var email = fields.email ? fields.email.value : '';
		var username = fields.username ? fields.username.value : '';
		var password = fields.password ? fields.password.value : '';
		
		Dsq.Templates.setLoadingButton(el_clicked, post_id);
		
		if (post_id) {
			Dsq.frames['reply_' + post_id].validateAuth(auth_choice, email, username, password);
		} else {
			Dsq.frames['reply_0'].validateAuth(auth_choice, email, username, password);
		}
	};

	this.lightboxUpdateEmail = function(post_id, new_email) {
		var fields = Dsq.Templates.getFormFields(post_id);
		fields.email.value = new_email;
	};

	this.lightboxAuthenticate = function(post_id, auth_choice, auth_data) {
		var title, body;
		var pid = post_id ? '-' + post_id : '';

		if(typeof(auth_data) == 'undefined') {
			var auth_data = Dsq.Templates.getFormFields(post_id);
		}

		d = auth_data;

		switch(auth_choice) {
			case 'register':
				var suggestedUsername = d.name.value.replace(/[^a-zA-Z0-9-]/g,'').toLowerCase();
			
				title = Dsq.jsonData.forum.allow_anon_post ? 'Optional:' : 'Required:';
				title += ' Register a <img src="http://media.disqus.com/images/embed/disqus-profile.png" alt=Disqus Profile" />';

				body = ' \
				<ul class="dsq-lightbox-register-reasons"> \
				<li>Verify your comments</li> \
				<li>Edit and delete comments</li> \
				<li>Manage comments and replies</li> \
				</ul> \
				';

				body += ' \
				<div class="dsq-lightbox-auth-fields"> \
					<table> \
						<tr> \
							<td>Email</td> \
							<td><input type="text" value="' + d.email.value + '" onchange="Dsq.Templates.lightboxUpdateEmail(' + post_id + ', this.value)" /><div id="dsq-email-errors' + pid + '"></div></td> \
						</tr> \
						<tr> \
							<td>Username</td> \
							<td><input id="dsq-field-username' + pid + '" type="text" value="' + suggestedUsername + '"/><div id="dsq-username-errors' + pid + '"></div></td> \
						</tr> \
						<tr> \
							<td>Password</td> \
							<td><input id="dsq-field-password' + pid + '" type="password" /><div id="dsq-password-errors' + pid + '"></div></td> \
						</tr> \
					</table> \
					<div class="dsq-lightbox-switch-auth"><a href="#" onclick="Dsq.Templates.lightboxAuthenticate(' + post_id + ',\'login\'); return false">Login instead</a></div> \
				</div> \
				<div id="dsq-lightbox-errors' + pid + '" class="dsq-lightbox-errors"></div> \
				<div class="dsq-lightbox-submit"> \
					<div class="dsq-lightbox-auth-post"><button type="button" class="dsq-button" onclick="Dsq.Templates.validateAuth(this, ' + post_id + ',\'' + auth_choice + '\')">Register and Post comment</button></div>'
					+ (Dsq.jsonData.forum.allow_anon_post
						? '<div class="dsq-lightbox-auth-skip"><button type="button" class="dsq-button-small" onclick="Dsq.Templates.postComment(' + post_id + ', this, true)">Just post as a Guest</button></div>'
						: '')
				+ '</div> \
				';
				break;
			case 'login':
				title = Dsq.jsonData.forum.allow_anon_post ? 'Optional:' : 'Required:';
				title += ' Login to your <img src="http://media.disqus.com/images/embed/disqus-profile.png" alt=Disqus Profile" />';
				body = '';
				
				if(d.avatar_url) {
					body += '<div class="dsq-lightbox-recognized"><table><tr>';
					body += '<td><img src="' + d.avatar_url + '" alt="" /></td>';
					body += '<td><span class="dsq-badge ' + (d.verified ? 'dsq-badge-verified' : 'dsq-badge-registered') + '">' + (d.verified ? 'Verified' : 'Registered') + '</span></td>';
					body += '<td>Hey <strong>' + d.display_name + '</strong>, is that you? Login below to claim this comment.';
					body += '</tr></table></div>';
				}

				body += ' \
				<div class="dsq-lightbox-auth-fields"> \
					<table> \
						<tr> \
							<td>Username or Email</td> \
							<td><input id="dsq-field-username' + pid + '" type="text" value="' + (d.avatar_url ? d.username : '') + '" /></td> \
						</tr> \
						<tr> \
							<td>Password <a href="http://disqus.com/forgot" target="_blank">(cannot log in?)</a></td> \
							<td><input id="dsq-field-password' + pid + '" type="password" /></td> \
						</tr> \
					</table> \
					<div class="dsq-lightbox-switch-auth"><a href="#" onclick="Dsq.Templates.lightboxAuthenticate(' + post_id + ',\'register\'); return false">Register instead</a></div> \
				</div> \
				<div id="dsq-lightbox-errors' + pid + '" class="dsq-lightbox-errors"></div> \
				<div class="dsq-lightbox-submit"> \
					<div class="dsq-lightbox-auth-post"><button type="button" class="dsq-button" onclick="Dsq.Templates.validateAuth(this, ' + post_id + ',\'' + auth_choice + '\')">Login and Post comment</button></div>'
					+ (Dsq.jsonData.forum.allow_anon_post
						? '<div class="dsq-lightbox-auth-skip"><button type="button" class="dsq-button-small" onclick="Dsq.Templates.postComment(' + post_id + ', this, true)">Just post as a Guest</button></div>'
						: '')
				+ '</div> \
				';
				break;
			default:
				break;
		}
		Dsq.Popup.lightbox(body, title, post_id);
		Dsq.$('dsq-field-username' + pid).focus();
	};
	
	this.buttonsToRestore = [];
	this.setLoadingButton = function(btn, post_id) {
		var pid = post_id ? '-' + post_id : '';
		if (btn) {

			var loadingBtn = document.createElement('button');
			loadingBtn.id = btn.id + '-loading';
			loadingBtn.innerHTML = '<img src="http://media.disqus.com/images/loading-lite.gif" alt="" /> ' + Dsq.Strings.JUST_A_MOMENT;
			loadingBtn.className = btn.className + ' dsq-post-loading';
			btn.parentNode.appendChild(loadingBtn);
			btn.style.display = 'none';
			var cancelBtn = Dsq.$('dsq-cancel-button' + pid);
			if(cancelBtn) { cancelBtn.style.display = 'none'; this.buttonsToRestore.push(cancelBtn); }
			this.buttonsToRestore.push(btn);
		} else {

			var buttons = this.buttonsToRestore;
			for(var i = 0; i < buttons.length; i++) {
				buttons[i].style.display = 'inline';
				Dsq.Utils.deleteNode(Dsq.$(buttons[i].id + '-loading'));
			}
		}
		
	};

	this.postComment = function(post_id, el_clicked, force, auth_choice) {
		var append_id = post_id ? '-' + post_id : '';
		var fields = Dsq.Templates.getFormFields(post_id);

		if (Dsq.Templates.validateFields(post_id)) {

			if (!Dsq.jsonData.request.is_authenticated && !force &&
				((!Dsq.Utils.readCookie('skipped_auth') && !disqus_skip_auth && !Dsq.jsonData.forum.disqus_auth_disabled) || !Dsq.jsonData.forum.allow_anon_post)) {
				Dsq.Templates.checkExistingUser(post_id);
				return false;
			}
			var params = [];
			if (!Dsq.jsonData.request.is_authenticated) {
				params.push(fields.name.value,
					fields.email.value,
					fields.website.value);

				if (auth_choice == 'login' || auth_choice == 'register') {
					params.push({
						auth_choice: auth_choice,
						username: fields.username.value,
						password: fields.password.value,
						email: fields.email.value
					});
				} else {
					params.push(null);
				}

				params.push(null /* sharing options */, Dsq.$('dsq-subscribe-on-post' + append_id).value);
			} else {
				var service_checked = function(name) {
					var el = Dsq.$('dsq-sharing-' + name + append_id);
					return (el !== null && el.checked === true) ? '1' : '0';
				};
				params.push(null, null, null, null, {
					tw: service_checked('twitter'),
					fb: service_checked('facebook'),
					tr: service_checked('tumblr'),
					wp: service_checked('wordpress'),
					mt: service_checked('movabletype'),
					tp: service_checked('typepad'),
					yh: service_checked('yahoo')
				});
			}

			var frame = Dsq.frames['reply_' + (post_id ? post_id : 0)];
			frame.post.apply(frame, params);

			if (el_clicked) {
				Dsq.Templates.setLoadingButton(el_clicked, post_id);
			}
			
			if (force) {
				Dsq.Utils.createCookie('skipped_auth', true);	
			}
			
		} else {
			return false;
		}
	};

	this.editComment = function(el_clicked, post_id) {
		var edited_message = Dsq.$('dsq-edit-textarea-' + post_id).value;

		Dsq.Templates.setLoadingButton(el_clicked, post_id);
		Dsq.frames['edit_' + post_id].edit(post_id, edited_message);
	};

	this.toggleEdit = function(post_id) {
		var body = Dsq.$('dsq-comment-body-' + post_id);
		var message = Dsq.$('dsq-comment-message-' + post_id);

		if (!Dsq.Post.stateEditToggled[post_id]) {


			message.style.display = 'none';
			if (Dsq.$('dsq-edit-' + post_id)) {
				Dsq.$('dsq-edit-' + post_id).style.display = 'block';
			} else {

				var edit_area = document.createElement('div');
				edit_area.id = 'dsq-edit-' + post_id;
				edit_area.className = 'dsq-edit dsq-textarea';
				edit_area.innerHTML = ' \
				<div class="dsq-textarea-wrapper"> \
					<textarea class="dsq-edit-textarea" id="dsq-edit-textarea-' + post_id + '">' + message.innerHTML + '</textarea> \
				</div> \
				<div class="dsq-save-edit"> \
					<button type="button" onclick="Dsq.Templates.editComment(this, ' + post_id + ')" class="dsq-button-small">Save Edit</button> \
				</div> \
				<div id="dsq-edit-iframe-' + post_id + '" style="display: none"></div> \
				';

				body.appendChild(edit_area);

				if (!Dsq.frames['edit_' + post_id]) {
					var _meta = Dsq.jsonData.posts[post_id];
					Dsq.frames['edit_' + post_id] = new Dsq.ReplyFrame(Dsq.$('dsq-edit-iframe-' + post_id), post_id);
					Dsq.frames['edit_' + post_id].init();
					Dsq.frames['edit_' + post_id].setState(post_id, _meta.depth);
				}
			}
		} else {

			message.style.display = 'block';
			Dsq.$('dsq-edit-' + post_id).style.display = 'none';
		}
		
		Dsq.Post.stateEditToggled[post_id] = !Dsq.Post.stateEditToggled[post_id];
	};
	
	this.edit = function(el, post_id) {

		Dsq.Templates.toggleEdit(post_id);
	};

	this.toggleReply = function(post_id, button) {
		
		if(!this.stateReplyToggled[post_id]) {

			if (Dsq.$('dsq-reply-post-' + post_id)) {
				Dsq.$('dsq-append-post-' + post_id).style.display = 'block';
			} else {
				Dsq.$('dsq-append-post-' + post_id).innerHTML = Dsq.Templates.postBox(post_id);
				var container = Dsq.$('dsq-textarea-wrapper-' + post_id);
				if (!Dsq.frames['reply_' + post_id] && container) {
					var _meta = Dsq.jsonData.posts[post_id];
					Dsq.frames['reply_' + post_id] = new Dsq.ReplyFrame(container, post_id);
					Dsq.frames['reply_' + post_id].init(function() {

						Dsq.$('dsq-append-post-' + post_id).innerHTML = Dsq.Templates.postBox(post_id, true);
						Dsq.$('dsq-form-area-' + post_id).innerHTML = '';

						var theme = (typeof disqus_frame_theme == 'undefined') ? 'default' : disqus_frame_theme;
						Dsq.Iframes.showReplyIframeInContainer(Dsq.$('dsq-form-area-' + post_id), post_id, {theme: theme});

					});
					Dsq.frames['reply_' + post_id].setState(post_id, _meta.depth);
				}
			}
			Dsq.$('dsq-append-post-' + post_id).className = 'dsq-append-post';
			Dsq.$('dsq-comment-footer-reply-' + post_id).className = 'dsq-comment-footer-reply-active';
			
		} else {

			Dsq.$('dsq-append-post-' + post_id).style.display = 'none';
			Dsq.$('dsq-append-post-' + post_id).className = '';
			Dsq.$('dsq-comment-footer-reply-' + post_id).className = 'dsq-comment-footer-reply';
		}
		
		this.stateReplyToggled[post_id] = !this.stateReplyToggled[post_id];

		if(Dsq.Utils.ie && this.stateReplyToggled[post_id]) {

		}

		Dsq.Events.fire(Dsq.Events.REPLY_IFRAME_TOGGLED, {
			postId: post_id,
			opened: this.stateReplyToggled[post_id]
		});
	};
	
	this.moderateOptions = function(post_id) {
		var _meta = Dsq.jsonData.posts[post_id];
		var userData = Dsq.jsonData['users'][_meta.user_key];
		
		if(!Dsq.jsonData.request.is_moderator && !Dsq.jsonData.request.is_global_moderator) { return false; }

		var html;
		
		html = ' \
		<div class="dsq-moderate-options"> \
		<table>'
		+ (_meta.email ? '<tr><td>Email</td><td>' + _meta.email + '</td></tr>' : '')
		+ (_meta.ip ? '<tr><td>IP address</td><td>' + _meta.ip + '</td></tr>' : '')
		+ '<tr> \
			<td>Actions</td> \
			<td><ul>'
			+ (Dsq.jsonData.request.moderator_can_edit
				? '<li><a href="#" onclick="Dsq.Post.edit(this, ' + post_id + '); Dsq.Popup._closePopup(null, true); return false;">Edit Comment</a></li>'
				: '')
			+ '<li><a href="#" onclick="Dsq.Post.removePost(' + post_id + ', 1); Dsq.Popup._closePopup(null, true); return false;">Delete Comment</a></li> \
			<li><a href="#" onclick="Dsq.Post.reportSpam(' + post_id + '); Dsq.Popup._closePopup(null, true); return false;">Mark Spam</a></li> \
			<li><a href="#" onclick="Dsq.Popup.blacklist(' + post_id + '); return false">Block User</a></li> \
			</ul></td> \
			</table> \
		</div> \
		';
		
		html += '<p>Go to the full <a href="http://disqus.com/comments/moderate/" target="_blank">moderate panel</a> for more options.</p>';
		
		return Dsq.Popup.popModal(html, 'Moderate Options', post_id);
	};
	
	this.placeholder = {
		'class': 'dsq-placeholder',
		'name': Dsq.Strings.NAME,
		'email': Dsq.Strings.EMAIL,
		'website': Dsq.Strings.WEBSITE + ' (' + Dsq.Strings.OPTIONAL.toLowerCase() + ')'
	};
	
	this.handlePlaceholder = function(evt, el, key) {
		var placeholder = Dsq.Templates.placeholder[key];
		var className = Dsq.Templates.placeholder['class'];
		
		switch(evt.type) {
			case 'focus':
				if(el.value == placeholder) {
					el.value = '';
					el.className = '';
				}
				break;

			case 'blur':
				if(el.value == '') {
					el.value = placeholder;
					el.className = className;
				}
				break;
			default:
				break;
		}
	};
	
	this.paginate = function(page, el_clicked) {

		var extra_params = '';

		if(typeof disqus_per_page != 'undefined') {
			extra_params += '&per_page=' + disqus_per_page;
		}
		if(typeof disqus_sort != 'undefined') {
			extra_params += '&sort=' + disqus_sort;
		}

		Dsq.$('dsq-pagination').innerHTML += '<img src="http://media.disqus.com/images/loading-small.gif">';
		
		if(el_clicked) {
			Dsq.Templates.setLoadingButton(el_clicked);
		}
		
		Dsq.Utils.execScript('http://disqus.com/forums/scobleizer/thread.js'
			+ '?slug='	+ 'help_i8217m_clueless_about_web_service_scalability'
			+ '&p='		+ page
			+ extra_params);
	};
	
	
	this.rate = function(el, id, vote) {


		if(Dsq.jsonData.request.is_authenticated || Dsq.jsonData.forum.allow_anon_votes) {
			if(vote == 1) {
				Dsq.$('dsq-like-' + id).innerHTML = '<img src="http://media.disqus.com/images/loading-small.gif">';
			}
			Dsq.Utils.execScript('http://disqus.com/forums/scobleizer/vote.js'
				+ '?post_id='    + id
				+ '&vote='        + vote);
		} else {
			Dsq.Popup.login('To rate, please log in');
		}
	};

	this.voted = function(post_id, points, vote) {

		Dsq.$('dsq-like-pts-' + post_id).innerHTML = points + Dsq.Utils.pluralize(points, ' person', ' people') + ' liked this.';

		if(vote) {
			Dsq.$('dsq-like-' + post_id).innerHTML = 'You liked this.&nbsp;&nbsp;';
		}
	};




	this.postComment_onSuccess = function(response, parent_post_id, post_id) {
		var approved = response.message.post_meta.approved;

		if (parent_post_id) {
			Dsq.Post.toggleReply(parent_post_id);
		}

		Dsq.Popup._closePopup(null, true);
		
		if (approved) {
			Dsq.Post.incrementPostCount();
			Dsq.Post.outlineComment(post_id);
		} else {			
			var unapproved_msg = 'Thanks for posting!\
	 Your comment must be approved by a moderator before appearing here.\
			';
			Dsq.Popup.popModal(unapproved_msg, 'Comment awaiting approval', post_id);
		}

		var sharing_results = response.message.sharing_results;
		var sharing_errors = '';
		for (var service in sharing_results) {
			if (sharing_results.hasOwnProperty(service) === true) {
				if (sharing_results[service].error === true) {
					sharing_errors += service + ', ';
				}
			}
		}

		if (sharing_results.facebook && sharing_results.facebook.callback) {
			FB.ensureInit(function() {
				FB.Connect.streamPublish('', sharing_results.facebook.attachment);
			});
		}

		if (sharing_errors !== '') {
			var message = 'Your comment was posted, but there were errors sharing with the following connections: ';
			message += sharing_errors.replace(/,\s$/, '');
			message += '<p><a href="' + Dsq.jsonData.settings.disqus_url + '/profile/connections" target="_blank">Configure your connections here</a></p>'
			Dsq.Popup.popModal(message, 'Sharing options');
		}

		Dsq.Templates.setLoadingButton(false);
	};

	this.postComment_onFailure = function(response, parent_post_id, post_id) {

		Dsq.Templates.setLoadingButton(false);
	};
};




// TODO: It might be faster to use string methods to find all <li (...) </li> blocks and pass to Dsq.PostHandler manually.
Dsq.CommentsHandler = function(str, head, post_id, content, tail, offset, s) {
	var prepend_post = Dsq.Templates.prependPost(post_id);
	var append_post = Dsq.Templates.appendPost(post_id);

	content = content.replace(Dsq.POST_RE, Dsq.PostHandler);
	Dsq.Templates.postLoopCounter++;
	head = Dsq.Templates.Filters.commentContainer(post_id, head);
	return prepend_post + head + content + tail + append_post;
};

Dsq.PostHandler = function(str, h_head, post_id, h_content, h_tail, b_head, b_content, b_tail, offset, s) {
	var prepend_header = Dsq.Templates.postPrependHeader(post_id);
	var append_header = Dsq.Templates.postAppendHeader(post_id);
	var prepend_body = Dsq.Templates.preBody(post_id);
	var append_body = Dsq.Templates.postBody(post_id);
	var append_footer = Dsq.Templates.postFooter(post_id);

	b_content = b_content.replace(Dsq.POST_BODY_RE, Dsq.PostBodyHandler);
	return h_head + prepend_header + h_content + append_header + h_tail + b_head + prepend_body + b_content + append_body + b_tail + append_footer;
};

Dsq.PostBodyHandler = function(str, head, post_id, content, tail, offset, s) {
	content = Dsq.Templates.Filters.commentContent(post_id, content);
	return head + content + tail;
};

Dsq.MediaPostHandler = function(str, args, offset, s) {
	args = args.split(' ');
	if(args[0] == 'seesmic') {
		return '<br />' + Dsq.Templates.mediaSeesmic(args[1], args[2]);
	}
	return '';
};


/**
 * Shorcuts
 */
Dsq.$ = function(element) { return document.getElementById(element); };
Dsq.$b = document.body || document.getElementsByTagName('body')[0];


/**
 * Dsq.Debug: Logging functions.
 */

Dsq.Debug = new function() {this.log=function(s){};this.profile=function(f){if(typeof f == 'function')return f();else return eval(f);};};


/**
 * Dsq.Urls: URL paths
 */
Dsq.Urls = new function() {
	this.LOGIN = '/profile/login/';
	this.LOGOUT = '/logout/';
	this.REPLY = 'http://scobleizer.disqus.com/help_i8217m_clueless_about_web_service_scalability/reply.html';
	this.REQUEST_USER_PROFILE = '/AnonymousUser/';
	this.REQUEST_USER_AVATAR = 'http://media.disqus.com/images/noavatar92.png';
};
// Dsq.Urls

/**
 * Dsq.Validators: Validation for form fields
 */
Dsq.Validators = new function() {
	this.VALID_EMAIL_RE = /^[a-z0-9\-\_\+]+(\.[a-z0-9\-\_\+]+)*\@(([a-z0-9\-\_\+]+(\.[a-z0-9\-\_\+]+)*)+\.[a-z]{2,}|([0-9]+\.){3}[0-9]+)$/i;
	this.name = function(name) {
		var error = false;

		if(typeof Dsq.Templates.placeholder !== 'undefined' &&
		   name == Dsq.Templates.placeholder.name) {
			error = true;
		}
		if(name.length <= 1) {
			error = true;
		}

		if(error) {
			return "Please enter a name to comment.";
		} else {
			return true;
		}
	};
	this.email = function(addr) {
		if(Dsq.Validators.VALID_EMAIL_RE.test(addr)) {
			return true;
		} else {
			return "Please enter a valid email to comment.";
		}
	};
	this.url = function(addr) {
		if(!addr || addr.indexOf('.') != -1) {
			return true;
		} else {
			return "Please check your website URL (this field is optional).";
		}
	};

	this.validate = function(bulk_validation, failure_callback) {
		failure_callback = failure_callback || function(e){ alert(e); };

		for(var i = 0; i < bulk_validation.length; i++) {
			v = bulk_validation[i];
			ret = v.validator(v.value);
			if(ret !== true) {
				failure_callback(ret);
				return false;
			}
		}
		return true;
	};
};

/**
 * Dsq.Utils: Generic utility functions.
 */
Dsq.Utils = new function() {
	this.ie = /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
	this.ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
	this.ie6 = (!window.XMLHttpRequest) ? true: false;
	this.webkit = navigator.userAgent.indexOf('AppleWebKit/') >= 0;
	this.gebiFromElementCollectionCache = {};
	this._styleSheet = null;

	this.gebiFromElement = function(el, id, tag) {
		// This only method only helps IE.
		if(!this.ie) {
			return Dsq.$(id);
		} else {
			var cacheKey = el.id + '-' + tag;
			tag = tag || 'div';
			if(typeof this.gebiFromElementCollectionCache[cacheKey] != 'undefined') {
				collection = this.gebiFromElementCollectionCache[cacheKey];
			} else {
				collection = el.getElementsByTagName(tag);
				this.gebiFromElementCollectionCache[cacheKey] = collection;
			}

			for(var i = 0; i < collection.length; i++) {
				if(collection[i].id == id) {
					return collection[i];
				}
			}
			return null;
		}
	};

	this.execOnReady = function(func) {
		var node = document.createElement('document:ready');
		try {
			node.doScroll('left');
			func();
			node = null;
		} catch(err) {
			setTimeout(function() { Dsq.Utils.execOnReady(func); }, 10);
		}
	};


	// Courtesy of http://www.quirksmode.org/js/cookies.html
	this.createCookie = function(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	};

	this.readCookie = function(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	};

	this.eraseCookie = function(name) {
		Dsq.Utils.createCookie(name,"",-1);
	};

	this.deleteNode = function(node) {
		if(node) {
			this.deleteChildren(node);
			if(typeof node.outerHTML != 'undefined') { node.outerHTML = ''; }
			else if(node.parentNode) { node.parentNode.removeChild(node); }
			delete node;
		}
	};

	this.deleteChildren = function(node) {
		if(node) {
			for(var x = node.childNodes.length-1; x >= 0; x--) {
				var childNode = node.childNodes[x];
				if(childNode.hasChildNodes()) { this.deleteChildren(childNode); }
				if(typeof childNode.outerHTML != 'undefined') { childNode.outerHTML = ''; }
				else node.removeChild(childNode);
				delete childNode;
			}
		}
	};

	this.findPos = function(obj) {
		var curleft = 0;
		var curtop = 0;
		if (obj.offsetParent) {
			do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
		return [curleft,curtop];
	};

	this.getWindowSize = function() {
		var windowWidth = -1;
		var windowHeight = -1;

		if(typeof(window.innerWidth) == 'number') { //Non-IE
			windowWidth = window.innerWidth;
			windowHeight = window.innerHeight;
		} else if(document.documentElement) { // IE 6+ in 'standards compliant mode'
			windowWidth = document.documentElement.clientWidth || document.body.clientWidth;
			windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
		}

		return [windowWidth, windowHeight];
	}

	this.getScrollPos = function() {
		var scrollWidth, scrollTop;

		if(document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollWidth)) {
			scrollWidth = document.documentElement.scrollWidth;
			// IE is weird here.  If no doctype is provided, document.body.scrollTop is 0,
			// otherwise document.documentElement.scrollTop is 0.
			scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
		} else if(document.body.scrollTop && document.body.scrollWidth) {
			scrollWidth = document.body.scrollWidth;
			scrollTop = document.body.scrollTop;
		}

		return [scrollWidth, scrollTop];
	}

	this.addEventListener = function(instance, eventName, listener) {
		var listenerFn = listener;
		if (instance.addEventListener) {
			instance.addEventListener(eventName, listenerFn, false);
		} else if (instance.attachEvent) {
			listenerFn = function() {
				listener(window.event);
			};
			instance.attachEvent("on" + eventName, listenerFn);
		} else {
			throw new Error("Event registration not supported");
		}
		return {
			instance: instance,
			name: eventName,
			listener: listenerFn
		};
	};

	this.removeEventListener = function(event) {
		var instance = event.instance;
		if (instance.removeEventListener) {
			instance.removeEventListener(event.name, event.listener, false);
		} else if (instance.detachEvent) {
			instance.detachEvent("on" + event.name, event.listener);
		}
	};

	this.fixIframesIE = function(id) {
		var disqusThread = Dsq.$(disqus_container_id);
		var iframes = disqusThread.getElementsByTagName('iframe');

		if(id) {
			var container = Dsq.$(id);
		} else {
			var container = Dsq.$('dsq-content');
		}

		for(i = 0; i < iframes.length; i++) {
			if (container) {
				iframes[i].style.width = container.offsetWidth;
			}
		}
	};

	this.getElementsByClassName = function(oElm, strTagName, strClassName) {
	/* Credit: Jonathan Snook [http://www.snook.ca/jonathan], Robert Nyman [http://www.robertnyman.com] */
		var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
		var arrReturnElements = new Array();
		strClassName = strClassName.replace(/\-/g, "\\-");
		var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
		var oElement;
		for(var i = 0; i < arrElements.length; i++) {
			oElement = arrElements[i];
			if(oRegExp.test(oElement.className)) {
				arrReturnElements.push(oElement);
			}
		}
		return (arrReturnElements);
	};

	this.postToUrl = function(url, post_data, opt_redirect) {
		var form = document.createElement('form');
		var iframe_container = document.createElement('div');
		var id = 'dsq-temp-iframe-' + (new Date()).getTime();

		form.method = 'POST';
		form.action = url;
		if (!opt_redirect) {
			form.target = id;
		}
		iframe_container.innerHTML = '<iframe style="display:none" name="' + id + '" id="' + id + '"></iframe>';

		for(var key in post_data) {
			if(post_data.hasOwnProperty(key)) {
				var input = document.createElement('input');
				input.name = key;
				input.type = 'hidden';
				input.value = post_data[key];

				form.appendChild(input);
			}
		}

		Dsq.$b.appendChild(iframe_container);
		Dsq.$b.appendChild(form);
		form.submit();
	};

	// Strips integer id from id of element in the form ('some-id-###')
	this.extractId = function(e) {
		var chunks = e.id.split('-');
		if(chunks.length <= 1) {
			return 0;
		} else {
			var retval = parseInt(chunks[chunks.length-1]);
			return !isNaN(retval) ? retval : null;
		}
	};

	this.getStyle = function(el, styleProp) {
		if(el.currentStyle) {
			var y = el.currentStyle[styleProp];
		} else if(window.getComputedStyle) {
			var y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
		}

		if(y == 'transparent' || y == '') {
			this.getStyle(el.parentNode, styleProp);
		} else {
			return y;
		}
	};

	this.execScript = function(url, append_qs, container) {
		var script = document.createElement('script');
		append_qs = typeof append_qs == 'undefined' ? true : append_qs;
		container = container || Dsq.container;

		if(append_qs) {
			var j = (url.indexOf('?') >= 0) ? '&' : '?';
			url += j + (new Date()).getTime();
		}
		script.type = 'text/javascript';
		script.charset = 'UTF-8';
		script.src = url;
		container.appendChild(script);
		return script;
	};

	this.pluralize = function(num, singular, plural) {
		return (num != 1) ? plural || 's' : singular || '';
	};

	this.getRequestParams = function(queryString /* optional */) {
		var pairs, tuple;
		var params = {};

		queryString = queryString || window.location.search.substring(1);
		pairs = queryString.split('&');

		for (var i = 0, pair; pair = pairs[i]; i++) {
			tuple = pair.split('=');
			params[tuple[0]] = (tuple[1] || true);
		}

		return params;
	};

	this.addCssRule = function(selector, styleText, index) {
		var stylesheet;
		index = index || 0;

		if(!this._styleSheet) {
			var styleEl = document.createElement('style');
			document.getElementsByTagName('head')[0].appendChild(styleEl);
			this._styleSheet = styleEl.sheet;
			if(!this._styleSheet) {
				// IE does not like our newly created stylesheet.
				this._styleSheet = document.styleSheets[document.styleSheets.length-1];
			}
		}
		stylesheet = this._styleSheet;

		if(stylesheet.insertRule) {
			var ruleText = selector + ' { ' + styleText + ' }';
			if(index == -1) {
				index = stylesheet.cssRules.length;
			}
			stylesheet.insertRule(ruleText, index);
		} else if(stylesheet.addRule) {
			stylesheet.addRule(selector, styleText, index);
		}
	};

	this.forEachIn = function(obj, callback) {
		for(var key in obj) {
			if(obj.hasOwnProperty(key)) {
				callback(key, obj[key]);
			}
		}
	};

	this._interpolateGlobalContext = {
		// values that get used a lot and are global to the request
		'profile_url': Dsq.Urls.REQUEST_USER_PROFILE,

		'disqus_url': Dsq.jsonData.settings.disqus_url,
		'media_url': Dsq.jsonData.settings.media_url,
		'request_username': Dsq.jsonData.request.username,
		'request_display_username': Dsq.jsonData.request.display_username,
		'forum_name': Dsq.jsonData.forum.name
	};

	this.renderFromContextStack = function(key, contexts) {
		// Returns the first instance of `key` in the array of objects `contexts` or else ''
		for (var i=0; i<contexts.length; i++) {
			if (contexts[i][key] !== undefined) {
				return String(contexts[i][key]);
			}
		}
		throw new Error('key ' + key + ' not found in context');
	};

	var that = this;
	this.interpolate = function(fmt, opt_localContext) {
		// Interpolate `fmt` named-format string with an assumed global context.
		// Based on `interpolate` in django.views.i18n
		var contextStack = [opt_localContext || {}, that._interpolateGlobalContext];
		return fmt.replace(/%\(\w+\)s/g, function(match){
			return that.renderFromContextStack(match.slice(2,-2), contextStack);
		});
	};

	this.stripTags = function(s) {
		// Removes HTML tags from `s`
		return s.replace(/(<([^>]+)>)/g,"");

	};

	this.assert = function(b) {
		if (!b) {
			throw new Error('Assertion error.');
		}
	};

};
// Dsq.Utils

/**
 * Dsq.Popup: Popup helper functions.
 */
Dsq.Popup = new function() {
	this.timeHide = new Array();
	this.timeShow = new Array();
	this.activePopup = {};
	this.profileCache = {};
	this.statusCache = {};

	this.showTimer = function(post_id) {
		// clear the hide timer
		clearTimeout(this.timeHide[post_id]);

		// start the timer
		if(!Dsq.Popup.profileIsOn && !Dsq.Thread.adminIsOn) {
			this.timeShow[post_id] = setTimeout("Dsq.Popup.popProfile(\"" + post_id + "\")", 400);
		}
	};

	this.hideTimer = function(post_id) {
		// clear the show timer
		clearTimeout(this.timeShow[post_id]);
	};

	this.updateProfile = function(username) {
		// Callback from /embed/profile.js
		if (this.statusCache[username]) {
			var statusEl = Dsq.$('dsq-profile-status-' + username);
			statusEl.innerHTML = this.statusCache[username];
			statusEl.style.display = 'block';
		}

		if (this.profileCache[username]) {
			var _cache = this.profileCache[username];

			var _genhtml = function(text) { return '<span><big>' + text + '</big></span>'; };
			var _no_comments = _genhtml(Dsq.FmtStrings.NUMBER_OF_COMMENTS(_cache.comments_count));
			var _no_likes = _genhtml(Dsq.FmtStrings.NUMBER_OF_LIKES(_cache.likes_count));
			var _no_points = _genhtml(Dsq.FmtStrings.NUMBER_OF_POINTS(_cache.points));

			var statsEl = Dsq.$('dsq-popup-profile-user-stats-' + username);
			statsEl.innerHTML = '';

			if (Dsq.jsonData.users[username].registered) {
				statsEl.innerHTML = _no_comments + _no_likes;
			}
			statsEl.innerHTML += _no_points;

			var activeSites = '';
			for (var i = 0; i < _cache.active_sites.length; i++) {
				var site = _cache.active_sites[i];
				activeSites += '<li><a href="' + site.url + '"> \
					<img src="' + site.favicon + '"/ width="16" height="16"/></a>\
					<a href="' + site.url + '">' + site.name + '</a></li>';
			}
			if (activeSites !== '') {
				Dsq.$('dsq-popup-profile-active-sites-' + username).innerHTML = activeSites;
			} else {
				Dsq.$('dsq-popup-profile-active-sites-' + username).innerHTML = 'This site.';
			}

			var moderatedSites = '';
			for (var i = 0; i < _cache.moderated_sites.length; i++) {
				var site = _cache.moderated_sites[i];
				moderatedSites += '<li><a href="' + site.url + '"> \
					<img src="' + site.favicon + '"/ width="16" height="16"/></a>\
					<a href="' + site.url + '">' + site.name + '</a></li>';
			}
			if (moderatedSites !== '') {
				Dsq.$('dsq-popup-profile-moderated-' + username).innerHTML = moderatedSites;
			} else {
				Dsq.$('dsq-popup-profile-moderated-wrapper-' + username).innerHTML = '';
			}
		}

		// Reposition popup after full HTML is rendered
		if(Dsq.Popup.activePopup && Dsq.Popup.activePopup.el) {
			Dsq.Popup.initPopup(Dsq.Popup.activePopup.el, Dsq.Popup.activePopup.id, Dsq.Popup.activePopup.type);
		}

	};

	this.showCookieMsgs = function() {
		var title = '';
		var message = '';
		var numAlerts = 0;

		Dsq.Utils.forEachIn(Dsq.jsonData.cookie_messages, function(k, v) {
			if (!v) return;

			switch(k) {
				// Cookie: Twitter
				case 'post_twitter':
					if (v === 'error') {
						title = 'Twitter Error!';
						message += '<li id="dsq-msg-twitter-error">Oops, we couldn\'t tweet this comment. Please check your <a href="http://disqus.com/account/services">account settings</a>.</li>';
					} else {
						var _msg = v.split(':');
						title = 'Tweeted!';
						message += '<li id="dsq-msg-twitter-success">Your comment was successfully tweeted. <a href="http://twitter.com/' + _msg[0] + '/status/' + _msg[1] + '">Click here to view the tweet</a>.</li>';
					}
					break;
				// Cookie: Unapproved Post
				case 'post_not_approved':
					title = 'Comment awaiting approval by a moderator';
					message += '<li id="dsq-msg-post-not-approved">Your comment must be approved by a moderator before appearing here.</li>';
					break;
				// Cookie: Profile Found
				case 'post_has_profile':
					title = 'Use your existing commenter profile';
					message += '<li id="dsq-msg-post-has-profile">You have just posted your commment as a <span class="dsq-badge-guest">Guest</span>, but you may already have a <span class="logo-disqus">Disqus</span> Profile.<br /><br /><a href="http://disqus.com/claim">Log in and claim this comment!</a></li>';
					break;
				case 'user_created':
					var _data = v.split(':');
					title = 'Profile created!';
					message += '<li id="dsq-msg-user-created">You have just created a <span class="logo-disqus">Disqus</span> Profile, the best way to claim, manage, and track your comments all over the web. \
					<br /><br />A confirmation is being sent to <strong>' + _data[1] + '</strong>. Please check for this email in order to verify your profile. \
					<ul class="dsq-list-tick"> \
						<li>Your username is <strong>' + _data[0] +'</strong>. <a href="http://disqus.com/people/' + _data[0] + '/" target="_blank">Click here to view your public profile</a>.</li> \
						<li>Be sure to set your profile picture, as well as connect your <span class="dsq-badge-facebook">Facebook</span> and <span class="dsq-badge-twitter">Twitter</span> accounts. <a href="http://disqus.com/account/" target="_blank">Click here for account settings</a>.</li> \
					</ul> \
					</li>'
					break;
				default:
					break;
			}
			numAlerts++;
		});

		if(numAlerts > 1) {
			message = '<ul class="dsq-list-bluebullet">' + message;
			message += '</ul>';
			title = 'Thanks for posting!';
		}
		if(numAlerts > 0) {
			if(typeof(disqus_cookie_msgs) == 'function') {
				disqus_cookie_msgs(message, title);
			} else {
				Dsq.Popup.popModal(message, title);
			}
		}
	};

	this.helpBadges = function(post_id) {
		var html = ' \
			<ul class="dsq-popup-help"> \
				<li><span class="dsq-badge dsq-badge-verified">Verified</span> has a <span class="logo-disqus">Disqus</span> Profile with a confirmed email address.</li> \
				<li><span class="dsq-badge dsq-badge-registered">Registered</span> has a <span class="logo-disqus">Disqus</span> Profile, but has not yet confirmed his or her email address.</li> \
				<li><span class="dsq-badge dsq-badge-guest">Guest</span> is not logged in with any account and has not claimed his or her comments.</li> \
				<li class="dsq-help-otheraccts">Other accounts</li> \
				<li><span class="dsq-badge dsq-badge-facebook">Facebook</span> is using his or her Facebook profile via Facebook Connect.</li> \
				<li><span class="dsq-badge dsq-badge-twitter">Twitter</span> is using his or her Twitter profile via Twitter Sign-in.</li> \
				<li><span class="dsq-badge dsq-badge-openid">OpenID</span> is using his or her OpenID.</li> \
			</ul> \
		';

		this.popModal(html, 'Help: Types of Commenters', post_id);
		return;
	};

	this.permalink = function(post_id) {
		var header = 'Link to this comment';
		var body = '<strong>You are anchored to</strong>:<br />' + document.location.protocol + '//' + document.location.host + document.location.pathname + document.location.search + '#comment-' + post_id;

		this.popModal(body, header, post_id);
	};

	this.login = function(header, body) {
		var h = header || 'Login or Register';
		var b = body || '';
		b += Dsq.Templates.frameLogin({id: 'dsq-popup-login'});
		b += '</iframe>'; // HACK: Sometimes there is something funky with the IFRAME SRC that causes no end tag
		this.popModal(b, h, null, true, 'dsq-popup-login');
	};

	this.blacklist = function(id) {
		var _meta = Dsq.jsonData.posts[id];
		var userData = Dsq.jsonData['users'][_meta.user_key];
		var title = 'Add to Blacklist';
		var message = ' \
		Adding this person to the blacklist will block him or her from commenting on this site. Check the following types that you would like to add to the blacklist:'
		+ (userData['registered'] ?
			'<div class="dsq-blacklist-option"> \
				<input id="dsq-blacklist-username" type="checkbox" checked> \
				<label for="dsq-blacklist-username"><strong>Username</strong>: ' + userData['username'] + '</label> \
			</div>'
			: '')
		+ (_meta.email ?
			'<div class="dsq-blacklist-option"> \
				<input id="dsq-blacklist-email" type="checkbox" checked> \
				<label for="dsq-blacklist-email"><strong>Email address</strong>: ' + _meta.email + '</label> \
			</div>'
			: '')
		+ '<div class="dsq-blacklist-option"> \
			<input id="dsq-blacklist-ip" type="checkbox" onclick="Dsq.$(\'dsq-blacklist-ip-warning\').style.display=\'block\'"> \
			<label for="dsq-blacklist-ip"><strong>IP address</strong>: ' + _meta.ip + '</label> \
		</div> \
		';

		message += ' \
			<p id="dsq-blacklist-ip-warning" style="display:none">	\
				Note: Blocking this person\'s IP address may also unintentionally prevent others, who share his/her IP address, from commenting on this site. \
				This may include people who are sharing the same computer, living in the same house, or using the same Internet provider. Only block an IP address as a last resort. \
			</p> \
		';

		message += ' \
			<p style="text-align:center"><button type="button" onclick="Dsq.Post.blockUser(' + id + '); this.disabled=true; this.innerHTML=\'Just one moment...\'">Add to Blacklist</button></p> \
		';

		Dsq.Popup.popModal(message, title);
	};

	this.remoteAccountSettings = function() {
		var body = '';
		// Set up IFrame.
		var params = {};
		var base_url = 'http://disqus.com/forums/scobleizer/_auth/embed/remote_settings/';
		var attributes = {id: 'dsq-popup-account-settings'};
		if (typeof disqus_frame_theme != 'undefined') {
			params['theme'] = disqus_frame_theme;
		}

		body = Dsq.Templates._frameGeneric(base_url, params, attributes);
		this.popModal(body, 'Account Settings', null, true, 'dsq-popup-account-settings');
	};

	this.popModal = function(message, title, post_id, use_listener, extra_classes) {
		var container = document.createElement('div');
		var header, body;

		Dsq.Popup._closePopup(null, true);

		if(typeof(title) == 'undefined') { title = ''; }
		if(typeof(use_listener) == 'undefined') { use_listener = true; }

		if(post_id) {
			container.id = 'dsq-popup-message-' + post_id;
		} else {
			container.id = 'dsq-popup-message';
		}

		header = title;
		body = message;

		container.innerHTML = Dsq.Templates.popupModal(header, body);
		Dsq.Popup.initPopup(container, post_id, 'message', extra_classes);
		if(use_listener) {
			Dsq.Popup.popupListener = Dsq.Utils.addEventListener(document, 'mouseup', Dsq.Popup._closePopup);
		}
	};

	this.popAlert = this.popModal;

	this.loading = function(post_id) {
		var title = Dsq.Strings.JUST_A_MOMENT;
		var body = '<div style="text-align:center; padding: 5px 0 10px 0"><img src="http://media.disqus.com/images/loading.gif" alt="" /></div>'
		Dsq.Popup.lightbox(body, title, post_id);
	};

	this.lightbox = function(message, title, post_id) {
		// Wraps Dsq.Popup.popModal

		var overlay = document.createElement('div');
		overlay.id = 'dsq-overlay';
		overlay.className = 'dsq-overlay';
		Dsq.$b.appendChild(overlay);
		
		Dsq.Popup.popModal(message, title, post_id, false, 'dsq-lightbox');
	};

	this.popProfile = function(post_id, userKey) {
		var post = Dsq.jsonData['posts'][post_id];
		if (post && post.has_been_anonymized) {
			Dsq.Popup.popModal('This message was anonymized by its previous owner.', 'Anonymized', post_id);
			return;
		}

		if(post_id) {
			userKey = Dsq.jsonData['posts'][post_id].user_key;	
		}
		var userData = Dsq.jsonData['users'][userKey];
		var elId = 'dsq-popup-profile-' + userKey;
		var container = document.createElement('div');

		if(this.activePopup.el) {
			this._closePopup(null, true);
			if(this.activePopup.linkClicked) {
				this.activePopup.linkClicked = false;
				return;
			}
		}

		container.id = elId;
		container.innerHTML = Dsq.Templates.popupProfile(userKey);

		this.initPopup(container, post_id, 'profile');
		this.popupListener = Dsq.Utils.addEventListener(document, 'mouseup', this._closePopup);

		if(!this.profileCache[userKey]) {
			Dsq.Utils.execScript('http://disqus.com/embed/profile.js'
				+ '?username=' + userKey
				+ '&anon=' + (userData['registered'] ? 0 : 1)
				+ '&f=' + Dsq.jsonData['request'].forum);
		} else {
			this.updateProfile(userKey);
		}
	};

	this._closePopup = function(e, force) {
		var activePopup = Dsq.Popup.activePopup.el;
		var id = Dsq.Popup.activePopup.id;
		var link = 'dsq-avatar-' + id; // HACK: Specific to profile toggle target

		// HACK: This event should be gone if there is no active popup.
		if(!activePopup) {
			return;
		}
		if(force || !Dsq.Popup.isClicked(e, activePopup.id)) {
			// TODO: This is breaking iE?
			if(Dsq.Popup.popupListener) {
				Dsq.Utils.removeEventListener(Dsq.Popup.popupListener);
			}
			
			// Kill overlay
			var overlay = Dsq.$('dsq-overlay');
			if(overlay) { Dsq.Utils.deleteNode(overlay); }
			
			try {
				Dsq.Utils.deleteNode(activePopup);
			} catch(e) {
				// HACK: IE6 throws an error when using deleteNode() with a node containing a <table> in the html.
				activePopup.parentNode.removeChild(activePopup);
			}
			Dsq.Popup.activePopup = {};
		}

		if(!force && Dsq.Popup.isClicked(e, link)) {
 			Dsq.Popup.activePopup.linkClicked = true;
		}

	};

	this.initPopup = function(popup, post_id, type, extra_classes) {
		popup.className = 'dsq-popup dsq-popup-' + type + ' ' + (extra_classes ? extra_classes : '');
		if(Dsq.Utils.ie6 || Dsq.Utils.ie7) {
			// HACK: We can't modify the body before it's ready, so we need
			//       to use an IE-safe "DOMReady" workaround before loading
			//       our popup.
			Dsq.Utils.execOnReady(function() {Dsq.$b.appendChild(popup); });
		} else {
			Dsq.$b.appendChild(popup);
		}

		popup.style.display = 'block';

		var xPos = (Dsq.Utils.getWindowSize()[0] - popup.offsetWidth) / 2;
		var yPos = (Dsq.Utils.getWindowSize()[1] - popup.offsetHeight) / 2;

		if(Dsq.Utils.ie6) {
			yPos += Dsq.Utils.getScrollPos()[1];
		}

		popup.style.left = xPos + 'px';
		popup.style.top = yPos + 'px';

		Dsq.Popup.activePopup = {
			'el' : popup,
			'id' : post_id,
			'type': type,
			'linkClicked' : false
		};
	};

	this.isClicked = function(e, id) {
		var t = e.target || e.srcElement;
		while(t && t.parentNode) {
			if(t.id == id) {
				return true;
			}

			t = t.parentNode;
		}
		return false;
	};
};
// Dsq.Popup

/**
 * Dsq.Templates
 */
Dsq.Templates = new function() {
	/*
	 * Counter keeping track of the number of posts iterated over.
	 */
	this.postLoopCounter = 0;
	this.filters = {};
	this.addPostContainer = 'dsq-post-add';
	this.textareaContainer = 'dsq-post-add';

	this.registerTemplate = function(name, func) {
		this['$$_' + name] = func;

		if(typeof DsqLocal.Filters != 'undefined'
		&& typeof DsqLocal.Filters[name] == 'function') {
			// Push filters to this.filters to unify code.
			this.filters[name] = this.filters[name] || [];
			this.filters[name].push(DsqLocal.Filters[name]);
		}

		this[name] = function() {
			var ret;

			if(typeof DsqLocal.Templates != 'undefined'
			&& typeof DsqLocal.Templates[name] == 'function') {
				ret = DsqLocal.Templates[name].apply(this, arguments);
			}

			if(ret === undefined) {
				ret = this['$$_' + name].apply(this, arguments);
			}

			if(this.filters[name]) {
				var args = [ret];

				args.push.apply(args, arguments);
				for(var i = 0; i < this.filters[name].length; i++) {
					ret = this.filters[name][i].apply(this, args);
				}
			}

			return ret;
		};
	};

	this.registerFilter = function(name, func) {
		this.filters[name] = this.filters[name] || [];
		this.filters[name].push(func);
	};

	/**
	 * Dsq.Templates.Filters
	 */
	this.Filters = new function() {
		this.commentContainer = function(post_id, s) {
			var _meta = Dsq.jsonData.posts[post_id];
			var classes = [];
			if(Dsq.jsonData.request.page > 1) {
				classes.push('dsq-append');
			}

			//
			// Extra classes used for custom themes
			//

			if(_meta.depth) {
				classes.push('dsq-comment-child', 'dsq-depth-' + _meta.depth, 'dsq-parent-is-' + _meta.parent_post_id);
			}


			//

			if(_meta.author_is_creator) {
				// TODO: We need to deprecate the "special" class since it is not properly prefixed.
				classes.push('special', 'dsq-special');
			}
			if(_meta.author_is_moderator) {
				classes.push('dsq-moderator');
			}
			classes.push(['dsq-odd', 'dsq-even'][Dsq.Templates.postLoopCounter % 2]);

			s = s.substring(0, s.lastIndexOf('>'));
			return s + ' class="dsq-comment ' + classes.join(' ') + '" style="margin-left:' + _meta.depth*30 + 'px">';
		};

		this.commentContent = function(post_id, s) {
			var _meta = Dsq.jsonData.posts[post_id];
			if (_meta.killed) {
				return '<em>Comment removed.</em>';
			} else if (!_meta.approved) {
				return '<em>This comment was flagged for review.</em>';
			}

			s = s.replace(Dsq.MEDIA_POST_RE, Dsq.MediaPostHandler);
			return s;
		};
	};

	//
	// Thread
	//
	// TODO: These need to be stripped of all Django template tags.

	this.authPost = function() {
		if (!Dsq.jsonData.context.show_reply) {
			return '';
		}
		var result = [];
		result = result.concat([
				'<div id="dsq-auth"',
						Dsq.jsonData.integration.reply_position ? 'class="dsq-auth-bottom"' : '',
						'>',
					'<div class="dsq-by">',
						'<a href="http://disqus.com" target="_blank">',
							(Dsq.jsonData.integration.disqus_logo ?
								Dsq.Utils.interpolate('<img src="%(media_url)s/images/embed/by-disqus.png" alt="discussion by DISQUS">') :
								Dsq.Utils.interpolate('<img src="%(media_url)s/images/embed/dsq-button-120x19.png" alt="discussion by DISQUS">')
							),
						'</a>',
					'</div>',
					'<div class="dsq-auth-header">',
						'<h3 id="dsq-add-new-comment" class="dsq-h3-addcomment">',
								Dsq.Strings.ADD_NEW_COMMENT,
						'</h3>',
						'<div id="dsq-login">',
						(!Dsq.jsonData.request.is_authenticated && Dsq.jsonData.forum.allow_anon_post
								? '<p class="dsq-login-message" id="dsq-login-message">You are commenting as a <a class="dsq-help" title="Click for more information" href="#" onclick="Dsq.Popup.helpBadges(); return false">Guest</a>. You may select one to log into:</p>'
								: '')
		]);
		if (!Dsq.jsonData.request.is_authenticated) {
			result = result.concat([
							Dsq.Utils.interpolate(
								'<a id="dsq-login-toggle" href="%(disqus_url)s%(login_url)s?next=article:%(thread_id)s" onclick="Dsq.Popup.login(); return false"><img class="dsq-login-icon" src="%(media_url)s/images/dsq-profile-btn.png" title="%(log_into)s" alt="%(log_into)s"/></a>',
								{login_url: Dsq.Urls.LOGIN, thread_id: Dsq.jsonData.thread.id, log_into: Dsq.Strings.LOG_INTO_DISQUS}
								),
							'&nbsp; ',
							(Dsq.jsonData.context.use_fb_connect ?
								'<div id="dsq-fbc-login" onlogin="DisqusFbcParentController.onLogin()" size="medium" background="light" length="short" style="display:inline; margin-right:7px"></div>' :
								''
							),
							(Dsq.jsonData.context.use_twitter_signin ?
								Dsq.Utils.interpolate(
									'<div id="dsq-twitter-login" class="dsq-twitter-login" onclick="Dsq.Twitter.startTwitterConnect();" style="display:inline; cursor: pointer"><img src="%(media_url)s/images/twitter-signin-short.png" style="margin-right:7px" /></div>', {}) : ''),
							(Dsq.jsonData.context.use_openid ?
								Dsq.Utils.interpolate(
									'<div id="dsq-openid-login" class="dsq-openid-login" onclick="Dsq.OpenID.requestURL();" style="display:inline; cursor:pointer;"><img src="%(media_url)s/images/openid-login-button.png"/></div>', {}
								) : '')
			]);
		}
		result = result.concat([
						'</div>', // dsq-login
					'</div>', // dsq-auth-header
					'<div id="dsq-authenticated" class="dsq-authenticated" ',
						Dsq.jsonData.request.is_authenticated ? 'style="display:block"' : '',
						'>',
						'<div class="dsq-authenticated-pic">',
								Dsq.Utils.interpolate('<a href="%(url)s" title="%(request_display_username)s">' +
																			'<img class="dsq-post-avatar" src="%(avatar_url)s" alt="" /></a>',
																			{avatar_url: Dsq.Urls.REQUEST_USER_AVATAR,
																			url: (Dsq.jsonData.request.is_remote
																					 ? Dsq.jsonData.request.url
																					 : Dsq.jsonData.settings.disqus_url + Dsq.Urls.REQUEST_USER_PROFILE) }),
						'</div>',
						'<div class="dsq-authenticated-info">',
							'<ul>',
								'<li>',
									(Dsq.jsonData.request.is_remote
										? Dsq.FmtStrings.LOGGED_IN_AS(
												Dsq.Utils.interpolate('<a href="%(url)s" title="%(request_display_username)s">%(request_display_username)s</a>', {url:Dsq.jsonData.request.url})
										  )
										: Dsq.FmtStrings.LOGGED_IN_AS(
												Dsq.Utils.interpolate('<a href="%(disqus_url)s%(profile_url)s" title="%(request_display_username)s">%(request_display_username)s</a>')
											)
									),
								'</li>',
								'<li class="logout">',
									(!Dsq.jsonData.request.is_remote
										? Dsq.Utils.interpolate('<img class="dsq-login-icon" src="%(media_url)s/images/dsqicon12.png" alt="%(logged_in_as)s"/>&nbsp',
											{logged_in_as: Dsq.FmtStrings.LOGGED_IN_AS(Dsq.jsonData.request.display_username)})
										: ''),

									(!Dsq.jsonData.request.is_remote
										? Dsq.Utils.interpolate('<a href="%(disqus_url)s%(logout_url)s?ctkn=%(csrf_token)s" title="%(logout_from_disqus)s">',
											{logout_url: Dsq.Urls.LOGOUT, csrf_token: Dsq.CSRF_TOKEN, logout_from_disqus: Dsq.FmtStrings.LOGOUT_FROM('DISQUS')})
										: ((Dsq.jsonData.request.remote_domain == 'twitter')
												? Dsq.Utils.interpolate('using Twitter (<a href="%(disqus_url)s%(logout_url)s?ctkn=%(csrf_token)s" title="Logout">Logout</a>)',
												 {logout_url: Dsq.Urls.LOGOUT, csrf_token: Dsq.CSRF_TOKEN})
												: ((Dsq.jsonData.request.remote_domain == 'openid')
													 ? Dsq.Utils.interpolate('using OpenID (<a href="%(disqus_url)s%(logout_url)s?ctkn=%(csrf_token)s" title="Logout">Logout</a>)',
													 {logout_url: Dsq.Urls.LOGOUT, csrf_token: Dsq.CSRF_TOKEN})
													 : ''
													)
											)
									),

									(!Dsq.jsonData.request.is_remote ? Dsq.FmtStrings.LOGOUT_FROM('<span class="logo-disqus">DISQUS</span>') : ''),
									'</a>',
								'</li>',
							'</ul>',
						'</div>',
					'</div>'
		]);
		if (Dsq.jsonData.context.use_fb_connect) {
			result = result.concat([
					'<div id="dsq-fbc-authenticated" class="dsq-authenticated">',
						'<div id="dsq-fbc-profilepic" class="dsq-authenticated-pic" uid="loggedinuser" type="FB.XFBML.ProfilePic" size="square" facebook-logo="true"></div>',
						'<div class="dsq-authenticated-info">',
							'<ul>',
								'<li>',
									'Logged in as <span id="dsq-fbc-name" uid="loggedinuser" type="FB.XFBML.Name" linked="true" useyou="false"></span>',
								'</li>',
								'<li class="logout">using Facebook Connect <a href="#" onclick="javascript:DisqusFbcParentController.logout();return false;">(Logout)</a></li>',
							'</ul>',
						'</div>',
					'</div>'
			]);
		}
		result = result.concat([
				'</div>', // dsq-auth
				'<div id="dsq-toolbar-items">',
				'</div>'
		]);
		result = result.concat([
					//
					//
					//
				((!Dsq.jsonData.forum.allow_anon_post && !Dsq.jsonData.request.is_authenticated) ?
					// Needs to be translated:
					('<p id="dsq-no-anon-msg">Required: Please log into <span class="logo-disqus">Disqus</span> ' +
					(Dsq.jsonData.context.use_fb_connect ? 'or connect with Facebook ' : '') +
					(Dsq.jsonData.context.use_twitter_signin ? 'or sign in with Twitter ' : '') +
					(Dsq.jsonData.context.use_openid ? 'or sign in using OpenID ' : '') +
					Dsq.Utils.interpolate('to comment on <strong>%(forum_name)s</strong>.</p>')) :
					''
				),
				'<div id="dsq-post-add"></div>',
				'<div style="margin:10px 0">',
				((Dsq.jsonData.forum.use_media) ?
						'<a href="#" id="dsq-media-link" onclick="Dsq.Post.showMenu(this, false, \'media\'); return false">' + Dsq.Strings.USE_MEDIA + ' <small>&#9660;</small></a>' :
						''),
				'</div>'
		]);
		return result.join('');
	};


	this.header = function() {

		var html = '\<h3 id="dsq-comments-count" class="dsq-h3-commentcount">\
	 <span id="dsq-num-posts">49</span> Comments\
	 &nbsp;\
	 <span class="dsq-item-feed">\
	 <a href="http://scobleizer.disqus.com/help_i8217m_clueless_about_web_service_scalability/latest.rss"><img src="http://media.disqus.com/images/embed/bullet-feed.png"></a>\
	 </span>\
	 </h3>\
	 <div id="dsq-options" style="margin:15px 0">\
	 <span class="dsq-item-sort">\
	 Sort by\
	 <select id="dsq-sort-select" onchange="Dsq.Thread.sortBy(this.value);">\
	 <option value="hot" selected="selected">Popular now</option>\
	 <option value="best" >Best Rating</option>\
	 <option value="newest" >Newest first</option>\
	 <option value="oldest" >Oldest first</option>\
	 </select>\
	 &nbsp;\
	 </span>\
	 <span class="dsq-item-cp"><a href="http://scobleizer.disqus.com/help_i8217m_clueless_about_web_service_scalability/">Community Page</a>&nbsp;&nbsp;&nbsp;</span>\
	 <span class="dsq-item-subscribe">\
	 <img src="http://media.disqus.com/images/embed/email.png" style="width:12px;height:12px;vertical-align:middle">\
	 <span id="dsq-subscribe">\
	 <a href="#" onclick="Dsq.Thread.subscribe(1); return false">Subscribe by email</a>\
	 </span>\
	 </span>\
	 </div>\
	 <div id="dsq-alerts">\
	 <p>Comments for this page are closed.</p>\
	 </div>\
		';

		

		
		if (Dsq.jsonData.request.is_moderator) { 
			html = ' \
			<div class="dsq-alert-message dsq-upgrade-message"> \
				<strong>Disqus upgrade available.</strong> Hi ' + Dsq.jsonData.request.display_username + ', this message is being displayed to you because you are a moderator of this site. <a href="#" onclick="Dsq.$(\'dsq-upgrade-message\').style.display=\'block\';this.style.display=\'none\';return false">Click here for details.</a> \
				<div style="display:none; margin-top:10px;" id="dsq-upgrade-message"> \
					A new theme is available with added features. <a href="http://disqus.com/comments/settings/' + Dsq.jsonData.forum.url + '/?p=customize">To change your theme, click here</a> and choose the theme Narcissus. \
					If you do not upgrade, you are missing out on features such as: real-time commenting, new sign-in integrations, and an upgrade interface. \
					<strong>This message will automatically go away in one week.</strong> \
				</div> \
			</div> \
			' + html; 
		}
		return html;
	};

	this.footer = function() {
		var html = Dsq.Templates.pagination();

		
			html += Dsq.Templates.authPost();
		

		html += Dsq.Templates.reactions();

		
			html += Dsq.Templates.trackbacks();
		

		return html;
	};

	this.pagination = function() {
		var html = '';
		
		if (Dsq.$('dsq-pagination')) { Dsq.$('dsq-pagination').innerHTML = ''; }
		if (!Dsq.jsonData.thread.paginate) { return ''; }

		//
		// TODO: num_paginator still uses the template tag for pagination, 
		// 		while append_paginator does it all in JavaScript.
		//		This should all be in JavaScript.
		//

		if (Dsq.jsonData.thread.num_pages > 1 && Dsq.jsonData.request.page < Dsq.jsonData.thread.num_pages) {
			html = ' \<a class="dsq-paginate-append-text" href="#" onclick="Dsq.Thread.paginate(Dsq.jsonData.request.page + 1, this); return false">Show more comments...</a>\
	 <button type="button" class="dsq-button-small dsq-paginate-append-button" onclick="Dsq.Thread.paginate(Dsq.jsonData.request.page + 1, this);">Load more comments</button>\
			';
		}
		
		if (Dsq.$('dsq-pagination')) {
			Dsq.$('dsq-pagination').innerHTML = html;
			return '';
		} else {
			return '<div id="dsq-pagination" class="dsq-pagination">' + html + '</div>';
		}
	};

	this.trackbacks = function() {
		var html = '';

		if(typeof DsqLocal != 'undefined' && DsqLocal.trackback_url && DsqLocal.trackbacks) {
			var trackbacks = DsqLocal.trackbacks;
			var trackback_url = DsqLocal.trackback_url;
		} else {
			var trackbacks = [
			
			
			];
			var trackback_url = 'http://scobleizer.disqus.com/help_i8217m_clueless_about_web_service_scalability/trackback/';
		}

		html += '<div class="dsq-item-trackback">Trackback URL&nbsp;&nbsp;<input class="dsq-trackback-url" onclick="this.select()" readonly="true" value="' + trackback_url + '"></div>';

		if(trackbacks.length) {
			html += '<ul id="dsq-references">'
			for(var i = 0; i < trackbacks.length; i++) {
				var trackback = trackbacks[i];
				html += '<li><cite><a href="' + trackback.author_url + '" rel="nofollow">' + trackback.author_name + '</a></cite> \
						<p class="dsq-meta">' + trackback.date + '</p> \
						<p class="dsq-content">' + trackback.excerpt + '</p></li>';
			}
			html += '</ul>';
			html = '<h3 class="dsq-h3-trackbacks">Trackbacks</h3>' + html;
		}

		return html;
	}

	this.showRetweets = function(id, limit, element_id /* Optional */) {
		var source, html = '';

		for (var i = 0, reaction; reaction = Dsq.jsonData.reactions[i]; i++) {
			if (reaction.id === id) {
				source = reaction.retweets;
			}
		}

		if (source) {
			if (limit === 0) {
				limit = source.length;
			}

			for (var j = 0; j < limit; j++) {
				var rt = source[j];
				html += '<a href="' + rt.url + '">' + rt.author_name + '</a>'	+ ((j === (limit - 1)) ? '.' : ', ');
			}
		}

		if (element_id === undefined) {
			return html;
		}

		var element = document.getElementById(element_id);
		element.innerHTML = html;
		return element;
	};

	this.showMoreReactions = function(reactions, has_more, start, limit) {
		var link = document.getElementById('dsq-show-more-reactions');
		var container = link.parentNode;
		container.removeChild(link);

		for (var i = 0, reaction; reaction = reactions[i]; i++) {
			var el = Dsq.Templates.generateReactionHTML(reaction);
			if (el) {
				container.innerHTML += el;
			}
		}

		if (has_more) {
			var d = Dsq.jsonData.settings.disqus_url;
			var f = Dsq.jsonData.forum.url;
			var t = Dsq.jsonData.thread.id;
			var s = start;
			var l = limit;

			var handler = 'Dsq.Utils.execScript(\'' + d + '/forums/' + f + '/more_reactions.js?t=' + t + '&s=' + s + '&l=' + l + '\', true); return false;';
			container.innerHTML += '<li id="dsq-show-more-reactions"><a href="#" onclick="' + handler + '">Show more reactions</a></li>';
		}
	};

	this.generateReactionHTML = function(reaction) {
		if (reaction.body === null || reaction.body == '') {
			return;
		}

		if (reaction.author_name === '') {
			reaction.author_name = '&nbsp;';
		}

		if (reaction.url === '') {
			reaction.url = reaction.get_service_url;
		}

		/* Reaction HTML begins */
		var item = '<li class="dsq-reaction" id="dsq-reaction-' + reaction.id + '">'
			+ '<div class="dsq-reaction-header">'
			+ '<div class="dsq-header-avatar">';

		if (reaction.author_url && reaction.author_url !== '') {
			item += '<a target="_blank" href="' + reaction.author_url +'">';
		} else {
			item += '<a target="_blank" href="#" onclick="return false;">';
		}

		if (reaction.avatar_url && reaction.avatar_url !== '') {
			item += '<img src="' + reaction.avatar_url + '"/>';
		} else {
			item += '<img src="' + Dsq.jsonData.media_url + '/images/noavatar32.png"/>';
		}

		var service_icon = (reaction.get_service_name == 'trackback' || reaction.get_service_name == 'pingback' ? 'rss' : reaction.get_service_name.replace(' ', ''));
		item += '<img class="dsq-service-icon" src="' + Dsq.jsonData.media_url + '/images/reactions/services/' + service_icon + '.png"/>'
			+ '</a></div>'
			+ '<cite><span>' + reaction.author_name + '</span></cite>'
			+ '<span class="dsq-header-meta"><a class="dsq-header-time">' + reaction.date_created + '</a></span>'
			+ '</div><div class="dsq-reaction-body">'
			+ '<div class="dsq-reaction-message">' + reaction.body + '</div>'
			+ '<div class="dsq-reaction-footer">From <a class="dsq-service-name" target="_blank" href="' + reaction.url + '">' + reaction.get_service_name + '</a> '
			+ 'via <a href="' + reaction.source_url + '">' + (reaction.source == 'backtype' ? 'BackType' : 'UberVU') + '</a>'
			+ (Dsq.jsonData.request.is_moderator || Dsq.jsonData.request.is_global_moderator ? '&nbsp;&bull;&nbsp;<a class="dsq-hide-reaction" href="#" onclick="Dsq.Reaction.hide(' + reaction.id + '); return false;">Hide</a>' : '') + '</div></div>';

		if(reaction.retweets) {
			var num_retweets = reaction.retweets.length;
			if (num_retweets > 0) {
				item += '<div class="dsq-reaction-retweets">';
				if (num_retweets == 1) {
					item += 'One more retweet from <a href="' + reaction.retweets[0].url + '">'  + reaction.retweets[0].author_name + '</a>';
				} else {
					item += (num_retweets + ' more retweets from ');

					item += '<span id="dsq-reaction-retweets-' + reaction.id + '">';
					var n_tweets = (num_retweets > 15) ? 15 : num_retweets;
					item += Dsq.Templates.showRetweets(reaction.id, n_tweets);

					if (n_tweets != num_retweets) {
						item += '</span> <a onclick="Dsq.Templates.showRetweets(' + reaction.id + ', 0, \'dsq-reaction-retweets-' + reaction.id + '\');'
							+ 'this.parentNode.removeChild(this); return false;" href="#">Show all</a>';
					}
				}
				item += '</div>';
			}
		}

		item += '</li>'; /* Reaction HTML ends */
		return item;
	};

	this.reactions = function() {
		var html, reaction;

		if (Dsq.jsonData.reactions === undefined || Dsq.jsonData.reactions.length === 0) {
			return '';
		}

		html = '';
		for (var i = 0; reaction = Dsq.jsonData.reactions[i]; i++) {
			var item = Dsq.Templates.generateReactionHTML(reaction);
			if (item) {
				html += item;
			}
		}

		if (Dsq.jsonData.has_more_reactions) {
			var d = Dsq.jsonData.settings.disqus_url;
			var f = Dsq.jsonData.forum.url;
			var t = Dsq.jsonData.thread.id;
			var s = Dsq.jsonData.reactions_start;
			var l = Dsq.jsonData.reactions_limit;

			var handler = 'Dsq.Utils.execScript(\'' + d + '/forums/' + f + '/more_reactions.js?t=' + t + '&s=' + s + '&l=' + l + '\', true); return false;';
			html += '<li id="dsq-show-more-reactions"><a href="#" onclick="' + handler + '">Show more reactions</a></li>';
		}

		return '<h3 class="dsq-h3-reactions">Reactions</h3><ul id="dsq-reactions" class="dsq-reactions">' + html + '</ul>';
	};
	
	this.missingPermissions = function() {
		return '	<p>Comments for this page are closed.</p>\n';
	};

	//
	// Post
	//

	this.prependPost = function(post_id) {
		var html = '<div id="comment-' + post_id + '"></div>';
		return html;
	};

	this.appendPost = function(post_id) {
		var html = '<div id="dsq-comment-reply-' + post_id + '"></div>';
		return html;
	};

	this.postPrependHeader = function(post_id) {
		var _meta = Dsq.jsonData.posts[post_id];
		var userData = Dsq.jsonData['users'][_meta.user_key];

		var _includeServices = function() {
			var userServices = Dsq.Post.getUserServices(null, post_id);
			var html = '';
			var hiddenThreshold = 3; // Define # of services to show before stuffing them in hidden div

			for(var i = 0; i < userServices.length; i++) {
				html +=
				(i == hiddenThreshold
					? '<li id="dsq-drop-hidden-' + post_id +'" class="dsq-drop-hidden"><ul>'
					: '')
				+ '<li class="dsq-drop-services"> \
					<a class="dsq-service-' + userServices[i].name.toLowerCase() + '" href="' + userServices[i].url + '" target="_blank"> \
						<img src="' + Dsq.jsonData.media_url + '/images/embed/services/' + userServices[i].name.toLowerCase() + '.png" alt="' + userServices[i].name.toLowerCase() + '">'
					+ userServices[i].name
					+ '</a> \
				</li>';
			}

			if(i >= hiddenThreshold) {
				html += '</ul></li> \
				<li id="dsq-drop-more-' + post_id + '" class="dsq-drop-more"><a href="#" onclick="Dsq.Post.dropProfileMore(this, '+ post_id + '); return false"><small>&#9660;</small></a></li> \
				';
			}
			return html;
		};

		return ' \
			<div class="dsq-header-avatar" id="dsq-header-avatar-' + post_id + '" onmouseover="Dsq.Post.dropProfile(' + post_id + ')"> \
				<a id="dsq-avatar-' + post_id + '" class="dsq-avatar" href="' + userData.url + '" onclick="Dsq.Popup.popProfile(' + post_id + '); return false;">'
			+ (Dsq.jsonData.forum.show_avatar
				? '<img src="' + Dsq.jsonData.users[_meta.user_key].avatar + '" alt="" />'
				: '')
			+ '</a>'
			+ '</div> \
		';
	};

	this.postAppendHeader = function(post_id) {
		var _meta = Dsq.jsonData.posts[post_id];

		return ''
			+ (_meta.author_is_moderator
				? '<img class="dsq-mod-star" src="http://media.disqus.com/images/bullet-star.png" title="Moderator" alt="" />'
				: '')
			+ '<span class="dsq-header-meta"> \
				<a id="dsq-time-' + post_id + '" class="dsq-header-time" href="#comment-' + post_id + '" title="Permalink">' + _meta.date + '</a> \
			</span>';
	};

	this.preBody = function(post_id) {
		return '';
	}

	this.postBody = function(post_id) {
		// TODO: Deprecate flagging conditional
		var _meta = Dsq.jsonData.posts[post_id];
		return ''
			+ (_meta.edited
				? '<p class="dsq-editedtxt">(Edited by a moderator)</p>'
				: '')
			;
	};

	this.postFooter = function(post_id) {
		// TODO: Use media should be conditional
		var _meta = Dsq.jsonData.posts[post_id];
		if(_meta.killed) { return ''; }

		return ' \
			<div class="dsq-comment-footer" id="dsq-comment-footer-' + post_id + '"> \
				<div id="dsq-points-' + post_id + '" class="dsq-likedtxt">'
				+ (_meta.points
					? _meta.points + Dsq.Utils.pluralize(_meta.points, ' person', ' people') + ' liked this comment.'
					: '')
				+ '</div>'
				+ '<ul class="dsq-comment-options dsq-list-style">'
				+ (_meta.votable
					? '<li class="dsq-list-first dsq-rate" id="dsq-rate-cont-' + post_id + '">'
					+ (!_meta.up_voted
						? '<a href="#" onclick="Dsq.Post.rate(this, ' + post_id + ', 1); return false;">Like</a>'
						: 'You liked this.') + '</li>'
					: '')
				+ '<li class="dsq-report' + (!_meta.votable ? ' dsq-list-first' : '') + '" id="dsq-post-report-' + post_id + '"><a href="#" class="dsq-post-report" onclick="Dsq.Post.report(' + post_id + ', false); return false;">Report</a></li> \
				</ul> \
				<ul class="dsq-list-style">'
				+ (_meta.can_reply
					? '<li class="dsq-list-first"><a href="#" id="dsq-reply-link-' + post_id +'" onclick="Dsq.Post.toggleReply(this, ' + post_id +'); return false;">Reply</a></li>'
					: '')
				+ (_meta.can_reply && !_meta.has_replies && _meta.from_request_user
					? '<li id="dsq-edit-el-' + post_id + '"><a id="dsq-edit-link-' + post_id + '" href="#" onclick="Dsq.Post.edit(this, ' + post_id + '); return false;">Edit</a></li>'
					: '')
				+ '<li class="' + (!_meta.can_reply ? 'dsq-list-first' : '') + '" id="dsq-more-el-' + post_id + '"><a id="dsq-more-link-' + post_id + '" href="#" onclick="Dsq.Post.showMenu(this, ' + post_id + ', \'more\'); return false">More <small>&#9660;</small></a></li>'
				+ (Dsq.jsonData.forum.use_media
					? '<li id="dsq-media-el-' + post_id +'" style="display:none"><a id="dsq-media-link-' + post_id + '" href="#" onclick="Dsq.Post.showMenu(this, ' + post_id + ', \'media\'); return false">Use Media <small>&#9660;</small></a></li>'
					: '')
				+ '</ul>'
				+ '<div id="dsq-reply-bar-' + post_id + '" class="dsq-reply-bar" style="display:none"> \
						<div id="dsq-reply-bar-items-' + post_id + '" class="dsq-reply-bar-items"> \
						</div> \
						<div id="dsq-reply-bar-auth-' + post_id + '" class="dsq-reply-bar-auth"> \
							 \
								 \
								 	<a href="#" class="dsq-help dsq-reply-req-opt" title="You are commenting as a Guest. You may choose to log into an existing DISQUS Profile, your Facebook, Twitter or OpenID account to comment on Scobleizer" onclick="Dsq.Popup.helpBadges(); return false">Optional:</a> \
								 \
								<img class="dsq-login-icon" src="http://media.disqus.com/images/dsq-favicon-16x16.png" alt="" /> \
								<a id="dsq-reply-login-' + post_id + '" href="http://disqus.com/profile/login/?next=article:18360842" onclick="Dsq.Popup.login(); return false">Login</a> \
								 \
									&nbsp;or&nbsp; \
									<img class="fb_login_image" src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_light_small_short.gif" alt="Facebook Connect"/> \
									<a href="#" onclick="FB.Connect.requireSession(DisqusFbcParentController.onLogin); return false;">Connect</a> \
								 \
								&nbsp;or&nbsp; \
									<img src="http://media.disqus.com/images/twitter-signin-icon.png" alt="" /> \
									<a href="#" onclick="Dsq.Twitter.startTwitterConnect(); return false">Sign-in</a> \
								 \
								 \
							 \
						</div> \
					</div> \
					<div id="dsq-reply-' + post_id + '"></div> \
			</div> \
		';
	};

	//
	// Iframes
	//

	this._makeAttributes = function(attributes) {
		// Makes a tag attributes string out of an object.
		// Caller is responsible for making sure nothing needs to be escaped.
		var result = [];
		for (key in attributes) {
			result.push(' ' + key + '="' + attributes[key] + '"');
		}
		result = result.join('');
		return result;
	};

	this._frameGeneric = function(base_url, params, attributes) {
		if(typeof(disqus_callback_params) == 'undefined') {
			disqus_callback_params = '';
		}

		var default_params = {
			// TODO: These should be moved to Dsq.jsonData.
			'f'				: 'scobleizer',
			't'				: 'help_i8217m_clueless_about_web_service_scalability',
			// Do we need encodeURIComponent here?
			'ifrs'			: encodeURIComponent(disqus_iframe_css),
			'to_redirect'	: encodeURIComponent(window.location),
			'cbp'			: disqus_callback_params,
			'ff'			: Dsq.Thread.ff,
			'fc'			: Dsq.Thread.fc,
			'ac'			: Dsq.Thread.ac,
			'default_text'	: disqus_default_text
		};

		base_url += '?' + (new Date()).getTime();
		// Add params to default_params.
		if(params) {
			for(var key in params) {
				if(params.hasOwnProperty(key)) {
					default_params[key] = encodeURIComponent(params[key]);
				}
			}
		}
		// Build querystring.
		for(var key in default_params) {
			if(default_params[key] && default_params.hasOwnProperty(key)) {
				base_url += '&' + key + '=' + default_params[key];
			}
		}

		return [
			'<iframe marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0"',
			(' allowtransparency="true" src="' + base_url + '"'),
			this._makeAttributes(attributes),
			'</iframe>'].join('');
	};

	this.frameLogin = function(opt_attributes) {
		var params = {};
		var base_url = 'http://disqus.com/embed/login.html';
		var attributes = opt_attributes || {};
		attributes['class'] = 'dsq-post-login';

		if(typeof disqus_frame_theme != 'undefined') {
			params['theme'] = disqus_frame_theme;
		}
		return this._frameGeneric(base_url, params, attributes);
	};

	this.frameReply = function(post_id, extra_params, attributes) {
		// Returns the HTML for a reply iframe. Called by Dsq.Iframes.setReplyIframeToContainer
		var _meta = (typeof post_id != 'undefined') ? Dsq.jsonData.posts[post_id] : false;
		var base_url = Dsq.Urls.REPLY;
		var params = {
			'def_email'		: disqus_def_email,
			'def_name'		: disqus_def_name
		};
		if(extra_params) {
			for(var key in extra_params) {
				if(extra_params.hasOwnProperty(key)) {
					params[key] = extra_params[key];
				}
			}
		}
		if(_meta) {
			params['parent_post'] = post_id;
		}
		if(typeof disqus_per_page != 'undefined') {
			params['per_page'] = disqus_per_page;
		}
		if(typeof disqus_frame_theme != 'undefined') {
			params['theme'] = disqus_frame_theme;
		}
		if(Dsq.jsonData.request.is_authenticated) {
			attributes['class'] += '-authenticated';
		}
		return this._frameGeneric(base_url, params, attributes);
	};

	this.frameEdit = function(post_id) {
		var _meta = (typeof post_id != 'undefined') ? Dsq.jsonData.posts[post_id] : false;
		var base_url = 'http://disqus.com/embed/edit.html';
		var params = {
			'p' : post_id
		};
		return this._frameGeneric(base_url, params, {'class': 'dsq-post-edit', 'name': 'dsq-edit_' + post_id + '-frame'});
	};

	//
	// Menus
	//

	this.menuMore = function(post_id) {
		// TODO: "Remove post" button should hide menu.
		var _meta = Dsq.jsonData.posts[post_id];
		var userData = Dsq.jsonData['users'][_meta.user_key];
		return ' \
			<li><a href="#comment-' + post_id + '" onclick="Dsq.Popup.permalink(' + post_id + ')">Link</a></li> \
			<li><a href="#" onclick="Dsq.Popup.popProfile(' + post_id + '); return false;">Profile</a></li>'
	+ (Dsq.jsonData.request.is_moderator || Dsq.jsonData.request.is_global_moderator
		? '	<li class="dsq-menu-sep"></li>' + (_meta.email ? '<li class="dsq-admin-email">' + _meta.email + '</li>' : '')
		+ '	<li class="dsq-admin-ip">' + _meta.ip + '</li> \
			<li class="dsq-menu-sep"></li>'
		+ (Dsq.jsonData.request.moderator_can_edit
			? ' <li class="dsq-admin-edit"><a href="#" onclick="Dsq.Post.edit(this, ' + post_id + '); return false;">Edit Comment</a></li>'
			: '')
		+ ' <li class="dsq-remove"><a href="#" onclick="Dsq.Post.removePost(' + post_id + ', 1); return false;">Remove Comment</a></li> \
			<li class="dsq-report-spam"><a href="#" onclick="Dsq.Post.reportSpam(' + post_id + '); return false;">Mark Spam</a></li> \
			<li class="dsq-block-user"><a href="#" onclick="Dsq.Popup.blacklist(' + post_id + '); return false">Block User</a></li>'
		: '');
	};

	this.menuMedia = function(post_id) {
		return ' \
			<li><a href="#" onclick="Dsq.Post.toggleMediaReply(this, ' + post_id + ', \'seesmic\'); return false;">Record video</a></li> \
		';
	};

	this.dropProfile = function(post_id) {
		var _meta = Dsq.jsonData.posts[post_id];
		var userData = Dsq.jsonData['users'][_meta.user_key];

		var _includeServices = function() {
			var userServices = Dsq.Post.getUserServices(null, post_id);
			var html = '';
			var hiddenThreshold = 3; // Define # of services to show before stuffing them in hidden div

			for(var i = 0; i < userServices.length; i++) {
				html +=
				(i == hiddenThreshold
					? '<li id="dsq-drop-hidden-' + post_id +'" class="dsq-drop-hidden"><ul>'
					: '')
				+ '<li class="dsq-drop-services"> \
					<a class="dsq-service-' + userServices[i].name.toLowerCase() + '" href="' + userServices[i].url + '" target="_blank"> \
						<img src="' + Dsq.jsonData.media_url + '/images/embed/services/' + userServices[i].name.toLowerCase() + '.png" alt="' + userServices[i].name.toLowerCase() + '">'
					+ userServices[i].name
					+ '</a> \
				</li>';
			}

			if(i >= hiddenThreshold) {
				html += '</ul></li> \
				<li id="dsq-drop-more-' + post_id + '" class="dsq-drop-more"><a href="#" onclick="Dsq.Post.dropProfileMore(this, '+ post_id + '); return false"><small>&#9660;</small></a></li> \
				';
			}
			return html;
		};


		var menu = '<li class="dsq-drop-showlnk"><a href="#" onclick="Dsq.Popup.popProfile(' + post_id + '); return false;">Expand &#8663;</a></li>';
		var pointsMessage = '';
		if (userData['registered']) {
			pointsMessage = 'with ' + userData['points'] + ' points (more points are better).';
		}

		if (userData['is_remote']) {
			var domain = userData['remote_domain_name'];
			menu += '<li class="dsq-drop-badge" title="' + userData['display_name'] + ' is a ' + domain + ' user ' + pointsMessage + '" onclick="Dsq.Popup.helpBadges()">';
			menu += '<span class="dsq-badge-' + domain.toLowerCase() + '">' + domain + '</span></li>';
		} else if (userData['registered']) {
			if (userData['verified']) {
				menu += '<li class="dsq-drop-badge" title="' + userData['display_name'] + ' has a verified commenter profile ' + pointsMessage + '" onclick="Dsq.Popup.helpBadges()">';
				menu += '<span class="dsq-badge-verified">Verified</span></li>';
			} else {
				menu += '<li class="dsq-drop-badge" title="' + userData['display_name'] + ' has a registered, but unverified, commenter profile ' + pointsMessage + '" onclick="Dsq.Popup.helpBadges()">';
				menu += '<span class="dsq-badge-registered">Registered</span></li>';
			}
		} else {
			menu += '<li class="dsq-drop-badge" title="' + userData['display_name'] + ' has not claimed this commenter profile." onclick="Dsq.Popup.helpBadges()"><span class="dsq-badge-guest">Guest</span></li>';
		}

		menu += _includeServices();
		return menu;
	};

	//
	// Popups
	//

	this._popupGeneric = function(content) {
		return ' \
		<div class="dsq-popup-content"> \
			<div class="dsq-popup-top"></div> \
			<div class="dsq-popup-body" class="clearfix"> \
				<div class="dsq-popup-body-padding"> \
					<div class="dsq-popup-header"> \
						<a class="dsq-close-link" href="#" onclick="Dsq.Popup._closePopup(null, true); return false"><img src="http://media.disqus.com/images/modal-close.png" alt="" /></a>'
						+ content['header']
					+ '</div>'
					+ content['body']
					+ '<div class="powered-by"><a href="http://disqus.com/comments/">Powered by <img src="http://media.disqus.com/images/embed/disqus-logo.png" alt="Disqus Comments" style="margin-bottom:-5px" /></a></div> \
				</div> <!-- padding --> \
			</div> <!-- body --> \
			<div class="dsq-popup-bottom"></div> \
		</div> \
		';
	};

	this.popupProfile = function(user_key) {
		var userServices = Dsq.Post.getUserServices(user_key, null);
		var userData = Dsq.jsonData['users'][user_key];
		var headerHtml = '';
		var bodyHtml = '';
		var content = {};

		var _includeServices = function() {
			var html = '';
			for(var i = 0; i < userServices.length; i++) {
				html +=
				(i == 0
					? '<h4>Connections</h4><ul>'
					: '')
				+ '<li> \
					<img src="' + Dsq.jsonData.media_url + '/images/embed/services/' + userServices[i].name.toLowerCase() + '.png" alt="' + userServices[i].name.toLowerCase() + '" title="' + userServices[i].name.toLowerCase() + '" /> \
					<a class="dsq-service-' + userServices[i].name.toLowerCase() + '" href="' + userServices[i].url + '" target="_blank">'
					+ userServices[i].name
					+ '</a> \
				</li>'
				+ (i+1 == userServices.length ? '</ul>' : '');
			}
			return html;
		};

		headerHtml = ' \
			<table> \
				<tr> \
					<td> \
						<a class="dsq-profile-userurl" href="' + userData.url + '"><img class="dsq-popup-profile-avatar" src="' + userData['avatar'] + '" alt="" /></a> \
					</td> \
					<td> \
						<div class="dsq-popup-profile-user"> \
							<h3>' + userData['display_name'] + '</h3> \
							<div class="dsq-popup-profile-user-stats" id="dsq-popup-profile-user-stats-' + user_key + '">Loading...</div> \
						</div> \
					</td> \
				</tr> \
			</table> \
		';

		bodyHtml = ' \
			<div class="dsq-popup-profile-state"> \
				This is a&nbsp;<span class="'
					+ (userData['registered']
						? (userData['verified']
							? ' dsq-badge-verified'
							: (userData['is_remote']
								? ' dsq-badge-' + userData['remote_domain_name'].toLowerCase()
								: ' dsq-badge-registered')
							)
							: ' dsq-badge-guest') + '">'
			+ (userData['registered']
				? (userData['verified']
					? 'Verified'
					: (userData['is_remote']
						 ? userData['remote_domain_name']
						 : 'Registered')
					)
				: 'Guest')
			+ '</span>&nbsp;commenter profile.'
			+ '&nbsp;<a class="dsq-profile-userurl" href="' + userData.url + '"><strong>View more comments </strong></a>'
			+ (!userData['points']
				? '<p class="dsq-popup-notice">If this is you, <a href="http://disqus.com/profile" target="_blank">claim it now</a> to manage your comments.</p>'
				: '')
			+ ((userData['registered'] && !userData['verified'] && (Dsq.jsonData.request.username && (Dsq.jsonData.request.username == userData['username'])) && !userData['is_remote'])
				? '<p class="dsq-popup-notice"><strong>Alert</strong>: You have not verified this account. <a href="http://disqus.com/verify">Verify it now.</a></p>'
				: '')
			+ '</div> \
			<div id="dsq-profile-status-' + user_key + '" class="dsq-popup-profile-status" style="display:none"></div> \
			<div class="dsq-popup-profile-snapshot"> \
				<table> \
					<tr> \
						<td> \
							<div id="dsq-popup-profile-active-sites-wrapper-' + user_key + '"> \
								<h4>Most active sites</h4> \
								<ul id="dsq-popup-profile-active-sites-' + user_key + '"> \
									<li>Loading...</li> \
								</ul> \
							</div> \
						</td> \
						<td>'
							+ _includeServices()
							+ '<div id="dsq-popup-profile-moderated-wrapper-' + user_key + '"> \
								<h4>Moderator of</h4> \
								<ul id="dsq-popup-profile-moderated-' + user_key + '"> \
									<li>Loading...</li> \
								</ul> \
							</div> \
						</td> \
					</tr> \
				</table> \
			</div> \
			';

		content = {
			'header': headerHtml,
			'body': bodyHtml
		};

		return this._popupGeneric(content);
	};

	this.popupReblog = function() {
		var headerHtml = '';
		var bodyHtml = '';
		var content = {};

		headerHtml = ' \
			<cite><span>Reblog this comment</span></cite> \
		';

		bodyHtml = ' \
			<div id="dsq-reblog-form" class="dsq-reblog-form"> \
			</div> \
		';

		content = {
			'header': headerHtml,
			'body': bodyHtml
		};

		return this._popupGeneric(content);
	};

	this.popupModal = function(title, message) {
		var headerHtml = '';
		var bodyHtml = '';
		var content = {};

		headerHtml = ' \
			<h3>' + title + '</h3> \
		';

		bodyHtml = message;

		content = {
			'header': headerHtml,
			'body': bodyHtml
		};

		return this._popupGeneric(content);
	};

	this.alertContent = function(name, post_id) {
		var alert = {
			'post_not_approved': {
				'title': 'Comment awaiting approval by a moderator',
				'message': 'Thanks for posting. Your comment must be approved by a moderator before appearing here.'
			},
			'post_has_profile': {
				'title': 'Use your existing commenter profile',
				'message': 'You have just posted your commment as a <span class="dsq-badge dsq-badge-guest">Guest</span>, but you may already have a <span class="dsq-badge dsq-badge-registered">Registered</span> commenter profile.<br /><br /><a href="http://disqus.com/claim">Log in and claim this comment!</a>'
			}
		};
		return alert[name] || false;
	};

	//
	// Actions
	//

	this.voted = function(post_id, points, vote) {
		// Update number of points
		Dsq.$('dsq-points-' + post_id).innerHTML = points + Dsq.Utils.pluralize(points, ' person', ' people') + ' liked this comment.';

		// Update link text
		if(vote) {
			Dsq.$('dsq-rate-cont-' + post_id).innerHTML = 'You liked this.';
		}
	};

	this.subscribed = function(status) {
		var title, message;

		if(status) {
			title = 'Subscribed!';
			message = 'You have subscribed to this comment thread. New comments will be sent directly to your email inbox, where you may read and respond by email.';
			Dsq.$('dsq-subscribe').innerHTML = ' \
				<a href="#" onclick="Dsq.Thread.subscribe(0); return false">Unsubscribe</a> \
			';
		} else {
			title = 'Unsubscribed';
			message = 'You have unsubscribed to this comment thread. New comments will no longer be sent to your email inbox.';
			Dsq.$('dsq-subscribe').innerHTML = ' \
				<a href="#" onclick="Dsq.Thread.subscribe(1); return false">Subscribe by email</a> \
			';
		}

		Dsq.Popup.popModal(message, title);

	};
	
	this.highlighted = function() {
		Dsq.Popup.popModal('This comment has been highlighted.', 'Highlighted comment');
	};

	//
	// Media
	//

	this.mediaSeesmic = function(id, thumb) {
		return ' \
			<div id="dsq-seesmic-' + id + '_preview" class="dsq-seesmic-preview"><a href="http://www.seesmic.com/video/' + id + '" target="_blank" class="see_link">&nbsp;</a> \
				<div style="display:block;width:160px; height:120px; border:none; background-image:url(http://t.seesmic.com/thumbnail/' + thumb + ')"> \
					<div id="dsq-seesmic-' + id + '_hide" class="seePlayOverlay" style="display:none;"><img onclick="see_play_video(\'' + id + '\',false)" src="http://media.disqus.com/images/seesmic/stopOverlay.png" width="50" height="50" style="cursor:pointer; cursor:hand; padding-top: 30px; padding-left: 50px" alt="" /></div> \
					<div id="dsq-seesmic-' + id + '_show" class="seePlayOverlay"><img onclick="see_play_video(\'' + id + '\',true)" src="http://media.disqus.com/images/seesmic/playOverlay.png" width="50" height="50" style="cursor:pointer; cursor:hand; border:none; padding-top: 30px; padding-left: 50px" alt="" /></div> \
				</div> \
			</div> \
			<div id="' + id + '_content" style="display:block; width:100%; padding-top:5px"></div> \
		';
	};

	//
	// Callbacks
	//

	this.postComment_onSuccess = function(parent_post_id) {
		// Increment post count
		var num_posts = Dsq.$('dsq-num-posts');
		var total_posts = Dsq.$('dsq-total-posts');
		
		if (num_posts) { 
			num_posts.innerHTML = parseInt(num_posts.innerHTML) + 1;
		}
		if (total_posts) { 
			total_posts.innerHTML = parseInt(total_posts.innerHTML) + 1;
		}
	};
};
// Dsq.Templates


/**
 * Dsq.Post
 */
Dsq.Post = new function() {
	this.openedMenu = {};
	this.menuEventListener = null;
	this.stateReplyToggled = {};
	this.stateEditToggled = {};
	this.stateRecordLink = {};

	/**
	 * Inserts a new post into the document.
	 *
	 * @param after_id {Number}	Insert a post before specified id.  If after_id
	 *							evaluates to false, then post in the front.  If
	 *							after_id is -1, post at the end.
	 */
	this.insert = function(after_id, id, message, author) {
		// Skeleton template from thread_posts.html.
		var skeleton = ' \
			<li id="dsq-comment-%(id)s"> \
				<div id="dsq-comment-header-%(id)s" class="dsq-comment-header"> \
					<cite id="dsq-cite-%(id)s" class="dsq-comment-cite"> \
						<a id="dsq-author-user-%(id)s" href="%(author_url)s" target="_blank" rel="nofollow">%(author_name)s</a> \
					</cite> \
				</div> \
				<div id="dsq-comment-body-%(id)s" class="dsq-comment-body"> \
					<div id="dsq-comment-message-%(id)s" class="dsq-comment-message">%(message)s</div> \
				</div> \
			</li> \
		';
		var _meta = Dsq.jsonData.posts[id];
		var _user_meta = Dsq.jsonData.users[_meta.user_key];
		var markup = Dsq.Utils.interpolate(skeleton, {
			id: id,
			message: message,
			author_url: _user_meta.blog,
			author_name: _user_meta.display_name
		});
		var div = document.createElement('div');
		markup = markup.replace(Dsq.COMMENTS_RE, Dsq.CommentsHandler);
		div.innerHTML = markup;

		if (after_id === -1) {
			Dsq.$('dsq-comments').appendChild(div);
		} else if (!after_id) {
			Dsq.$('dsq-comments').insertBefore(div, Dsq.$('dsq-comments').firstChild);
		} else if (Dsq.$('dsq-comment-' + after_id)) {
			// Get next node after "after_id", so we can insert before it.
			// If "after_id" is the last comment, the target node is the
			// last node.
			
			// var append_post_id = Dsq.Templates.appendPost(after_id).replace('<div id="','').replace('"></div>', '');
			var append_post_id = 'dsq-append-post-' + after_id;
			var node = Dsq.$(append_post_id);
			while (node = node.nextSibling) {
				if (!node || node.nodeType == 1) { // 1 == Node.ELEMENT_NODE
					break;
				}
			}
			if (!node) {
				node = Dsq.$(append_post_id);
			}
			node.parentNode.insertBefore(div, node);
		}
	};

	this.incrementPostCount = function() {
		
		var num_posts = Dsq.$('dsq-num-posts');
		var total_posts = Dsq.$('dsq-total-posts');

		if (num_posts) {
			num_posts.innerHTML = parseInt(num_posts.innerHTML, 10) + 1;
		}
		if (total_posts) {
			total_posts.innerHTML = parseInt(total_posts.innerHTML, 10) + 1;
		}
	}
	
	this.outlineComment = function(post_id) {
		Dsq.$('dsq-comment-' + post_id).className += ' dsq-comment-outline';
		setTimeout("(function () { Dsq.Post.clearOutlineComment(" + post_id + ") })()", 3000);
	};
	
	this.clearOutlineComment = function(post_id) {
		Dsq.$('dsq-comment-' + post_id).className = Dsq.$('dsq-comment-' + post_id).className.replace('dsq-comment-outline', '');
	};

	this.showMenu = function(el, id, name) {
		var anchorPos = Dsq.Utils.findPos(el);
		var menu = document.createElement('ul');

		if(this.openedMenu) {
			if(this.openedMenu.linkClicked) {
				this.openedMenu.linkClicked = false;
				return;
			}
		}

		switch(name) {
			case 'more':
				menu.innerHTML = Dsq.Templates.menuMore(id);
				break;
			case 'media':
				menu.innerHTML = Dsq.Templates.menuMedia(id);
				break;
			default:
				break;
		}

		// Add menu to document body
		menu.id = 'dsq-menu-' + id;
		menu.className = 'dsq-menu';
		Dsq.$b.appendChild(menu);

		// Position and show
		anchorPos[1] += 15;
		menu.style.left = anchorPos[0] + 'px';
		menu.style.top = anchorPos[1] + 'px';
		menu.style.display = 'block';

		// Set global reference
		this.openedMenu = {
			'el' : menu,
			'id' : id,
			'name' : name,
			'linkClicked' : false
		};

		// Set listener
		this.menuEventListener = Dsq.Utils.addEventListener(document, 'mouseup', this._hideMenu);
	};

	this._hideMenu = function(e) {
		var el = e.target || e.srcElement;
		var openedMenu = Dsq.Post.openedMenu.el;
		var id = Dsq.Post.openedMenu.id;

		if(!id) {
			var link = 'dsq-' + Dsq.Post.openedMenu.name + '-link';
		} else {
			var link = 'dsq-' + Dsq.Post.openedMenu.name + '-link-' + id;
		}

		if(!openedMenu) {
			return;
		}

		if(!Dsq.Popup.isClicked(e, openedMenu.id)) {
			openedMenu.style.display = 'none';
			Dsq.Utils.removeEventListener(Dsq.Post.menuEventListener);
			Dsq.Utils.deleteNode(openedMenu);

		} else {
			// Hide the menu if a link was clicked inside the menu.  We can't
			// completely remove the menu until the onclick event on the link
			// fires, but the menuEventListener will prevent multiple menus
			// from polluting the DOM.
			if(el && typeof el.href != 'undefined') {
				openedMenu.style.display = 'none';
				Dsq.Post.openedMenu.el = null;
			}
		}

		if(Dsq.Popup.isClicked(e, link)) {
 			Dsq.Post.openedMenu.linkClicked = true;
		}
	};


	this.getUserServices = function(user_key, id) {
		if(!user_key && id) {
			var _meta = Dsq.jsonData.posts[id];
			user_key = _meta.user_key;
		}
		var userData = Dsq.jsonData['users'][user_key];
		var userServices = [];

		// Keep a full list of supported services. This is the order they will display in the drop-profile.
		// Each service must have a corresponding case in _buildServiceUrl()
		var supportedServices = ['blog', 'twitter', 'facebook', 'tumblr'];

		function _buildServiceUrl(serviceName) {
			var data = userData[serviceName];
			var services = {
				blog:		function(d) { return d; },
				twitter:	function(d) { return d; },
				facebook:	function(d) { return d; },
				tumblr:		function(d) { return 'http://' + d + '.tumblr.com'; }
			};
			return services[serviceName](data);
		}

		for(var i = 0; i < supportedServices.length; i++) {
			if(userData[supportedServices[i]]) {
				var serviceUrl = _buildServiceUrl(supportedServices[i]);
				userServices.push({'name' : supportedServices[i], 'url' : serviceUrl});
			}
		}
		return userServices;
	}

	this.dropProfile = function(id) {
		var dp = Dsq.$('dsq-drop-profile-' + id);

		// IE6 needs JS to display/hide. All other browsers use CSS.
		if(dp) {
			if(Dsq.Utils.ie6) dp.style.display = (dp.style.display == 'inline') ? 'none' : 'inline';
			return false;
		} else {
			dp = document.createElement('ul');
		}

		dp.id = 'dsq-drop-profile-' + id;
		dp.className = 'dsq-drop-profile';

		if(Dsq.Utils.ie6) { dp.style.display = 'inline'; }

		var container = Dsq.$('dsq-header-avatar-' + id);
		dp.innerHTML = Dsq.Templates.dropProfile(id);
		container.appendChild(dp);
	};

	this.dropProfileMore = function(el, id) {
		var hiddenItems = Dsq.$('dsq-drop-hidden-' + id);

		hiddenItems.style.display = 'inline';
		el.parentNode.style.display = 'none';
	};

	this._updateReplyLinks = function(el, id) {
		// Update "reply / cancel" links based on state.
		var displayDict = {};

		if(id) {
			if(this.stateReplyToggled[id]) {
				el.innerHTML = 'Cancel';
				displayDict['media'] = 'inline';
				displayDict['edit'] = 'none';
			} else {
				el.innerHTML = 'Reply';
				displayDict['media'] = 'none';
				displayDict['edit'] = 'inline';
			}
		}

		for(var key in displayDict) {
			if(displayDict.hasOwnProperty(key)) {
				var	linkEl = Dsq.$('dsq-' + key + '-el-' + id),
					spacer = Dsq.$('dsq-' + key + '-spacer-' + id);

				if(linkEl) {
					linkEl.style.display = displayDict[key];
					if(spacer) spacer.style.display = displayDict[key];
				}
			}
		}
	};

	this._updateMediaLinks = function(el, id) {
		// Update "use media / cancel" links based on state.
		var appendId = (id) ? ('-' + id) : '';
		var link = Dsq.$('dsq-media-link' + appendId);

		if(this.stateRecordLink[id]) {
			link.innerHTML = 'Cancel Media';
			link.onclick = function() { Dsq.Post.toggleMediaReply(link, id); return false; };
		} else {
			link.innerHTML = 'Use Media <small>&#9660;</small>';
			link.onclick = function() { Dsq.Post.showMenu(link, id, 'media'); return false; };
		}
	};

	this.toggleReply = function(el, id) {
		// Create reply IFrame
		if (window.disqus_use_postmessage) {
			if (!this.stateReplyToggled[id]) {
				Dsq.$('dsq-reply-' + id).style.display = 'block';
				Dsq.$('dsq-reply-bar-' + id).style.display = 'block';
				// Create IFrame if it doesn't exist.
				if (!Dsq.frames['reply_' + id]) {
					var _meta = Dsq.jsonData.posts[id];
					Dsq.frames['reply_' + id] = new Dsq.ReplyFrame(Dsq.$('dsq-reply-frame-' + id), id);
					Dsq.frames['reply_' + id].init();
					Dsq.frames['reply_' + id].setState(id, _meta.depth);
				}
			} else {
				Dsq.$('dsq-reply-' + id).style.display = 'none';
				Dsq.$('dsq-reply-bar-' + id).style.display = 'none';
			}
		} else {
			// DEPRECATED
			if(!this.stateReplyToggled[id]) {
				// Reply toolbar
				Dsq.$('dsq-reply-bar-' + id).style.display = 'block';
				Dsq.Iframes.showReplyIframeInContainerIfAllowed(Dsq.$('dsq-reply-' + id), id);
			} else {
				Dsq.$('dsq-reply-bar-' + id).style.display = 'none';
				Dsq.Iframes.hideAllInContainer(Dsq.$('dsq-reply-' + id));
				if(this.stateRecordLink[id]) {
					// HACK: Cancel media before canceling self.
					this.toggleMediaReply(Dsq.$('dsq-media-link-' + id), id);
				}
			}
		}

		this.stateReplyToggled[id] = !this.stateReplyToggled[id];
		this._updateReplyLinks(el, id);

		if(Dsq.Utils.ie) { Dsq.Utils.fixIframesIE('dsq-reply-' + id); }

		Dsq.Events.fire(Dsq.Events.REPLY_IFRAME_TOGGLED, {
			postId: id,
			opened: this.stateReplyToggled[id]
		});
	};

	this.toggleMediaReply = function(el, id, xtype) {
		id = id || 0;
		if(id) {
			var container = Dsq.$('dsq-reply-' + id);
		} else {
			var container = Dsq.$('dsq-post-add');
		}

		if(!this.stateRecordLink[id]) {
			Dsq.Iframes.showReplyIframeInContainer(container, id, {xtype:xtype}, 'dsq-post-video');
		} else {
			Dsq.Iframes.showReplyIframeInContainer(container, id);
		}
		this.stateRecordLink[id] = !this.stateRecordLink[id];
		this._updateMediaLinks(el, id);

		if(Dsq.Utils.ie) { Dsq.Utils.fixIframesIE(); }
	};

	this.edit = function(el, id) {
		Dsq.$('dsq-comment-message-' + id).innerHTML = Dsq.Templates.frameEdit(id);
		el.parentNode.style.display = 'none';
		if(Dsq.Utils.ie) { Dsq.Utils.fixIframesIE('dsq-comment-message-' + id); }
	};

    this.rate = function(el, id, vote) {
		if(Dsq.jsonData.request.is_authenticated || Dsq.jsonData.forum.allow_anon_votes) {
			if(vote == 1) {
                Dsq.$('dsq-rate-cont-' + id).innerHTML = '<img src="http://media.disqus.com/images/loading-small.gif">';
            }

            Dsq.Utils.execScript('http://disqus.com/forums/scobleizer/vote.js'
                + '?post_id='    + id
                + '&vote='        + vote);

		} else {
			Dsq.Popup.login(Dsq.Strings.TO_RATE_PLEASE_LOG_IN);
		}
    };

	this.report = function(id, confirmed) {
		if(confirmed) {
			Dsq.Utils.postToUrl('http://disqus.com/forums/scobleizer/help_i8217m_clueless_about_web_service_scalability/post_report/', {'post_id': id});
			Dsq.Popup.popModal('Thank you. This comment has been flagged for moderator attention.', 'Successfully flagged');
			Dsq.Utils.deleteNode(Dsq.$('dsq-post-report-' + id));
		} else {
			var title = Dsq.Strings.FLAG_INAPPROPRIATE_COMMENT;
			var message = Dsq.Strings.ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPORT_THIS_COMMENT_TO_A_MODERATOR + '? \
			<br /><br /> \
			<button type="button" onclick="Dsq.Popup._closePopup(null, true)"><strong>' + Dsq.Strings.NO + '</strong>, ' + Dsq.Strings.NEVER_MIND + '</button>&nbsp;&nbsp;&nbsp;<button type="button" onclick="Dsq.Post.report(' + id + ', true);"><strong>' + Dsq.Strings.YES + '</strong>, ' + Dsq.Strings.FLAG_INAPPROPRIATE_COMMENT + '</button><br /><br />'
			+ Dsq.Strings.THIS_WILL_FLAG_COMMENTS_FOR_MODERATORS_TO_TAKE_ACTION + '. \
			';

			Dsq.Popup.popModal(message, title, id);
		}
	};



	this.showAlert = function(id, msg) {
		var msgEl = Dsq.$('dsq-comment-message-' + id);
		var alert = '<div class="dsq-comment-alert">' + msg + '</div>';

		msgEl.innerHTML = alert + msgEl.innerHTML;
	};

};
// Dsq.Post


/**
 * Dsq.Thread
 */
Dsq.Thread = new function() {
	this.fc = null;
	this.ff = null;
	this.ac = null;

	
	this.adminIsOn = false;

	
	
	

	this.hlComment = null;
	this.hlCommentClass = null;

	this.getNextComment = function(el) {
		var start_id = el.id;
		while(el = el.nextSibling) {
			if(el.id && el.id.indexOf('dsq-comment-') != -1 && el.id != start_id) {
				return el;
			}
		}
		return null;
	};

	this.getActiveCommentId = function() {
		if (document.URL.indexOf('#comment-') >= 0) {
			var anchor = document.URL.slice(document.URL.indexOf('#') + 1);
			return anchor.replace('comment-', '');
		}
		return null;
	};

	this.highlightAnchor = function() {
		var i = this.getActiveCommentId();
		if (i == null) return false;
		var id = 'dsq-comment-' + i;
		var hash = window.location.hash;

		// Toggle the hash incase the comment isn't available when the page loads
		// for WebKit-based browsers.
		if (Dsq.Utils.webkit) {
			window.location.hash = '';
			window.location.hash = hash;
		}

		this.hlComment = Dsq.$(id);
		// Adding this conditional guard pending #289
		if (!this.hlComment) {
			return;
		}
		this.hlCommentClass = this.hlComment.className;
		this.hlComment.className += ' dsq-hl-anchor';

		setTimeout("Dsq.Thread.highlightClear()", 3000);
	};

	this.highlightClear = function() {
		if (!this.hlComment) {
			return;
		}
		this.hlComment.className = this.hlCommentClass;
	};

	this.login = function(toggle) {
		// toggle id is #dsq-reply-login-[id]
		var postId;
		if(toggle.id.indexOf('dsq-reply-login') != -1) {
			postId = toggle.id.slice(16);
			var container = Dsq.$('dsq-reply-' + postId);
		} else {
			var container = Dsq.$('dsq-post-add');
		}

		if(toggle) {
			if(toggle.className == 'dsq-login-active') {
				Dsq.Iframes.showReplyIframeInContainerIfAllowed(container, postId);
				toggle.className = '';
			} else {
				Dsq.Iframes.showLoginIframeInContainer(container, postId);
				toggle.className = 'dsq-login-active';
			}
		} else {
			Dsq.Iframes.showLoginIframeInContainer(container, postId);
		}

		if(Dsq.Utils.ie) { Dsq.Utils.fixIframesIE(); }
	};


	this.paginate = function(page, el_clicked, per_page) {
		// Use extra_params to pass any override parameters that we need to persist.
		var extra_params = '';

		// "Per page" can either be overriden by providing it as an argument
		// (per-call) or setting the disqus_per_page override variable (global).
		if(typeof per_page == 'undefined') {
			per_page = null;
		}
		if(typeof disqus_per_page != 'undefined' && per_page === null) {
			per_page = disqus_per_page;
		}

		if(typeof disqus_sort != 'undefined') {
			extra_params += '&sort=' + disqus_sort;
		}
		if(per_page !== null) {
			extra_params += '&per_page=' + per_page;
		}

		Dsq.$('dsq-pagination').innerHTML += '<img src="http://media.disqus.com/images/loading-small.gif">';
		
		if(el_clicked) {
			el_clicked.style.display = 'none';
		}
		
		Dsq.Utils.execScript('http://disqus.com/forums/scobleizer/thread.js'
			+ '?slug='	+ 'help_i8217m_clueless_about_web_service_scalability'
			+ '&p='		+ page
			+ extra_params);
	};

	this.sortBy = function(sort) {
		var disqus_script = document.createElement('script');
		var disqus_date = new Date();

		if (location.hash != '') {
			location.hash = '#disqus_thread';
		}

		if(typeof(disqus_url) == 'undefined') {
			disqus_url = disqus_href;
		}
		disqus_script.type = 'text/javascript';
		disqus_script.src = 'http://disqus.com/forums/scobleizer/thread.js'
			+ '?slug='	+ 'help_i8217m_clueless_about_web_service_scalability'
			+ '&sort='	+ sort
			+ '&title='
			+ '&'		+ disqus_date.getTime();

		Dsq.$('dsq-comments').innerHTML = '<img src="http://media.disqus.com/images/loading.gif">';
		Dsq.container.appendChild(disqus_script);
	};

	this.subscribe = function(status, email) {
		// `status` is an int -- 1 to subscribe, 0 to unsubscribe
		if(Dsq.jsonData.request.is_authenticated || email) {
			// If authenticated user OR anonymous email provided

			if(email) {
				Dsq.Popup._closePopup(null, true);
			}

			Dsq.Utils.execScript('http://disqus.com/forums/scobleizer/subscribe.js'
				+'?status=' 	+ status
				+ '&slug='		+ 'help_i8217m_clueless_about_web_service_scalability'
				+ '&email=' 	+ encodeURIComponent(email));

		} else if(!email) {
			// If anonymous user and no email has been provided yet, prompt for email

			var title = 'Subscribe to this comment thread';
			var message = ' \
				New comments will be sent directly to your email inbox! \
				<div class="dsq-subscribe-submit"> \
					<p><strong>Enter your email address below.</strong></p> \
					<input type="text" id="dsq-subscribe-email"> \
					<button type="button" onclick="Dsq.Thread.subscribe(1, Dsq.$(\'dsq-subscribe-email\').value)">Subscribe</button> \
				</div> \
			';

			Dsq.Popup.popModal(message, title);
		}
	};

	this.showSettings = function() {
		if (!Dsq.jsonData.request.is_moderator) {
			return;
		}

		/* The form has to be re-designed when more options will come out. */
		var html = 'Automatically close comments after <input size="3" id="dsq-thread-days-alive" value="' + Dsq.jsonData.thread.days_alive + '" type="text" /> days. Existing comments will still be displayed.<br /><br />(Using 0 days will disable this feature)<br /><br />'
								 + '<button type="button" onclick="Dsq.Thread.updateDaysAlive();" class="dsq-button-small"><span>Save</span></button>'
								 + '<span id="dsq-thread-settings-status" class="dsq-options-status"></span>';

		Dsq.Popup.popModal(html, 'Settings');
	};

  this.showModeratorActions = function() {
      if (!Dsq.jsonData.request.is_moderator) {
          return;
      }

      var html = '<div class="dsq-moderate-options"><table><tr>' +
                 '<td>' + Dsq.Strings.ACTIONS + '</td><td><ul>';
      html += '<li><a href="#" onclick="Dsq.Thread.toggleClosed(); return false;">' +
              (Dsq.jsonData.thread.closed ? Dsq.Strings.OPEN_THREAD : Dsq.Strings.CLOSE_THREAD) +
              '</a></li>';
      html += '<li><a href="#" onclick="Dsq.Thread.toggleKilled(); return false;">' +
              (Dsq.jsonData.thread.killed ? Dsq.Strings.RESTORE_THREAD : Dsq.Strings.REMOVE_THREAD) +
              '</a></li>';
      html += '</ul></td></tr></table></div>' +
              '<p>Go to the full <a href="http://disqus.com/comments/moderate-threads/" target="_blank">moderate panel</a> for more options.</p>';
      Dsq.Popup.popModal(html, Dsq.Strings.MODERATE_OPTIONS);
  };

	this.updateDaysAlive = function() {
		  var days = Dsq.$('dsq-thread-days-alive').value;
		  var status = Dsq.$('dsq-thread-settings-status');
		  Dsq.Utils.postToUrl('http://disqus.com/forums/scobleizer/update_days_alive.js', {days:days,thread:Dsq.jsonData.thread.id});
		  status.innerHTML = 'Saved!';
		  window.setTimeout(function() { status.innerHTML = ''; }, 1000);
	};

  this.toggleClosed = function() {
      Dsq.Utils.postToUrl('http://disqus.com/forums/scobleizer/toggle_thread_closed.js', {thread:Dsq.jsonData.thread.id});
      window.setTimeout(function() { window.location.reload(); }, 500);
  };

  this.toggleKilled = function() {
      Dsq.Utils.postToUrl('http://disqus.com/forums/scobleizer/toggle_thread_killed.js', {thread:Dsq.jsonData.thread.id});
      window.setTimeout(function() { window.location.reload(); }, 500);
  };
};
// Dsq.Thread

Dsq.Events = function() {
	var obj = {};

	// Private
	var handlers = {};
	var getHandlers = function(event) {
		if (handlers[event] === undefined) {
			handlers[event] = [];
		}
		return handlers[event];
	};

	// Public
	// Value keys : postId, node, xtype
	obj.REPLY_IFRAME_CREATED = 1;
	// Value keys : postId, opened
	obj.REPLY_IFRAME_TOGGLED = 2;
	obj.fire = function(event, opt_value) {
		if (!event) {
			throw new Error('Unknown event');
		}
		var value = opt_value || {};
		for (var i=0; i<getHandlers(event).length; i++) {
			getHandlers(event)[i](value);
		}
	};
	obj.addHandler = function(event, callback) {
		getHandlers(event).push(callback);
	};

	return obj;
}();

/**
 * Dsq.Realtime
 */
Dsq.Realtime = new function() {
	var initialized = false;
	var interval = null;
	var last_checked = Dsq.jsonData.request.timestamp;
	var new_posts = [];
	var ongoing_request = false;
	var prev_script = null;

	function updateNewPostCount() {
		Dsq.$('dsq-realtime-alert').style.display = new_posts.length ? 'block' : 'none';

		Dsq.$('dsq-realtime-queued').innerHTML = new_posts.length
		+ ' new '
		+ Dsq.Utils.pluralize(new_posts.length, 'comment', 'comments')
		+ Dsq.Utils.pluralize(new_posts.length, ' was', ' were')
		+ ' just posted.';

		Dsq.$('dsq-realtime-show').innerHTML = '(' + Dsq.Strings.SHOW + ')';
	}

	function insertNewPosts() {
		var post_id = null;
		var after_id = Dsq.$('dsq-sort-select').value === 'oldest' ? -1 : null;

		for (var i=0; i<new_posts.length; i++) {
			post_id = new_posts[i];
			Dsq.Post.insert(after_id, post_id, Dsq.jsonData.posts[post_id].message);
			Dsq.Post.incrementPostCount();
			Dsq.Post.outlineComment(post_id);
		}
		new_posts = [];
	}

	this.enableInterval = function() {
		interval = setInterval(Dsq.Realtime.check, Dsq.jsonData.context.realtime_speed);
		Dsq.$('dsq-realtime-status').innerHTML = Dsq.Strings.ENABLED;
		Dsq.$('dsq-realtime-toggle').innerHTML = '(' + Dsq.Strings.PAUSE + ')';
	}

	this.disableInterval = function() {
		if (interval) {
			clearInterval(interval);
			interval = null;
		}
		Dsq.$('dsq-realtime-status').innerHTML = Dsq.Strings.PAUSED;
		Dsq.$('dsq-realtime-toggle').innerHTML = '(' + Dsq.Strings.RESUME + ')';
	}

	this.toggleInterval = function() {
		if (!interval) {
			Dsq.Realtime.enableInterval();
		} else {
			Dsq.Realtime.disableInterval();
		}
		return false;
	}

	this.initialize = function() {
		if (!initialized) {
			initialized = true;
			Dsq.$('dsq-realtime-toggle').onclick = this.toggleInterval;
			if (!Dsq.jsonData.forum.streaming_realtime) {
				Dsq.$('dsq-realtime-show').onclick = this.show;
				updateNewPostCount();
			}
			if (Dsq.jsonData.thread.realtime_paused) {
				Dsq.Realtime.disableInterval();
			} else {
				Dsq.Realtime.enableInterval();
			}
		}
	}

	this.show = function() {
		insertNewPosts();
		updateNewPostCount();
		return false;
	}

	this.check = function() {
		if (!ongoing_request && Dsq.jsonData.realtime_enabled) {
			if (prev_script) {
				prev_script.parentNode.removeChild(prev_script);
			}
			ongoing_request = true;
			prev_script = Dsq.Utils.execScript('http://disqus.com/forums/18360842/realtime.js?timestamp=' + last_checked);
		}
	};

	this.update = function(timestamp, posts, users) {
		ongoing_request = false;
		last_checked = timestamp;

		if (users) {
			for (var user_id in users) {
				if (users.hasOwnProperty(user_id)) {
					if (!Dsq.jsonData.users[user_id]) {
						Dsq.jsonData.users[user_id] = users[user_id];
					}
				}
			}
		}

		if (posts) {
			for (var post_id in posts) {
				if (posts.hasOwnProperty(post_id)) {
					if (!Dsq.jsonData.posts[post_id]) {
						Dsq.jsonData.posts[post_id] = posts[post_id];
						new_posts.push(post_id);
					}
				}
			}

			if (Dsq.jsonData.forum.streaming_realtime) {
				insertNewPosts();
			} else {
				updateNewPostCount();
			}
		}
	};

}();

// DEPRECATED
Dsq.Iframes = function() {
	// Different style of object from the above. Hoping to switch to this for some reason.
	var obj = {};

	// Private
	var showIframeInContainer = function(container, id, markup) {
		// Look through container for iframes, hiding them, except show one that matches id
		// If none of them matched id, create a new iframe using markup and insert it.
		// Returns the iframe node if and only if it was newly created.
		var found = false;
		for (var i=0; i<container.childNodes.length; i++) {
			var child = container.childNodes[i];
			if (child.nodeName == 'IFRAME') {
				if (child.id == id) {
					child.style.display = 'block';
					found = true;
				} else {
					child.style.display = 'none';
				}
			}
		}
		if (found) {
			return;
		}
		// The iframe wasn't found, so construct it and add it to the container.
		// Don't use innerHTML because it might reload iframes
		var div = document.createElement('div');
		div.innerHTML = markup;
		var iframe = div.childNodes[0];
		div.removeChild(iframe);
		container.appendChild(iframe);
		return iframe;
	};

	// Public
	obj.makeReplyIframeId = function(opt_postId, opt_xtype) {
		var id = 'dsq-post-add-iframe';
		if (opt_xtype) {
			id += '-' + opt_xtype;
		}
		if (opt_postId) {
			id += '-' + opt_postId;
		}
		return id;
	};
	obj.makeLoginIframeId = function(opt_postId) {
		if (!opt_postId) {
			return 'dsq-login-iframe';
		}
		return 'dsq-login-iframe-' + opt_postId;
	};
	obj.makeReplyIframeName = function(opt_postId, opt_xtype) {
		var name = 'dsq-reply-frame';
		if (opt_xtype) {
			name += '-' + opt_xtype;
		}
		if (opt_postId) {
			name += '-' + opt_postId;
		}
		return name;
	};
	obj.showReplyIframeInContainer = function(container, opt_postId, opt_extraParams, opt_className) {
		// Construct the id so we can check if it's already present.
		// Hide any other iframes we find, and show this one if it's found.
		var params = opt_extraParams || {};
		// use xtype in the id and name so we can distinguish media replies from text replies:
		var id = Dsq.Iframes.makeReplyIframeId(opt_postId, params.xtype);
		var name = Dsq.Iframes.makeReplyIframeName(opt_postId, params.xtype);
		var attributes = {
			'id': id,
			'name': name,
			'class': opt_className || 'dsq-post-reply'
			};
		var markup = Dsq.Templates.frameReply(opt_postId, opt_extraParams, attributes);
		var iframe = showIframeInContainer(container, id, markup);
		// It was newly created
		if (iframe) {
			Dsq.Events.fire(Dsq.Events.REPLY_IFRAME_CREATED, {
				postId: opt_postId,
				node: iframe,
				xtype: params.xtype
			});
		}
	};
	obj.showLoginIframeInContainer = function(container, opt_postId) {
		var id = Dsq.Iframes.makeLoginIframeId(opt_postId);
		var markup = Dsq.Templates.frameLogin({id: id});
		showIframeInContainer(container, id, markup);
	};
	obj.showReplyIframeInContainerIfAllowed = function(container, opt_postId) {
		if (Dsq.jsonData.context.show_reply) {
			obj.showReplyIframeInContainer(container, opt_postId);
		} else {
			obj.hideAllInContainer(container);
		}
	};
	obj.hideAllInContainer = function(container) {
		for (var i=0; i<container.childNodes.length; i++) {
			var child = container.childNodes[i];
			if (child.nodeName == 'IFRAME') {
				child.style.display = 'none';
			}
		}
	};

	return obj;
}();

Dsq.Twitter = new function() {
	var that = this;

	this.startTwitterConnect = function() {
		var popupParams = 'location=0,status=0,width=800,height=400';
		that._twitterWindow = window.open(Dsq.jsonData.settings.disqus_url + '/_ax/twitter/begin/', 'twitterWindow', popupParams);
		that._twitterInterval = window.setInterval(that.completeTwitterConnect, 1000);
	};

	this.completeTwitterConnect = function() {
		if (that._twitterWindow.closed) {
			window.clearInterval(that._twitterInterval);
			window.location.reload();
		}
	};
};

Dsq.Yahoo = new function() {
	var that = this;

	this.startYahooConnect = function() {
		var popupParams = 'location=0,status=0,width=800,height=400';
		that._yahooWindow = window.open(Dsq.jsonData.settings.disqus_url + '/_ax/yahoo/begin/', 'yahooWindow', popupParams);
		that._yahooInterval = window.setInterval(that.completeYahooConnect, 1000);
	};

	this.completeYahooConnect = function() {
		if (that._yahooWindow.closed) {
			window.clearInterval(that._yahooInterval);
			window.location.reload();
		}
	};
};

Dsq.OpenID = new function() {
	var that = this;

	this.requestURL = function() {
		var message = '<table class="dsq-openid-form"><tr><td style="vertical-align:top;" rowspan="2"><img src="' + Dsq.jsonData.settings.media_url + '/images/openid-icon-100x100.png" /></td>';
		message += '<td><label for="dsq-openid-url">OpenID URL:</label></td><td><input type="text" id="dsq-openid-url" /></td></tr>';
		message += '<tr><td><label for="dsq-openid-username">Display name:</label></td><td><input type="text" id="dsq-openid-username" /></td></tr>';
		message += '<tr><td class="dsq-openid-submit" colspan="3"><input type="button" value="Sign in" onclick="Dsq.OpenID.startConnect();" /></td></tr>';
		message += "</table>";

		Dsq.Popup.popModal(message, 'Sign in using OpenID');
	};

	this.startConnect = function() {
		var isblank = function(str) {
			return /^\s*$/.test(str);
		};

		var openid_url = Dsq.$('dsq-openid-url').value;
		var username = Dsq.$('dsq-openid-username').value;

		if (isblank(openid_url)) {
			return;
		}

		var popupParams = 'location=0,status=0,width=800,height=500';
		var url = Dsq.jsonData.settings.disqus_url + '/_ax/openid/begin/' + '?url=' + encodeURIComponent(openid_url) + '&username=' + encodeURIComponent(username);
		that._openidWindow = window.open(url, 'openidWindow', popupParams);
		that._openidInterval = window.setInterval(that.completeConnect, 1000);
	};

	this.completeConnect = function() {
		if (that._openidWindow.closed) {
			window.clearInterval(that._openidInterval);
			window.location.reload();
		}
	};
};

Dsq.Reaction = new function() {
	var that = this;

	this.hide = function(id) {
		Dsq.Utils.execScript('http://disqus.com/forums/scobleizer/hidereaction.js?' + 'reaction_id=' + id);
	};

	this.reportMissingReactions = function() {
		if (!Dsq.jsonData.request.is_moderator || !Dsq.jsonData.forum.reactions_enabled) {
			return;
		}

		if (Dsq.jsonData.thread.queued) {
			Dsq.Popup.popModal('Your report has been received. The system will automatically search for new reactions; if any are found, they will be displayed on this comment thread.<br/><br/>Thank&nbsp;you.',
												 'Reported missing reactions');
			return;
		}

		Dsq.Utils.execScript(Dsq.jsonData.settings.disqus_url + '/forums/scobleizer/queueurl.js');
	};
};

Dsq.CNN = function() {
	var obj = {};

	obj.authenticate = function() {
		var url = Dsq.jsonData.settings.disqus_url + "/saml/cnn/try/";
		Dsq.Utils.postToUrl(url, {'target': document.location}, true);
	};

	return obj;
}();


if(Dsq.Utils.ie6) {
	(function() {
		DSQ_HEADER_AVATAR_RE = /<div class="dsq-header-avatar"(.*?)>/gim;
		Dsq.Templates.registerFilter('postPrependHeader', function(html, post_id) {
			// Add "onmouseout" for dsq-header-avatar for dropProfile
			// functionality since IE6 cannot use :hover.
			function _headerAvatarReplace(content, inner, _unused, html) {
				return '<div class="dsq-header-avatar" '
					+ inner
					+ ' onmouseout="Dsq.Post.dropProfile(' + post_id + ')">';
			}
			html = html.replace(DSQ_HEADER_AVATAR_RE, _headerAvatarReplace);
			return html;
		});
	})();
}





	// TODO: Move Seesmic code outside of the main script.  Don't let this script clobber the global namespace.
	if(typeof seesmic == 'undefined') { var seesmic = {}; }
	seesmic.widget = new function () {
		this.callback = function (data) {
			playerVersion = data.disqusplayer;
		};
	};

	
	var scriptEl = document.createElement('script');
	scriptEl.setAttribute('type', 'text/javascript');
	scriptEl.setAttribute('src', 'http://seesmic.com/version.js?callback=seesmic.widget.callback');
	document.getElementsByTagName('head')[0].appendChild(scriptEl);

	
	var scriptEl = document.createElement('script');
	scriptEl.setAttribute('type', 'text/javascript');
	scriptEl.setAttribute('src', 'http://media.disqus.com/javascript/library/swfobject.js');
	document.getElementsByTagName('head')[0].appendChild(scriptEl);

	function see_play_video(_videoUri, _add) {
		var swf = !!playerVersion ? playerVersion : 'http://seesmic.com/embeds/StandalonePlayer.swf';

		flashcontentDiv = Dsq.$(_videoUri + '_content');
		previewDiv = Dsq.$('dsq-seesmic-' + _videoUri + '_preview');
		hideDiv = Dsq.$('dsq-seesmic-' + _videoUri + '_hide');
		showDiv = Dsq.$('dsq-seesmic-' + _videoUri + '_show');
		if(_add) {
			// push flash widget
			var so = new SWFObject(swf, 'sotester', '300', '270', '9', '#000000');
			so.addVariable('video', _videoUri);
			so.addParam('allowFullScreen', 'true');
			so.addParam('allowScriptAccess','always');
			so.useExpressInstall('swfobject/expressinstall.swf');
			so.write(_videoUri + '_content');

			previewDiv.style.display = 'none';
			hideDiv.style.display = 'block';
			showDiv.style.display = 'none';
		}
		else {
			flashcontentDiv.innerHTML = '';
			previewDiv.style.display = 'block';
			hideDiv.style.display = 'none';
			showDiv.style.display = 'block';
		}
	};





(function() {
	//
	// Load theme.  This overrides the base templates with template functions
	// from the respective themes.
	//
	if (Dsq.jsonData.integration.theme == 4) {
		var theme = 'narcissus';
		// HACK: Set variable on window to use post message.
		window.disqus_use_postmessage = true;

		
		for(var prop in Dsq.Themes[theme]) {
			if(Dsq.Themes[theme] && Dsq.Themes[theme].hasOwnProperty(prop)) {
				Dsq.Templates[prop] = Dsq.Themes[theme][prop];
			}
		}
		
		for(var prop in Dsq.Post) {
			if(Dsq.Themes[theme] && Dsq.Themes[theme].hasOwnProperty(prop)) {
				Dsq.Post[prop] = Dsq.Themes[theme][prop];
			}
		}
	}

	//
	// Register templates.  This must be done after all themes are loaded.
	//
	Dsq.Templates.registerTemplate('authPost', Dsq.Templates.authPost);
	Dsq.Templates.registerTemplate('header', Dsq.Templates.header);
	Dsq.Templates.registerTemplate('footer', Dsq.Templates.footer);
	Dsq.Templates.registerTemplate('trackbacks', Dsq.Templates.trackbacks);
	Dsq.Templates.registerTemplate('reactions', Dsq.Templates.reactions);
	Dsq.Templates.registerTemplate('prependPost', Dsq.Templates.prependPost);
	Dsq.Templates.registerTemplate('appendPost', Dsq.Templates.appendPost);
	Dsq.Templates.registerTemplate('postPrependHeader', Dsq.Templates.postPrependHeader);
	Dsq.Templates.registerTemplate('postAppendHeader', Dsq.Templates.postAppendHeader);
	Dsq.Templates.registerTemplate('preBody', Dsq.Templates.preBody);
	Dsq.Templates.registerTemplate('postBody', Dsq.Templates.postBody);
	Dsq.Templates.registerTemplate('postFooter', Dsq.Templates.postFooter);
	Dsq.Templates.registerTemplate('_popupGeneric', Dsq.Templates._popupGeneric);
	Dsq.Templates.registerTemplate('voted', Dsq.Templates.voted);
	Dsq.Templates.registerTemplate('popupProfile', Dsq.Templates.popupProfile);
	Dsq.Templates.registerTemplate('postBox', Dsq.Templates.postBox);
	Dsq.Templates.registerTemplate('pagination', Dsq.Templates.pagination);
	Dsq.Templates.registerTemplate('postComment_onSuccess', Dsq.Templates.postComment_onSuccess);

})();

Dsq.container.className = "clearfix";
Dsq.container.innerHTML = ' \
<ul id="dsq-comments">\
	 <li id="dsq-comment-9710548">\
	 <div id="dsq-comment-header-9710548" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710548" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710548" href="http://twitter.com/palam" target="_blank" rel="nofollow">Palaniappan C</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710548" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710548" class="dsq-comment-message">At which point in the process of building your app do you think about scalability? For what kind of apps is it important that scalability is taken into consideration from the get go, when you\'re making your data model? And for what kind of apps is it not all that critical?<br><br>Also, how difficult is it to alter your data model and architecture without screwing up when you are live? Does everyone have to get an expensive DBA? Or is it mostly common sense?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710549">\
	 <div id="dsq-comment-header-9710549" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710549" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710549" href="http://unholyknight.com/" target="_blank" rel="nofollow">Eric Lorentz</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710549" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710549" class="dsq-comment-message">I would ask them how they develop their databases functions.<br><br>I usually develop in stages, with the first stage being very bloated with repetitive functions and calls.  After I get all of my functionality in order I work through everything and consolidate functions to make them as dynamic as I possibly can.  I\'ve tried to plan things on paper ahead of time, but it never works out.<br><br>Do they have a development process that addresses this from the beginning, or do they go through the same stages?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710550">\
	 <div id="dsq-comment-header-9710550" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710550" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710550" href="http://www.eflorenzano.com/" target="_blank" rel="nofollow">Eric Florenzano</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710550" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710550" class="dsq-comment-message">It seems like the pain point of everybody\'s scalability right now lies in the database layer.  Did you use traditional methods of scaling the database (clustering, replication, etc.) or have you turned to alternatives like CouchDB and HBase, and what have been the benefits/drawbacks of your decisions in that area?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710551">\
	 <div id="dsq-comment-header-9710551" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710551" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710551" href="http://twitter.com/palam" target="_blank" rel="nofollow">Palaniappan C</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710551" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710551" class="dsq-comment-message">Also, how effective do you think Amazon\'s web services are at being a worry-free solution for this problem? What kind of apps make sense on this kind of database?<br><br>Thanks!</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710552">\
	 <div id="dsq-comment-header-9710552" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710552" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710552" href="http://www.ecokinddesign.com/" target="_blank" rel="nofollow">ecokind</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710552" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710552" class="dsq-comment-message">Holy smokes!  That\'s a bigtime interview!  Looks like you have some good answers generating.<br><br>Have a great time!<br>Amy Woidtke<br>green interior decorator<br>Seattle, WA</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710530">\
	 <div id="dsq-comment-header-9710530" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710530" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710530">mike ashworth</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710530" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710530" class="dsq-comment-message">Hi Robert,<br><br>I\'ve picked up on one of the words you just used "glue". Perhaps ask them how they can build a credible, trusted Brand when they glue bits of applications together to create something for the end-user.<br><br>How, as a Brand will they cope when these services fail, how will they manage that Brand Experience. Sure, a lot of these products are free to the end user yet that doesn\'t mean that they should receive a shoddy or  poor or failing service.<br><br>If they choose free services in the cloud from places like Amazon and Google with no real uptime guarantees, how can they manage that?<br><br>Lots of people love twitter, yet people are having to now change their ways to use it well, de-follow, use Friendfeed, Twitter turned off sms in UK as well. All these are actually people problems and not technical problems. They impact upon the way people go about their lives.<br><br>I\'d also be interested in how they plan (or if they can at all) for people using the product in ways they never imagine that impact upon their initial scope? That\'s kinda what happened to Twitter as well.<br><br>Mike Ashworth<br>Marketing Coach and Consultant<br>Brighton and Hove, Sussex, UK</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710542">\
	 <div id="dsq-comment-header-9710542" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710542" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710542" href="http://scobleizer.com/" target="_blank" rel="nofollow">Robert Scoble</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710542" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710542" class="dsq-comment-message">There are more comments on this post over on FriendFeed, including some good suggestions: <a href="http://friendfeed.com/e/ad1a6d75-56de-1139-792e-2d6fa006d839/Help-I-m-clueless-about-Web-Service/" rel="nofollow">http://friendfeed.com/e/ad1a6d75-56de-1139-792e...</a></div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710543">\
	 <div id="dsq-comment-header-9710543" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710543" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710543" href="http://www.sifry.com/alerts/" target="_blank" rel="nofollow">David Sifry</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710543" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710543" class="dsq-comment-message">Robert,<br><br>Come up and visit us in San Francisco this week - having gone through a LOT of scalability issues with the growth of Technorati, I can give you lots of grounding on the basics, so you won\'t feel uncomfortable with these very smart guys.  There\'s a set of basic rules and principles that help out in building scalable systems - but it\'d take an entire book to really talk about them all in detail. Come on up and visit - and if you want, I\'ll give you a sneak peek into the depths of Offbeat Guides, and how we\'re building to scale as well... :-)<br><br>You\'ve got my number/email, drop me a line. It\'d be great to catch up as well!!!<br><br>Dave</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710545">\
	 <div id="dsq-comment-header-9710545" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710545" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710545" href="http://fred67.com/" target="_blank" rel="nofollow">epiquest</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710545" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710545" class="dsq-comment-message">Schoobie!......I can\'t believe that there\'s \'any\' on-line subject you\'re not well versed in, (but I love the \'magnetic\' tag).<br><br>This is a work of art and you must be congratulated. It\'s no wonder you\'re everywhere we turn.<br><br>Good luck with your interview, I\'m sure it\'ll be a great success.<br><br>Pete.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710546">\
	 <div id="dsq-comment-header-9710546" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710546" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710546" href="http://startuplessonslearned.blogspot.com/" target="_blank" rel="nofollow">Eric</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710546" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710546" class="dsq-comment-message">I\'d like to know: what metrics do you consider key to determining whether your system is scaling well? Do you run a consistent set of requests through and measure latency over time? Do you look at aggregate loads or throughput?<br><br>How do you think about ROI for time and energy invested in making your architecture more scalable?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710541">\
	 <div id="dsq-comment-header-9710541" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710541" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710541" href="http://www.magmawave.com/" target="_blank" rel="nofollow">danielmcvicar</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710541" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710541" class="dsq-comment-message">Hi Robert<br>I would use your lack of knowledge about scalability as an asset...you are a curious person, and can help someone like me who wants to learn about scalability through you.<br><br>It is sometimes better not to know too much so that you can find out.<br><br>So find out for me!<br>D</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710540">\
	 <div id="dsq-comment-header-9710540" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710540" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710540" href="http://www.800px.com/" target="_blank" rel="nofollow">Simon</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710540" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710540" class="dsq-comment-message">"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." Knuth, Donald<br><br>Discuss.<br><br>Do you build an application and make it scalable, or do you build a scalable application from the beginning?<br><br>Is scalability more important than functionality sometimes?<br><br>Simon.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710539">\
	 <div id="dsq-comment-header-9710539" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710539" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710539" href="http://shellshadow.com/" target="_blank" rel="nofollow">Jon Hancock</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710539" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710539" class="dsq-comment-message">Scalability is another word for saying "how do you engineer something well".  If you\'re a software engineer with enough experience, the answer is that making something scalable has no silver bullet.  You just "write good software".  So what does that mean?<br><br>In part it means, encapsulating your design and code at a mid to low level of granularity.  If you are strict with encapsulation techniques (following pure OO and message passing design is a solid method) it doesn\'t matter what languages or libraries o databases you use in each part as you simply rewrite/replace components as they become bottlenecks.<br><br>This approach allows you to get a full system bootstrapped without need to optimize components ahead of time.<br><br>The whole point of a web service is that you have a simple API and others don\'t care about how you implement internals.  So taking an API-centric design approach is key.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710547">\
	 <div id="dsq-comment-header-9710547" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710547" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710547">Bob Dole</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710547" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710547" class="dsq-comment-message">I\'d take a 3 part approach:<br><br>1) Start with something very restrictive.  App Engine is somewhat close to where you should start.  You get .2 seconds to handle each request, you have no state on the server, you can\'t do joins or complex queries on the database, and you can\'t persist anything outside of the database.  At no point should you assume that any two requests will hit the same front end server, and at no point should you assume that any two database entries will be on the same DB server.<br><br>2) Ignore everything in step 1 *when necessary for your application*.  This important request needs to do a lot of heavy lifting and a few joins?  Fine.  You need to do a database query that takes 2 seconds on an empty database for a feature of marginal use?  No.  Make your application unscalable if it is necessary, but only as a conscious choice.<br><br>3) Now you\'ve hit the big time, and your system is melting.  Add front end servers and throw session info into the database.  Federate and replicate the heck out of the database, and do everything you can to get rid of the expensive queries you added in step 2.  Generally, this will involve de-normalizing and caching as much as possible.  Add caching at every point in your app.  You should be able to hire people to help at this point.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710536">\
	 <div id="dsq-comment-header-9710536" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710536" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710536" href="http://iki.fi/tksu" target="_blank" rel="nofollow">Tuomas Tanner</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710536" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710536" class="dsq-comment-message">Do you think the new more "sexy" interpreted languages such as Python, Ruby or PHP are more difficult to scale than the arguably faster compiled languages such as .NET and Java?<br><br>Are there some features in a language / framework that make it better suited for scaling?<br><br>Which language / platform would be ideal for building a robust easily scalable web application?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710537">\
	 <div id="dsq-comment-header-9710537" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710537" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710537" href="http://fwennber.blogspot.com/" target="_blank" rel="nofollow">Fredrik Wennberg</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710537" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710537" class="dsq-comment-message">I would like to know;<br><br>  * What technical infrastructure scalability models did they try (horizontal, vertical or perhaps a combination?<br>  * Scalability and resilience often go hand in hand... was resilience considered to be a known factor or a bonus when they decided to scale up or scale out?<br>  * Have they encountered any geographical scalability problems?<br>  * On what OSI-level have they concentrated the most, when trying to solve scalability issues?<br>  * How are they pro actively monitoring performance problems and on what OSI-levels are they monitoring?<br>  * From a scalability perspective "the cloud" can look like a good idea, but what are their thoughts on resilience in "the cloud"?<br><br>Fredrik Wennberg<br>IT Solution Architect</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710535">\
	 <div id="dsq-comment-header-9710535" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710535" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710535">Robert</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710535" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710535" class="dsq-comment-message">There are a number of tools out there for monitoring the efficiency and effectiveness of the web services layer, which, if any, do they use and why?<br><br>Amberpoint is the one I\'m most familiar with. (<a href="http://www.amberpoint.com" rel="nofollow">www.amberpoint.com</a>).  I\'d love to know if there are others that are different/better.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710523">\
	 <div id="dsq-comment-header-9710523" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710523" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710523" href="http://www.agilecmmi.com/" target="_blank" rel="nofollow">Hillel Glazer</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710523" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710523" class="dsq-comment-message">I\'d definitely include a question of how the issue of scalability "showed up" for each of them.  It is likely different.<br>- What were the symptoms?<br>- What part of the architecture or system was the most limiting factor?<br>- What did they do about it that wasn\'t just volume/capacity adjustments with more boxes?<br>- What was the most innovative thing that was created to deal with scale?  Did they make any new/interesting algorithms, techniques, methods, etc.?<br>- They\'re probably not done dealing with scalability, what are their ongoing efforts to improve?<br>- Was scalability always/only about technology?  What about processes and people scalability?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710525">\
	 <div id="dsq-comment-header-9710525" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710525" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710525" href="http://mashraqi.com/" target="_blank" rel="nofollow">Frank Mashraqi</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710525" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710525" class="dsq-comment-message">Hi Scoble,<br><br>I regularly speak at conferences about scalability including 4 sessions this year at MySQL Conference. In the past I helped scale Fotolog (then the 13th largest website on the Internet) to achieve a 10x growth without adding any database server. Most recently I presented a session at Dave McClure\'s Startonomics about Startup Scalability Strategies: How to grow up without blowing up. I regularly help candidates preparing for their interviews. You can reach me at 5 5 1 6 5 5 5 5 9 0 and within 30 minutes I can help you cover major ground in terms of strategies, approaches and tools to become scalable.<br><br>Regarding at what point a Startup should consider scalability:<br><a href="http://startonomics.com/blog/startup-scalability-strategies-how-important-is-being-scalable/" rel="nofollow">http://startonomics.com/blog/startup-scalabilit...</a><br><a href="http://mashraqi.com/2008/09/startonomics-startup-scalability.html" rel="nofollow">http://mashraqi.com/2008/09/startonomics-startu...</a><br><a href="http://startonomics.com/blog/scalability-for-start-ups-how-to-grow-up-without-blowing-up/" rel="nofollow">http://startonomics.com/blog/scalability-for-st...</a><br><br>Talk to you soon,<br><br>thanks,<br>Frank</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710526">\
	 <div id="dsq-comment-header-9710526" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710526" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710526" href="http://glencampbell.name/" target="_blank" rel="nofollow">Glen</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710526" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710526" class="dsq-comment-message">High Scalability is a good website to keep up with. They recently had a post on the "7 stages of scaling web apps." The problem is that so many of these smaller websites simply keep reinventing the wheel; very few of the problems they face are new, and there are known ways of scaling sites, especially at places like Yahoo! and Google that have been doing it for years.<br><br>I wrote a blog post on this issue last month at <a href="http://blog.broadpool.com/2008/09/23/it-goes-to-11/" rel="nofollow">http://blog.broadpool.com/2008/09/23/it-goes-to...</a> .  I guess the biggest questions for most listeners would be, "How do I get there? I can\'t start from where Yahoo! starts, so how do I build a site so that it can grow over time?" The other question would be, "How do I handle success? What do I need to do to ensure that, should my web app be wildly successful, we don\'t die because of it?"</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710528">\
	 <div id="dsq-comment-header-9710528" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710528" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710528" href="http://www.penguinsix.com/" target="_blank" rel="nofollow">penguinsix</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710528" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710528" class="dsq-comment-message">I think you should ask whether a startup should plan to scale from the beginning, or concentrate instead of building growth and dealing with scalability later.<br><br>You have to bring up the Twitter scenario--ask them there thoughts on why Twitter failed (db scalability).<br><br>You should also ask about \'the cloud\' and the future of scalability.  Is what was once a major purchase and commitment (new servers, configing and coordinating) soon to be replaced by \'cycles on the cloud\'?<br><br>Ask them about scaling on LAMP vs. scaling on Windows.  :-)</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710527">\
	 <div id="dsq-comment-header-9710527" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710527" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710527" href="http://www.iconnectdots.com/" target="_blank" rel="nofollow">Steve Borsch</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710527" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710527" class="dsq-comment-message">Thanks for reaching out on this interview prep. I can\'t think of anything more important to the future of cloud computing, user experience and lower blood pressure globally than scalability!<br><br>Ironic that tomorrow is the 3 year anniversary of a post I did entitled, "Web 2.0 Conference: The Dirty Little Secret": <a href="http://www.iconnectdots.com/ctd/2005/10/web_20_conferen.html" rel="nofollow">http://www.iconnectdots.com/ctd/2005/10/web_20_...</a> where I talked about the complete and utter lack of ANY discussion of scalability or latency. It was all about "just build it" which made me shudder.<br><br><br><br>Here are some key questions to ask:<br><br>1) There are two audiences for scalability, developers and users, but they have one shared goal, performance. Are there any best practices or benchmarks for how fast a web app or page SHOULD parse? Is there a min-max window of performance developers should target?<br><br>- Developers want application performance but balanced with a need to optimize conflicting priorities (e.g., delivering fast web apps but needing to wait for an ad server to deliver a personalized advertisement).<br><br>- Users don\'t care about the monetization demands...they just want the app to work and be nearly as good an experience as a desktop app (though willing to make a trade-off for having stuff in the cloud accessible from anywhere with different device types)<br><br><br>2) We all know there are accelerating internet loads from an ever-increasing number of broadband users, apps in the cloud, and data types like video. We\'ve seen wildly conflicting estimates of internet capacity as well.  Are there *any* definitive internet infrastructure numbers that\'ll help developers, I.T. professionals or anyone creating \'net-centric strategies, to get a clue about latency, capacity and so forth going forward?<br><br>(Need to tell you that this is THE #1 biggest issue with all the startups we cover at <a href="http://Minnov8.com" rel="nofollow">Minnov8.com</a>. Without a PhD in network topology and infrastructure, how the hell is a handful of geeks to build and deliver a strategically sound platform or application-set?).<br><br><br>3) "To API or not API: That is the question". One could argue that the root cause of Twitter being the poster whale for fail was the API. It\'s almost comical how many have leapt on the API and are using it for all sorts of apps. So the question might not be "API or not", but "when to API"?<br><br>Good luck.<br><br>--<br>Steve</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710529">\
	 <div id="dsq-comment-header-9710529" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710529" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710529" href="http://robert.accettura.com/" target="_blank" rel="nofollow">Robert Accettura</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710529" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710529" class="dsq-comment-message">Following the pareto principle (80% rule) what is in your opinion(s) the hitlist of tasks to scale a LAMP application on the web?  When do you feel the deadline is in terms of development and launch?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710524">\
	 <div id="dsq-comment-header-9710524" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710524" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710524" href="http://www.createoddjobs.com/" target="_blank" rel="nofollow">Robert Sanchez</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710524" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710524" class="dsq-comment-message">Hi Robert,<br><br>Sounds like an amazingly interesting webinar. I guess the question I would ask is, how exactly do you test your efficiency and scalability before hand, so that you can be modestly prepared for that overnight 6 million user count?<br><br>Also, will this be available after the conference? I registered on Fast Company, but I will have to working as the conference is live. Thank you Scobleizer</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710534">\
	 <div id="dsq-comment-header-9710534" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710534" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710534" href="http://giri.sh/" target="_blank" rel="nofollow">Girish</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710534" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710534" class="dsq-comment-message">For someone that is serious about rejecting job applications if they have spelling errors, you sure don\'t care as much about your own blog concerning the same issue now, do ya? ;)<br><br>Admonishion? You mean admonition?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710533">\
	 <div id="dsq-comment-header-9710533" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710533" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710533">Tim Shisler</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710533" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710533" class="dsq-comment-message">How can you complain about folks not being prepared to send in a job resume and turn around the next day and say you can go into something underprepared and be okay about it?<br><br>I know there is a stark difference, but really, come on. If you\'re allowed to ask help, why not give folks the benefit of the doubt if they flub a resume and ask them why?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710531">\
	 <div id="dsq-comment-header-9710531" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710531" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710531">Molly Scofield</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710531" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710531" class="dsq-comment-message">Great points raised by all.  I\'d also love to know, in the face of rapid scale, what success looks like to these guys.<br><br>Fast and big can be great (and usually commands attention) but may or may not be a good indicator of success.  Likewise, how do they measure success and then revise/redeploy on the fly in response to the data.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710553">\
	 <div id="dsq-comment-header-9710553" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710553" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710553">Guest</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710553" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710553" class="dsq-comment-message">Lots of the questions posed above are rather direct.  If your looking to get a conversation going amongst them, I\'d ask questions which encourage some "give-and-take" rather than give direction to their answers.  You want to hear what these very smart dudes think is most important/relevant about the topic.  Being modest, I\'d start by assuming they would ask better questions of each other than I could ask of them - after all, we are interviewing them because of their successful expertise.<br><br>Questions:<br><br>"Individually looking at each others past projects like iLike and Friendfeed, what items in their development do you think were key to the projects success?  In a similar vein, what would you have done differently and how would it have made things better?"<br><br>"In hindsight, were there key players beneath the surface in these projects which played a large part in making them a success, or was the project so well defined that everyone came together equally in making it a success?  If there were key people, what did they provide to the project that you couldn\'t provide personally?"</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710554">\
	 <div id="dsq-comment-header-9710554" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710554" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710554">Freeman</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710554" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710554" class="dsq-comment-message">First off, you need to have Katie Couric interview you on the subject.  Do whatever you can to look as clueless as possible during this interview.  This will sharply lower everybody\'s expectations of your performance during the real interview.<br><br>Then it should be easy to show remarkable improvement when the real interview comes around.  Everyone will be commenting about how you aced it, regardless of the fact that you will still be the least-informed individual in the room on the subject.<br><br>It\'s all about perception management.  Instead of comparing you to the more-informed subjects of your interview, most people will compare you to your even-less-informed previous performance.<br><br>I\'m not going to tell you where I got this idea.  Just suffice it to say that political strategists are genius!</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710538">\
	 <div id="dsq-comment-header-9710538" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710538" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710538" href="http://www.adf.lt/" target="_blank" rel="nofollow">svetainiu kurimas</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710538" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710538" class="dsq-comment-message">Thanks for post like this!!!</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710555">\
	 <div id="dsq-comment-header-9710555" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710555" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710555" href="http://scobleizer.com/" target="_blank" rel="nofollow">Robert Scoble</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710555" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710555" class="dsq-comment-message">Tim: &gt;&gt;How can you complain about folks not being prepared to send in a job resume and turn around the next day and say you can go into something underprepared and be okay about it?<br><br>Who is going in unprepared. Seems this blog post just prepared me in a BIG way for Thursday!</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710556">\
	 <div id="dsq-comment-header-9710556" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710556" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710556">Tim Shisler</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710556" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710556" class="dsq-comment-message">Very true Robert. It was more of a gut reaction that I should\'ve thought more about. Thanks for replying.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710557">\
	 <div id="dsq-comment-header-9710557" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710557" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710557">maa</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710557" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710557" class="dsq-comment-message">I have had my share of building scalable systems in the past -- and the one thing that always came back to me was the question: is the chosen application architecture adequate to support the needs?<br><br>There are some basic topologies that everybody uses:<br><br>a) "the sink" uses the database as repository of every message -- write it first, let it be read second; parallelize/cluster the db server and you easily crank up the volume. This model is very popular amongst web 2.0 systems. It is limited though, as adding a db server only brings 0.75 more power.<br><br>b) "the network" uses pipes to distribute messages between writers and readers -- very popular in the telco industry, where speed is master and geography plays an important role. Parallelize writers and readers and you get a linear scale that depends alone on the number of servers you put in. Big disadvantage is that distributed persistence needs to be consolidated at some point -- can generate some difficult to tame data flows.<br><br>Now, ask yourself: which model was chosen by google? and which by twitter?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710558">\
	 <div id="dsq-comment-header-9710558" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710558" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710558">alistairc</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710558" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710558" class="dsq-comment-message">Robert,<br><br>Services are fascinating, for a couple of reasons. Sure, there are technical "service scaling" issues, which the other folks on the panel will know all about. Matt has great stories on the scaling of Akismet. But far more interesting are the human scaling issues. I always find more thoughtful discussions there.<br><br>First, there are terms-of-use issues. When you get to a certain size, you need to have policies for appropriate use. You wind up creating competitors, and an ecosystem emerges around your service. Look at Twitter, and the emergence of complementary products like Summize. Then look at what happened when Notchup exploited Linkedin to grab a bunch of users. How you monitor use and enforce terms of use is a big question, and it goes far beyond simple APIs and scaing.<br><br>Second, there\'s the fact that we\'re building human APIs. APIs and web services are typically focused on letting machines talk to one another. But by tying realtime activity feeds to our mobile devices, or location-based services that report our coordinates, we\'re plugging humans into applications, Amazon Turk style. As humans start to interact with applications via web services, through mobile devices and so on, a whole new set of scaling issues emerge.<br><br>Since you\'re the higher-level, human-angle participant on the panel, I\'d elevate things beyond bits and bytes and into humans, policies, exploitation, and startup ecosystems.<br><br>Not sure that helps... sounds like it\'ll be a great panel!<br><br>A.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710559">\
	 <div id="dsq-comment-header-9710559" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710559" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710559">Geoffrey Wiseman</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710559" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710559" class="dsq-comment-message">There\'s a few areas I\'d want to cover:<br>- Where does scalability cross paths with standards (WS-*, WSDL, UDDI) vs. simplicity (REST, POX+HTTP).<br>- Do these people think that ESB has a place in their view of scalable services?<br>- How should you look at databases differently in a service-oriented model?  (There\'s all sorts of sub-topics here; do services share a database, or have their own, does it vary?  2PC vs. other kinds of synchronization?  Clustered caches vs. RDBMS?)<br>- What mechanisms are important to keep instances in synch and sharing work without tripping over each other or creating new bottlenecks (messaging, database, clustered caches, etc.)?<br>- Are location-transparency/routing and directory/discovery services important to scalable SOA, or is this simply the job for DNS and load balancers?<br><br>There\'s tons of interesting things to talk about here, really.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710560">\
	 <div id="dsq-comment-header-9710560" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710560" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710560" href="http://newestindustry.org/" target="_blank" rel="nofollow">Stephen Pierzchala</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710560" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710560" class="dsq-comment-message">Everyone has the internal component covered. I come at it from the outside.<br><br>How do you measure and monitor the external performance of your Web API to proactively deal with loading, connectivity, and application issues?<br><br>What is the issue you run up against most: bandwidth bottlenecks or application loads?<br><br>smp</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710561">\
	 <div id="dsq-comment-header-9710561" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710561" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710561">Matt M.</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710561" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710561" class="dsq-comment-message">?: It seems like a lot of problems with scalability start with the current Database Server architecture.  Should a new startup looking to scale start with an alternate?  Are there production ready open source or commercially supported alternatives?  What would it take for an alternate to be considered "safe" like a SQL Database Server?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710562">\
	 <div id="dsq-comment-header-9710562" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710562" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710562">paul</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710562" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710562" class="dsq-comment-message">How do you provide guaranteed failover when ultimately your service has one IP address, cached inside the world\'s network of DNS servers? Anyone know, by the way?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710563">\
	 <div id="dsq-comment-header-9710563" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710563" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710563">Ryan</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710563" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710563" class="dsq-comment-message">@paul: One easy thing you can do is high-availability failover where a separate server takes over the IP address (and other characteristics) of your failed server.  Check out <a href="http://www.linux-ha.org" rel="nofollow">www.linux-ha.org</a>.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710564">\
	 <div id="dsq-comment-header-9710564" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710564" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710564">Pete Austin</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710564" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710564" class="dsq-comment-message">You need to decide how scalable you want it to be, because the architecture gets trickier with each power of 10 and the bugs subtler. You can give up on getting any sensible advice on the InterWeb for a start. With massive systems, the principle is to design your service as a cluster of sites which are as independent as possible in normal use, but which provide disaster-recovery for each other. The bottlenecks are in things like assigning a user to a site and passing messages between sites.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710565">\
	 <div id="dsq-comment-header-9710565" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710565" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710565">jonas</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710565" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710565" class="dsq-comment-message">follow this blog if you want to know more :)<br><br><a href="http://highscalability.com/" rel="nofollow">http://highscalability.com/</a></div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710566">\
	 <div id="dsq-comment-header-9710566" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710566" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710566">jonas</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710566" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710566" class="dsq-comment-message">( <a href="http://highscalability.com/start-here" rel="nofollow">http://highscalability.com/start-here</a> )</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710567">\
	 <div id="dsq-comment-header-9710567" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710567" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710567" href="http://www.niallkennedy.com/" target="_blank" rel="nofollow">Niall Kennedy</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710567" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710567" class="dsq-comment-message">What are your current bottlenecks? If you could install a new piece of software or rack a new piece of hardware tomorrow to solve key pain points, what would it do?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710568">\
	 <div id="dsq-comment-header-9710568" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710568" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710568" href="http://www.speak-tome.com/" target="_blank" rel="nofollow">Ted Murphy</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710568" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710568" class="dsq-comment-message">Ask them for one scary example in their past where they screwed up and the app hit the wall.  And ask them how they fixed it.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710569">\
	 <div id="dsq-comment-header-9710569" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710569" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710569">sidereal</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710569" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710569" class="dsq-comment-message">1) At what point in the lifecycle of your product do you start to focus on high scalability. How willing should you be to compromise performance or development time to reach it before it\'s strictly necessary?<br><br>2) Is true horizontal scalability ever achievable or will there always be some shared resources?<br><br>3) Is designing for scalability a reactive or proactive process?<br><br>4) Are we too eager to abandon the benefits of normalization to achieve scalability?<br><br>5) Traffic patterns, especially for smaller sites, can be extremely volatile and unpredictable. How to you design for that?<br><br>6) What\'s the time horizon on scalability becoming a commodity that\'s provided by hosting providers alongside power and ethernet?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710570">\
	 <div id="dsq-comment-header-9710570" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710570" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710570">matt m</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710570" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710570" class="dsq-comment-message">How much consideration was given to scalability issues in your initial design?<br><br>What decisions, from your initial design, presented the largest hurdles to scaling?<br><br>What issues will you ensure are taken into consideration in your next version 0 design?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710571">\
	 <div id="dsq-comment-header-9710571" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710571" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710571" href="http://www.productionscale.com/" target="_blank" rel="nofollow">Kent Langley</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710571" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710571" class="dsq-comment-message">My Question:<br><br>How have you changed the way you develop software to improve scalability?</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710572">\
	 <div id="dsq-comment-header-9710572" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710572" class="dsq-comment-cite">\
	 <span id="dsq-author-user-9710572">robw</span>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710572" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710572" class="dsq-comment-message">A good conversation starter would be to ask them about which dimensions they found to be the most challenging to scale along.<br><br>Software/system architecture is only one aspect of successfully building a scalable system. Operations, development/deployment processes, monitoring and so on all make a big different to the scalability of any system.</div>\
	 </div>\
	 </li>\
	 <li id="dsq-comment-9710573">\
	 <div id="dsq-comment-header-9710573" class="dsq-comment-header">\
	 <cite id="dsq-cite-9710573" class="dsq-comment-cite">\
	 <a id="dsq-author-user-9710573" href="http://www.mixin.com/" target="_blank" rel="nofollow">frederic sidler</a>\
	 </cite>\
	 </div>\
	 <div id="dsq-comment-body-9710573" class="dsq-comment-body">\
	 <div id="dsq-comment-message-9710573" class="dsq-comment-message">Hosting<br>Which provider would they choose today if they would need to built a new service that could face a scalability problem.<br><br>Limitation/Marketing<br>Is an invitation procedure a good way to manage the number of users accessing the platform. Would it frustrate the people not authorized to access the system or would it force them to find alternative ways to beta test it ;-)</div>\
	 </div>\
	 </li>\
	 </ul>\
';

(function() {
	
	





Dsq.Debug.profile(function() {
	if(Dsq.jsonData.request.page == 1 && Dsq.jsonData.request.is_initial_load) {
		Dsq.container.innerHTML = Dsq.Templates.header() + Dsq.container.innerHTML + Dsq.Templates.footer();
	}
	Dsq.$(Dsq.curPageId).innerHTML = Dsq.$(Dsq.curPageId).innerHTML.replace(Dsq.COMMENTS_RE, Dsq.CommentsHandler);
}); // Dsq.Debug.Profile

// HACK: Resetting cache because we're done with.
Dsq.Utils.gebiFromElementCollectionCache = null;


	
	
	var dsq_styleEl = document.getElementById(disqus_container_id);
	var dsq_anchorEl = document.getElementsByTagName('a')[0];
	
	Dsq.Thread.fc = Dsq.Utils.getStyle(dsq_styleEl, 'color');
	if(dsq_anchorEl) { Dsq.Thread.ac = Dsq.Utils.getStyle(dsq_anchorEl, 'color'); }
	Dsq.Thread.ff = Dsq.Utils.getStyle(dsq_styleEl, (Dsq.Utils.ie || window.opera ? 'fontFamily' : 'font-family'));
	// For Safari / Opera: strip quotes.
	Dsq.Thread.ff = Dsq.Thread.ff.replace(/['"]/g, '');
	Dsq.Thread.fc = encodeURIComponent(Dsq.Thread.fc);
	Dsq.Thread.ac = encodeURIComponent(Dsq.Thread.ac);
	Dsq.Thread.ff = encodeURIComponent(Dsq.Thread.ff);

	
	
	
	if(Dsq.$(Dsq.Templates.addPostContainer)) {
		// TODO: Check to see if theme uses postmessage.
		if (window.disqus_use_postmessage) {
			Dsq.frames['reply_0'] = new Dsq.ReplyFrame(Dsq.$(Dsq.Templates.textareaContainer));
			Dsq.frames['reply_0'].init(function() {
				// Use fallback iframe
				Dsq.$(Dsq.Templates.addPostContainer).innerHTML = '';
				var theme = (typeof disqus_frame_theme == 'undefined') ? 'default' : disqus_frame_theme;
				Dsq.Iframes.showReplyIframeInContainer(Dsq.$(Dsq.Templates.addPostContainer), null, {theme: theme});
				// if(Dsq.Utils.ie) { Dsq.Utils.fixIframesIE(); }
			});
		} else {
			// DEPRECATED
			Dsq.Iframes.showReplyIframeInContainer(Dsq.$('dsq-post-add'));
		}
	}

	
	

	
	if(document.location.hash != '') {
		document.location.hash = document.location.hash.substring(1);
	}

	Dsq.Popup.showCookieMsgs();

	
	if(document.location.search != '' && location.hash != '#disqus_thread') {
		var reply_id = Dsq.Utils.getRequestParams().dsq;
		if(reply_id) { document.location.hash = 'comment-' + reply_id; }
	}

	
	if((typeof OB_Script != 'undefined') && (typeof OB_versionNum != 'undefined')) {
		if(navigator.userAgent.indexOf("Firefox") != -1) {
			if(window.frames['dsq-reply-frame']) {
				window.frames['dsq-reply-frame'].location = Dsq.Urls.REPLY + (new Date()).getTime() + '&f=scobleizer&t=help_i8217m_clueless_about_web_service_scalability&to_redirect=' + encodeURIComponent(window.location) + '&ifrs=' + encodeURIComponent(disqus_iframe_css);
			}
		}
	}

	if (Dsq.jsonData.integration.theme == 4) {
		if (Dsq.jsonData.realtime_enabled) {
			Dsq.Realtime.initialize();
		}
	}

	



	window.ExecuteWhen = (function () {
	var obj = {}
	
	// Private
	var running = false;
	var timer = null;
	var pending = [];
	var startTimer = function() {
		running = true;
		timer = setInterval(obj.heartBeat, 100);
	};
	var stopTimer = function() {
		running = false;
		clearInterval(timer);
	};
	
	// Public
	obj.add = function (condition, code) {
		pending.push([condition,code]);
		this.heartBeat(); //!
		if (!running) {
			startTimer();
		}
	};
	obj.heartBeat = function() {
		if (!pending.length) {
			stopTimer();
		}
		var newPending = [];
		for (var i=0; i<pending.length; i++) {
			var cond = pending[i][0];
			var code = pending[i][1];
			// FIXME: if cond or code throw an error, they never get removed from pending
			if (cond()){
				code();
			}
			else {
				newPending.push([cond, code]);
			}
		}
		pending = newPending;
	};
	return obj;
})();

// also used in embed_thread.js:
window.fbIsReady = function () {return window.FB && FB.init;};
// NOTE: This script gets executed again without threadEl
//       set when we are loaded again as the fbc_receiver.
//       In this case, we don't need the hidden container.

if(!window.FB || !FB.init) {
	if(window.Dsq && Dsq.container) {
		// container is not present when init.js is loaded from an xd-receiver iframe; in this case,
		// we don't need the FB_HiddenContainer anyway.
		var fbDiv = document.createElement('div');
		fbDiv.id = "FB_HiddenContainer";	// Required or else FeatureLoader will execute a document.write.
		fbDiv.style.position = 'absolute';	// This is intentionally not setting display to none as this breaks
		fbDiv.style.top = '-10000px';		// Flash in Safari.
		fbDiv.style.left = '-10000px';
		fbDiv.style.width = '0px';
		fbDiv.style.height = '0px';
		Dsq.container.appendChild(fbDiv);
	}
	var fbJS = document.createElement('script');
	fbJS.type = "text/javascript";
	fbJS.src = "http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php";
	document.getElementsByTagName('head')[0].appendChild(fbJS);

	ExecuteWhen.add(window.fbIsReady,
		function () {
			// HACK: This is a workaround FBC's single domain limitation by
			//		 allowing sites to create multiple forums with different
			//		 Facebook API keys.  This must be used in conjunction with
			//		 disqus_facebook_forum (see authenticateFacebook).
			var facebook_api_key = 'faaf467d0f47abde553c3b8e0e1b3570';
			if (typeof disqus_facebook_api_key != 'undefined') {
				facebook_api_key = disqus_facebook_api_key;
			}

			FB.init(facebook_api_key, window.facebookXdReceiverPath || null,
				{fetchSignedPublicSessionData: true});
		});
}


	


if(typeof(disqus_callback) == 'function') {
	var callback_params = Dsq.Utils.getRequestParams()['dsq_cbp'] || null;

	// We don't care about any errors in third-party code
	try {
		disqus_callback(callback_params);
	} catch (x) {
		if (typeof(console) != 'undefined' && typeof(console.log) == 'function') {
			// But it would be nice to let developers know about them
			console.log(x);
		}
		// pass
	}

	// HACK: We don't know if the callback wraps our container, which may
	// possibly result in a new DOM element.
	Dsq.container = document.getElementById('dsq-content');
}

// Global event handler for narcissus.
if (Dsq.jsonData.integration.theme == 4) {
	var g = Dsq.Utils.ie ? document : window;
	Dsq.Utils.addEventListener(g, 'keydown', function(event) {
		// Handle "enter" key on input for post box.
		if ((event.keyCode || event.which) == 13) {
			var target = Dsq.Utils.ie ? event.srcElement : event.target;
			// For Safari bug, detect text node.
			if (target.nodeType == 3) {
				target = target.parentNode;
			}

			if (target.nodeName == 'INPUT' &&
				target.parentNode.className == 'dsq-input-wrapper') {
				var postId = Dsq.Utils.extractId(target);
				Dsq.Templates.postComment(postId, this, false);
			}
		}
	});
}

})();




