<script type="text/JavaScript">
//<![CDATA[
// Auto PM on Registration Created by Viral -
http://zbaio.zetabin.com
var pm = {};
pm.newmessage = "New Message";
pm.from = "System Message";
pm.subject = "Welcome to the Forum!";
pm.content = 'Hello and welcome!';
pm.sent = "One minute ago";
pm.url = "#";
pm.id = $("#top_info strong a").text();
pm.sendmessage = function()
{
$.get(main_url+"msg/?c=2",{},function(data)
{
pm.xc = $("input[name=xc]",data).val();
pm.secure = $("input[name=secure]",data).val();
$.post(main_url+"msg/?c=3&sd=1",{name:pm.id,xc:pm.xc,msg:0,fwd:0,convo:0,draft_edit:0,secure:pm.secure,title:"wJf3V99o_I8hI_c8q-P",post:pm.content,track:1},function(){window.name = window.name.replace("reg=1","");pm.getmessage();});
});
}
pm.toast = function(url,newmessage,from,subject,sent)
{
$("#copyright").after('<div id="pmtoast" style="display: block;"><a id="pmlink" href="'+url+'"><big>'+newmessage+'</big><small>From:</small><strong>'+from+'</strong><br/><small>Subject:</small><strong>'+subject+'</strong><br/><small>Sent:</small><strong>'+sent+'</strong></a><a id="pmclose" href="#">Close</a></div>');
$("#pmclose").click(function(){$(this).parent().hide("slow");});
}
pm.getmessage = function()
{
$.get(main_url+"msg/?folder=-2",{},function(data){
pm.data = $("table.pm.togglechecks tr.row1:first td:first a",data);
pm.url = pm.data.attr("href");
with(pm)
{
toast(url,newmessage,from,subject,sent);
}
});
}
pm.clean = function()
{
if(document.title == "wJf3V99o_I8hI_c8q-P"){
document.title = pm.subject;
var theTitle = $("#boardmeta").next().children();
theTitle.eq(0).html(theTitle.html().replace("wJf3V99o_I8hI_c8q-P",pm.subject));
$("#main a[href="+$('#top_info strong a').attr('href')+"]").parent().html(pm.from);
var nav = document.getElementById("nav");
nav.innerHTML = nav.innerHTML.replace("wJf3V99o_I8hI_c8q-P",pm.subject);
$("#conversation").next().remove();
$("#conversation tr:first td:first img").remove();
}
$("table.pm.togglechecks tr a").each(function()
{
if($(this).text() == "wJf3V99o_I8hI_c8q-P")
{
$(this).text(pm.subject).parent().next().html(pm.from);
}
});
}
pm.register = function()
{
if(location.href.match(//register/?c=1/gi)){
$("button[type=submit]").click(function()
{
window.name = "reg=1";
});
}
}
pm.logged_in = function()
{
return $("#top_info small a").size() == 1;
}
pm.startAuto = function(){
if(window.name.match("reg=1"))
{
if(pm.logged_in() === true)
{
pm.sendmessage();
}
else
{
window.name = window.name.replace("reg=1","");
}
}
}
pm.startAuto();
pm.register();
pm.clean();
//]]>
</script>