function confirmBeforeDelete(id) { if (confirm("Are you sure?")) window.location = "http://www.nadaimportante.org/app/delete.php?post_id="+id; return; } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } function init(is_reply) { if (readCookie("dg_form") == "show") { document.getElementById("contenido").focus(); } else { chgForm(is_reply); } } function chgForm(is_reply) { // chequeamos si existe el formulario, porque probablemente // lo estamos ocultando y entonces este objeto no existe. var obj = document.getElementById("formPane"); if (obj == null) return; var style = document.getElementById("formPane").style; style.display = style.display == "none"? "block" : "none"; if (style.display == "none") { showForm(true,is_reply); createCookie("dg_form","hidden",3600); createCookie("dg_tmp","no",0); } else { showForm(false,is_reply); createCookie("dg_form","showed",3600); document.getElementById("contenido").focus(); } } function showForm(show,is_reply) { var obj = document.getElementById("formLink"); if (show) { if (is_reply) { obj.innerHTML = "reply to this post"; obj.title = "reply to this post"; } else { obj.innerHTML = "click here to say something"; obj.title = "click here to say something"; } } else { obj.innerHTML = "hide form"; obj.title = "hide form"; } return; } function toogleHelp(e) { var style = document.getElementById(e).style; style.display = style.display == "none"? "inline" : "none"; var style = document.getElementById(e+"Link").style; style.display = style.display == "none"? "inline" : "none"; } function postMsg() { chgForm(); createCookie("dg_tmp","yes",0); document.frmPost.submit(); } function voteFavor(id) { window.location = "http://www.nadaimportante.org/app/vote.php?post_id="+id+"&voto=favor"; } function voteContra(id) { window.location = "http://www.nadaimportante.org/app/vote.php?post_id="+id+"&voto=contra"; } function goToUrl (id) { window.location = "http://www.nadaimportante.org/edit/"+id+"/"; } function xxxnewRequestObject() { var xmlhttp=false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } function newRequestObject() { var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; }