function loadXMLs(str) 
	{
	try //Internet Explorer
	  {
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  xmlDoc.async="false";
	  xmlDoc.loadXML(str);
	  return(xmlDoc); 
	  }
	catch(e)
	  {
	  try //Firefox, Mozilla, Opera, etc.
		{
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(str,"text/xml");
		return(xmlDoc);
		}
	  catch(e) {alert(e.message)}
	  }
	return(null);
	}
xmlstr='<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" 		xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" 		xmlns:atom="http://www.w3.org/2005/Atom" >   <channel> 	<opensearch:totalResults>394</opensearch:totalResults>                  <title>Found 394 jobs matching your criteria</title>     <description>The latest jobs to view and apply for now with jobs.theengineer.co.uk</description>     <link>http://jobs.theengineer.co.uk/jobsrss/</link>         <pubDate>Fri, 03 Sep 2010 02:16:41 +0000</pubDate>     <lastBuildDate>Fri, 03 Sep 2010 02:16:41 +0000</lastBuildDate>         <generator>jobs.theengineer.co.uk</generator>      		 	<item>       <title>MICHAEL PAGE ENGINEERING: Senior Civil &amp; Structural Engineering Manager</title>       <description> £40000 to £50000 per annum:  Michael Page Engineering: In this role, you will control and direct a group of 4 - 6 engineers and contracted staff who are involved in the investigation, development,...  </description>       <link>http://jobs.theengineer.co.uk/job/35533/senior-civil-and-structural-engineering-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Technical Manager</title>       <description> £45000 to £50000 per annum:  Michael Page Engineering: The role will report into the Technical Director and ensure complete compliance with all internal and external technical regulations and strict QA standards.Duties and Responsibilities:...  </description>       <link>http://jobs.theengineer.co.uk/job/35532/technical-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Head of Continuous Improvement</title>       <description> £40000 to £45000 per annum:  Michael Page Engineering: As Head of Continuous Improvement you will be responsible for coordinating and directing manufacturing improvement projects to further develop the continuous improvement strategy. As part...  </description>       <link>http://jobs.theengineer.co.uk/job/35531/head-of-continuous-improvement/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Production Manager</title>       <description> £45000 to £55000 per annum:  Michael Page Engineering: As Production Manager you will be responsible for all production and shift based employees in a significant manufacturing site. You will be part of the...  </description>       <link>http://jobs.theengineer.co.uk/job/35530/production-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Quality Manager</title>       <description> £35000 to £40000 per annum:  Michael Page Engineering: Reporting to the Site Manager the Quality Manager will manage, develop and implement systems, drive process and procedures through effective partnerships with operations, engineering and...  </description>       <link>http://jobs.theengineer.co.uk/job/35529/quality-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Project Manager</title>       <description> £40000 to £45000 per annum:  Michael Page Engineering: This is a great opportunity for a Project Manager to head up a division that designs and builds aseptic filling machines, you will be responsible...  </description>       <link>http://jobs.theengineer.co.uk/job/35528/project-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Maintenance Technician</title>       <description> £25000 to £27000 per annum:  Michael Page Engineering: Working as part of a multi disciplined engineering team you will be responsible for providing maintenance support for buildings, plant and equipment and overseeing planned...  </description>       <link>http://jobs.theengineer.co.uk/job/35527/maintenance-technician/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Service Solution Design Engineer</title>       <description> £35000 to £55000 per annum:  Michael Page Engineering: Reporting to the Chief of Service as a Service Solution Designer you will work on a range of projects across the programme life-cycle. You will...  </description>       <link>http://jobs.theengineer.co.uk/job/35526/service-solution-design-engineer/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Assistant Plant Manager</title>       <description> £50000 to £60000 per annum:  Michael Page Engineering: Reporting into the Factory General Manager this role will be responsible for production, supply chain and logistics. Being part of the site management team you...  </description>       <link>http://jobs.theengineer.co.uk/job/35525/assistant-plant-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>MICHAEL PAGE ENGINEERING: Engineering Maintenance Manager</title>       <description> £40000 per annum:  Michael Page Engineering: We are looking for an Engineering Manager to lead on site maintenance supervisors and technicians within a high volume fast moving manufacturing environment. You will...  </description>       <link>http://jobs.theengineer.co.uk/job/35524/engineering-maintenance-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>TECHNICAL FUTURES: Mechanical Design Engineer</title>       <description> Experience Dependent:  Technical Futures: A great opportunity for a Degree qualified Mechanical Design Engineer to join a growing specialist design and development company in Norwich. Norwich </description>       <link>http://jobs.theengineer.co.uk/job/35515/mechanical-design-engineer/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 17:06:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Junior Chemical Engineers</title>       <description> £20000 to £22000 per annum:  Beechwood Recruitment: JUNIOR CHEMICAL ENGINEERS BUILDING MATERIALS SOLIHULL, WEST MIDLANDS  We are now looking for Junior Chemical Engineers to join this world leading manufacturer of building materials including cement, aggregates...  </description>       <link>http://jobs.theengineer.co.uk/job/35517/junior-chemical-engineers/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Senior Logistics Engineer</title>       <description> £35000 to £50000 per annum:  Beechwood Recruitment: SENIOR LOGISTICS ENGINEER BUILDING MATERIALS SOLIHULL, WEST MIDLANDS  We are now looking for a Senior Logistics Engineer to join this world leading manufacturer of building materials including cement,...  </description>       <link>http://jobs.theengineer.co.uk/job/35516/senior-logistics-engineer/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Development Engineer</title>       <description> £35000 to £40000 per annum:  Beechwood Recruitment: DEVELOPMENT ENGINEER BUILDING MATERIALS STAFFORDSHIRE   We are now looking for a Development Engineer to join this world leading manufacturer of building materials including cement, aggregates and plasterboard. ...  </description>       <link>http://jobs.theengineer.co.uk/job/35514/development-engineer/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Production Manager</title>       <description> £35000 to £40000 per annum:  Beechwood Recruitment: PRODUCTION MANAGER BUILDING MATERIALS VALE OF GLAMORGAN, SOUTH WALES  We are now looking for a Production Manager to join this world leading manufacturer of building materials including cement,...  </description>       <link>http://jobs.theengineer.co.uk/job/35512/production-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Maintenance Manager</title>       <description> £35000 to £50000 per annum:  Beechwood Recruitment: MAINTENANCE MANAGER BUILDING MATERIALS EAST LOTHIAN, SCOTLAND  We are now looking for a Maintenance Manager to join this world leading manufacturer of building materials including cement, aggregates and...  </description>       <link>http://jobs.theengineer.co.uk/job/35511/maintenance-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Production Manager</title>       <description> £35000 to £40000 per annum:  Beechwood Recruitment: PRODUCTION MANAGER BUILDING MATERIALS CO.TYRONE, NORTHERN IRELAND  We are now looking for a Production Manager to join this world leading manufacturer of building materials including cement, aggregates and...  </description>       <link>http://jobs.theengineer.co.uk/job/35510/production-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Operations Manager</title>       <description> £35000 to £50000 per annum:  Beechwood Recruitment: OPERATIONS MANAGER BUILDING MATERIALS CO.TYRONE, NORTHERN IRELAND  We are now looking for an Operations Manager to join this world leading manufacturer of building materials including cement, aggregates and...  </description>       <link>http://jobs.theengineer.co.uk/job/35509/operations-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Operations Manager</title>       <description> £35000 to £50000 per annum:  Beechwood Recruitment: OPERATIONS MANAGER BUILDING MATERIALS EAST LOTHIAN, SCOTLAND   We are now looking for an Operations Manager to join this world leading manufacturer of building materials including cement, aggregates...  </description>       <link>http://jobs.theengineer.co.uk/job/35507/operations-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 		 	<item>       <title>BEECHWOOD RECRUITMENT: Quality Manager</title>       <description> £35000 to £40000 per annum:  Beechwood Recruitment: QUALITY MANAGER BUILDING MATERIALS STAFFORDSHIRE  We are now looking for a Quality Manager to join this world leading manufacturer of building materials including cement, aggregates and plasterboard. ...  </description>       <link>http://jobs.theengineer.co.uk/job/35506/quality-manager/?TrackID=5</link>             <pubDate>Thu, 02 Sep 2010 09:00:00 +0000</pubDate>     </item> 	 		   </channel> </rss>';
xmlDoc = loadXMLs(xmlstr);
var txt = '';
var txt = '';
items = xmlDoc.getElementsByTagName("item");
	for (i=0; i<6; i++) {
	
		var title=""; 
		var hlink="";
		var descr="";
		var pubdate=""
date = items[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue;
	result = date.match(/\d{1,2}.*\d{4}/);
	date = result[0];
	date = date.replace(/ /g,"-");if (items[i].getElementsByTagName("title")[0].length != 0)
title = items[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
title = title.substring(title.indexOf(":") + 1, title.length );
if (items[i].getElementsByTagName("link")[0].length != 0)
hlink = items[i].getElementsByTagName("link")[0].childNodes[0].nodeValue;
if (items[i].getElementsByTagName("description")[0].childNodes.length != 0)
txt += '<li class="arrow"><a href="'+ hlink +'">' + title + '</a><br /><br /></li>';
txt += '<div style="clear:both;"></div>'
}
document.write (txt);
