// JavaScript Document


gardenloadone = new Image();
gardenloadone.src = "images/largegarden1.jpg";

gardenloadtwo = new Image();
gardenloadtwo.src = "images/largegarden2.jpg"; 

gardenloadthree = new Image();
gardenloadthree.src = "images/largegarden3.jpg"; 

gardenloadthree = new Image();
gardenloadthree.src = "images/largegarden4.jpg"; 


 window.onload = functions;
 
 function functions() {
     first();
 }
 
 
 
 function first() {
	 
	  var bodycolour = document.getElementsByTagName("body")[0];
	  bodycolour.style.background = "#d8caa8";
       var javascriptneeded = document.body.getElementsByTagName("h2")[0];
	         document.body.removeChild(javascriptneeded);
			 
       var container = document.createElement("div");
	     container.setAttribute("id", "container");
	   var middle = document.createElement("div");
	      middle.setAttribute("id", "middle");
	   var middleleft = document.createElement("div");
	     middleleft.setAttribute("id", "middleleft");
	   var center = document.createElement("div");
	     center.setAttribute("id", "center");
	   var header = document.createElement("div");
	     header.setAttribute("id", "header");
		 
		 
	   
	   var galleryimage = document.createElement("img");
	     galleryimage.setAttribute("src", "images/gardendefault.jpg");
		  galleryimage.setAttribute("id", "maingalleryimage");
		  
		var galleryimage2 = document.createElement("img");
	     galleryimage2.setAttribute("src", "images/largegarden2.jpg");
		  

		 
	 
		var middleright = document.createElement("div");
		  middleright.setAttribute("id", "middleright");
		  
		 var gallerylink1 = document.createElement("a");
		 gallerylink1.setAttribute("href", "#"); 
		 gallerylink1.setAttribute("id", "jasonone");
		var imagerightone = document.createElement("img");
		imagerightone.setAttribute("border", "0px");
		   imagerightone.setAttribute("id", "jasononeone");
		  imagerightone.setAttribute("src", "images/smallgarden1.jpg");
		  
		  var gallerylink2 = document.createElement("a");
		  gallerylink2.setAttribute("href", "#");
		var imagerighttwo = document.createElement("img");
		  imagerighttwo.setAttribute("border", "0px");
		  imagerighttwo.setAttribute("src", "images/smallgarden2.jpg");
		  var gallerylink3 = document.createElement("a");
		  gallerylink3.setAttribute("href", "#"); 
		var imagerightthree = document.createElement("img");
		imagerightthree.setAttribute("border", "0px");
		  imagerightthree.setAttribute("src", "images/smallgarden3.jpg");
		  var gallerylink4 = document.createElement("a"); 
		  gallerylink4.setAttribute("href", "#");
		var imagerightfour = document.createElement("img");
		imagerightfour.setAttribute("border", "0px");
		  imagerightfour.setAttribute("src", "images/smallgarden4.jpg");
		   
		 var imagedescription = document.createElement("h3");
		  imagedescription.setAttribute("id", "imagedescription");
		  var gardentext = document.createTextNode("Welcome");
		 var middlelinks = document.createElement("div");
		    middlelinks.setAttribute("id", "middlelinks");
		var unordered = document.createElement("ul");
		
		var linksone = document.createElement("li");
		var linkstwo = document.createElement("li");
		var linksthree = document.createElement("li");
		var linksfour = document.createElement("li");
		var linksfive = document.createElement("li");
		
		var listanchor1 = document.createElement("a");
		 listanchor1.setAttribute("href", "#");
		var listanchor2 = document.createElement("a");
		 listanchor2.setAttribute("href", "#");
		var listanchor3 = document.createElement("a");
		 listanchor3.setAttribute("href", "#");
		var listanchor4 = document.createElement("a");
		 listanchor4.setAttribute("href", "#");
		var listanchor5 = document.createElement("a");
		  listanchor5.setAttribute("href", "#");
		
		var gardenone = document.createTextNode("Garden link one");
		var gardentwo = document.createTextNode("Garden link two");	
		var gardenthree = document.createTextNode("Garden link three");	
		var gardenfour = document.createTextNode("Garden link four");	
		var gardenfive = document.createTextNode("Garden link five");		 
		  
		var bottom = document.createElement("div");
		 bottom.setAttribute("id", "bottom");
		var para = document.createElement("p");
		var maintext = document.createTextNode("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.");   	 
	 
	 container.appendChild(center);
	 center.appendChild(header);
	 center.appendChild(middle);
	 middle.appendChild(middleleft);
	 middleleft.appendChild(galleryimage);
	 middleleft.appendChild(middleright);
	 
	 middleright.appendChild(gallerylink1);
	 gallerylink1.appendChild(imagerightone);
	 
	 middleright.appendChild(gallerylink2);
	 gallerylink2.appendChild(imagerighttwo);
	 
	 middleright.appendChild(gallerylink3);
	 gallerylink3.appendChild(imagerightthree);
	 
	 middleright.appendChild(gallerylink4);
	 gallerylink4.appendChild(imagerightfour);
	 
	 imagedescription.appendChild(gardentext);
	 middleright.appendChild(imagedescription);
	 middle.appendChild(middlelinks);
	 middlelinks.appendChild(unordered);
	 
	 unordered.appendChild(linksone);
	 linksone.appendChild(listanchor1);
	 listanchor1.appendChild(gardenone);
	 
	 unordered.appendChild(linkstwo);
	 linkstwo.appendChild(listanchor2);
	 listanchor2.appendChild(gardentwo);
	 
	 
	 unordered.appendChild(linksthree);
	 linksthree.appendChild(listanchor3);
	 listanchor3.appendChild(gardenthree);
	 
	unordered.appendChild(linksfour);
	 linksfour.appendChild(listanchor4);
	 listanchor4.appendChild(gardenfour);
	 
	 unordered.appendChild(linksfive);
	 linksfive.appendChild(listanchor5);
	 listanchor5.appendChild(gardenfive);
	 
	 
	 
	 center.appendChild(bottom);
	 bottom.appendChild(para);
	para.appendChild(maintext);
	 
	 
	 document.body.appendChild(container);
	 
imagerightone.onclick = function() {
      galleryimage.setAttribute("src", "images/largegarden1.jpg");
	  gardentext.nodeValue = "Garden one";
	  return false
	  }	 
	  
imagerighttwo.onclick = function() {
      galleryimage.setAttribute("src", "images/largegarden2.jpg");
	  gardentext.nodeValue = "Garden two";
	  return false
	  }	
	  
imagerightthree.onclick = function() {
      galleryimage.setAttribute("src", "images/largegarden3.jpg");
	  gardentext.nodeValue = "Garden three";
	  return false
	  }	
imagerightfour.onclick = function() {
      galleryimage.setAttribute("src", "images/largegarden4.jpg");
	  gardentext.nodeValue = "Garden four";
	  return false
	  }
	  
	  
	  
listanchor1.onclick = function() {
	  gardentext.nodeValue = "Test link 1";
	  return false
}

listanchor2.onclick = function() {
	  gardentext.nodeValue = "Test link 2";
	  return false
} 

listanchor3.onclick = function() {
	  gardentext.nodeValue = "Test link 3";
	  return false
} 

listanchor4.onclick = function() {
	  gardentext.nodeValue = "Test link 4";
	  return false
} 

listanchor5.onclick = function() {
	  gardentext.nodeValue = "Test link 5";
	  return false
} 



}


