
url = window.location.toString().toLowerCase();

url=url.split("?");
url=url[0];

function bread(){	
		var ec = "";
		var li = "";
		var hp = "";
		var pb = "";
		var nf = "";
		
		url_units = url.split("/");
		for(var i=0; i<=url_units.length; i++){
			var temp = url_units[i];
			
			if(temp=="aboutus.php"){						   
				document.getElementById('step2').innerHTML = about;			
			}
			if(temp=="bornfree.php"){						   
				document.getElementById('step2').innerHTML = bfree;			
			}
			if(temp=="tusk.php"){						   
				document.getElementById('step2').innerHTML = tusk;			
			}
			if(temp=="pressoffice.php"){						   
				document.getElementById('step2').innerHTML = poffice;			
			}
			if(temp=="recent.php"){						   
				document.getElementById('step2').innerHTML = recent;			
			}
			if(temp=="archive.php"){						   
				document.getElementById('step2').innerHTML = archive;			
			}
			if(temp=="contactus.php"){				
				document.getElementById('step2').innerHTML = contact;				
			}
			if(temp=="otherproducts.php"){				
				document.getElementById('step2').innerHTML = other;				
			}
			if(temp=="breakdowncover.php"){				
				document.getElementById('step2').innerHTML = breakD;				
			}
			if(temp=="travelinsurance.php"){			
				document.getElementById('step2').innerHTML = travel;				
			}
			if(temp=="homeinsurance.php"){						   
				document.getElementById('step2').innerHTML = homeins;			
			}
			if(temp=="homeownerinsurance.php"){						   
				document.getElementById('step2').innerHTML = homeownins;			
			}	
			if(temp=="bikeinsurance.php"){						   
				document.getElementById('step2').innerHTML = bikeins;			
			}
			if(temp=="otherproducts.php#van"){				
				document.getElementById('step2').innerHTML = van;				
			}			
			
			if(temp=="reasonstobuy"){
				document.getElementById('step2').innerHTML = reasons;								
			}												
			if(temp=="sitemapelephant.php"){
				document.getElementById('step2').innerHTML = sitemap;												
			}
			if(temp=="addbookmark.php"){
				document.getElementById('step2').innerHTML = addfav;												
			}			
			

			if(temp=="existingcustomers"){												
				var pagename = url_units[4];
				if (pagename == "claimprocess.php"){					
					trail = "how to make a claim";					
				}
				if (pagename == "emailforms.php"){
					trail = "email forms";					
				}
				if (pagename == "insuresecondcar.php"){
					trail = "insure a second car";					
				}
				if (pagename == "renewal.php"){
					trail = "what happens at renewal";					
				}
				if (pagename == "yourrenewal.php"){
					trail = "your renewal";					
				}				
				if (pagename == "services.php"){															
					ec = "yes";					
				}				
				if (ec =="yes"){
					tt = "<span class=\"trail2\">existing customers </span>";					
				}
				else
				{
					tt = "<span class=\"trail1\"><a href=\"/existingCustomers/services.php\" class=\"trail1\">existing customers</a> &gt;</span><span class=\"trail2\"> " + trail +"</span>";									
				}
				document.getElementById('step2').innerHTML = tt;																										
			}
			if(temp=="legalinformation"){
				var pagename2 = url_units[4];
				if (pagename2 == "conditionsofuse.php"){					
					trail2 = "conditions of use";					
				}				
				if (pagename2 == "privacysecurity.php"){					
					trail2 = "your privacy and security";					
				}
				if (pagename2 == "legalinformation.php"){										
					li = "yes";					
				}
				if (li =="yes"){
					legl = "<span class=\"trail2\">legal information </span>";					
				}
				else
				{
					legl = "<span class=\"trail1\"><a href=\"/legalInformation/legalInformation.php\" class=\"trail1\">legal information</a> &gt;</span><span class=\"trail2\"> " + trail2 +"</span>";									
				}
				document.getElementById('step2').innerHTML = legl;								
			}
			if(temp=="help"){
				var pagename4 = url_units[4];				
				if (pagename4 == "faqbuyingpolicy"){									
					trail3 = "FAQs about buying a policy";					
				}				
				if (pagename4 == "faqclaim"){					
					trail3 = "FAQs about your claim";					
				}
				if (pagename4 == "faqrenewal"){					
					trail3 = "FAQs about your renewal";					
				}
				if (pagename4 == "faqyourpolicy"){					
					trail3 = "FAQs about your policy";					
				}				
				if (pagename4 == "help.php"){										
					hp = "yes";					
				}
				if (hp =="yes"){
					pagename9 = "<span class=\"trail2\">help </span>";					
				}				
				var pagename3 = url_units[4];				
				if (pagename3 == "faqbuyingpolicy.php"){									
					trail3 = "FAQs about buying a policy";					
				}				
				if (pagename3 == "faqclaim.php"){					
					trail3 = "FAQs about your claim";					
				}
				if (pagename3 == "faqrenewal.php"){					
					trail3 = "FAQs about your renewal";					
				}
				if (pagename3 == "faqyourpolicy.php"){					
					trail3 = "FAQs about your policy";					
				}				
				if (pagename3 == "help.php"){										
					hp = "yes";					
				}
				if (hp =="yes"){
					pagename9 = "<span class=\"trail2\">help </span>";					
				}
				else
				{
					pagename9 = "<span class=\"trail1\"><a href=\"/help/help.php\" class=\"trail1\">help</a> &gt;</span><span class=\"trail2\"> " + trail3 +"</span>";									
				}
				document.getElementById('step2').innerHTML = pagename9;								
			}
			if(temp=="policydocs"){
				var pagename4 = url_units[4];
								
				if (pagename4 == "policypage.php"){										
					pb = "yes";					
				}
				if (pb =="yes"){
					pbook = "<span class=\"trail2\">policy books</span>";					
				}
				else
				{
					pbook = "<span class=\"trail1\"><a href=\"/policyDocs/policyPage.php\" class=\"trail1\">policy books</a> &gt;</span><span class=\"trail2\"> " + trail4 +"</span>";									
				}
				document.getElementById('step2').innerHTML = pbook;								
			}												
			if(temp=="carinsurance"){
				var pagename5 = url_units[4];
				if (pagename5 == "carinsurance.php"){					
					trail5 = "car insurance";					
				}
				if (pagename5 == "carinsurancequote.php"){					
					trail5 = "car insurance quote";					
				}
				if (pagename5 == "carinsuranceuk.php"){					
					trail5 = "car insurance uk";					
				}
				if (pagename5 == "discountcarinsurance.php"){					
					trail5 = "discount car insurance";					
				}
				if (pagename5 == "onlinecarinsurance.php"){					
					trail5 = "online car insurance";					
				}
				if (pagename5 == "ukcarinsurancequotes.php"){					
					trail5 = "uk car insurance quotes";					
				}																					
				ci = "<span class=\"trail2\"> " + trail5 +"</span>";												
				document.getElementById('step2').innerHTML = ci;								
			}		
			if(temp=="cheapinsurance"){
				var pagename6 = url_units[4];
				if (pagename6 == "budgetcarinsurance.php"){					
					trail6 = "budget car insurance";					
				}
				if (pagename6 == "cheapcarinsurance.php"){					
					trail6 = "cheap car insurance";					
				}
				if (pagename6 == "cheapcarinsurancequote.php"){					
					trail6 = "cheap car insurance quote";					
				}
				if (pagename6 == "cheapcarinsuranceuk.php"){					
					trail6 = "cheap car insurance uk";					
				}
				if (pagename6 == "cheapercarinsurance.php"){					
					trail6 = "cheaper car insurance";					
				}
				if (pagename6 == "cheapestcarinsurance.php"){					
					trail6 = "cheapest car insurance";					
				}
				if (pagename6 == "lowcostcarinsurance.php"){					
					trail6 = "low cost car insurance";					
				}																					
				chi = "<span class=\"trail2\"> " + trail6 +"</span>";												
				document.getElementById('step2').innerHTML = chi;								
			}	
			if(temp=="motorinsurance"){
				var pagename7 = url_units[4];
				if (pagename7 == "cheapestmotorinsurance.php"){					
					trail7 = "cheapest motor insurance";					
				}
				if (pagename7 == "cheapmotorinsurance.php"){					
					trail7 = "cheap motor insurance";					
				}
				if (pagename7 == "cheapmotorinsuranceuk.php"){					
					trail7 = "cheap motor insurance uk";					
				}
				if (pagename7 == "motorcarinsuranceuk.php"){					
					trail7 = "motor car insurance uk";					
				}
				if (pagename7 == "motorinsurance.php"){					
					trail7 = "motor insurance";					
				}				
				if (pagename7 == "onlinemotorinsurance.php"){					
					trail7 = "online motor insurance";					
				}																					
				mi = "<span class=\"trail2\"> " + trail7 +"</span>";												
				document.getElementById('step2').innerHTML = mi;								
			}
				if(temp=="newsfeeds"){
					var trail9 = "";
					var pagename9 = url_units[4];				
					if (pagename9 == "newsfeeds.php"){	
						trail9 = "latest news";					
						news = "<span class=\"trail1\"><a href=\"/newsFeeds/newsFeeds.php\" class=\"trail1\">news</a> &gt;</span><span class=\"trail2\"> " + trail9 +"</span>";									
					}
												
					if (pagename9 == "newssearch.php"){	
						trail9 = "search results";	
						news = "<span class=\"trail1\"><a href=\"/newsFeeds/newsFeeds.php\" class=\"trail1\">news</a> &gt;</span><span class=\"trail2\"> " + trail9 +"</span>";									
					}	
					
					if (pagename9 == "newsrssinfo.php"){	
						trail9 = "what is rss?";	
						news = "<span class=\"trail1\"><a href=\"/newsFeeds/newsFeeds.php\" class=\"trail1\">news</a> &gt;</span><span class=\"trail2\"> " + trail9 +"</span>";									
					}						
					
			document.getElementById('step2').innerHTML = news;								
			}
			
			
				if(temp=="newsarchive"){
					var trail10 = "";
					var pagename10 = url_units[4];
					var pagename11 = url_units[5];		
					if (!isNaN(pagename10)){	
						trail10 = "news archive " + pagename10;	
						trail11 = pagename11;					
						news2 = "<span class=\"trail1\"><a href=\"/newsFeeds/newsFeeds.php\" class=\"trail1\">news</a> &gt;</span><span class=\"trail2\"> " + trail10 +"/" + trail11 +"</span>";									
					}
												
					if (pagename10 == "newssearch.php"){	
						trail9 = "search results";	
						news2 = "<span class=\"trail1\"><a href=\"/newsFeeds/newsFeeds.php\" class=\"trail1\">news</a> &gt;</span><span class=\"trail2\"> " + trail10 +"</span>";									
					}				
					
			document.getElementById('step2').innerHTML = news2;								
			}
			
			if (temp=="newsarticles"){																				
				var pagename12 = url_units[5];
				
				var trail12 = pagename12.replace(/-/g," ")
				var trail12 = trail12.replace(/%27/g,"'")				
							
				news3 = "<span class=\"trail1\"><a href=\"/newsFeeds/newsFeeds.php\" class=\"trail1\">news</a> &gt;</span><span class=\"trail2\"> " + trail12 +"</span>";
				document.getElementById('step2').innerHTML = news3;
			}			
			
			
			
			if (temp=="pressreleases"){																				
				var pagename8 = url_units[6];
				var date = pagename8.replace(".php"," ");
								
                if (isNaN(date)){
				
				var presspage = date.replace(/-/g," ")				
							
				la = "<span class=\"trail1\"> <a href=\"/contactUs/contactUs.php\" class=\"trail1\">contact us</a> &gt; <a href=\"/contactUs/pressOffice/pressOffice.php\" class=\"trail1\">press office</a> &gt; </span><span class=\"trail2\"> " + presspage + "</span>";
				document.getElementById('step2').innerHTML = la;
			}
				else {				
				
				MyArray=date.split("");
				var thirdchar = MyArray[2];
				MyArray[2]=thirdchar.replace(thirdchar,"-"+thirdchar);
				
				var fifthchar = MyArray[4];
				MyArray[4]=fifthchar.replace(fifthchar,"-"+fifthchar);								
							
				la = "<span class=\"trail1\"> <a href=\"/contactUs/contactUs.php\" class=\"trail1\">contact us</a> &gt; <a href=\"/contactUs/pressOffice/pressOffice.php\" class=\"trail1\">press office</a> &gt; </span><span class=\"trail2\"> release " + MyArray[0] + MyArray[1] + MyArray[2] + MyArray[3] + MyArray[4] + MyArray[5] + "</span>";
				document.getElementById('step2').innerHTML = la;
			}
			
			}
											
		}
	}


about = "<span class=\"trail2\"> about us</span>";
bfree = "<span class=\"trail1\"> <a href=\"/aboutUs/aboutUs.php\" class=\"trail1\">about us</a> &gt; </span> <span class=\"trail2\">born free</span>";
tusk = "<span class=\"trail1\"> <a href=\"/aboutUs/aboutUs.php\" class=\"trail1\">about us</a> &gt; </span> <span class=\"trail2\">tusk</span>";
poffice = "<span class=\"trail1\"> <a href=\"/contactUs/contactUs.php\" class=\"trail1\">contact us</a> &gt; </span> <span class=\"trail2\">press office</span>";				
recent = "<span class=\"trail1\"> <a href=\"/contactUs/contactUs.php\" class=\"trail1\">contact us</a> &gt; <a href=\"/contactUs/pressOffice/pressOffice.php\" class=\"trail1\">press office</a> &gt; </span> <span class=\"trail2\">press releases</span>";				
archive = "<span class=\"trail1\"> <a href=\"contactUs/contactUs.php\" class=\"trail1\">contact us</a> &gt; <a href=\"/contactUs/pressOffice/pressOffice.php\" class=\"trail1\">press office</a> &gt; </span> <span class=\"trail2\">archived press releases</span>";
contact = "<span class=\"trail2\"> contact us</span>";
other = "<span class=\"trail2\"> other products</span>";
homeins = "<span class=\"trail1\"> <a href=\"/otherProducts/otherProducts.php\" class=\"trail1\">other products</a> &gt; </span> <span class=\"trail2\">home insurance</span>";
bikeins = "<span class=\"trail1\"> <a href=\"/otherProducts/otherProducts.php\" class=\"trail1\">other products</a> &gt; </span> <span class=\"trail2\">motorbike insurance</span>";
breakD = "<span class=\"trail1\"> <a href=\"/otherProducts/otherProducts.php\" class=\"trail1\">other products</a> &gt; </span> <span class=\"trail2\">breakdown cover</span>";
homeownins = "<span class=\"trail1\"> <a href=\"/otherProducts/otherProducts.php\" class=\"trail1\">other products</a> &gt; </span> <span class=\"trail2\">home owner insurance</span>";
reasons = "<span class=\"trail2\"> reasons to buy</span>";	
sitemap = "<span class=\"trail2\"> site map</span>";
addfav = "<span class=\"trail2\"> add us to your favourites</span>";
travel = "<span class=\"trail1\"> <a href=\"/otherProducts/otherProducts.php\" class=\"trail1\">other products</a> &gt; </span> <span class=\"trail2\">travel insurance</span>";
van = "<span class=\"trail1\"> <a href=\"/otherProducts/otherProducts.php\" class=\"trail1\">other products</a> &gt; </span> <span class=\"trail2\">van insurance</span>";

