
var eatDrink_data;



/* Indexes */
var image1 = 0;
var image2 = 1;
var image3 = 2;
var image4 = 3;
var image5 = 4;
var image6 = 5;
var reservatioNumber = 6;
var title = 7;
var address = 8;
var description = 9 ; 
var tagLinks = 10;
var openingTimes = 11;
var menu = 12;
var directions = 13;
var www = 14;


  
                
                
    
function showDescription( company , actionType ){
  
   var companyArray;  
  
  if ( company == 'EatDrink'){
      companyArray = getEatDrinkData();
    
  }
  
  displayDescription( actionType, companyArray, company + 'Description'  )
  
}
                

function getEatDrinkData(){

 if (! eatDrink_data ){

		  eatDrink_data = new Array (14);

		  eatDrink_data[image1] = "images/images/listings/eatdrink/image1.jpg";
		  eatDrink_data[image2] = "images/images/listings/eatdrink/image2.jpg";
		  eatDrink_data[image3] = "images/images/listings/eatdrink/image3.jpg";
		  eatDrink_data[image4] = "images/images/listings/eatdrink/image4.jpg";
		  eatDrink_data[image5] = "images/images/listings/eatdrink/image5.jpg";
		  eatDrink_data[image6] = "images/images/listings/eatdrink/image6.jpg";
		  
		  eatDrink_data[reservatioNumber] = "0845 643 6171";
		  eatDrink_data[title] = "Mulbury Rooms Restaurant";
		  eatDrink_data[address] = "<a href=\"#\">Beckenham High Street Beckenham</a>";
		  
		  var t_description = "Offering a more informal take on Italian dining, Mulberry Rooms is";
		  t_description +=    " just that; sit on a stool at the bar with a glass of Nero d'Avola &amp; ";
		  t_description += 		"a plate of freshly shaved charcuterie, or book a table in the dining room for something more substantial. ";
		  
		  
		  eatDrink_data[description] = t_description ;
      
      eatDrink_data[tagLinks] = "0845 643 6171";
      eatDrink_data[openingTimes] = "Mon - Fri 10 - 18:00";
      eatDrink_data[menu] = "<a href=\"#\">Click here to open EatDrinks menu</a>";
      eatDrink_data[directions] = "<a href=\"Javascript:openDirections('http://www.multimap.com/maps/?qs=BR3+1BN&countryCode=GB');\">Click here to open directions to EatDrinks</a>";
      eatDrink_data[www] = "<a href=\"#\">Click here to open EatDrinks website</a>";
      		 		  
	}	  
  
  return eatDrink_data;
}


function displayDescription( actionType, companyArray, descriptionId  ){
	
	var text;
	
	if ( actionType == 'openingHours'){
		text = companyArray[openingTimes];
		
	}
	else if ( actionType == 'menu'){
    text = companyArray[menu];
    
  }
  else if ( actionType == 'directions'){
    text = companyArray[directions];
    
  }
  
  else if ( actionType == 'www'){
    text = companyArray[www];
    
  }
	
	document.getElementById( descriptionId ).innerHTML = text;
	
}



function getExampleServicesHTML(selected){

		
	
	var html = "<div id=\"examplesHeaderBG\" ><div id=\"examplesHeaderText\" > Please note this is not the complete, definitive list of services we provide, but merely an example list of the services which we are able to offer you <br /> <br />If you have any other requirements please do not hesitate to contact us.</div></div><br/><div  id=\"examplesMainBG\"><div id=\"examplesBGMenu\">";
	
	
	html += getExampleMenuListAsHTML(selected);
	
	html += "</div>";
	

	html += "<div id=\"examplesBG\">";
	html += getExampleListAsHTML(selected);
	
	html += "</div></div>";
	
	
	return html;

} 


function getExampleMenuListAsHTML( selected ){

	if ( !exampleServices ){	
		setUpExampleServices();
	}
	
	//var exampleServicesMenu = new Array ( exampleServices.length );
	
	var selectedArrayIndex =  getExampleServicesIndex(selected );

	var html = "<ul>";
	
	for (i = 0; i < exampleServices.length; i++){
		
		var menuLabel = exampleServices[i][0]; 
		
		if (menuLabel){
		
			html += "<li>";
			
					
			if (i != selectedArrayIndex){
					html += "<a href=\"Javascript:changeExampleList('";
					html += menuLabel;
					html += "' );\">";
					html += menuLabel;
					html += "</a>";
			
			}
			else{
				html += menuLabel; 		
			}
		
		
			html += "</li>";
			
		}	

	}
	
	
	html += "</ul>";
	
	
	return html;
	
	
	//return exampleServicesMenu ;
}



function getExampleListAsHTML(selected){

	var selectedArrayIndex =  getExampleServicesIndex(selected );
	
	if ( !exampleServices ){	
		setUpExampleServices();
	}
	
	var selectedExampleListSize = exampleServices[selectedArrayIndex].length;
	
	var exampleList = new Array (selectedExampleListSize);
	
	
	var html = "<ul>";
	
	
	for (i = 1; i < selectedExampleListSize; ++i){
		
		exampleList [i] = exampleServices[selectedArrayIndex][i]; 
		
		
		if (exampleList [i]){
		
			html += "<li>";
			html += exampleList [i];
			html += "</li>";
		
		}

	}
	
	
	
	html += "</ul>";
	
	
	return html;
	

}





var min=10;
var max=15;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}





