(function() {
	var
	  questions = [ { "title": "How to ensure effectivity of Fraxel on facial acne scars?", "nid": "145707", "url": "/question/acne-scars-and-Fraxel-How-to-ensure-effectivity-of-Fraxel-on-facial-acne-scars" }, { "title": "Fraxel Restore from a plastic surgeon or dermatologist?", "nid": "145744", "url": "/question/Fraxel-laser-for-acne-scars-Fraxel-Restore-from-a-plastic-surgeon-or-dermatologist" }, { "title": "Can cortisone injections cause fat atrophy?", "nid": "139550", "url": "/question/Corticosteroid-fat-atrophy-Can-cortisone-injections-cause-fat-atrophy" }, { "title": "Fat grafting after Radiesse?", "nid": "143307", "url": "/question/fat-injections-after-Radiesse-Fat-grafting-after-Radiesse" }, { "title": "How long does Botox last in the obicularis muscle?", "nid": "143316", "url": "/question/Botox-for-Crows-feet-lasts-3-4-months-How-long-does-Botox-last-in-the-obicularis-muscle" }, { "title": "Can liposuction get rid of paunch look?", "nid": "143122", "url": "/question/liposuction-for-a-paunch-Can-liposuction-get-rid-of-paunch-look" }, { "title": "How does Juvederm feel?", "nid": "143142", "url": "/question/Juvederm-is-a-soft-filler-How-does-Juvederm-feel" }, { "title": "Will next Radiesse treatment for non surgical nose job last longer?", "nid": "143189", "url": "/question/Non-surgical-nose-job-with-Radiesse-Will-next-Radiesse-treatment-for-non-surgical-nose-job-" }, { "title": "What is Fraxel Restore really for? ", "nid": "142651", "url": "/question/Fraxel-Restore-Laser-for-facial-rejuvenation-What-is-Fraxel-Restore-really-for" }, { "title": "Is lower body lift the only option?", "nid": "142890", "url": "/question/liposuction-Is-lower-body-lift-the-only-option" }, { "title": "What is the difference between Fraxel Restore and  Fraxel Restore Dual?", "nid": "142734", "url": "/question/Fraxel-Dual-Laser-for-facial-pigmentation-What-is-the-difference-between-Fraxel-Restore-and" }, { "title": "Can Radiesse affect breast augmentation surgery and result?", "nid": "142164", "url": "/question/Radiesse-and-breast-augmentation-surgery-Can-Radiesse-affect-breast-augmentation-surgery-an" }, { "title": "Average cost of Liposuction for love handles in or around NYC?", "nid": "142488", "url": "/question/Pricing-for-liposuction-Average-cost-of-Liposuction-for-love-handles-in-or-around-NYC" }, { "title": "Botox for droopy mouth?", "nid": "142200", "url": "/question/Botox-for-a-droopy-mouth-Botox-for-droopy-mouth" }, { "title": "How much saline do you put into the Botox bottle", "nid": "142327", "url": "/question/How-is-Botox-diluted-How-much-saline-do-you-put-into-the-Botox-bottle" }, { "title": "Safe to have nurse inject Restylane?", "nid": "142316", "url": "/question/nurses-or-doctors-to-inject-Restylane-Safe-to-have-nurse-inject-Restylane" }, { "title": "Botox injections for spasticity ", "nid": "142403", "url": "/question/Botox-for-spasticity-Botox-injections-for-spasticity" }, { "title": "Spider veins on face", "nid": "142407", "url": "/question/sclerotherapy-for-facial-veins-Spider-veins-on-face" }, { "title": "Does Fraxel on hypopigmented acne scars?", "nid": "143325", "url": "/question/laser-treatment-of-hypopigmentation-Does-Fraxel-on-hypopigmented-acne-scars" }, { "title": "What is the relation between fat, scar tissue, and collagen?", "nid": "142288", "url": "/question/liposuction-and-scar-tissue-What-is-the-relation-between-fat-scar-tissue-and-collagen" }, { "title": "Recommended Fraxel Laser for pores, acne scars and wrinkles?", "nid": "142582", "url": "/question/Acne-pitted-scarring-punch-grafts-and-fraxel-laser-treatment-Recommended-Fraxel-Laser-for-p" }, { "title": "Too young for Liposuction?", "nid": "142587", "url": "/question/What-is-too-young-for-liposuction-Too-young-for-Liposuction" }, { "title": "Breast injections - using Botox to lift breasts", "nid": "143722", "url": "/question/Botox-is-not-indicated-for-Breast-Lifts-Breast-injections-using-Botox-to-lift-breasts" }, { "title": "Fraxel Laser to repair bit lip?", "nid": "143471", "url": "/question/Fraxel-treatment-of-a-scar-on-the-lip-Fraxel-Laser-to-repair-bit-lip" }, { "title": "What are the chances of lumpiness and disfiguration after liposuction?", "nid": "143636", "url": "/question/satisfaction-with-liposuction-What-are-the-chances-of-lumpiness-and-disfiguration-after-lip" } ],
	  pro = { "nid": 17158, "title": "Ronald Shelton, MD", "uri": "find/New-York/New-York-City/Dermatologist/Ronald-Shelton" },
	  domain = 'http://www.realself.com';
	
	function parse_questions() {
	  var
	    contains_link = false;
	    links = document.getElementsByTagName('A');
	  
	  for (var i in links) {
	    if (typeof links[i] != 'undefined' && links[i].protocol + '//' + links[i].hostname == domain) {
	      contains_link = true;
	      break;
	    }
	  }
	  
	  var output = '<div>';
	  if (contains_link) {
	    var i = 0;
      while(typeof questions[i] != 'undefined') {
        output += '<p><a href="' + domain + questions[i].url + '" target="_blank">' + questions[i].title + '</a></p>';
        i++;
      }
	  }
	  else {
	    output += "This page must link to www.realself.com to use this widget";
	  }
	  output += '<div>';
		
		var cont = document.getElementById('rs_questions');
		cont.innerHTML = output + cont.innerHTML;
		
		var links = cont.getElementsByTagName('A');
		if (links.length) {
			var s = 'pro_hdr=' + pro.nid
			for (var i = 0; i < links.length; i++) {
				links[i].href += (links[i].href.indexOf('#') == -1 ? '#' : '') + s;
			}
		}
	}
	
	function add_event(el, type, listener) {
		if (document.addEventListener) {
			el.addEventListener(type, listener, true);
		}
		else {
			el.attachEvent('on' + type, listener);
		}
	}
	
	add_event(window, 'load', parse_questions);
})();
