/*Moods Modification, User Controled, By Trini_Gangsta
Feel free to share this, just don't claim it*/

if(location.href.match('UserCP&CODE=22') && !location.href.match('page=moods') && document.referrer.match('page=moods'))
{
document.write('<Style>table{display:none;}</style>');
location.href=document.referrer;
}

if(location.href.match('page=moods'))
{
document.getElementById('moodmod').style.display='none';
document.title='Welcome to your moods page';

if(!document.REPLIER.Post.value.match(/\[MOOD\](.*)\[\/MOOD\]/))
   {
document.REPLIER.Post.value+='[MOOD]happy[/MOOD]';
   }

if(document.REPLIER.Post.value.match(/\[MOOD\](.*)\[\/MOOD\]/))
   {
var moodit=RegExp.$1;
   
document.write('<div class="maintitle">What Mood Are You In?</div><div class="tablepad"><center><big>Current Mood:</big>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/'+moodit+'.gif"/><br/><br/><b><u>Click on any of the following moods</u></b><br/><br/><br/><img src="http://www.miqbalkhan.com/onlyiqbal/moods/cool.gif" onclick="iamcool()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/angry.gif" onclick="iamangry()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/happy.gif" onclick="iamhappy()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/sad.gif" onclick="iamsad()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/scared.gif" onclick="iamscared()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/flirty.gif" onclick="iamflirty()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/relaxed.gif" onclick="iamrelaxed()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/amazed.gif" onclick="iamamazed()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/worried.gif" onclick="iamworried()"/><br/><br/><img src="http://www.miqbalkhan.com/onlyiqbal/moods/crappy.gif" onclick="iamcrappy()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/doubtful.gif" onclick="iamdoubtful()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/fine.gif" onclick="iamfine()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/grumpy.gif" onclick="iamgrumpy()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/innocent.gif" onclick="iaminnocent()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/sick.gif" onclick="iamsick()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/mellow.gif" onclick="iammellow()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/bored.gif" onclick="iambored()"/><br/><br/><img src="http://www.miqbalkhan.com/onlyiqbal/moods/roflol.gif" onclick="iamroflol()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/psychedelic.gif" onclick="iampsychedelic()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/busy.gif" onclick="iambusy()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/sneaky.gif" onclick="iamsneaky()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/buzzed.gif" onclick="iambuzzed()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/asleep.gif" onclick="iamasleep()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/daring.gif" onclick="iamdaring()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/cheerful.gif" onclick="iamcheerful()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/shocked.gif" onclick="iamshocked()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/argumentative.gif" onclick="argumentative()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/bovvered.gif" onclick="bothered()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/cocky.gif" onclick="cocky()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/disappointed.gif" onclick="dissappointed()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/hyper.gif" onclick="hyper()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/hungry.gif" onclick="hungry()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/justchillin.gif" onclick="justchillin()"/>&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/bitchy.gif" onclick="bitchy()"/>																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																				<br/><br/><i><span id="selected"></span></i><br/></center></div>');

function bitchy()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/bitchy.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('bitchy');
updateme();
      }
	  
function justchillin()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/justchillin.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('justchillin');
updateme();
      }
	  

function hungry()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/hungry.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('hungry');
updateme();
      }
	  
function hyper()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/hyper.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('hyper');
updateme();
      }

function dissappointed()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/disappointed.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('disappointed');
updateme();
      }

function cocky()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/cocky.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('cocky');
updateme();
      }
	  
	  
function bothered()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/bovvered.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('bovvered');
updateme();
      }
	  
function argumentative()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/argumentative.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('argumentative');
updateme();
      }
	  
function iamcool()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/cool.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('cool');
updateme();
      }

function iamangry()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/angry.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('angry');
updateme();
      }

function iamhappy()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/happy.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('happy');
updateme();
      }

function iamsad()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/sad.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('sad');
updateme();
      }

function iamscared()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/scared.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('scared');
updateme();
      }

function iamflirty()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/flirty.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('flirty');
updateme();
      }

function iamrelaxed()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/relaxed.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('relaxed');
updateme();
      }

function iamamazed()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/amazed.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('amazed');
updateme();
      }

function iamworried()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/worried.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('worried');
updateme();
      }

function iamcrappy()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/crappy.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('crappy');
updateme();
      }

function iamdoubtful()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/doubtful.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('doubtful');
updateme();
      }

function iamfine()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/fine.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('fine');
updateme();
      }

function iamgrumpy()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/grumpy.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('grumpy');
updateme();
      }

function iaminnocent()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/innocent.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('innocent');
updateme();
      }

function iamsick()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/sick.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('sick');
updateme();
      }

function iammellow()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/mellow.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('mellow');
updateme();
      }

function iambored()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/bored.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('bored');
updateme();
      }

function iamroflol()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/roflol.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('roflol');
updateme();
      }

function iampsychedelic()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/psychedelic.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split('moodit').join('psychedelic');
updateme();
      }

function iambusy()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/busy.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('busy');
updateme();
      }

function iamsneaky()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/sneaky.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('sneaky');
updateme();
      }

function iambuzzed()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/buzzed.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('buzzed');
updateme();
      }

function iamasleep()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/asleep.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('asleep');
updateme();
      }

function iamdaring()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/daring.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('daring');
updateme();
      }

function iamcheerful()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/cheerful.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('cheerful');
updateme();
      }

function iamshocked()
      {
document.getElementById('selected').innerHTML='Changing your mood to:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/shocked.gif"/>';
document.REPLIER.Post.value=document.REPLIER.Post.value.split(moodit).join('shocked');
updateme();
      }

function updateme()
      {
var z=document.getElementsByTagName('input');
for(x=0;x<z.length;x++)
         {
if(z[x].value.match('Update my Signature'))
            {
z[x].click();
            }
         }
      }
   }
}

/*Special thanks to Slayer766!*/

if(location.href.match('showtopic'))
{
var z=document.getElementsByTagName('span');
for(x=0;x<z.length;x++)
   {
if(z[x].className.match('postdetails') && z[x].innerHTML.match('Joined'))
      {
var b=z[x].parentNode.parentNode.getElementsByTagName('td')[1];
if(b.getElementsByTagName('div')[b.getElementsByTagName('div').length-1].className.match('signature'))
         {
if(b.getElementsByTagName('div')[b.getElementsByTagName('div').length-1].innerHTML.match(/\[MOOD\](.*)\[\/MOOD\]/))
            {
var moodit=RegExp.$1;

z[x].innerHTML=z[x].innerHTML.split('Joined').join('Mood:&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/'+moodit+'.gif"/><br/>Joined');
b.getElementsByTagName('div')[b.getElementsByTagName('div').length-1].innerHTML=b.getElementsByTagName('div')[b.getElementsByTagName('div').length-1].innerHTML.split('[MOOD]'+moodit+'[/MOOD]').join('');
            }
         }
      }
   }
}

if(location.href.match('showuser'))
{
var z=document.getElementsByTagName('td');
for(x=0;x<z.length;x++)
   {
if(z[x].className.match('plainborder') && z[x].innerHTML.match(/\[MOOD\](.*)\[\/MOOD\]/))
      {
var moodit = RegExp.$1;

z[x].innerHTML=z[x].innerHTML.split('[MOOD]'+moodit+'[/MOOD]').join('');
z[x].innerHTML+='<td class="row3" width="65%" valign="top">&nbsp;<b>Mood</b></td><td align="left" class="row1">&nbsp;<img src="http://www.miqbalkhan.com/onlyiqbal/moods/'+moodit+'.gif"/>';
      }
   }
}

if(location.href.match('UserCP&CODE=22'))
{
var z=document.getElementsByTagName('div');
for(x=0;x<z.length;x++)
   {
if(z[x].className.match('signature') && z[x].innerHTML.match(/\[MOOD\](.*)\[\/MOOD\]/))
      {
var moodit=RegExp.$1;

z[x].innerHTML=z[x].innerHTML.split('[MOOD]'+moodit+'[/MOOD]').join('');
      }
if(z[x].className.match('pformstrip') && z[x].innerHTML.match('Edit your signature') && document.REPLIER.Post.value.match(/\[MOOD\](.*)\[\/MOOD\]/))
      {
z[x].innerHTML+='&nbsp;(Do NOT remove the [MOOD] tag! It will NOT effect or show in your signature)';
      }
   }
}

if(document.getElementById('userlinks').innerHTML.match('Logged in as:'))
{
document.getElementById('userlinks').getElementsByTagName('TD')[1].innerHTML+='&nbsp;&middot;&nbsp;<a href="'+window.location.href.split('?')[0]+'?act=UserCP&CODE=22&page=moods">Edit Mood</a>';
}
