
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - ++resource++plone.app.discussion.javascripts/comments.js - */
// http://www.gruponovaenergia.com/portal_javascripts/++resource++plone.app.discussion.javascripts/comments.js?original=1
jq(document).ready(function(){jq(".reply").find("input[name='form.buttons.reply']").css("display","none");jq(".reply").find("input[name='form.buttons.cancel']").css("display","none");jq(".reply-to-comment-button").css("display","inline");var post_comment_div=jq("#commenting");var in_reply_to_field=post_comment_div.find("input[name='form.widgets.in_reply_to']");if(in_reply_to_field.val()!=""){var current_reply_id="#"+in_reply_to_field.val();var current_reply_to_div=jq(".discussion").find(current_reply_id);createReplyForm(current_reply_to_div);clearForm(post_comment_div)}
function createReplyForm(comment_div){var comment_id=comment_div.attr("id");var reply_button=comment_div.find(".reply-to-comment-button");var reply_div=jq("#commenting").clone(true);reply_div.find("#formfield-form-widgets-captcha").find("script").remove();reply_div.appendTo(comment_div).css("display","none");reply_div.removeAttr("id")
jq(reply_button).css("display","none");var reply_form=reply_div.find("form");reply_form.find("input[name='form.widgets.in_reply_to']").val(comment_id);var cancel_reply_button=reply_div.find(".cancelreplytocomment");cancel_reply_button.attr("id",comment_id);reply_form.find("input[name='form.buttons.cancel']").css("display","inline");reply_div.slideDown("slow");cancel_reply_button.css("display","inline")}
function clearForm(form_div){form_div.find(".error").removeClass("error");form_div.find(".fieldErrorBox").remove();form_div.find("input[type='text']").attr("value","");form_div.find("textarea").attr("value","")}
jq(".reply-to-comment-button").bind("click", function(e){var comment_div=jq(this).parents().filter(".comment");createReplyForm(comment_div);clearForm(comment_div)});jq("#form-buttons-cancel").bind("click", function(e){e.preventDefault();reply_to_comment_button=jq(this).
parents().
filter(".comment").
find(".reply-to-comment-button");reply_to_comment_form=jq(this).parents().filter(".reply")
reply_to_comment_form.slideUp("slow", function(){jq(this).remove()});reply_to_comment_button.css("display","inline")})});

/* - ++resource++gne.theme.javascripts/contador.js - */
// http://www.gruponovaenergia.com/portal_javascripts/++resource++gne.theme.javascripts/contador.js?original=1
function contador(){var co_ini=160160000;var co_fin=209440000;var segs=31536000;var ahora=new Date();var dataini=new Date(ahora.getFullYear(),00,01);var dias=ahora.getTime()-dataini.getTime();var tiempo=Math.floor(dias/1000);var noemi=co_ini+(((co_fin-co_ini) * tiempo)/segs);var nums=formato(noemi,2,",",".");document.getElementById("conta").innerHTML=nums;if(document.getElementById("contag")){document.getElementById("contag").innerHTML=nums}
setTimeout("contador()",1000)}
function formato(numero,decimales,separador_decimal,separador_miles){numero=parseFloat(numero);if(isNaN(numero)){return ""}
if(decimales!==undefined){numero=numero.toFixed(decimales)}
numero=numero.toString().replace(".",separador_decimal!==undefined?separador_decimal:",");if(separador_miles){var miles=new RegExp("(-?[0-9]+)([0-9]{3})");while(miles.test(numero)){numero=numero.replace(miles,"$1"+separador_miles+"$2")}}
return numero}

