// JavaScript Document function windowOpener(url,title,features) { controlWindow=window.open(url,title,features); } function popWindow(strName, intX, intY, strImgSrc) { posLeft = 0; posTop = 0; if (!window.popup) { // has not yet been defined popup = window.open('http://www.hpiracing.com/showimage.php?imgSrc=' + strImgSrc ,strName, 'width=' + intX + ', height=' + intY + ',noscrollbars, resizable=1') } else { // already open, close it and pop another popup.close(); popup = window.open('http://www.hpiracing.com/showimage.php?imgSrc=' + strImgSrc ,strName, 'width=' + intX + ', height=' + intY + ',noscrollbars, resizable=1') } // focus the window popup.focus(); } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i'+alt+''); if (imageType == "swf"){ newWindow.document.write(''); newWindow.document.write(''); newWindow.document.write(''); newWindow.document.write(''); }else{ newWindow.document.write('\"'+alt+'\"'); } newWindow.document.write(''); newWindow.document.close(); newWindow.focus(); } function searchClickedSimple(form) { if (form.s.value=='') { alert("Please enter a term to search for."); return false; } return true; } function getPage(part) { var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } var file2open = '/piw4.php?part=' + part; var urlvarcheck = document.location; xmlhttp.open("GET", file2open, true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.getElementById('response').innerHTML = xmlhttp.responseText; } } xmlhttp.send(null) } function confirmID() { //alert('Testing ID field'); //alert(document.signup.customID.value); if(document.signup.customID.value != "") { var iChars = "*|,\":<>[]{}`\';()@&$#%/-()! "; var string = document.signup.customID.value; var badUser = 0 for (var i = 0; i < string.length; i++) { if (iChars.indexOf(string.charAt(i)) != -1) { badUser = 1; } } if(badUser == 1) { alert("Special characters and spaces are not allowed in the username!"); return false; } else { if(confirm("Are you sure you want to change your Pit Stop profile address? This cannot be undone!")) { if(confirm("This is really your last chance to change your mind! Click ok if you're SURE this is the name you want.")) { return true; } else { return false; } } else { return false; } } } } function doFlashGallery(partNo) { document.write('\n'); document.write('\n'); document.write('\n'); document.write('\n'); document.write('\n'); } function positionit() { var theobject = document.all? document.all.surveyfloatlink : document.getElementById("surveyfloatlink"); if(navigator.appName == "Microsoft Internet Explorer") { var iebody = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body } else { var iebody = document.body; } if (document.all||document.getElementById) theobject.style.visibility="hidden" var height = document.all ? iebody.clientHeight : window.innerHeight; var width = document.all ? iebody.clientWidth : window.innerWidth; var dsocleft = document.all ? iebody.scrollLeft : pageXOffset var dsoctop = document.all ? iebody.scrollTop : pageYOffset oldtop = parseFloat(theobject.style.top); if (oldtop) {} else { oldtop = 0; } newtop = (height + dsoctop) - 70; if (document.all||document.getElementById) { theobject.style.left = (620) + "px"; theobject.style.top = newtop + "px"; //alert(theobject.style.top); //theobject.style.top = Math.round(newtop - (newtop - oldtop) * 0.8); theobject.style.visibility = "visible" //document.getElementById('status').innerHTML = dsoctop; } } function positionit2(offset) { var theobject = document.all? document.all.surveyfloatlink : document.getElementById("surveyfloatlink"); if(navigator.appName == "Microsoft Internet Explorer") { var iebody = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body } else { var iebody = document.body; } if (document.all||document.getElementById) theobject.style.visibility="hidden" var height = document.all ? iebody.clientHeight : window.innerHeight; var width = document.all ? iebody.clientWidth : window.innerWidth; var dsocleft = document.all ? iebody.scrollLeft : pageXOffset var dsoctop = document.all ? iebody.scrollTop : pageYOffset oldtop = parseFloat(theobject.style.top); if (oldtop) {} else { oldtop = 0; } newtop = (height + dsoctop) - 70; if (document.all||document.getElementById) { theobject.style.left = (620 + offset) + "px"; theobject.style.top = newtop + "px"; //alert(theobject.style.top); //theobject.style.top = Math.round(newtop - (newtop - oldtop) * 0.8); theobject.style.visibility = "visible" //document.getElementById('status').innerHTML = dsoctop; } } function swapvideo(which,width,height,location) { var vidname = which.replace('.flv',''); var vidtext = ''; document.getElementById(location).innerHTML = vidtext; } function strtotime(str, now) { // Convert string representation of date and time to a timestamp // // version: 902.2516 // discuss at: http://phpjs.org/functions/strtotime // + original by: Caio Ariede (http://caioariede.com) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: David // + improved by: Caio Ariede (http://caioariede.com) // % note 1: Examples all have a fixed timestamp to prevent tests to fail because of variable time(zones) // * example 1: strtotime('+1 day', 1129633200); // * returns 1: 1129719600 // * example 2: strtotime('+1 week 2 days 4 hours 2 seconds', 1129633200); // * returns 2: 1130425202 // * example 3: strtotime('last month', 1129633200); // * returns 3: 1127041200 // * example 4: strtotime('2009-05-04 08:30:00'); // * returns 4: 1241418600 var i, match, s, strTmp = '', parse = ''; strTmp = str; strTmp = strTmp.replace(/\s{2,}|^\s|\s$/g, ' '); // unecessary spaces strTmp = strTmp.replace(/[\t\r\n]/g, ''); // unecessary chars if (strTmp == 'now') { return (new Date()).getTime(); } else if (!isNaN(parse = Date.parse(strTmp))) { return parse/1000; } else if (now) { now = new Date(now); } else { now = new Date(); } strTmp = strTmp.toLowerCase(); var process = function (m) { var ago = (m[2] && m[2] == 'ago'); var num = (num = m[0] == 'last' ? -1 : 1) * (ago ? -1 : 1); switch (m[0]) { case 'last': case 'next': switch (m[1].substring(0, 3)) { case 'yea': now.setFullYear(now.getFullYear() + num); break; case 'mon': now.setMonth(now.getMonth() + num); break; case 'wee': now.setDate(now.getDate() + (num * 7)); break; case 'day': now.setDate(now.getDate() + num); break; case 'hou': now.setHours(now.getHours() + num); break; case 'min': now.setMinutes(now.getMinutes() + num); break; case 'sec': now.setSeconds(now.getSeconds() + num); break; default: var day; if (typeof (day = __is_day[m[1].substring(0, 3)]) != 'undefined') { var diff = day - now.getDay(); if (diff == 0) { diff = 7 * num; } else if (diff > 0) { if (m[0] == 'last') diff -= 7; } else { if (m[0] == 'next') diff += 7; } now.setDate(now.getDate() + diff); } } break; default: if (/\d+/.test(m[0])) { num *= parseInt(m[0]); switch (m[1].substring(0, 3)) { case 'yea': now.setFullYear(now.getFullYear() + num); break; case 'mon': now.setMonth(now.getMonth() + num); break; case 'wee': now.setDate(now.getDate() + (num * 7)); break; case 'day': now.setDate(now.getDate() + num); break; case 'hou': now.setHours(now.getHours() + num); break; case 'min': now.setMinutes(now.getMinutes() + num); break; case 'sec': now.setSeconds(now.getSeconds() + num); break; } } else { return false; } break; } return true; } var __is = { day: { 'sun': 0, 'mon': 1, 'tue': 2, 'wed': 3, 'thu': 4, 'fri': 5, 'sat': 6 }, mon: { 'jan': 0, 'feb': 1, 'mar': 2, 'apr': 3, 'may': 4, 'jun': 5, 'jul': 6, 'aug': 7, 'sep': 8, 'oct': 9, 'nov': 10, 'dec': 11 } } match = strTmp.match(/^(\d{2,4}-\d{2}-\d{2})(\s\d{1,2}:\d{1,2}(:\d{1,2})?)?$/); if (match != null) { if (!match[2]) { match[2] = '00:00:00'; } else if (!match[3]) { match[2] += ':00'; } s = match[1].split(/-/g); for (i in __is.mon) { if (__is.mon[i] == s[1] - 1) { s[1] = i; } } return strtotime(s[2] + ' ' + s[1] + ' ' + s[0] + ' ' + match[2]); } var regex = '([+-]?\\d+\\s' + '(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?' + '|sun\.?|sunday|mon\.?|monday|tue\.?|tuesday|wed\.?|wednesday' + '|thu\.?|thursday|fri\.?|friday|sat\.?|saturday)' + '|(last|next)\\s' + '(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?' + '|sun\.?|sunday|mon\.?|monday|tue\.?|tuesday|wed\.?|wednesday' + '|thu\.?|thursday|fri\.?|friday|sat\.?|saturday))' + '(\\sago)?'; match = strTmp.match(new RegExp(regex, 'g')); if (match == null) { return false; } for (i in match) { if (!process(match[i].split(' '))) { return false; } } return (now); } var dateFormat = function () { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, timezoneClip = /[^-+\dA-Z]/g, pad = function (val, len) { val = String(val); len = len || 2; while (val.length < len) val = "0" + val; return val; }; // Regexes and supporting functions are cached through closure return function (date, mask, utc) { var dF = dateFormat; // You can't provide utc if you skip other args (use the "UTC:" mask prefix) if (arguments.length == 1 && (typeof date == "string" || date instanceof String) && !/\d/.test(date)) { mask = date; date = undefined; } // Passing date through Date applies Date.parse, if necessary date = date ? new Date(date) : new Date(); if (isNaN(date)) throw new SyntaxError("invalid date"); mask = String(dF.masks[mask] || mask || dF.masks["default"]); // Allow setting the utc argument via the mask if (mask.slice(0, 4) == "UTC:") { mask = mask.slice(4); utc = true; } var _ = utc ? "getUTC" : "get", d = date[_ + "Date"](), D = date[_ + "Day"](), m = date[_ + "Month"](), y = date[_ + "FullYear"](), H = date[_ + "Hours"](), M = date[_ + "Minutes"](), s = date[_ + "Seconds"](), L = date[_ + "Milliseconds"](), o = utc ? 0 : date.getTimezoneOffset(), flags = { d: d, dd: pad(d), ddd: dF.i18n.dayNames[D], dddd: dF.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dF.i18n.monthNames[m], mmmm: dF.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(L > 99 ? Math.round(L / 10) : L), t: H < 12 ? "a" : "p", tt: H < 12 ? "am" : "pm", T: H < 12 ? "A" : "P", TT: H < 12 ? "AM" : "PM", Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] }; return mask.replace(token, function ($0) { return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); }); }; }(); // Some common format strings dateFormat.masks = { "default": "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" }; // Internationalization strings dateFormat.i18n = { dayNames: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] }; // For convenience... Date.prototype.format = function (mask, utc) { return dateFormat(this, mask, utc); }; /* * JavaScript Pretty Date * Copyright (c) 2008 John Resig (jquery.com) * Licensed under the MIT license. */ // Takes an ISO time and returns a string representing how // long ago the date represents. function prettyDate(time) { var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ")), diff = (((new Date()).getTime() - date.getTime()) / 1000), day_diff = Math.floor(diff / 86400); if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 ) return; return day_diff == 0 && ( diff < 60 && "just now" || diff < 120 && "1 minute ago" || diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" || diff < 7200 && "1 hour ago" || diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") || day_diff == 1 && "Yesterday" || day_diff < 7 && day_diff + " days ago" || day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago"; } function getBillInfo() { var ips = document.getElementsByTagName('input'); for(i=0;i