Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need some javascript editing help

 
Lifelesspeople.com Forum Index -> Bargain Boutique
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Wed Jan 23, 2008 7:07 am    Post subject: need some javascript editing help Reply with quote

I have this javascript code from the internet
Code:
<script type="text/javascript">
   <!--
   var startTime=new Date();
   var endTime=new Date();
   var startPressed=false;
   var bgChangeStarted=false;
   var maxWait=20;
   var timerID;
   function startTest()
   {
   document.bgColor="#000000";
   bgChangeStarted=true;
   startTime=new Date();
   }
   function remark(responseTime)
   {var responseString="";
    if (responseTime < 0.01)                         responseString="You are super human.  I bow to Thee!"
    if (responseTime > 0 && responseTime <0.01)      responseString="You are THE speed demon!"
    if (responseTime >.01 && responseTime <.05 )     responseString="Stunning!  But you can still get faster...";
    if (responseTime >= 0.05 && responseTime <.10)   responseString="Pretty excellent!";
    if (responseTime >= 0.10 && responseTime < 0.20) responseString="Not bad at all!";
    if (responseTime >=0.20 && responseTime < 0.30)  responseString="Pretty average, c'mon try harder!";
    if (responseTime >=0.30 && responseTime < 0.60)  responseString="Ok, this isn't funny!  You can do better!!!";
    if (responseTime >=0.60 && responseTime < 1)     responseString="You're not over 90 are you?  Try using your finger and not your walking stick";
    if (responseTime >=1)                            responseString="Hello?!  Wakey wakey!  Time for breakfast!";
    return responseString;
   }
   function stopTest()
   {
   if(bgChangeStarted)
    {
    endTime=new Date();
    var responseTime=(endTime.getTime()-startTime.getTime())/1000;
    document.bgColor="#990000";       
    alert("You reaction time is " + responseTime + " seconds " + "\n" + remark(responseTime));
    startPressed=false;
    bgChangeStarted=false;
    }
   else
    {
    if (!startPressed)
     {
     alert("Press 'Start' to commence testing!");
     }
    else
     {       
     clearTimeout(timerID);
     startPressed=false;             
     alert("OI!! No cheating!  Press 'start' again...");
     }               
    }
   }
   var randMULTIPLIER=0x015a4e35;
   var randINCREMENT=1;
   var today=new Date();
   var randSeed=today.getSeconds();
   function randNumber()
   {
    randSeed = (randMULTIPLIER * randSeed + randINCREMENT) % (1 << 31);
    return((randSeed >> 15) & 0x7fff) / 32767;
   }
   function startit()
   {
   if(startPressed)
    {alert("Already started. Press stop to stop");
     return;
    }
   else
    {
    startPressed=true;
    timerID=setTimeout('startTest()', 6000*randNumber());
    }
   }
   // -->
   </script>

For some reason when using background colour in a css file, this code can't change the background colour

This is how i have the code set in the file
Code:
background-color:#990000;


This is the address to the whole file
http://darknesswithin.com.ru/darknesswithin.css

I would also like to edit it so that instead of telling you your time, if your time was less than .30 then it sets $_SESSION['action'] == "reward"

Pay is up to you
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Fri Jan 25, 2008 3:52 am    Post subject: Reply with quote

never mind, with help i've done it myself
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Bargain Boutique All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com