function createListDiv(url, imgURL, title, time, type) {
    return "<a class='noticia newsid-"+urlToId(url, type)+"' onclick=\"loadNews" + type + "('" +
            url +
            "', true)\"><div class='news'><img class='news-img'" +
            " src='http://www.crhoy.com/wp-content/themes/crch/Slider/timthumb.php?src=" +
            imgURL +
            "&amp;w=216&amp;h=172zc=1'/><h2 class='news-title'>" +
            title + "</h2> <div class='news-time'>" +
            "" +
            "</div> <div class='news-time'>" +
            time +
            "</div></div></a>";
}
function urlToId(url, type) {
    if(type === ""){
        return url;
    }
    return url.replace(/([.\.:\/])/g, '');
}
function createCommentDiv(url, imgURL, name, time, comment) {
    if(imgURL==="") {
        return "<div class='comment'><div class='comment-area'><div class='comment-author'>" +
            name + "</div> <div class='comments-time'>" +
            time +
            "</div><div class='comments-content'>" +
            comment +
            "</div></div></div>";
    } else {
        return "<div class='comment'><img class='comment-img' src='" +
            imgURL +
            "'/><div class='comment-area'><div class='comment-author'>" +
            name + "</div> <div class='comments-time'>" +
            time +
            "</div><div class='comments-content'>" +
            comment +
            "</div></div></div>";
    }   
}
function createResultsInfo(query, results, time) {
    return "<h2 class='section-title-search'>Resultados: <b>" +
            query + "</b></h2><div class='search-info'>Aproximandamente " +
            results +
            " resultados encontrados (" +
            time +
            " segundos)</div>";
}
function createConnectionErrorDiv() {
    return "<div class='error'> No se pudo conectar con el servidor, verifique que tenga Internet y vuelva recargar para intentar de nuevo  <img onclick='navigate.currentPage.open();' src='img/update.png' /></div>";
}
function createLoadingImg() {
    return "<div id='recent-loading-img'  ><img  src=img/loading.gif /></div>";
}
function createHomeCategoryElement(postId, img, title, time) {
    return "<td class='category-td'><a onclick='loadNews(" +
            postId +
            ", true)'><div class='category-news' style='background-image: url(\"http://www.crhoy.com/wp-content/themes/crch/Slider/timthumb.php?src=" +
            img +
            "&w=248&h=178zc=1\");'><div class='caption'><div class='caption-title-category'>" +
            title +
            "</div></div>" +
            "</div></a></td>";
}
function createHomeSecsElement(news) {
    return "<td class='category-td'><h3 class='section-title'> <a onclick='loadCat(" + news[6] + ", 0)'> " + news[5] + " </a> </h3><a onclick='loadNews(" +
            news[0] +
            ", true)'><div class='category-news' style='background-image: url(\"http://www.crhoy.com/wp-content/themes/crch/Slider/timthumb.php?src=" +
            news[1] +
            "&w=248&h=178zc=1\");'><div class='caption'><div class='caption-title-category'>" +
            news[2] +
            "</div></div>" +
            "</div></a></td>";
}
function createOpinionElement(info) {
    return "<td class='category-td'><a onclick='loadNews(" +
            info[0] +
            ", true)'><div class='category-news' ><div class='header-opinion'><table><tr><td><img src='http://www.crhoy.com/wp-content/themes/crch/Slider/timthumb.php?src=" +
            info[1] +
            "&w=135&h=105zc=1'</td><td>" + info[4][1] + "<br>" +
            info[4][2] +
            "</a></td></tr></table></div><div class='content-opinion'><div class='caption-title-opinion'>" +
            info[2] +
            "</div></div>" +
            "</div></a></td>";
}
function createSliderElement(info) {
    return "<td class='slider-td'><a onclick='loadNews(" +
            info[0] +
            ", true)'><div class='slider-news' style='background-image: url(\"http://www.crhoy.com/wp-content/themes/crch/Slider/timthumb.php?src=" +
            info[1] +
            "&w=" + w + "&h=" + h + "zc=1\");'><div class='caption'><div class='caption-title'>" +
            info[2] +
            "</div><table><tr class='tag-info'><td class='cat_tag'>" +
            displayCategories(info[3]) +
            "</td><td> | </td><td><a class='author' href='" +
            info[5][0] +
            "'>" +
            info[5][1] + " " + info[5][2]
            + "</a></td></tr></table></div>" +
            "</div></a></td>";
}