function htmlencode(str) 
{ 
     str = '' + str; 
     var re = /\&/gi; 
     str = str.replace(re, '&amp;'); 
     re = /"/gi; 
     str = str.replace(re, '&quot;'); 
     re = /</gi; 
     str = str.replace(re, '&lt;'); 
     re = />/gi; 
     str = str.replace(re, '&gt;'); 
     return str; 
} 

function getPropertyType(bedrooms)
{
	switch (bedrooms)
	{
        case -1:
	        return "All property types";
	    case 0:
	        return "Studios";
	    case 1:
	        return "1 bedroom homes and appartments";
	    case 2:
	        return "2 bedroom houses and apartments";
	    case 3:
	        return "3 bedroom properties and flats";
        case 4:
	        return "4 bedroom properties";
        case 5:
	        return "5+ bedroom houses";
        default:
	        return "";
	}
}
	
function setMonth(m, index)
{    
  for (i=0; i<=m; i++)
  {     
    e = document.getElementById("rr_tablem_m"+i*2);
    
    e1 = document.getElementById("rr_month"+ i);
    
    if (index == i)
    {     
      if (e != null) e.style.display = '';
      if (e1 != null) e1.style.display = '';
      
    }
    else
    {           
      if (e != null) e.style.display = 'none';
      if (e1 != null) e1.style.display = 'none';     
    }
  } 
}	
	    
function setVisibility(index)
{  
  propertyType = getPropertyType(index);
  pageTitle = document.getElementById("rr_page_title");
  pageTitle.innerHTML = propertyType;
  for (i=0; i<=6; i++)
  {     
    e = document.getElementById("rr_table_m"+i*2);
    e1 = document.getElementById("rr_link"+i);
    if (index+1 == i)
    {     
      if (e != null) e.style.display = '';
      if (e1 != null) e1.style.display = 'none';
      
    }
    else
    {     
      if (e != null) e.style.display = 'none';
      if (e1 != null) e1.style.display = '';     
    }
  } 
}

var randomnumber=Math.floor(Math.random()*10000000);

var url = "http://www.rentright.co.uk/rrpiclient.aspx";

document.write('<script src="' +  url + '" type="text/JavaScript"><\/script>');



