Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2004
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Merging 2 scripts

    Hi there
    I have 2 scripts, one is a countdown timer, the other a text field with loads of buttons. The countdown timer has 2 boxes with their own borders. What im asking is how can i place script 2 on the same page with the same border/background? I know its pretty simple lol but i have tried and its just messed up both scripts.
    Here is the code for the countdown timer:
    (you cant see what ur typing in the player name field because the text it is same colour as background- dont know how to fix this)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <!-- saved from url=(0066)https://www.sharemation.com/supersha...n%20Timer.html -->
    <HTML 
    xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>countdown script</TITLE>
    <META http-equiv=Content-Type content="application/xhtml+xml; charset=utf-8">
    <STYLE type=text/css>BODY {
    	MARGIN-TOP: 0px; BACKGROUND: #000066
    }
    .container {
    	BORDER-RIGHT: #0046d5 2px inset; BORDER-TOP: #0046d5 2px inset; MARGIN: 0px; BORDER-LEFT: #0046d5 2px inset; WIDTH: 18em; BORDER-BOTTOM: #0046d5 2px inset
    }
    .container {
    	FONT-SIZE: 16px; FONT-FAMILY: comic sans ms
    }
    LABEL {
    	FONT-SIZE: 16px; FONT-FAMILY: comic sans ms
    }
    FORM {
    	FONT-SIZE: 0.8em; FONT-FAMILY: comic sans ms
    }
    .div1 {
    	BORDER-RIGHT: #0046d5 6px inset; BORDER-TOP: #0046d5 6px inset; BACKGROUND: #0046d5; BORDER-LEFT: #0046d5 6px inset; WIDTH: 16em; BORDER-BOTTOM: #0046d5 6px inset; TEXT-ALIGN: center
    }
    .div2 {
    	BORDER-RIGHT: #0046d5 6px inset; BORDER-TOP: #0046d5 6px inset; BACKGROUND: #0046d5; BORDER-LEFT: #0046d5 6px inset; WIDTH: 16em; BORDER-BOTTOM: #0046d5 6px inset; TEXT-ALIGN: center
    }
    .div1 {
    	BORDER-BOTTOM-WIDTH: 0px; MARGIN: 8px 8px 0px 9px
    }
    .div2 {
    	BORDER-TOP-WIDTH: 0px; MARGIN: 0px 8px 8px 9px
    }
    .timer {
    	BACKGROUND: #000; MARGIN: 3px; WIDTH: 1.8em; COLOR: #0046d5
    }
    .butts {
    	BACKGROUND: #999; MARGIN: 3px; WIDTH: 3.6em; COLOR: #333
    }
    .time_left {
    	WHITE-SPACE: pre
    }
    </STYLE>
    
    <SCRIPT type=text/javascript>
    			//<![CDATA[
    				function timers() {
    				    this.instance_name = 'countdown';
    				    this.last_update = Math.floor(new Date().getTime() / 1000);
    				    this.secs = 180;
    				    this.timers = new Array();
    				    this.parent = document.getElementById('active');
    				    this.create = function() {
    				        var name = document.timer.name.value;
    				        if(!name) window.alert('Specify a name for the countdown first.');
    				        else {
    				            for(var i = 0; i < this.timers.length; i++) {
    				                if(this.timers[i].name == name) {
    									window.alert('Name already in use.');
    									return;
    				                }
    				            }
    				            var no_counters = document.getElementById('no_counters');
    				            if(no_counters) no_counters.parentNode.removeChild(no_counters);
    				        	var tr = document.createElement('tr');
    				        	var td_name = document.createElement('td');
    				        	td_name.appendChild(document.createTextNode(name));
    				        	var td_time_left = document.createElement('td');
    				        	td_time_left.className = 'time_left';
    				        	var label_mins = document.createElement('label');
    				        	var label_secs = document.createElement('label');
    							var input_mins = document.createElement('input');
    							input_mins.type = 'text';
    							input_mins.className = 'timer';
    							input_mins.readonly = 1;
    							var input_secs = input_mins.cloneNode(true);
    							input_mins.value = '03';
    							input_secs.value = '00';
    							label_mins.appendChild(input_mins);
    							label_mins.appendChild(document.createTextNode(' mins. '));
    							label_secs.appendChild(input_secs);
    							label_secs.appendChild(document.createTextNode(' secs. '));
    							td_time_left.appendChild(label_mins);
    							td_time_left.appendChild(label_secs);
    				        	var td_reset = document.createElement('td');
    				        	var input_reset = document.createElement('input');
    				        	input_reset.type = 'button';
    				        	input_reset.className = 'butts';
    							input_reset.value = 'reset';
    				        	input_reset.setAttribute('onclick', this.instance_name + '.reset(' + this.timers.length + ');');
    				        	td_reset.appendChild(input_reset);
    				        	var td_clear = document.createElement('td');
    				        	var input_clear = document.createElement('input');
    				        	input_clear.type = 'button';
    				        	input_clear.className = 'butts';
    				        	input_clear.value = 'clear';
    				        	input_clear.setAttribute('onclick', this.instance_name + '.clear(' + this.timers.length + ');');
    				        	td_clear.appendChild(input_clear);
    				        	tr.appendChild(td_name);
    				        	tr.appendChild(td_time_left);
    				        	tr.appendChild(td_reset);
    				        	tr.appendChild(td_clear);
    				        	this.parent.appendChild(tr);
    				        	var timer = { };
    				            timer.name = name;
    				            timer.left = this.secs;
    				            timer.elem = tr;
    				            this.timers.push(timer);
    				            if(typeof(document.all) != 'undefined' && typeof(window.opera) == 'undefined') this.damn_ie();
    				        }
    				    }
    				    this.reset = function(number) {
    				        this.timers[number].left = this.secs;
    				    }
    				    this.clear = function(number) {
    				        this.timers[number].elem.parentNode.removeChild(this.timers[number].elem);
    				        this.timers.splice(number, 1);
    				    }
    				    this.update = function() {
    				        var now = Math.floor(new Date().getTime() / 1000);
    				        var elapsed_secs = now - this.last_update;
    				        this.last_update = now;
    				        for(var i = 0; i < this.timers.length; i++) {
    				            this.timers[i].left -= elapsed_secs;
    				            if(this.timers[i].left < 1) {
    				                this.notify(i);
    				                this.clear(i);
    								i--;
    				            }
    				            else this.show(i);
    				        }
    				        if(!i) this.no_counters();
    						window.setTimeout(this.instance_name + '.update()', 1000);
    				    }
    				    this.show = function(number) {
    				        var secs = this.timers[number].left;
    				        var mins_left = Math.floor(secs / 60);
    				        var secs_left = secs - mins_left * 60;
    				        var td_timers = this.timers[number].elem.childNodes[1];
    				        td_timers.firstChild.firstChild.value = (mins_left < 10) ? '0' + mins_left : mins_left;
    				        td_timers.childNodes[1].firstChild.value = (secs_left < 10) ? '0' + secs_left : secs_left;
    				    }
    				    this.no_counters = function() {
    				        if(document.getElementById('no_counters')) return;
    				        var tr = document.createElement('tr');
    				        tr.id = 'no_counters';
    				        var td = document.createElement('td');
    				        td.colSpan = 4;
    				        td.appendChild(document.createTextNode('No active countdowns'));
    				        tr.appendChild(td);
    				        this.parent.appendChild(tr);
    				        if(typeof(document.all) != 'undefined' && typeof(window.opera) == 'undefined') this.damn_ie();
    				    }
    				    this.notify = function(i) {
    				        alert ('"' + this.timers[i].name + '"s time is up!.');
    				    }
    				    this.damn_ie = function() {
    				        this.parent.parentNode.innerHTML = this.parent.parentNode.innerHTML;
    						this.parent = document.getElementById('active');
    						var trs = this.parent.getElementsByTagName('tr');
    						for(var i = 0; i < this.timers.length; i++) {
    							this.timers[i].elem = trs[i + 1];
    						}
    				    }
    				}
    				window.onload = function() {
    					countdown = new timers();
    					countdown.update();
    				}
    			//]]>
    		</SCRIPT>
    
    <META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
    <BODY>
    <FORM name=timer onsubmit="countdown.create(); return false;" action=#>
    <FIELDSET class=container><LEGEND>Start a new countdown</LEGEND>
    <DIV class=div1><LABEL>Player Name: <INPUT class=timer style="WIDTH: 8em" 
    name=name></LABEL> </DIV>
    <DIV class=div2><INPUT class=butts type=submit value=start> </DIV></FIELDSET> 
    </FORM>
    <FORM action=#>
    <FIELDSET class=container><LEGEND>Active countdowns</LEGEND>
    <TABLE class="div1 div2" id=active>
      <TBODY>
      <TR>
        <TH>Name</TH>
        <TH>Time left</TH>
        <TH>Reset</TH>
        <TH>Clear</TH></TR></TBODY></TABLE></LEGEND></FIELDSET> </FORM></BODY></HTML>
    And for the script that needs to be put on the same page.
    Code:
    <html>
    <head>
    
    
    
    <style>
    .MyBut { font-Size:14px;width:56px;background-color:red; }
    .MyBut2 { font-Size:14px;width:56px;background-color:blue; }
    .MyBut3 { font-Size:14px;width:56px;background-color:green; }
    .MyBut4 { font-Size:14px;width:56px;background-color:gold; }
    .MyBut5 { font-Size:14px;width:56px;background-color:purple; }
    .MyBut6 { font-Size:14px;width:55px;background-color:turquoise; }
    .MyBut7 { font-Size:14px;width:77px;background-color:grey; }
    .MyBut8 { font-Size:14px;width:45px;background-color:grey; }
    .MyBut9 { font-Size:14px;width:140px;background-color:grey; }
    .MyBut10 { font-Size:14px;width:32px;background-color:grey; }
    .MyBut11 { font-Size:14px;width:64px;background-color:grey; }
    .MyBut12 { font-Size:14px;width:68px;background-color:grey; }
    .MyBut13 { font-Size:14px;width:55px;background-color:grey; }
    .MyBut14 { font-Size:14px;width:191px;background-color:grey; }
    
    </style>
    
    <script type="text/javascript">
    
    var pos;
    var txtS='';
    var txtF='';
    
    function add(st){
     document.getElementById('TextAreaName').value+=st;
    }
    
    {
    iView.document.execCommand('undo', false, null);
    }
    
    function doRedo()
    {
    iView.document.execCommand('redo', false, null);
    }
    
    function checkCursor(where){
     largeArea=where;
     txtS='';txtF='';
     if (document.selection){
      largeArea.focus();
      sel=document.selection.createRange();
      if(sel.text==""){
       sel.text='µµµ';
       dummy=largeArea.createTextRange();
       dummy.findText('µµµ');
       dummy.select();
       pos=largeArea.value.indexOf('µµµ');
       document.selection.clear();
       largeArea.focus();
      }
     }
     else if (largeArea.selectionStart||largeArea.selectionStart == '0') {//Moz
      pos = largeArea.selectionStart;
     }
     txtS=largeArea.value.substring(0,pos);
     txtF=largeArea.value.substring(pos,largeArea.value.length);
    }
    
    function cmdA(el) {
     with(el){
      focus(); select();
     }
     if(document.all){
      window.status='Selected and Copied to Clipboard!';
      document.getElementById('CopyBut').value='COPY';
      window.clipboardData.setData('Text',document.getElementById('TextAreaName').value);
      setTimeout('document.getElementById(\'CopyBut\');window.status=""',6000);
     }
     else {
      window.status='Press Ctrl & C to Copy the Text to the Clipboard';
      setTimeout('window.status=""',6000);
     }
    }
    
    
    function insert(){
      document.getElementById('TextAreaName').value=txtS+document.getElementById('jumpnumber').value+txtF;
      textS=document.getElementById('TextAreaName').value;
      textF='';
     }
    
    function clearDefault(){
     document.getElementById('TextAreaName').value='';
     textS=''; textF='';
    
    }
    
    function countit(){
     document.getElementById('displaycount').value = document.getElementById('TextAreaName').value.length+' ';
    }
    
    </script>
    </HEAD>
    
    <BODY>
    
    
    
    <form action="" name="FormName" method="post">
    <TEXTAREA id="TextAreaName" NAME="TextareaName" COLS="53" ROWS="5" onclick="javascript:checkCursor(this);" onmouseup="javascript:checkCursor(this);" >
    </TEXTAREA>
    <br>
    <input id="jumpnumber" NAME="jumpnumber" size="10">
    
    <input class="MyBut2" type="button" width="120" NAME="copyButton" value="  " onClick="add('€b')">
    <input class="MyBut" type="button" width="120" NAME="copyButton" value=" " onClick="add('€r')">
    <input class="MyBut3" type="button" width="120" NAME="copyButton" value="" onClick="add('€g')">
    <input class="MyBut4" type="button" width="120" NAME="copyButton" value="  " onClick="add('€y')">
    <input class="MyBut5" type="button" width="120" NAME="copyButton" value="" onClick="add('€m')">
    <input class="MyBut6" type="button" width="120" NAME="copyButton" value="" onClick="add('€c')">
    <input type="button" width="120" NAME="copyButton" value=" INSERT " onClick="insert();" >
        
    <input type="button" width="120" NAME="copyButton" value=" !! " onClick="add('!!')">
    <input type="button" width="120" NAME="copyButton" value=" !!!" onClick="add('!!!')">
    <input type="button" width="120" NAME="copyButton" value="!!!!" onClick="add('!!!!')">
    <input type="button" width="120" NAME="copyButton" value=" .:: " onClick="add('.::')">
    <input type="button" width="120" NAME="copyButton" value=" ::. " onClick="add('::.')">
    <input type="button" width="120" NAME="copyButton" value=">>> " onClick="add('>>>')">
    <input type="button" width="120" NAME="copyButton" value=" <<<" onClick="add('<<<')">
    <input type="button" width="120" NAME="copyButton" value=" [[ " onClick="add('[[')">
    <input type="button" width="120" NAME="copyButton" value=" ]] " onClick="add(']]')">
    <input type="button" width="120" NAME="copyButton" value=" (( " onClick="add('((')">
    <input type="button" width="120" NAME="copyButton" value=" )) " onClick="add('))')">
    <input type="button" width="120" NAME="copyButton" value=" // " onClick="add('//')">
    <input type="button" width="120" NAME="copyButton" value=" \\ " onClick="add('\\')">
    <input type="button" width="120" NAME="copyButton" value=" { " onClick="add('{')">
    <input type="button" width="120" NAME="copyButton" value=" } " onClick="add('}')">
    <input type="button" width="120" NAME="copyButton" value="{{" onClick="add('{{')">
    <input type="button" width="120" NAME="copyButton" value="}}" onClick="add('}}')">
    <input type="button" width="120" NAME="copyButton" value="-=::" onClick="add('-=::')">
    <input type="button" width="120" NAME="copyButton" value="::=-" onClick="add('::=-')">
    <input type="button" width="120" NAME="copyButton" value="+//=" onClick="add('+//=')">
    <input type="button" width="120" NAME="copyButton" value="=\\+" onClick="add('=\\+')">
    <input type="button" width="120" NAME="copyButton" value="--==<<" onClick="add('--==<<')">
    <input type="button" width="120" NAME="copyButton" value=">>==--" onClick="add('>>==--')">
    <input type="button" width="120" NAME="copyButton" value="<--+-->" onClick="add('<--+-->')">
    <input type="button" width="120" NAME="copyButton" value="{}" onClick="add('{}')">
    <input type="button" width="120" NAME="copyButton" value=" .::. " onClick="add('.::.')">
    <input type="button" width="120" NAME="copyButton" value="  ^^ " onClick="add('^^')">
    <input type="button" width="120" NAME="copyButton" value="<<>>" onClick="add('<<>>')">
    <input class="MyBut10" type="button" width="120" NAME="copyButton" value=" <> " onClick="add('<>')">
    <input type="button" width="120" NAME="copyButton" value="--=--=--" onClick="add('--=--=--')">
    <input type="button" width="120" NAME="copyButton" value="--=--" onClick="add('--=--')">
    <input type="button" width="120" NAME="copyButton" value="<~~~>" onClick="add('<~~~>')">
    <input type="button" width="120" NAME="copyButton" value="Join@Jpool.co.uk" onClick="add('Join@Jpool.co.uk')">
    <input type="button" width="120" NAME="copyButton" value="www.Jpool.co.uk" onClick="add('www.Jpool.co.uk')">
    <input type="button" width="120" NAME="copyButton" value="  4 man  " onClick="add('4 man')">
    <input class="MyBut11" type="button" width="120" NAME="copyButton" value=" 8 man " onClick="add('8 man')">
    <input type="button" width="120" NAME="copyButton" value=" 16 man " onClick="add('16 man')">
    <input type="button" width="120" NAME="copyButton" value=" 32 man " onClick="add('32 man')">
    <input type="button" width="120" NAME="copyButton" value="64 man" onClick="add('64 man')">
    <input type="button" width="120" NAME="copyButton" value="  SE  " onClick="add(' SE')">
    <input type="button" width="120" NAME="copyButton" value=" DE " onClick="add(' DE')">
    <input class="MyBut12" type="button" width="120" NAME="copyButton" value="  1 vs 1  " onClick="add(' 1 vs 1')">
    <input type="button" width="120" NAME="copyButton" value="2 vs 2" onClick="add(' 2 vs 2')">
    <input type="button" width="120" NAME="copyButton" value="3 vs 3" onClick="add(' 3 vs 3')">
    <input type="button" width="120" NAME="copyButton" value="4 vs 4" onClick="add(' 4 vs 4')">
    <input type="button" width="120" NAME="copyButton" value="5 vs 5" onClick="add(' 5 vs 5')">
    <input type="button" width="120" NAME="copyButton" value="6 v 6" onClick="add(' 6 vs 6')">
    <input type="button" width="120" NAME="copyButton" value="3 Rd" onClick="add(' 3 Round')">
    <input type="button" width="120" NAME="copyButton" value="4 Rd" onClick="add(' 4 Round')">
    <input type="button" width="120" NAME="copyButton" value="5 Rd" onClick="add(' 5 Round')">
    <input type="button" width="120" NAME="copyButton" value="6 Rd" onClick="add(' 6 Round')">
    <input type="button" width="120" NAME="copyButton" value="7 Rd" onClick="add(' 7 Round')">
    <input type="button" width="120" NAME="copyButton" value="8 Rd" onClick="add(' 8 Round')">
    <input class="MyBut8" type="button" width="120" NAME="copyButton" value="Swiss" onClick="add(' Swiss')">
    <input class="MyBut7" type="button" width="120" NAME="copyButton" value="True Swiss" onClick="add(' True Swiss')">
    <input class="MyBut9" type="button" value="Calculate Characters" 
          onClick="countit(this)"> 
    <input type="text" VALUE="Max 200" name="displaycount" size="5">
    <input type="button" width="120" NAME="copyButton" value=" Clear " onClick="clearDefault(TextareaName)">
    <input type="button" width="120" NAME="copyButton" value=" Undo " onClick="document.execCommand('undo')">
    <input type="button" width="120" NAME="copyButton" value=" Redo " onClick="document.execCommand('redo')"> 
    <input class=''MyBut13'' type="button" id="CopyBut" value="COPY" onClick="cmdA(TextareaName)">
    
    
    
    
          </p>
          <div align="center"><center><p><font face="comic sans ms" size="-2">
    </form>
    </body>
    </html>
    (the buttons line up with each other when you resize the window)
    Below is a picture to show what i mean.

    Thanks for any help

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's the problem??
    I see nothing in the javascript which would cause conflicts between the two scripts...

    .....Willy

  • #3
    New Coder
    Join Date
    Dec 2004
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    hmm i will try again

  • #4
    New Coder
    Join Date
    Dec 2004
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Whahay i did it finally after loads of trial and error. There are some minor minor problems that wont go away though. The buttons are further apart, messing up the alignment in 'advert creator'. I dont understand why on earth this would change, or find any value to correct it. The font size of the text inside some of the buttons has changed. if you look closely at the 5 vs 5 button in my earlier post you will see the 5 does not look italic. However now i have joined them the vertical line is now slightly diagonal. Anyone know how i can set the spacing to how it was before?

    Also the background of the 'Player name' field is the same as the text you put into it. Changing the colour of .timer { changes both to the specified colour so it does not solve the problem.

    Sorry these are boring problems but i have tried my best to correct them.
    Thanks if anyone can help.
    My code:-
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <!-- saved from url=(0066)https://www.sharemation.com/supersha...n%20Timer.html -->
    <HTML 
    xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>countdown script</TITLE>
    <META http-equiv=Content-Type content="application/xhtml+xml; charset=utf-8">
    <STYLE type=text/css>BODY {
    	MARGIN-TOP: 0px; BACKGROUND: #000066
    }
    .container {
    	BORDER-RIGHT: #0046d5 2px inset; BORDER-TOP: #0046d5 2px inset; MARGIN: 0px; BORDER-LEFT: #0046d5 2px inset; WIDTH: 18em; BORDER-BOTTOM: #0046d5 2px inset
    }
    .container {
    	FONT-SIZE: 16px; FONT-FAMILY: comic sans ms
    }
    .container2 {
    	BORDER-RIGHT: #0046d5 2px inset; BORDER-TOP: #0046d5 2px inset; MARGIN: 0px; BORDER-LEFT: #0046d5 2px inset; WIDTH: 32em; BORDER-BOTTOM: #0046d5 2px inset
    }
    .container2 {
    	FONT-SIZE: 16px; FONT-FAMILY: comic sans ms
    }
    LABEL {
    	FONT-SIZE: 14px; FONT-FAMILY: comic sans ms
    }
    FORM {
    	FONT-SIZE: 0.8em; FONT-FAMILY: comic sans ms
    }
    .div1 {
    	BORDER-RIGHT: #0046d5 6px inset; BORDER-TOP: #0046d5 6px inset; BACKGROUND: #0046d5; BORDER-LEFT: #0046d5 6px inset; WIDTH: 16em; BORDER-BOTTOM: #0046d5 6px inset; TEXT-ALIGN: center
    }
    .div2 {
    	BORDER-RIGHT: #0046d5 6px inset; BORDER-TOP: #0046d5 6px inset; BACKGROUND: #0046d5; BORDER-LEFT: #0046d5 6px inset; WIDTH: 16em; BORDER-BOTTOM: #0046d5 6px inset; TEXT-ALIGN: center
    }
    .div1 {
    	BORDER-BOTTOM-WIDTH: 0px; MARGIN: 8px 8px 0px 9px
    }
    .div2 {
    	BORDER-TOP-WIDTH: 0px; MARGIN: 0px 8px 8px 9px
    }
    .div3 {
    	BORDER-RIGHT: #0046d5 6px inset; BORDER-TOP: #0046d5 6px inset; BACKGROUND: #0046d5; BORDER-LEFT: #0046d5 6px inset; WIDTH: 30em; HEIGHT: 1em; BORDER-BOTTOM: #0046d5 6px inset; TEXT-ALIGN: left
    }
    .div4 {
    	BORDER-RIGHT: #0046d5 6px inset; BORDER-TOP: #0046d5 6px inset; BACKGROUND: #0046d5; BORDER-LEFT: #0046d5 6px inset; WIDTH: 30em; HEIGHT: 1em; BORDER-BOTTOM: #0046d5 6px inset; TEXT-ALIGN: left
    }
    .div3 {
    	BORDER-BOTTOM-WIDTH: 0px; MARGIN: 8px 8px 0px 9px
    }
    .div4 {
    	BORDER-TOP-WIDTH: 0px; MARGIN: 0px 8px 8px 9px
    }
    .timer {
    	BACKGROUND: #000; MARGIN: 3px; WIDTH: 1.8em; COLOR: #0046d5
    }
    .butts {
    	BACKGROUND: #999; MARGIN: 3px; WIDTH: 3.6em; COLOR: #333
    }
    .time_left {
    	WHITE-SPACE: pre
    }
    .MyBut { font-Size:14px;width:57px;background-color:red; }
    .MyBut2 { font-Size:14px;width:58px;background-color:blue; }
    .MyBut3 { font-Size:14px;width:56px;background-color:green; }
    .MyBut4 { font-Size:14px;width:56px;background-color:gold; }
    .MyBut5 { font-Size:14px;width:56px;background-color:purple; }
    .MyBut6 { font-Size:14px;width:55px;background-color:turquoise; }
    .MyBut7 { font-Size:14px;width:77px;background-color:grey; }
    .MyBut8 { font-Size:14px;width:45px;background-color:grey; }
    .MyBut9 { font-Size:14px;width:140px;background-color:grey; }
    .MyBut10 { font-Size:14px;width:32px;background-color:grey; }
    .MyBut11 { font-Size:14px;width:64px;background-color:grey; }
    .MyBut12 { font-Size:14px;width:68px;background-color:grey; }
    .MyBut13 { font-Size:14px;width:55px;background-color:grey; }
    .MyBut14 { font-Size:14px;width:191px;background-color:grey; }
    
    </STYLE>
    
    <SCRIPT type=text/javascript>
    var pos;
    var txtS='';
    var txtF='';
    			//<![CDATA[
    				
    
    
    
    
    
    
    
    				    function timers() {
    				    this.instance_name = 'countdown';
    				    this.last_update = Math.floor(new Date().getTime() / 1000);
    				    this.secs = 180;
    				    this.timers = new Array();
    				    this.parent = document.getElementById('active');
    				    this.create = function() {
    				        var name = document.timer.name.value;
    				        if(!name) window.alert('Specify a name for the countdown first.');
    				        else {
    				            for(var i = 0; i < this.timers.length; i++) {
    				                if(this.timers[i].name == name) {
    									window.alert('Name already in use.');
    									return;
    				                }
    				            }
    				            var no_counters = document.getElementById('no_counters');
    				            if(no_counters) no_counters.parentNode.removeChild(no_counters);
    				        	var tr = document.createElement('tr');
    				        	var td_name = document.createElement('td');
    				        	td_name.appendChild(document.createTextNode(name));
    				        	var td_time_left = document.createElement('td');
    				        	td_time_left.className = 'time_left';
    				        	var label_mins = document.createElement('label');
    				        	var label_secs = document.createElement('label');
    							var input_mins = document.createElement('input');
    							input_mins.type = 'text';
    							input_mins.className = 'timer';
    							input_mins.readonly = 1;
    							var input_secs = input_mins.cloneNode(true);
    							input_mins.value = '03';
    							input_secs.value = '00';
    							label_mins.appendChild(input_mins);
    							label_mins.appendChild(document.createTextNode(' mins. '));
    							label_secs.appendChild(input_secs);
    							label_secs.appendChild(document.createTextNode(' secs. '));
    							td_time_left.appendChild(label_mins);
    							td_time_left.appendChild(label_secs);
    				        	var td_reset = document.createElement('td');
    				        	var input_reset = document.createElement('input');
    				        	input_reset.type = 'button';
    				        	input_reset.className = 'butts';
    							input_reset.value = 'reset';
    				        	input_reset.setAttribute('onclick', this.instance_name + '.reset(' + this.timers.length + ');');
    				        	td_reset.appendChild(input_reset);
    				        	var td_clear = document.createElement('td');
    				        	var input_clear = document.createElement('input');
    				        	input_clear.type = 'button';
    				        	input_clear.className = 'butts';
    				        	input_clear.value = 'clear';
    				        	input_clear.setAttribute('onclick', this.instance_name + '.clear(' + this.timers.length + ');');
    				        	td_clear.appendChild(input_clear);
    				        	tr.appendChild(td_name);
    				        	tr.appendChild(td_time_left);
    				        	tr.appendChild(td_reset);
    				        	tr.appendChild(td_clear);
    				        	this.parent.appendChild(tr);
    				        	var timer = { };
    				            timer.name = name;
    				            timer.left = this.secs;
    				            timer.elem = tr;
    				            this.timers.push(timer);
    				            if(typeof(document.all) != 'undefined' && typeof(window.opera) == 'undefined') this.damn_ie();
    				        }
    				    }
    				    this.reset = function(number) {
    				        this.timers[number].left = this.secs;
    				    }
    				    this.clear = function(number) {
    				        this.timers[number].elem.parentNode.removeChild(this.timers[number].elem);
    				        this.timers.splice(number, 1);
    				    }
    				    this.update = function() {
    				        var now = Math.floor(new Date().getTime() / 1000);
    				        var elapsed_secs = now - this.last_update;
    				        this.last_update = now;
    				        for(var i = 0; i < this.timers.length; i++) {
    				            this.timers[i].left -= elapsed_secs;
    				            if(this.timers[i].left < 1) {
    				                this.notify(i);
    				                this.clear(i);
    								i--;
    				            }
    				            else this.show(i);
    				        }
    				        if(!i) this.no_counters();
    						window.setTimeout(this.instance_name + '.update()', 1000);
    				    }
    				    this.show = function(number) {
    				        var secs = this.timers[number].left;
    				        var mins_left = Math.floor(secs / 60);
    				        var secs_left = secs - mins_left * 60;
    				        var td_timers = this.timers[number].elem.childNodes[1];
    				        td_timers.firstChild.firstChild.value = (mins_left < 10) ? '0' + mins_left : mins_left;
    				        td_timers.childNodes[1].firstChild.value = (secs_left < 10) ? '0' + secs_left : secs_left;
    				    }
    				    this.no_counters = function() {
    				        if(document.getElementById('no_counters')) return;
    				        var tr = document.createElement('tr');
    				        tr.id = 'no_counters';
    				        var td = document.createElement('td');
    				        td.colSpan = 4;
    				        td.appendChild(document.createTextNode('No active countdowns'));
    				        tr.appendChild(td);
    				        this.parent.appendChild(tr);
    				        if(typeof(document.all) != 'undefined' && typeof(window.opera) == 'undefined') this.damn_ie();
    				    }
    				    this.notify = function(i) {
    				        alert ('"' + this.timers[i].name + '"s time is up!.');
    				    }
    				    this.damn_ie = function() {
    				        this.parent.parentNode.innerHTML = this.parent.parentNode.innerHTML;
    						this.parent = document.getElementById('active');
    						var trs = this.parent.getElementsByTagName('tr');
    						for(var i = 0; i < this.timers.length; i++) {
    							this.timers[i].elem = trs[i + 1];
    						}
    				    }
    				}
    				window.onload = function() {
    					countdown = new timers();
    					countdown.update();
    				}
    function add(st){
     document.getElementById('TextAreaName').value+=st;
    }
    {
    iView.document.execCommand('undo', false, null);
    }
    function doRedo()
    {
    iView.document.execCommand('redo', false, null);
    }
    function checkCursor(where){
     largeArea=where;
     txtS='';txtF='';
     if (document.selection){
      largeArea.focus();
      sel=document.selection.createRange();
      if(sel.text==""){
       sel.text='µµµ';
       dummy=largeArea.createTextRange();
       dummy.findText('µµµ');
       dummy.select();
       pos=largeArea.value.indexOf('µµµ');
       document.selection.clear();
       largeArea.focus();
      }
     }
     else if (largeArea.selectionStart||largeArea.selectionStart == '0') {//Moz
      pos = largeArea.selectionStart;
     }
     txtS=largeArea.value.substring(0,pos);
     txtF=largeArea.value.substring(pos,largeArea.value.length);
    }
    
    function cmdA(el) {
     with(el){
      focus(); select();
     }
     if(document.all){
      window.status='Selected and Copied to Clipboard!';
      document.getElementById('CopyBut').value='COPY';
      window.clipboardData.setData('Text',document.getElementById('TextAreaName').value);
      setTimeout('document.getElementById(\'CopyBut\');window.status=""',6000);
     }
     else {
      window.status='Press Ctrl & C to Copy the Text to the Clipboard';
      setTimeout('window.status=""',6000);
     }
    }
    function insert(){
      document.getElementById('TextAreaName').value=txtS+document.getElementById('jumpnumber').value+txtF;
      textS=document.getElementById('TextAreaName').value;
      textF='';
     }
    function clearDefault(){
     document.getElementById('TextAreaName').value='';
     textS=''; textF='';
    
    }
    function countit(){
     document.getElementById('displaycount').value = document.getElementById('TextAreaName').value.length+' ';
    }
    			//]]>
    		</SCRIPT>
    
    <META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
    <BODY>
    <FORM name=timer onsubmit="countdown.create(); return false;" action=#>
    <FIELDSET class=container><LEGEND>Start a new countdown</LEGEND>
    <DIV class=div1><LABEL>Player Name: <INPUT class=timer style="WIDTH: 8em" 
    name=name></LABEL> </DIV>
    <DIV class=div2><INPUT class=butts type=submit value=start> </DIV></FIELDSET> 
    </FORM>
    <FORM action=#>
    <FIELDSET class=container><LEGEND>Active countdowns</LEGEND>
    <TABLE class="div1 div2" id=active>
      <TBODY>
      <TR>
        <TH>Name</TH>
        <TH>Time left</TH>
        <TH>Reset</TH>
        <TH>Clear</TH></TR></TBODY></TABLE></LEGEND></FIELDSET> </FORM>
    
    
    
    
    <form action='''' name="FormName" method="post">
    <FIELDSET class=container2><LEGEND>Advert Creator</LEGEND>
    
    <DIV class=div3></DIV>
    
    <DIV class=div4> <TEXTAREA id="TextAreaName" NAME="TextareaName" COLS="53" ROWS="5" onclick="javascript:checkCursor(this);" onmouseup="javascript:checkCursor(this);" >
    </TEXTAREA>
    <br>
    <input id="jumpnumber" NAME="jumpnumber" size="7">
    
    <input class="MyBut2" type="button" width="120" NAME="copyButton" value="  " onClick="add('€b')">
    <input class="MyBut" type="button" width="120" NAME="copyButton" value=" " onClick="add('€r')">
    <input class="MyBut3" type="button" width="120" NAME="copyButton" value="" onClick="add('€g')">
    <input class="MyBut4" type="button" width="120" NAME="copyButton" value="  " onClick="add('€y')">
    <input class="MyBut5" type="button" width="120" NAME="copyButton" value="" onClick="add('€m')">
    <input class="MyBut6" type="button" width="120" NAME="copyButton" value="" onClick="add('€c')">
    <input type="button" width="120" NAME="copyButton" value=" INSERT " onClick="insert();" >
        
    <input type="button" width="120" NAME="copyButton" value=" !! " onClick="add('!!')">
    <input type="button" width="120" NAME="copyButton" value=" !!!" onClick="add('!!!')">
    <input type="button" width="120" NAME="copyButton" value="!!!!" onClick="add('!!!!')">
    <input type="button" width="120" NAME="copyButton" value=" .:: " onClick="add('.::')">
    <input type="button" width="120" NAME="copyButton" value=" ::. " onClick="add('::.')">
    <input type="button" width="120" NAME="copyButton" value=">>> " onClick="add('>>>')">
    <input type="button" width="120" NAME="copyButton" value=" <<<" onClick="add('<<<')">
    <input type="button" width="120" NAME="copyButton" value=" [[ " onClick="add('[[')">
    <input type="button" width="120" NAME="copyButton" value=" ]] " onClick="add(']]')">
    <input type="button" width="120" NAME="copyButton" value=" (( " onClick="add('((')">
    <input type="button" width="120" NAME="copyButton" value=" )) " onClick="add('))')">
    <input type="button" width="120" NAME="copyButton" value=" // " onClick="add('//')">
    <input type="button" width="120" NAME="copyButton" value=" \\ " onClick="add('\\')">
    <input type="button" width="120" NAME="copyButton" value=" { " onClick="add('{')">
    <input type="button" width="120" NAME="copyButton" value=" } " onClick="add('}')">
    <input type="button" width="120" NAME="copyButton" value="{{" onClick="add('{{')">
    <input type="button" width="120" NAME="copyButton" value="}}" onClick="add('}}')">
    <input type="button" width="120" NAME="copyButton" value="-=::" onClick="add('-=::')">
    <input type="button" width="120" NAME="copyButton" value="::=-" onClick="add('::=-')">
    <input type="button" width="120" NAME="copyButton" value="+//=" onClick="add('+//=')">
    <input type="button" width="120" NAME="copyButton" value="=\\+" onClick="add('=\\+')">
    <input type="button" width="120" NAME="copyButton" value="--==<<" onClick="add('--==<<')">
    <input type="button" width="120" NAME="copyButton" value=">>==--" onClick="add('>>==--')">
    <input type="button" width="120" NAME="copyButton" value="<--+-->" onClick="add('<--+-->')">
    <input type="button" width="120" NAME="copyButton" value="{}" onClick="add('{}')">
    <input type="button" width="120" NAME="copyButton" value=" .::. " onClick="add('.::.')">
    <input type="button" width="120" NAME="copyButton" value="  ^^ " onClick="add('^^')">
    <input type="button" width="120" NAME="copyButton" value="<<>>" onClick="add('<<>>')">
    <input class="MyBut10" type="button" width="120" NAME="copyButton" value=" <> " onClick="add('<>')">
    <input type="button" width="120" NAME="copyButton" value="--=--=--" onClick="add('--=--=--')">
    <input type="button" width="120" NAME="copyButton" value="--=--" onClick="add('--=--')">
    <input type="button" width="120" NAME="copyButton" value="<~~~>" onClick="add('<~~~>')">
    <input type="button" width="120" NAME="copyButton" value="Join@Jpool.co.uk" onClick="add('Join@Jpool.co.uk')">
    <input type="button" width="120" NAME="copyButton" value="www.Jpool.co.uk" onClick="add('www.Jpool.co.uk')">
    <input type="button" width="120" NAME="copyButton" value="  4 man  " onClick="add('4 man')">
    <input class="MyBut11" type="button" width="120" NAME="copyButton" value=" 8 man " onClick="add('8 man')">
    <input type="button" width="120" NAME="copyButton" value=" 16 man " onClick="add('16 man')">
    <input type="button" width="120" NAME="copyButton" value=" 32 man " onClick="add('32 man')">
    <input type="button" width="120" NAME="copyButton" value="64 man" onClick="add('64 man')">
    <input type="button" width="120" NAME="copyButton" value="  SE  " onClick="add(' SE')">
    <input type="button" width="120" NAME="copyButton" value=" DE " onClick="add(' DE')">
    <input class="MyBut12" type="button" width="120" NAME="copyButton" value="  1 vs 1  " onClick="add(' 1 vs 1')">
    <input type="button" width="120" NAME="copyButton" value="2 vs 2" onClick="add(' 2 vs 2')">
    <input type="button" width="120" NAME="copyButton" value="3 vs 3" onClick="add(' 3 vs 3')">
    <input type="button" width="120" NAME="copyButton" value="4 vs 4" onClick="add(' 4 vs 4')">
    <input type="button" width="120" NAME="copyButton" value="5 vs 5" onClick="add(' 5 vs 5')">
    <input type="button" width="120" NAME="copyButton" value="6 v 6" onClick="add(' 6 vs 6')">
    <input type="button" width="120" NAME="copyButton" value="3 Rd" onClick="add(' 3 Round')">
    <input type="button" width="120" NAME="copyButton" value="4 Rd" onClick="add(' 4 Round')">
    <input type="button" width="120" NAME="copyButton" value="5 Rd" onClick="add(' 5 Round')">
    <input type="button" width="120" NAME="copyButton" value="6 Rd" onClick="add(' 6 Round')">
    <input type="button" width="120" NAME="copyButton" value="7 Rd" onClick="add(' 7 Round')">
    <input type="button" width="120" NAME="copyButton" value="8 Rd" onClick="add(' 8 Round')">
    <input class="MyBut8" type="button" width="120" NAME="copyButton" value="Swiss" onClick="add(' Swiss')">
    <input class="MyBut7" type="button" width="120" NAME="copyButton" value="True Swiss" onClick="add(' True Swiss')">
    <input class="MyBut9" type="button" value="Calculate Characters" 
          onClick="countit(this)"> 
    <input type="text" VALUE="Max 200" name="displaycount" size="5">
    <input type="button" width="120" NAME="copyButton" value=" Clear " onClick="clearDefault(TextareaName)">
    <input type="button" width="120" NAME="copyButton" value=" Undo " onClick="document.execCommand('undo')">
    <input type="button" width="120" NAME="copyButton" value=" Redo " onClick="document.execCommand('redo')"> 
    <input class=''MyBut13'' type="button" id="CopyBut" value="COPY" onClick="cmdA(TextareaName)">
    
    
    
    
          </p>
          <div align="center"><center><p><font face="comic sans ms" size="-2"> </DIV></FIELDSET>
    
    
    
    </form>
    
    </BODY></HTML>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •