
<!--
/*
Automatic Welcome PM
Originally by MKII
Taken from Gogf, solved by DeltaOne
Enjoy this fine script!
http://lucian.goobergunch.net/
*/

appearFrom = ["Modelairplane", 1]
msgTitle = "Welcome to our Forum!"
msgContents = "Welcome to the The Modelfly Forum! Please be sure to read the [url=http://z3.invisionfree.com/The_Modelfly_Forum/index.php?showtopic=663]Rules[/url] before posting on the site and please follow them so we can all enjoy the forum.\n\n" +
"For starters, after reading the rule, you can go [url=http://z3.invisionfree.com/The_Modelfly_Forum/index.php?showforum=89]Here[/url] and introduce yourself to the site!\n" +
"If you have any problems at all while you are here, go [url=http://z3.invisionfree.com/The_Modelfly_Forum/index.php?showforum=33]Here[/url] and post the problem and someone will try their best to help you.\n\n" +
"If you need further help, feel free to pm a Admin. Heres a list of them and a link so you can pm them:\n" +
"[url=http://z3.invisionfree.com/The_Modelfly_Forum/index.php?showuser=1]Modelairplane[/url]"

home = "http://"+location.hostname
home += location.pathname.match(/\/[^\/]+\//) ? "/" + location.pathname.substr(1).substr(0, location.pathname.substr(1).indexOf("/") + 1) : location.pathname + "/"
home += "index.php?"

if(document.forms['REG'])
document.forms['REG'].onsubmit = function()
{
if(!Validate())
return false
document.cookie = "newMember=1; expires=" + new Date("1/1/2010").toGMTString()
return true
}

userLinks = document.getElementById("userlinks")
userName = userLinks.getElementsByTagName("A")[0].innerHTML.replace(/<[^>]+>/g, "")

if(userLinks.innerHTML.match("Logged in")&&document.cookie.match("newMember=1"))
{
document.cookie = "newMember=0; expires=" + new Date().toGMTString()
document.write("<iframe src='" + home + "act=Msg&CODE=4&MODE=1&entered_name=" + escape(userName) + "&msg_title=" + escape(msgTitle) + "&Post=" + escape(msgContents) + "' style='display:none'></iframe>")
alert("You have a new personal message from "+ appearFrom[0])
window.location.href='http://z3.invisionfree.com/The_Modelfly_Forum/index.php?act=Msg&CODE=01'
}


if(location.href.match(/act=Msg&CODE=0*1/))
{
td = document.getElementsByTagName("TD")
for(i = 0; i < td.length; i++)
if(td[i].innerHTML.replace(/<[^>]+>/g, "") == msgTitle)
{
a = td[i + 1].getElementsByTagName("A")
a[0].href = home + "showuser=" + appearFrom[1]
a[0].innerHTML = appearFrom[0]
a[1].href = a[1].href.replace(/MID=\d+/, "MID=" + appearFrom[1])
}
}

if(location.href.match(/MSID=\d+/))
{
b = document.getElementsByTagName("B")
for(i = 0; i < b.length; i++)
if(b[i].innerHTML == msgTitle && b[i].parentNode.className == "postdetails")
{
div2 = document.getElementsByTagName("DIV")
for(e = 0; e < div2.length; e++)
if((div2[e].className == "pformstrip") && div2[e].width != "100%")
{
div2[e + 1].innerHTML=""
div2[e + 10].innerHTML=""
}
td = document.getElementsByTagName("TD")
for(n = 0; n < td.length; n++)
if((td[n].className == "post1") && td[n].width != "100%")
{
a = td[n - 2].getElementsByTagName("A")[0]
if(a.innerHTML.replace(/<[^>]+>/g,"") != userName)
break
a.href = home + "showuser=" + appearFrom[1]
a.innerHTML = appearFrom[0]
div = td[n + 1].getElementsByTagName("DIV")
for(x = 0; x < div.length; x++)
if(div[x].className == "signature")
div[x].removeNode(true)
a = td[n + 3].getElementsByTagName("A")
for(x = 0; x < a.length; x++)
if(a[x].href.match(/MID=\d+/))
a[x].href = a[x].href.replace(/MID=\d+/, "MID=" + appearFrom[1])
td[n + 1].colSpan = "2"
td[n].removeNode(true)
break
}
break
}
}

//-->

