// render development rollover table
//function t(id)
//{
//	var plot = id;
//	HTMLContent = '<table class="tt"><tr><td style="padding: 4px"><strong>Plot ' + plot + '</strong></td></tr><tr><td class="ttd">';
//	var notReleased = 0;
//	if (d[id] && notReleased != 1) 
//	{
//		plotStyle = d[id][0];
//		plotType = d[id][1];
//		plotPrice = d[id][2];
//		plotStatus = d[id][3];
//		plotShowHome = (d[id][4] == '1') ? ' SHOWHOME' : '';
//		HTMLContent += '<strong>' + plotStyle + '</strong><br>' + plotType + '<br>Price: ' + plotPrice + '<br>Status: ' + plotStatus + plotShowHome + '</td></tr></table>';
//	}
//	
//	return HTMLContent;
//}

 /* RWN - re-written for v2 */
 
function t(id) {
    ///<summary></summary>
    ///<remarks>N.b. arrays are written to the page in server code file: Miller.WebControls.DevelopmentPlanControl.cs</remarks>
    ///<param name="id"></param>
    
	var plot = id;	
	var notReleased = 0;
	var html = '';
	var plotId;
		
	if (d[id] && notReleased != 1) {
		
		var plotNumber = plot;
		var plotTitle = d[id][0]; // plotTitleArray[id];
		var houseStyleId = houseStyleIDArray[plot];
		var plotBedType = d[id][1];
		var plotPrice = d[id][2];
		var plotStatus = d[id][3];
		var plotImageFile = plotImageArray[id];
		var spOffersAvail = d[id][7];
				
		// image path
		var imgHtml = '';
		var imgPath = '/Miller.HomesWeb/dynamicImages/thumbnailpreview.axd?w=78&h=86&filename=~/HouseStyles/';		
		
		if(plotImageArray[id]!= null) {
            if(plotImageArray[id].length > 0) {
              imgHtml = '<img src="' + imgPath + houseStyleId + '/' + plotImageFile + '" alt=" " />';
        }}
        
        // virtual tour
        var vtHTML = '';
        
        if(plotVTourArray[id]) {
            if(plotVTourArray[id].toLowerCase() == 'true')
                vtHTML = '<div class="vt"></div>';
        }
        
        // rwn : fix to changed non-logged in price from "[log in]" to "[log in for price]" - n.b. value sent from server
        if(plotPrice == "[log in]")
            plotPrice = "[log in for price]";

        if (plotStatus == "SOLD" || plotStatus == "RESERVED" || plotStatus == "UNRELEASED")
            plotPrice = "<br />";
            
            
        if(plotPrice == "&pound;&#x2014;") // £-
            plotPrice = '';
        //alert(plotStatus);
        if (plotStatus == "PRERELEASE") {
            plotStatus = "UNRELEASED";
            
        }

        var s = (32.0 / (plotTitle.length)) * 4 + 3; // dynamically change text size of house style
        if (s > 15) s = 15;
		html += '<div id="siteplanToolTip">'       
        html +=     '<div class="siteplanTooltipWrapper">';
        html +=         '<div class="siteplanTooltipInner">';
        html +=             '<div class="left">';
        
        html +=                 '<div class="title colorTitle">';
        html +=                     vtHTML;
        html +=                     'Plot ' + plotNumber;
        html +=                 '</div>';
        html +=                 '<div class="title colorTitle" style="white-space:nowrap;font-size:' + s + 'px;">';
        html +=                     plotTitle;
        html +=                 '</div>';
        html +=                 '<div class="beds colorTitle">';
        html +=                     plotBedType;
        html +=                 '</div>';
        html +=                 '<div class="summary">';
        html +=                     plotPrice;
        html +=                 '</div>';
        html +=                 '<div class="summary colorTitle">';
        html +=                     plotStatus;
        html +=                 '</div>';
        
        html +=                 '<div class="specialOfferLbl">';
        html +=                     spOffersAvail;
        html +=                 '</div>';

        html +=                 '<div class="summary">';
        html +=                     'Click to view';
        html +=                 '</div>';
                
        html +=             '</div>';
        
        html +=             '<div class="right">';
        html +=                 imgHtml;
        html +=             '</div>';
        
        html +=             '<div class="clearLeft"></div>';
        
        html +=         '</div>';
        
        html +=         '<div class="tail"></div>';
        
        html +=     '</div>';
        html +=     '<div>';
        html +=         '<div class="tailLeft"></div>';
        html +=         '<div class="tailGraphic"></div>';
        html +=         '<div class="tailRight"></div>';
        html +=         '<div class="clearLeft"></div>';
        html +=     '</div>';
        html += '</div>';
	}
	
	return html;
}

