jQuery(document).ready(function(){ 
	jQuery("#close a").click(function() {
		jQuery("#certificate").hide();
	});
}); 


//dropdown menu
function mmLoadMenus() {
  if (window.mm_menu_0803095412_0) return;
   
  window.mm_menu_0803095412_0 = new Menu("root",168,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803095412_0.addMenuItem("NO&nbsp;Cut&nbsp;SUPERLASIK","location='no-cut-super-lasik.html'");
  mm_menu_0803095412_0.addMenuItem("LASEK","location='lasek.html'");
  mm_menu_0803095412_0.addMenuItem("Frequently&nbsp;Asked&nbsp;Questions","location='superlasik-faq.html'");
   mm_menu_0803095412_0.fontWeight="bold";
   mm_menu_0803095412_0.hideOnMouseOut=true;
   mm_menu_0803095412_0.childMenuIcon="arrows.gif";
   mm_menu_0803095412_0.bgColor='#334d80';
   mm_menu_0803095412_0.menuBorder=1;
   mm_menu_0803095412_0.menuLiteBgColor='#334d80';
   mm_menu_0803095412_0.menuBorderBgColor='#334d80';

  window.mm_menu_0803101632_0_1_1 = new Menu("Intralase",180,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803101632_0_1_1.addMenuItem("Procedure&nbsp;with&nbsp;Intralase&nbsp;LASIK","location='procedure-with-intralase.html'");
  mm_menu_0803101632_0_1_1.fontWeight="bold";
   mm_menu_0803101632_0_1_1.hideOnMouseOut=true;
   mm_menu_0803101632_0_1_1.bgColor='#334d80';
   mm_menu_0803101632_0_1_1.menuBorder=1;
   mm_menu_0803101632_0_1_1.menuLiteBgColor='#334d80';
   mm_menu_0803101632_0_1_1.menuBorderBgColor='#334d80';
   
  window.mm_menu_0803101632_0_1 = new Menu("Our&nbsp;Technology",170,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803101632_0_1.addMenuItem("VISX&nbsp;LASER","location='visx_laser.html'");
  mm_menu_0803101632_0_1.addMenuItem(mm_menu_0803101632_0_1_1,"location='intralase.html'");
  mm_menu_0803101632_0_1.addMenuItem("IntraLase&nbsp;vs.&nbsp;Microkeratome","location='intralase_microkeratome.html'");
  mm_menu_0803101632_0_1.addMenuItem("Allegretto","location='allegretto.html'");
  mm_menu_0803101632_0_1.fontWeight="bold";
   mm_menu_0803101632_0_1.hideOnMouseOut=true;
   mm_menu_0803101632_0_1.bgColor='#334d80';
   mm_menu_0803101632_0_1.menuBorder=1;
   mm_menu_0803101632_0_1.menuLiteBgColor='#334d80';
   mm_menu_0803101632_0_1.menuBorderBgColor='#334d80';

  window.mm_menu_0803101632_0 = new Menu("root",200,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803101632_0.addMenuItem("LASIK","location='lasik.html'");
  mm_menu_0803101632_0.addMenuItem("LASIK&nbsp;with&nbsp;Wavefront","location='lasik-with-wavefront.html'");
  mm_menu_0803101632_0.addMenuItem("Custom&nbsp;LASIK","location='custom_lasik.html'");
  mm_menu_0803101632_0.addMenuItem("Iris&nbsp;Registration","location='iris_registration.html'");
  mm_menu_0803101632_0.addMenuItem(mm_menu_0803101632_0_1,"location='our_lasik_technology.html'");
  mm_menu_0803101632_0.addMenuItem("Frequently&nbsp;Asked&nbsp;LASIK&nbsp;Questions","location='lasik_faq.html'");
   mm_menu_0803101632_0.fontWeight="bold";
   mm_menu_0803101632_0.hideOnMouseOut=true;
   mm_menu_0803101632_0.bgColor='#334d80';
   mm_menu_0803101632_0.menuBorder=1;
   mm_menu_0803101632_0.menuLiteBgColor='#334d80';
   mm_menu_0803101632_0.menuBorderBgColor='#334d80';

  window.mm_menu_0803102443_0_1 = new Menu("ASC",120,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true); 
  mm_menu_0803102443_0_1.addMenuItem("AAAHC&nbsp;Certification","location='aaahc-certification.html'");
  mm_menu_0803102443_0_1.addMenuItem("Microscope","location='microscopes-and-cataract-surgery.html'");
  mm_menu_0803102443_0_1.addMenuItem("Infinit&nbsp;Ozzil","location='infiniti-ozzil.html'");
   mm_menu_0803102443_0_1.fontWeight="bold";
   mm_menu_0803102443_0_1.hideOnMouseOut=true;
   mm_menu_0803102443_0_1.bgColor='#334d80';
   mm_menu_0803102443_0_1.menuBorder=1;
   mm_menu_0803102443_0_1.menuLiteBgColor='#334d80';
   mm_menu_0803102443_0_1.menuBorderBgColor='#334d80';
   
  window.mm_menu_0803102443_0_2 = new Menu("Cataracts",120,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803102443_0_2.addMenuItem("Cataract&nbsp;Surgery","location='cataract-more.html'");
  mm_menu_0803102443_0_2.addMenuItem("Cataract&nbsp;Questions","location='cataract-faq.html'");
   mm_menu_0803102443_0_2.fontWeight="bold";
   mm_menu_0803102443_0_2.hideOnMouseOut=true;
   mm_menu_0803102443_0_2.bgColor='#334d80';
   mm_menu_0803102443_0_2.menuBorder=1;
   mm_menu_0803102443_0_2.menuLiteBgColor='#334d80';
   mm_menu_0803102443_0_2.menuBorderBgColor='#334d80';
   
  window.mm_menu_0803102443_0_3 = new Menu("PRELEX",120,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803102443_0_3.addMenuItem("What&nbsp;is&nbsp;PRELEX?","location='what-is-prelex.html'");
  mm_menu_0803102443_0_3.addMenuItem("PRELEX&nbsp;Consultation","location='prelex-consultation.html'");
   mm_menu_0803102443_0_3.fontWeight="bold";
   mm_menu_0803102443_0_3.hideOnMouseOut=true;
   mm_menu_0803102443_0_3.bgColor='#334d80';
   mm_menu_0803102443_0_3.menuBorder=1;
   mm_menu_0803102443_0_3.menuLiteBgColor='#334d80';
   mm_menu_0803102443_0_3.menuBorderBgColor='#334d80';
   
  window.mm_menu_0803102443_0 = new Menu("root",230,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803102443_0.addMenuItem(mm_menu_0803102443_0_2,"location='cataracts-history.html'");
  mm_menu_0803102443_0.addMenuItem(mm_menu_0803102443_0_3,"location='prelex.html'");
  mm_menu_0803102443_0.addMenuItem("Restor&nbsp;Aspheric&nbsp;3D","location='restor_aspheric_3d.html'");
  mm_menu_0803102443_0.addMenuItem("Crystalens&nbsp;HD","location='cataracts_crystalens.html'");
  mm_menu_0803102443_0.addMenuItem("Technis&nbsp;Multifocal ","location='cataracts.html'");
  mm_menu_0803102443_0.addMenuItem("ReZoom","location='rezoom.html'");
  mm_menu_0803102443_0.addMenuItem(mm_menu_0803102443_0_1,"location='ambulator-surgery-center.html'");
  mm_menu_0803102443_0.addMenuItem("Refractive&nbsp;Frequently&nbsp;Asked&nbsp;Questions","location='refractive_faq.html'");
  mm_menu_0803102443_0.addMenuItem("ReSTOR&nbsp;Frequently&nbsp;Asked&nbsp;Questions","location='restor_faq.html'");
  mm_menu_0803102443_0.addMenuItem("Crystalens&nbsp;HD&nbsp;vs&nbsp;ReSTOR&nbsp;Aspehric","location='crystalens-vs-restore.html'");
   mm_menu_0803102443_0.fontWeight="bold";
   mm_menu_0803102443_0.hideOnMouseOut=true;
   mm_menu_0803102443_0.bgColor='#334d80';
   mm_menu_0803102443_0.menuBorder=1;
   mm_menu_0803102443_0.menuLiteBgColor='#334d80';
   mm_menu_0803102443_0.menuBorderBgColor='#334d80';

  window.mm_menu_0803103406_0_1 = new Menu("RK&nbsp;Surgery",120,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0803103406_0_1.addMenuItem("Radial&nbsp;Keratotomy ","location='surgery_radial_keratotomy.html'");
   mm_menu_0803103406_0_1.fontWeight="bold";
   mm_menu_0803103406_0_1.hideOnMouseOut=true;
   mm_menu_0803103406_0_1.bgColor='#334d80';
   mm_menu_0803103406_0_1.menuBorder=1;
   mm_menu_0803103406_0_1.menuLiteBgColor='#334d80';
   mm_menu_0803103406_0_1.menuBorderBgColor='#334d80';

  window.mm_menu_0803103406_0_2 = new Menu("CK",250,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0803103406_0_2.addMenuItem("Refractive&nbsp;Surgery&nbsp;After&nbsp;Radial&nbsp;Keratotomy","location='refractive-surgery-after-radial-keratotomy.html'");
   mm_menu_0803103406_0_2.fontWeight="bold";
   mm_menu_0803103406_0_2.hideOnMouseOut=true;
   mm_menu_0803103406_0_2.bgColor='#334d80';
   mm_menu_0803103406_0_2.menuBorder=1;
   mm_menu_0803103406_0_2.menuLiteBgColor='#334d80';
   mm_menu_0803103406_0_2.menuBorderBgColor='#334d80';

  window.mm_menu_0803103406_0 = new Menu("root",215,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",4,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0803103406_0.addMenuItem("LASIK","location='lasik.html'");
  mm_menu_0803103406_0.addMenuItem("Superlasik","location='superlasik_epilasik.html'");
  mm_menu_0803103406_0.addMenuItem("PRK","location='prk.html'");
  mm_menu_0803103406_0.addMenuItem(mm_menu_0803103406_0_1,"location='surgery_radial_keratotomy.html'");
  mm_menu_0803103406_0.addMenuItem(mm_menu_0803103406_0_2,"location='ck.html'");
  mm_menu_0803103406_0.addMenuItem("Phakic&nbsp;ICL&nbsp;(STAAR&nbsp;Visian)","location='staar_vision.html'");
  mm_menu_0803103406_0.addMenuItem("PRELEX","location='prelex.html'");
  mm_menu_0803103406_0.addMenuItem("Presbyopia&nbsp;and&nbsp;Baby&nbsp;Boomers","location='presbyopia-baby-boomers.html'");
  mm_menu_0803103406_0.addMenuItem("Frequently&nbsp;Asked&nbsp;Questions","location='refractive_faq.html'");
  mm_menu_0803103406_0.addMenuItem("Which&nbsp;is&nbsp;Right&nbsp;For&nbsp;Me,&nbsp;CK&nbsp;or&nbsp;ReSTOR?","location='ck_or_restor.html'");
   mm_menu_0803103406_0.fontWeight="bold";
   mm_menu_0803103406_0.hideOnMouseOut=true;
   mm_menu_0803103406_0.bgColor='#334d80';
   mm_menu_0803103406_0.menuBorder=1;
   mm_menu_0803103406_0.menuLiteBgColor='#334d80';
   mm_menu_0803103406_0.menuBorderBgColor='#334d80';
   
  window.mm_menu_0802104035_0 = new Menu("root",170,20,"Arial, Helvetica, sans-serif",14,"#FFFFFF","#eac56a","#334f81","#334f81","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0802104035_0.addMenuItem("Meet&nbsp;Dr.&nbsp;Khanna","location='lasik_surgeon.html'");
mm_menu_0802104035_0.addMenuItem("Why&nbsp;Are&nbsp;We&nbsp;Different?","location='lasik_resources_different.html'");
mm_menu_0802104035_0.fontWeight="bold";
   mm_menu_0802104035_0.hideOnMouseOut=true;
   mm_menu_0802104035_0.bgColor='#000000';
   mm_menu_0802104035_0.menuBorder=1;
   mm_menu_0802104035_0.menuLiteBgColor='#334f81';
   mm_menu_0802104035_0.menuBorderBgColor='#334f81';
  window.mm_menu_0802104039_0_1 = new Menu("Blepharoplasty",180,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0802104039_0_1.addMenuItem("Blepharoplasty&nbsp;Questions","location='blepharoplasty-faq.html'");
  mm_menu_0802104039_0_1.fontWeight="bold";
   mm_menu_0802104039_0_1.hideOnMouseOut=true;
   mm_menu_0802104039_0_1.bgColor='#000000';
   mm_menu_0802104039_0_1.menuBorder=1;
   mm_menu_0802104039_0_1.menuLiteBgColor='#334f81';
   mm_menu_0802104039_0_1.menuBorderBgColor='#334f81';
  window.mm_menu_0802104039_0 = new Menu("root",130,20,"Arial, Helvetica, sans-serif",11,"#334d80","#FFFFFF","#f8cd6c","#334d80","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0802104039_0.addMenuItem("BOTOX","location='botox.html'");
  mm_menu_0802104039_0.addMenuItem(mm_menu_0802104039_0_1,"location='blepharoplasty.html'");
  mm_menu_0802104039_0.addMenuItem("Pterygium","location='pterygium-faq.html'");
  mm_menu_0802104039_0.addMenuItem("Dry&nbsp;EYE&nbsp;/&nbsp;Punctal&nbsp;Plugs","location='dry_eye.html'");
  mm_menu_0802104039_0.addMenuItem("Glaucoma","location='glaucoma.html'");
  mm_menu_0802104039_0.addMenuItem("Astigmatism","location='astigmatism.html'");
  mm_menu_0802104039_0.addMenuItem("Eye&nbsp;Care&nbsp;Glossary","location='eye_glossary.html'");
	mm_menu_0802104039_0.fontWeight="bold";
   mm_menu_0802104039_0.hideOnMouseOut=true;
   mm_menu_0802104039_0.bgColor='#334d80';
   mm_menu_0802104039_0.menuBorder=1;
   mm_menu_0802104039_0.menuLiteBgColor='#334d80';
   mm_menu_0802104039_0.menuBorderBgColor='#334d80';
	mm_menu_0802104039_0.writeMenus();
}



//news feed
function loadRSSfeed () {
	if(window.myInterval){window.clearInterval(window.myInterval);
	}if(importXML('rssLocal.php?feedURL='+escape('http://www.usaeyes.org/lasik.xml')+(true?'&amp;fix091=1':''),'parseRSS',false,2000)){if(parseFloat(0)){window.myInterval=window.setInterval('importXML(\'rssLocal.php?feedURL='+escape('http://www.usaeyes.org/lasik.xml')+(true?'&amp;fix091=1':'')+'\',\'parseRSS\',false,2000);',parseFloat(0)*60000);}}else{alert('Your browser cannot import XML, so it cannot view RSS feeds using this script');}return false;
}

//embed flash
function movie01Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="615" height="147"><param name="movie" value="media/eyesketch.swf" /><param name="quality" value="high" /><param name="LOOP" value="false" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="media/eyesketch.swf" width="615" height="147" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#ffffff" wmode="transparent"></embed></object>');
}



/********************************************************************************************************
                                  Script to parse RSS/Atom XML data files
                                        Written by Mark Wilton-Jones
                            version 3.1.0 updated 12/10/2005 to add OPML support

Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
Please see http://www.howtocreate.co.uk/tutorials/jsexamples/rss.html for a demo and description
Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use
********************************************************************************************************/

//display image enclosures: 0 = none, 1 = inside link to item, 2 = after item description
var displayEnclosures = 2;

//display atom links: 0 = before item description, 1 = after item description
var displayAtomLinks = 1;

function cloneTree(oFrom,oTo) { try {
	for( var i = 0, n; i < oFrom.childNodes.length; i++ ) {
		n = oFrom.childNodes[i];
		if( n.tagName ) {
			var oTag = document.createElement(n.tagName);
			oTo.appendChild(oTag);
			for( var j = 0; j < n.attributes.length; j++ ) {
				try { oTag.setAttribute(n.attributes[j].nodeName,n.attributes[j].nodeValue); } catch(e) {}
			}
			cloneTree(n,oTag);
		} else if( n.nodeType == 3 ) {
			oTo.appendChild(document.createTextNode(n.nodeValue));
		}
	}
} catch(e) { alert(oFrom.tagName+' '+n.nodeValue); throw(e); } }
function prepHTMLCode(oFrom) {
	return oFrom.replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
function getUnNestedTextNodes(oFrom) {
	var oStr = '';
	for( var i = 0; i < oFrom.childNodes.length; i++ ) {
		if( ( oFrom.childNodes[i].nodeType == 3 ) || ( oFrom.childNodes[i].nodeType == 4 ) ) { oStr += oFrom.childNodes[i].nodeValue; }
	}
	return oStr;
}
function parseRSS(oDocObj) {

	//check if the browser interpreted the XML correctly
	if( oDocObj.documentElement && ( !oDocObj.documentElement.tagName || ( oDocObj.documentElement.tagName && oDocObj.documentElement.tagName.toUpperCase() == 'HTML' ) ) ) {
		setTimeout('alert(\'For no apparent reason, your browser has turned the RSS feed into HTML based garbage.\\nScript aborted.\');',50); return; }
	var chanEl = oDocObj.getElementsByTagName('channel')[0];
	if( !chanEl ) { chanEl = oDocObj.getElementsByTagName('atomSpoof')[0]; }
	if( !chanEl ) {
		if( oDocObj.getElementsByTagName('opml')[0] || oDocObj.getElementsByTagName('outlineDocument')[0] ) {
			getListOfFeeds(oDocObj);
		} else {
			alert('Format was not recognised as a valid RSS feed');
		}
		return;
	}
	var RSSversion = oDocObj.getElementsByTagName('rssSpoof')[0] ? oDocObj.getElementsByTagName('rssSpoof')[0].getAttribute('version') : ( oDocObj.getElementsByTagName('atomSpoof')[0] ? ( 'atomfeed' + oDocObj.getElementsByTagName('atomSpoof')[0].getAttribute('version') ) : '' );

	//get the information about the feed
	for( var x = 0, y, feedInfo = [], tagName2, tagName3; x < chanEl.childNodes.length; x++ ) {
		y = chanEl.childNodes[x];
		if( y.tagName ) {
			tagName2 = y.tagName.toLowerCase();
			if( tagName2 == 'fiximage' ) {
				feedInfo['image'] = [];
				for( var i = 0, j; i < y.childNodes.length; i++ ) {
					j = y.childNodes[i];
					if( j.tagName ) {
						tagName3 = j.tagName.toLowerCase();
						feedInfo['image'][tagName3] = getUnNestedTextNodes(j);
						if( RSSversion.match(/0?\.91/) ) { feedInfo['image'][tagName3] = prepHTMLCode(feedInfo['image'][tagName3]); }
					}
				}
			} else if( tagName2 != 'item' && tagName2 != 'entry' ) {
				if( tagName2 != 'fixlink' || !y.getAttribute('rel') ) {
					feedInfo[tagName2] = getUnNestedTextNodes(y);
					if( RSSversion.match(/0?\.91/) ) { feedInfo[tagName2] = prepHTMLCode(feedInfo[tagName2]); }
				}
			}
		}
	}

	if( !feedInfo['lastbuilddate'] ) { feedInfo['lastbuilddate'] = feedInfo['pubdate']; }

	//parse each news item
	var y = oDocObj.getElementsByTagName('item');
	if( !y.length ) { y = oDocObj.getElementsByTagName('entry'); }
	for( var x = 0, newsItems = []; x < y.length; x++ ) {
		newsItems[x] = [];
		newsItems[x]['links'] = {alternate:[],related:[],via:[]};
		newsItems[x]['content'] = '';
		for( var i = 0, j, theRel; i < y[x].childNodes.length; i++ ) {
			j = y[x].childNodes[i];
			if( j.tagName ) {
				tagName2 = j.tagName.toLowerCase();
				theRel = j.getAttribute('rel');
				if( theRel ) { theRel = theRel.toLowerCase(); }
				theType = j.getAttribute('type');
				if( theType ) { theType = theType.toLowerCase(); }
				if( tagName2 == 'enclosure' || ( ( tagName2 == 'fixlink' ) && ( theRel == 'enclosure' ) ) ) {
					if( !newsItems[x]['enclosure'] ) { newsItems[x]['enclosure'] = []; }
					newsItems[x]['enclosure'][newsItems[x]['enclosure'].length] = [];
					for( var k = 0, l, atn; l = j.attributes[k]; k++ ) {
						atn = l.nodeName.toLowerCase();
						if( atn == 'href' ) { atn = 'url'; }
						newsItems[x]['enclosure'][newsItems[x]['enclosure'].length-1][atn] = l.nodeValue;
					}
				} else if( tagName2 == 'fixlink' ) {
					if( !theRel || ( theRel == 'alternate' ) ) {
						newsItems[x]['links']['alternate'][0] = prepHTMLCode( j.firstChild ? getUnNestedTextNodes(j) : j.getAttribute('href') );
					} else if( ( theRel == 'via' ) || ( theRel == 'related' ) ) {
						newsItems[x]['links'][theRel][newsItems[x]['links'][theRel].length] = [prepHTMLCode(j.getAttribute('href')),prepHTMLCode(j.getAttribute('title'))];
					}
				} else if( tagName2 == 'summary' ) {
					if( !theType || ( theType == 'text' ) || theType.match(/^text\/plain$/) ) {
						newsItems[x]['description'] = prepHTMLCode(getUnNestedTextNodes(j));
					} else if( ( theType == 'html' ) || ( theType == 'text\/html' ) ) {
						newsItems[x]['description'] = getUnNestedTextNodes(j);
					} else if( ( theType == 'xhtml' ) || theType.match(/^application\/.*\+xml$/) ) {
						var foo = document.createElement('div');
						cloneTree(j,foo);
						newsItems[x]['description'] = foo.innerHTML;
					}
				} else if( tagName2 == 'content' ) {
					if( !theType || ( theType == 'text' ) || theType.match(/^text\/plain$/) ) {
						newsItems[x]['content'] += (newsItems[x]['content']?'<br>':'')+prepHTMLCode(getUnNestedTextNodes(j));
					} else if( ( theType == 'html' ) || ( theType == 'text\/html' ) ) {
						newsItems[x]['content'] += (newsItems[x]['content']?'<br>':'')+getUnNestedTextNodes(j);
					} else if( ( theType == 'xhtml' ) || theType.match(/^application\/.*\+xml$/) ) {
						var foo = document.createElement('div');
						cloneTree(j,foo);
						newsItems[x]['content'] += (newsItems[x]['content']?'<br>':'')+foo.innerHTML;
					}
				} else {
					newsItems[x][tagName2] = getUnNestedTextNodes(j);
					if( RSSversion.match(/0?\.91/) ) { newsItems[x][tagName2] = prepHTMLCode(newsItems[x][tagName2]); }
				}
			}
		}
	}

	//now that the entire feed has been converted into JavaScript arrays, it is time to write it out
	document.title = feedInfo['title'] ? ( 'News feed: ' + feedInfo['title'] ) : 'Untitled newsfeed';

	//headers
	var oFeedStr = '<div class="rssarea"><div class="headers">'+
		((feedInfo['image']&&feedInfo['image']['url'])?(
			(feedInfo['image']['fixlink']?('<div class="withImage"><a href="'+feedInfo['image']['fixlink']+'">'):'')+
			'<img src="'+prepHTMLCode(feedInfo['image']['url'])+'" alt="'+(feedInfo['image']['title']?feedInfo['image']['title']:'')+'">'+
			(feedInfo['image']['fixlink']?'<\/a></div>':'')
		):'')+
		'<h2>'+(feedInfo['fixlink']?('<a href="'+prepHTMLCode(feedInfo['fixlink'])+'">'+prepHTMLCode(document.title)+'<\/a>'):prepHTMLCode(document.title))+'<\/h2>'+
		(feedInfo['subtitle']?('<p><b>Subtitle:<\/b> '+prepHTMLCode(feedInfo['subtitle'])+'<\/p>'):'')+
		(feedInfo['description']?('<p><b>Description:<\/b> '+feedInfo['description']+'<\/p>'):'')+
		(feedInfo['lastbuilddate']?('<p><b>Published date:<\/b> '+prepHTMLCode(feedInfo['lastbuilddate'])+'<\/p>'):'')+
		(feedInfo['updated']?('<p><b>Last updated:<\/b> '+prepHTMLCode(feedInfo['updated'])+'<\/p>'):'')+

		'<\/div><div class="newsitems">\n';

	//items
	for( var x = 0, y; y = newsItems[x]; x++ ) {
		var oEncl = '';
		if( displayEnclosures && y['enclosure'] ) { for( var p = 0, q; q = y['enclosure'][p]; p++ ) {
			if( q['url'] && q['type'] && q['type'].match(/^image\/(gif|png|jpeg)$/i) ) {
				oEncl += '<img src="'+prepHTMLCode(q['url'])+'" alt="Image">';
			}
		} }
		//special atom links
		var oAtomLinks = '', oLtypes = [['related','Related links'],['via','Cited sources']];
		for( var oTyp = 0, oETyp; oETyp = oLtypes[oTyp]; oTyp++ ) {
			if( y['links'][oETyp[0]].length ) {
				oAtomLinks += '<h4 class="'+oETyp[0]+'">'+oETyp[1]+':<\/h4><ul class="'+oETyp[0]+'">';
				for( var oLn = 0, oEach; oEach = y['links'][oETyp[0]][oLn]; oLn++ ) {
					oAtomLinks += '<li><a href="'+oEach[0]+'">'+oEach[1]?oEach[1]:oEach[0]+'<\/a><\/li>';
				}
				oAtomLinks += '</ul>';
			}
		}
		oFeedStr += '<div class="feeditem"><h3><a href="'+y['links']['alternate']+'" target="_blank">';
		if( displayEnclosures == 1 ) { oFeedStr += oEncl; }
		oFeedStr += (y['title']?prepHTMLCode(y['title']):'Untitiled')+'<\/a><\/h3>';
		if( !displayAtomLinks ) { oFeedStr += oAtomLinks; }
		oFeedStr += y['description']?('<div class="descr">'+y['description']+'<\/div>'):'';
		oFeedStr += y['content']?('<div class="conte">'+y['content']+'<\/div>'):'';
		if( displayAtomLinks ) { oFeedStr += oAtomLinks; }
		if( displayEnclosures == 2 ) { oFeedStr += oEncl; }
		oFeedStr += '<\/div>\n';
	}

	//footer
	oFeedStr += '/div>'+
		(feedInfo['copyright']?('<div class="footers"><p><b>Copyright:<\/b> '+prepHTMLCode(feedInfo['copyright'])+'<\/p><\/div>'):'')+
		'</div>\n';

	//output
	document.getElementById('feedcontainer').innerHTML = oFeedStr;

}

//using a link from an OPML file - change this if you change the layout
function fromOPML(oURL,oFix91) {
	window.storedFeedTitle = document.title;
	window.backToFoo = document.getElementById('feedcontainer').innerHTML;
	window.backToFooURL = document.forms['feedForm'].feedURL.value;
	if( !window.backBut ) {
		window.backBut = document.createElement('a');
		window.backBut.style.marginRight = '7px';
		window.backBut.appendChild(document.createTextNode('<< List'));
		window.backBut.setAttribute('href','javascript:doBackBut();');
		window.backBut.setAttribute('target','_self');
		window.backBut.setAttribute('title','Back to last imported feed list');
		document.getElementsByTagName('h1')[0].appendChild(window.backBut);
	}
	document.forms['feedForm'].fix091.checked = oFix91;
	document.forms['feedForm'].feedURL.value = oURL;
	document.forms['feedForm'].onsubmit();
	return false;
}

//going back after using a link from an OPML file - change this if you change the layout
function doBackBut() {
	document.getElementById('feedcontainer').innerHTML = backToFoo;
	document.forms['feedForm'].feedURL.value = window.backToFooURL;
	window.backBut.parentNode.removeChild(window.backBut);
	window.backBut = null;
	document.title = window.storedFeedTitle;
}

//parse OPML
function getListOfFeeds(oDoc) {

	//get the list title
	var allText = oDoc.getElementsByTagName('title')[0];
	document.title = ( allText && allText.firstChild ) ? ( 'Feed collection: ' + getUnNestedTextNodes( allText ) ) : 'Untitled feed collection';
	allText = '<h2>' + prepHTMLCode(document.title) + '<\/h2>';

	//get the feed list - and try to cope with different formats - no promises
	var oOutline = oDoc.getElementsByTagName('outline'), oAllLinks = '';
	for( var i = 0, j; i < oOutline.length; i++ ) {
		j = oOutline[i];
		var xmlUrl = j.getAttribute('xmlUrl');
		if( !xmlUrl ) { continue; }
		var oTitle = j.getAttribute('title');
		if( !oTitle ) { oTitle = j.getAttribute('text'); }
		if( !oTitle ) { oTitle = xmlUrl; }
		oTitle = prepHTMLCode(oTitle);
		xmlUrl = prepHTMLCode(xmlUrl);
		oAllLinks += '<li><a onclick="return fromOPML(this.href,'+((j.getAttribute('fix091')=='yes')?true:false)+');" href="'+prepHTMLCode(xmlUrl)+'" target="_self">'+prepHTMLCode(oTitle)+'<\/a><\/li>';
	}
	allText += oAllLinks ? ('<ul>'+oAllLinks+'<\/ul>') : '<p>No feeds found<\/p>';

	//output
	document.getElementById('feedcontainer').innerHTML = allText;

}

// Clear/Replace Fields
 
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
}


function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}



