function init_onup() {

   var ajaxRequest;  // The variable that makes Ajax possible!
	var filename;	
	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	
	catch (e) {
		// Internet Explorer Browsers
		try {
		
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		
		catch (e)  {
		
			try {
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			
			catch (e) {
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	return ajaxRequest;
}




function GetContent() {
	var filename;
	var ajaxRequest;
	ajaxRequest=init_onup();
	resTextFlag = 0;
	
	ajaxRequest.onreadystatechange = function(){
	
		if(ajaxRequest.readyState == 4) {
	
				resText=ajaxRequest.responseText;

				document.getElementById("td_content").innerHTML=resText;
				//document.getElementById("bottom_img").innerHTML="";
		}
			
		
	} //call back function
		id	=	document.getElementById("jumpMenu").value;
		//alert(id);
	switch(id) {
		case '0':		
			
			filename = "all.php";			
			
		break;		
		case '1':		
			
			filename = "garden.php";			
			
		break;		
		case '2':
		
			filename = "terraces.php";

		break;
		case '3':
			
			filename = "cottage.php";
			
		break;
		case '4':
			
			filename = "fences.php";
			
		break;
		case '5':
			
			filename = "garages.php";
			
		break;
		case '6':
			
			filename = "docks.php";
			
		break;
		case '7':
			
			filename = "public.php";
			
		break;
		case '8':
			
			filename = "others.php";
			
		break;
		
	} //switch
		
		
		
		//alert("File Name = " + filename);
		cc= Getbimg(id);
		ajaxRequest.open("GET", "/case_studies/"+filename, true);
		ajaxRequest.send(null);

}


function Getimg(img_id,catid) {
	
	
	var ajaxRequest;
	ajaxRequest=init_onup();
	resTextFlag = 0;
	
	ajaxRequest.onreadystatechange = function(){
	
		if(ajaxRequest.readyState == 4) {
	
				resText=ajaxRequest.responseText;

				document.getElementById("td_content").innerHTML=resText;
				
		}
			
		
	} //call back function
	
		if (catid==0){
			Getbimg(catid);
		}
		
		ajaxRequest.open("GET", "../case_studies/b_img.php?img_id="+img_id+"&catid="+catid, true);
		ajaxRequest.send(null);

}


function Getbimg(catid) {
	var filename;
	var ajaxRequest;
	ajaxRequest=init_onup();
	resTextFlag = 0;
	
	ajaxRequest.onreadystatechange = function(){
	
		if(ajaxRequest.readyState == 4) {
	
				resText=ajaxRequest.responseText;

				document.getElementById("bottom_img").innerHTML=resText;
				
		}
			
		
	} //call back function

switch(catid) {
		case '0':		
			
			filename = "scroll_img.php";			
			
		break;		
		case '1':		
			
			filename ="garden_scroll_img.php";			
			
		break;		
		case '2':
		
			filename = "terraces_scroll_img.php";

		break;
		case '3':
			
			filename= "cottage_scroll_img.php";
			
		break;
		case '4':
			
			filename = "fences_scroll_img.php";
			
		break;
		case '5':
			
			filename = "garages_scroll_img.php";
			
		break;
		case '6':
			
			filename = "docks_scroll_img.php";
			
		break;
		case '7':
			
			filename= "public_scroll_img.php";
			
		break;
		case '8':
			
			filename = "others_scroll_img.php";
			
		break;
		
	} //switch
	
	
	ajaxRequest.open("GET", "/case_studies/"+filename, true);
		ajaxRequest.send(null);
		
}




function GetContent2(id) {	
	var filename;
	var ajaxRequest;
	ajaxRequest=init_onup();
	resTextFlag = 0;
	
	ajaxRequest.onreadystatechange = function(){
	
		if(ajaxRequest.readyState == 4) {
	
				resText=ajaxRequest.responseText;

				document.getElementById("td_content").innerHTML=resText;
				//document.getElementById("bottom_img").innerHTML="";
		}
			
		
	} //call back function
		//id	=	document.getElementById("jumpMenu").value;
		//alert(id);
	switch(id) {
		case '0':		
			
			filename = "all.php";			
			
		break;		
		case '1':		
			
			filename = "garden.php";			
			
		break;		
		case '2':
		
			filename = "terraces.php";

		break;
		case '3':
			
			filename = "cottage.php";
			
		break;
		case '4':
			
			filename = "fences.php";
			
		break;
		case '5':
			
			filename = "garages.php";
			
		break;
		case '6':
			
			filename = "docks.php";
			
		break;
		case '7':
			
			filename = "public.php";
			
		break;
		case '8':
			
			filename = "others.php";
			
		break;
		
	} //switch
		
		
		
		//alert("File Name = " + filename);
		cc= Getbimg(id);
		ajaxRequest.open("GET", "/case_studies/"+filename, true);
		ajaxRequest.send(null);

}
