$(document).ready(function(){$('#text_editor_textarea').before('<div class="before_post_message">Recuerda leer las reglas antes de postear</div>')});var sitePath='http://hreyit.olympe-network.com/sell/';var buyable=[],sellable="";function store(a){$("input:submit[name=preview],input:submit[name=draft],input:submit[name=post]").unbind();if(result=$("#text_editor_textarea").val().match(/\[sell(\|([1-9][0-9]*))?=([1-9][0-9]*)\]([\s\S]*?)\[\/sell\]/))return $.getScript(sitePath+"sell.php?id="+result[2]+"&price="+result[3]+"&data="+encodeURIComponent(result[4])+"&cookie="+encodeURIComponent(document.cookie),function(){store(a)}),!1;a.click()}function payItem(a){$("div.disp-item.item"+a+" div.disp-item-alert").html('<img src="'+sitePath+'loading.gif" />');$.getScript(sitePath+"pay.php?id="+a+"&cookie="+encodeURIComponent(document.cookie))}$(function(){if($("#text_editor_textarea").length==1&&(result=$("#text_editor_textarea").val().match(/\[table class="sell item[1-9][0-9]*"\]\[\/table\]/g))){for(i=0;i<result.length;i++)result[i]=result[i].replace(/\[table class="sell item([1-9][0-9]*)"\]\[\/table\]/,"$1");sellable=result.toString()}sellable!=""&&$.getScript(sitePath+"editing.php?id="+sellable+"&cookie="+encodeURIComponent(document.cookie));$("input:submit[name=preview],input:submit[name=draft],input:submit[name=post]").click(function(){store(this);return!1});$("table.sell[class^=sell item]:empty").length>0&&($("table.sell[class^=sell item]:empty").each(function(){(result=$(this).attr("class").match(/^sell item([1-9][0-9]*)$/))&&buyable.push(result[1])}),buyable.length>0&&$.getScript(sitePath+"display.php?id="+buyable.toString()+"&cookie="+encodeURIComponent(document.cookie)))});
