﻿function getHTMLValue(address, name, website, email, tel, fax, vhid, addrid, eventid, image, desc, category){
	//alert("getHTMLValue");
    var html = "";
    
    html = html + "<span style='margin-bottom: 20px;text-decoration: none;font-size: 1em;line-height: 16pt;word-spacing: 1pt;'><table border='0'>";
    if (name == null) 
        name = "";
    var namehtml = "";
    if (website != null && website != '' && website.indexOf("http:") == -1) {
        namehtml = "<a href='javascript:openMapLocatorPopup(\"/eng/" + website + "\")' style='color:#53C5DF'><b><font color='#53C5DF'>" + name + "</font></b></a>";
    }
    else 
        if (website != null && website != "") {
            namehtml = "<b><a href='javascript:openMapLocatorPopup(\"" + website + "\")' style='color:#53C5DF'><font color='#53C5DF'>" + name + "</font></a></b>";
        }
        else {
            namehtml = "<b><font color='#53C5DF'>" + name + "</font></b>";
        }
    
    var imghtml = "";
    
    if (image != "" && image != null) {
        imghtml = "<img src=\"images/gmap/" + image + "\" width=\"70\" height=\"70\" border=\"0\" /><br/>";
    }
    
    if (imghtml != "") {
        html = html + "<tr>";
        html = html + "<td width='80px'>";
        html = html + imghtml;
        html = html + "</td>";
        html = html + "<td width='220' align='left'>";
        html = html + namehtml;
        html = html + "</td>";
        html = html + "</tr>";
    }
    else {
        html = html + "<tr>";
        html = html + "<td width='300'>";
        html = html + namehtml;
        html = html + "</td>";
        html = html + "</tr>";
    }
    
    html = html + "</table></span>";
    
    return html;
}

function addCol(html, colname, value, color){
    var htmlOut = html;
    var bgcolor = ((color % 2) == 0) ? "#f4f4f2" : "#ffffff";
    
    htmlOut = htmlOut + "<tr>";
    htmlOut = htmlOut + "<td bgcolor='" + bgcolor + "' width='70' valign='top' style='font-size:13px;letter-spacing:0px;'>";
    htmlOut = htmlOut + colname;
    htmlOut = htmlOut + "</td>";
    htmlOut = htmlOut + "<td bgcolor='" + bgcolor + "' width='230'  valign='middle' align='left'  style='font-size:13px;letter-spacing:0px;'>";
    htmlOut = htmlOut + value;
    htmlOut = htmlOut + "</td>";
    htmlOut = htmlOut + "</tr>";
    
    return htmlOut;
}

function openMapLocatorPopup(url){
    var mapLocatorPopup = window.open(url, "MapLocatorPopup");
    mapLocatorPopup.focus();
}

