JavaScript - Dynamic Colors
I want to have <div> cells that the background-color css style dynamically change between 4 colors depending on how many times they are clicked. The options are none, yellow, red and green then repeat. So when the page loads, they are all at none, and if you click once it goes to green, twice to yellow, three times to red, then back to none.
I do not know if this is possible, but if anyone can point me to a tutorial, I would be appreciative. I just am having a hard time searching the proper terms. Similar TutorialsHi All, i know how to create a dynamic form or DIv ..but what i do not know is how to create a dynamic form/ or div into a previous dynamic one.. i need basically to see 5 dynamic forms / DIV in cascade where each one trigger the one coming after.. For what i need that : i have my user inserting information on the level 1. let say Copagny info 2- then he will be asked if he wants to add a sub level information ( subform) for that compagny or even many subforms at the same level .. and so on... 3- those sub level ( subforms ) can also call their respective subforms.. Any idea how to design this ? thanks I'm trying to make buttons that change from one color to another when you click them and change back when you click them a third time. I wrote this page but it only works on Firefox(Not IE or Chome, untested on safari or Opera). I'm using javascript to change the button colors. Is there another way to do this that works universal or another tool such as CSS? Code: function changeBtn(btn) { if (! btn.style) { alert("Sorry, your browser doesn't support this operation."); return; } if (btn.style.background.substring(0,3)=="Red") { btn.style.background = "white"; btn.style.color = "black"; return; } else { btn.style.background = "Red"; btn.style.color = "black"; return; } } Alright so for a school assignment I need to create a button with the name of the color it is going to turn the background to. the assignment says nothing about naming the buttons the hex numbers for the color therefo I was curious if someone could show me how to create a button in java script that would generate a random hex number for a color ie: #+()+()+()+()+()+() and the text shown on the button would be the same as the hex number generated. feed back please I got 3 sections on the site, at the bottom of each are 5 bars which are used to change the text color. I'm trying to minimize the code, so I created an array which contains all the colors, but I'm not sure where to put the call to the array. If I put it in the for loop, the selected color will always be green no matter which color you click. The bars should also go up to 40px when clicked and when the next bar is clicked the current bar at 40px should go back to it's originals size(20px) Any ideas? this is the JS Code: var colors = new Array(4); colors[0] = "#ed1c24"; colors[1] = "#736257"; colors[2] = "#620460"; colors[3] = "#e87e01"; colors[4] = "#00a650"; function changeColor(numerSekcji, numerKoloru) { document.getElementById('section' + numerSekcji + 'Color' + numerKoloru).style.paddingTop = 20 + "px"; document.getElementById('section' + numerSekcji + 'Color' + numerKoloru).style.marginTop = 0 + "px"; for (i = numerKoloru; i <= 4; i++) { document.getElementById('section' + numerSekcji + 'Color' + numerKoloru).style.padding = 0 + "px"; document.getElementById('section' + numerSekcji + 'Color' + numerKoloru).style.marginTop = 20 + "px"; document.getElementById('section' + numerSekcji + 'Text').style.color = colors[i]; } } } this is the html for the color boxes Code: <a class="color1" id="section1Color1" href="javascript:changeColor(1, 1)"> </a> <a class="color2" id="section1Color2" href="javascript:changeColor(1, 2)"> </a> <a class="color3" id="section1Color3" href="javascript:changeColor(1, 3)"> </a> <a class="color4" id="section1Color4" href="javascript:changeColor(1, 4)"> </a> <a class="color5" id="section1Color5" href="javascript:changeColor(1, 5)"> </a> edit: edited the js... edit2: all the colors are going through the loop, the 1st one is missed :S changing the html to start with ...changeColor(1, 0) does not help. Clicking on the 1st bar doesn't run the loop. hey there, I have a problem when trying to set a different color for each button on my 4 blocks, matching the proper color. Here is my page http://holidays.area-italia.com I ve copy/paste the default art-button in the template.css file adding a " -red" suffix. I also made a new image with the red colors to match the active/hovered/pressed. Here is the code: Code: /* begin Button-red */ .art-button-wrapper-red a.art-button-red, .art-button-wrapper-red a.art-button-red:link, .art-button-wrapper-red input.art-button-red, .art-button-wrapper-red button.art-button-red { text-decoration: none; font-family: Verdana, Tahoma, Arial, Helvetica, Sans-Serif; font-size: 13px; position:relative; top:0; display: inline-block; vertical-align: middle; white-space: nowrap; text-align: center; color: #FFFFFF !important; width: auto; outline: none; border: none; background: none; line-height: 37px; height: 37px; margin: 0 !important; padding: 0 26px !important; overflow: visible; cursor: pointer; } .art-button-red img, .art-button-wrapper-red img { margin: 0; vertical-align: middle; } .art-button-wrapper-red { vertical-align: middle; display: inline-block; position: relative; height: 37px; overflow: hidden; white-space: nowrap; width: auto; margin: 0; padding: 0; z-index: 0; } .firefox2-red .art-button-wrapper-red { display: block; float: left; } input, select, textarea { vertical-align: middle; font-family: Verdana, Tahoma, Arial, Helvetica, Sans-Serif; font-size: 13px; } .art-block-red select { width:96%; } .art-button-wrapper-red.hover .art-button-red, .art-button-wrapper-red.hover a.art-button-red:link, .art-button-red:hover { color: #FFFFFF !important; text-decoration: none !important; } .art-button-wrapper-red.active .art-button-red, .art-button-wrapper-red.active a.art-button-red:link { color: #FCFCFD !important; } .art-button-wrapper-red .art-button-l-red, .art-button-wrapper-red .art-button-r-red { display: block; position: absolute; height: 121px; margin: 0; padding: 0; background-image: url('images/buttonr.png'); (I made a new image with the red colors) } .art-button-wrapper-red .art-button-l-red { left: 0; right: 14px; } .art-button-wrapper-red .art-button-r-red { width: 417px; right: 0; clip: rect(auto, auto, auto, 403px); } .art-button-wrapper-red.hover .art-button-l-red, .art-button-wrapper-red.hover .art-button-r-red { top: -42px; } .art-button-wrapper-red.active .art-button-l-red, .art-button-wrapper-red.active .art-button-r-red { top: -84px; } .art-button-wrapper-red input { float: none !important; } /* end Button-red */ Then I copy/paste the default code button in the index.php adding the "-red" suffix, into my red block: Code: <center> <span class="art-button-wrapper-red"> <span class="art-button-l-red"> </span> <span class="art-button-r-red"> </span> <a class="readon art-button-red" href="javascript:void(0)">More</a> </span> </center> Doing all the mentioned above doesnt work, it always shows the default button. I know there is a javascript which rules it but i dont know how to edit/add the function. Here is my part of the script.js related to the button: Code: /* begin Button */ function artButtonSetup(className) { jQuery.each(jQuery("a." + className + ", button." + className + ", input." + className), function(i, val) { var b = jQuery(val); if (!b.parent().hasClass('art-button-wrapper')) { if (!b.hasClass('art-button')) b.addClass('art-button'); jQuery("<span class='art-button-wrapper'><span class='art-button-l'> </span><span class='art-button-r'> </span></span>").insertBefore(b).append(b); if (b.hasClass('active')) b.parent().addClass('active'); } b.mouseover(function() { jQuery(this).parent().addClass("hover"); }); b.mouseout(function() { var b = jQuery(this); b.parent().removeClass("hover"); if (!b.hasClass('active')) b.parent().removeClass('active'); }); b.mousedown(function() { var b = jQuery(this); b.parent().removeClass("hover"); if (!b.hasClass('active')) b.parent().addClass('active'); }); b.mouseup(function() { var b = jQuery(this); if (!b.hasClass('active')) b.parent().removeClass('active'); }); }); } jQuery(function() { artButtonSetup("art-button"); }); /* end Button */ Anyone who can help out please? Many thanks. I have made a script where you can add extra fields, and next to the row is a span that automatically displays the outcome from a calculation of three fields in that row. i.e. Q x (B - A) = total. Here is the bit that does the calculation: Code: function advCalc(selected) { var result = Number(document.formmain.elements["quantity"+selected].value) * (Number(document.formmain.elements["provideamount"+selected].value) - Number(document.formmain.elements["supplyamount"+selected].value)) ; result = result.toFixed(2) ; result = addCommas(result) ; document.getElementById("total"+selected).innerHTML = result ; } The bit that adds a new row of fields is: Code: function addPart(divName){ var newdiv = document.createElement('div') ; newdiv.setAttribute('id', 'partrow' + counter) ; newdiv.setAttribute('style', 'clear:both;') ; newdiv.innerHTML = "<div style='float:left;width:40px;text-align:center;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc('" + counter + "')\" id=' quantity " + counter + "' type='text' value='1' size='1'/>\r</div>\r<div style='float:left;width:100px;text-align:left;margin:5px 0px 0px 0px;'>\r<input id='manufacturer" + counter + "'type='text' value='' size='9'/>\r</div>\r<div style='float:left;width:95px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='partnumber" + counter + "'type='text' value='' size='9'/>\r</div>\r<div style='float:left;width:80px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='supplier" + counter + "'type='text' value='' size='4'/>\r</div>\r<div style='float:left;width:100px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='type" + counter + "'type='text' value='' size='6'/>\r</div>\r<div style='float:left;width:85px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='deliverytime" + counter + "'type='text' value='' size='13'/>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 0px 0px 45px;'>\r<select id='supplyCurrency" + counter + "'>\r<option value='pound' selected='selected'>£</option><option value='dol'>$</option><option value='euro'>€</option></select>\r</div>\r<div style='float:left;width:15px;text-align:left;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc(\'" + counter + "\')\" id=' supplyamount " + counter + "'type='text' value='' size='3'/>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 0px 0px 45px;'>\r<select name='provideCurrency" + counter + "'><option value='pound' selected='selected'>£</option><option value='dol'>$</option><option value='euro'>€</option></select>\r</div>\r<div style='float:left;width:15px;text-align:left;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc(\'" + counter + "\') id=' provideamount " + counter + "' type='text' value='' size='3'/>\r</div>\r<div style='float:left;width:20px;text-align:left;margin:5px 0px 0px 45px;'>\r<strong>£</strong>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 5px 0px 0px;'><span id=' total " + counter + "'></span></div> \r" ; document.getElementById(divName).appendChild(newdiv) ; counter++ ; } The problem I am having is that it works fine for the first row which is hardcoded as e.g. id="provideamount0" etc. It isn't working for any other fields added but I can't see what is wrong I dont get why that doesn't work... it has me baffled 0.o Code: <html> <div id="divId">Button clicked 0 times</div> <input type="button" value="click me" onclick="divClick()" /> <script type="text/javascript"> var i = 0; function divClick() { var colorNum1 = Math.floor(Math.random()*255); var colorNum2 = Math.floor(Math.random()*255); var colorNum3 = Math.floor(Math.random()*255); var color = "rbg(" + colorNum1 + "," + colorNum2 + "," + colorNum3 + ")"; i++; var divId = document.getElementById("divId"); divId.style.backgroundColor = color; divId.innerHTML = "Button clicked " + i + " times"; } </script> </html> figured it out finally i had rbg instead of rgb >< How do I format a string in different colors with canvas:fillText(...); I want the following result: str = "This is blue", where "This is" is black color and "blue" is blue color. I have a dynamic website where my client can upload pictures to, i have php dynamically show the images and etc, i also have php assign each photo an id number. Basically what it is each photo dynamically gets id=$i++. So every photo uploaded it goes up one higher. Now i wanted to make it so in javascript the same happens, the id is dynamically i++ but im not very good in javascript so i was hoping i could get some help. Basically i want it to be something like this. (unless u know a better way of doing the same kind of effect) Code: var i=0; $(document) .ready(function(){ setTimeout(function () {$("#i++").fadeOut("slow");}, 100); setTimeout(function () {$("#i++").fadeIn("fast");}, 400); }); I just need help getting the i++ to work. Hello all. I am currently viewing various reports based on a location chosen by a dropdown. When I select GO, the page sends the location to a popup, which then queries based on that location and displays the graph on the popup window. What I want to do is to eliminate the popup and send the location to a <div> on the same page and then have the query run and display the graph on the same page. Is this possible, or do Divs have to be static content? Thanks, Parallon In a webpage I am developing I need to change the presentation depending on user selection. At the moment this code is huge and not very maintainable. The first purpose was to have a working code, now I would like to make it more maintainable. Below is a main part of the problem; Code: function myFunction(type) { if (type.value == "1") { var form1 = document.getElementById("OrderForm1"); form1.style.display = "block"; var form2 = document.getElementById("OrderForm2"); form2.style.display = "none"; var form3 = document.getElementById("OrderForm3"); form3.style.display = "none"; } else if (type.value == "2") { var form1 = document.getElementById("OrderForm1"); form1.style.display = "none"; var form2 = document.getElementById("OrderForm2"); form2.style.display = "block"; var form3 = document.getElementById("OrderForm3"); form3.style.display = "none"; } else if (type.value == "3") { var form1 = document.getElementById("OrderForm1"); form1.style.display = "none"; var form2 = document.getElementById("OrderForm2"); form2.style.display = "none"; var form3 = document.getElementById("OrderForm3"); form3.style.display = "block"; } } <div id="OrderForm" style="display: block;"> <div id="OrderForm1" style="display: none;"> <FORM METHOD="POST"></FORM> </div> <div id="OrderForm2" style="display: none;"> <FORM METHOD="POST"></FORM> </div> <div id="OrderForm3" style="display: none;"> <FORM METHOD="POST"></FORM> </div> </div> Basically the myFunction will be called based on user input. This input will show one section of html code and hide other sections of html code. So if input is "1", then OrderForm1 shall be shown and OrderForm2 and OrderForm3 must be hidden. if input is "2", the OrderForm2 shall be shown and OrderForm1 and OrderForm3 must be hidden etc. By adding more forms to show and hide, this code is growing massively. I would like to add some kind of for loop function to this but I am not sure how to loop through the various section names (OrderForm1, OrderForm2 and OrderForm3) and set the appropriate value. Appreciate any help Hello. I am using javascript to create a dynamic form to allow me to add multiple items to the form before posting... this is the code: Code: if (!$_POST) { ?> <title>Adding elements to a form</title> <form name="form1" enctype="multipart/form-data" action="" method="post"> <div ID="Items"> <b>Dog 1:</b> <input type="text" name="Item1" size="45"> <br> <input type="button" value="Add Item" onClick="AddItem();" ID="add"> <input type="submit" name ="submit" value="Submit Form" > </div> </form> <? } else { echo print_r ($_POST); } ?> <script language="javascript"> var items=1; function AddItem() { div=document.getElementById("Items"); button=document.getElementById("add"); items++; newitem="<b>Dog " + items + ": </b>"; newitem+="<input type=\"text\" name=\"Item" + items ; newitem+="\" size=\"45\"><br>"; newnode=document.createElement("span"); newnode.innerHTML=newitem; div.insertBefore(newnode,button); } </script> It works but each element in the printed post array shows as Item1, Item2 etc with each being a seperate array... How can I make it so that I have a single posted array called Item with that array then having elements Item[1] etc up to the number of elements I add... Any help would be appreciated hi i got some code from another site. i modified it according to my needs. what is it doing it adds dynamic form fields by clicking "add another" link. the problem is when logged in user wants to modify his contact details he clicks on edit then gets to this modification form where all the data in his db is selected and displayed in that form fields. so the problem here is when he clicks on add another link it adds up that many fields sets that appeared currently. means if there appeared four sets of fields then clicking on add another link will add four more fields. what i want is to add only one set of fields which contains of text field and select menu. my code is here Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#btnAdd').click(function() { var num = $('.clonedInput').length; var newNum = new Number(num + 1); var newElem = $('#input' + num).clone().attr('id', 'input' + newNum); newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum); $('#input' + num).after(newElem); }); }); </script> <style> #myForm div { font-size:14px; margin-bottom: 10px; clear: left; } #myForm label { width: 125px; display: block; font-size:14px; font-weight: bold; color: #999; float: left; } #btnAdd { margin-left:130px; } </style> </head> <body> <form id="myForm" method="post" action="process.php"> <div> <label>First Name: </label><input type="text" name="fname" id="fname"><br> </div> <div> <label>Last Name: </label><input type="text" name="lname" id="lname"><br> </div> <?php $connect = mysql_connect("localhost","user","pass"); mysql_select_db("db"); $get_im = mysql_query("SELECT * FROM contactim WHERE userid='$_SESSION[userid]'"); $count = mysql_num_rows($get_im); while($get_contactim = mysql_fetch_assoc($get_im)) { $userim_db = $get_contactim['username']; $im_db = $get_contactim['im']; //echo $userim_db."<br>"; for($i = 1; $i <= $count; $i++) { ?> <div id="input1" class="clonedInput"> <label>IM Screen Names:</label> <input type="text" name="name[]" id="name1" value="<?php if($userim_db == "") { echo ""; } else { echo $userim_db; } ?>" /> <select name="screenname[]" id="screenname1"> <option value="AIM" <?php if($im_db == "AIM") { echo "SELECTED"; } ?>>AIM</option> <option value="gtalk" <?php if($im_db == "gtalk") { echo "SELECTED"; } ?>>Google Talk</option> <option value="skype" <?php if($im_db == "skype") { echo "SELECTED"; } ?>>Skype</option> <option value="windows" <?php if($im_db == "windows") { echo "SELECTED"; } ?>>Windows Live</option> <option value="yahoo" <?php if($im_db == "yahoo") { echo "SELECTED"; } ?>>Yahoo</option> </select><br /> <?php } } ?> </div> <div> <a href="#" id="btnAdd">Add another</a> </div> <input type="submit" name="submit" value="Submit"> </form> </body> </html> Is this possible? Please look at the attached image. I am trying to create a team creation page for a site I am making, however I want the user to be able to see all the names they enter before the information is passed to the .php file to send it to the MySQL table. 1. So, every time the user enters a name and presses the "add name" button the name details are stored in an Javascript array and displayed in the box below. 2. When the user presses the "save team" button the team name is passed by a simple form post and the javascript array is passed to a php array and then processed ready to be passed to the MySQL table. The problem is I don't know to do the first bit (number1). Any ideas or pointers? I am running a vBulletin and am using a script to set a cookie each time someone clicks a banner. When the user then reloads the page it looks for that cookie and hides the banner if the cookie exists. I now want to write the date into the cookie name so that the cookie name changes every day. I want to do this because for some reason the cookie gets re-written sometimes and never expires. Because of vBulletin and Firefox I have to use PHP to check initially if the cookie is even set. Here is my current script, any help would be appreciated. Code: <?PHP if( isset( $_COOKIE['noads139'] ) ) { } else { ?> <script type="text/javascript"> function as_click () { myDate = new Date(); myDate.setTime(myDate.getTime()+(1*24*60*60*1000)); document.cookie = 'noads139=noads139; expires=' + myDate.toGMTString()+"; path=/" } // incredibly funky onload add-event scripting, for all browsers if(typeof window.addEventListener != 'undefined') { //.. gecko, safari, konqueror and standard window.addEventListener('load', adsense_init, false); } else if(typeof document.addEventListener != 'undefined') { //.. opera 7 document.addEventListener('load', adsense_init, false); } else if(typeof window.attachEvent != 'undefined') { //.. win/ie window.attachEvent('onload', adsense_init); } //** remove this condition to degrade older browsers else { //.. mobile safari, mac/ie5 and anything else that gets this far //if there's an existing onload function if(typeof window.onload == 'function') { //store it var existing = onload; //add new onload handler window.onload = function() { //call existing onload function existing(); //call adsense_init onload function adsense_init(); }; } else { //setup onload function window.onload = adsense_init; } } function adsense_init () { if (document.all) { //ie var el = document.getElementsByTagName("iframe"); for(var i = 0; i < el.length; i++) { if(el[i].src.indexOf('googlesyndication.com') > -1) { el[i].onfocus = as_click; } } } else { // firefox window.addEventListener('beforeunload', doPageExit, false); window.addEventListener('mousemove', getMouse, true); } } //for firefox var px; var py; function getMouse(e) { px=e.pageX; py=e.pageY; } function findY(obj) { var y = 0; while (obj) { y += obj.offsetTop; obj = obj.offsetParent; } return(y); } function findX(obj) { var x = 0; while (obj) { x += obj.offsetLeft; obj = obj.offsetParent; } return(x); } function doPageExit(e) { ad = document.getElementsByTagName("iframe"); for (i=0; i<ad.length; i++) { var adLeft = findX(ad[i]); var adTop = findY(ad[i]); var inFrameX = (px > (adLeft - 10) && px < (parseInt(adLeft) + parseInt(ad[i].width) + 15)); var inFrameY = (py > (adTop - 10) && py < (parseInt(adTop) + parseInt(ad[i].height) + 10)); if (inFrameY && inFrameX) { myDate = new Date(); myDate.setTime(myDate.getTime()+(1*24*60*60*1000)); document.cookie = 'noads139=noads139; expires=' + myDate.toGMTString()+"; path=/" } } } //end for firefox </script> <?PHP } ?> <div id="adsense" style="display: none"> <script type="text/javascript"><!-- google_ad_client = "pub-xxxxxxxxxxxxxxx"; /* 728x90, created 4/15/10 */ google_ad_slot = "xxxxxxxxxxxxxx"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <script type="text/javascript"> if (document.cookie.indexOf('noads139') < 0) { document.getElementById('adsense').style.display = ''; } else { } </script> <script type="text/javascript"> if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { document.getElementById('adsense').style.display = 'none'; } else { } </script> hi i need help in creating dynamic form using jquery. i create a form in this form i want when "add another" link is clicked then it adds one more set of fields. form is here Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="lib/jquery-1.4.min(Production).js"></script> <script src="js/script.js" type="text/javascript"></script> <style> #form1 div { font-size:14px; margin-bottom: 10px; clear: left; } #form1 label { width: 125px; display: block; font-size:14px; font-weight: bold; color: #999; float: left; } #link { margin-left:125px; } </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <div> <label>IM Screen Names:</label> <input type="text" name="textfield" id="textfield" /> <select name="select" id="select"> <option value="AIM" selected="selected">AIM</option> <option value="gtalk">Google Talk</option> <option value="skype">Skype</option> <option value="windows live">Windows Live</option> <option value="yahoo">Yahoo</option> </select><br /> <div id="link"><a href="">Add another</a></div> </div> </form> </body> </html> Hi, Is it possible to code a slideshow where the slides can change at a different intervals? Which can be set by me?? The slideshow will hold just text and links but will need to be dynamic in size. i.e. there maybe 5 or 6 lines of text anything more can be viewed by a view more link and then i'll need the box to stretch to fit rest of text. how would i do this?? Thanks Hello, I'm new here and also new to writing JS. I was hoping someone could tell me what is wrong with the code below. I am trying to load a page, and the filename will be different depending on current month and year. If I use the code below in the body for document.write instead of window.location it correctly displays this months page as 102009.htm. Is there a better way to do this? Thanks in advance for any help. Code: <script type="text/javascript"> <!-- var months=new Array(13); months[1]="01" months[2]="02" months[3]="03" months[4]="04" months[5]="05" months[6]="06" months[7]="07" months[8]="08" months[9]="09" months[10]="10" months[11]="11" months[12]="12" var time=new Date(); var lmonth=months[time.getMonth() + 1]; var year=time.getYear(); window.location = (1month + year + ".htm") //--> </script> |