function signup() { var myConn = new XHConn(); if (!myConn) { oldbrowseralert (); return; } var fnWhenDone = function (oXML) { var result = oXML.responseText; var mark = result.split("|"); var sel = mark[0]; var url = mark[1]; //document.write(sel); //alert("url: " + url); if ( sel == 1) { // valid user //alert("valid user"); window.location=url; } if ( sel == 2 ) { // invalid user - show returned text in js box //alert(url); displayError(url); //document.getElementById("error").value="All fields are mandatory"; } if ( sel == 3) { // BPL opt in // set cookie? displayMessage(url); } if ( sel == 4 ) { // invalid user - show returned text in js box displayError(url, '450', '200'); } myConn = null; }; myConn.connect("/bplsite/ajax/reg-post.html", "GET", "LOGIN=" + document.getElementById('LOGIN').value + "&PASSWDA=" + document.getElementById('PASSWDA').value + "&PASSWDB=" + document.getElementById('PASSWDB').value + "&EMAIL=" + document.getElementById('EMAIL').value + "×tamp=" + new Date().getTime(), fnWhenDone); } /*********************************************** * Dynamic Countdown script- © Dynamic Drive (http://www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ function loadContent(elementSelector, sourceURL) { $(""+elementSelector+"").load(""+sourceURL+""); } function cdtime(container, targetdate){ if (!document.getElementById || !document.getElementById(container)) return this.container=document.getElementById(container) this.currentTime=new Date() this.targetdate=new Date(targetdate) this.timesup=false this.updateTime() } cdtime.prototype.updateTime=function(){ var thisobj=this this.currentTime.setSeconds(this.currentTime.getSeconds()+1) setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second } cdtime.prototype.displaycountdown=function(baseunit, functionref) { this.baseunit=baseunit this.formatresults=functionref this.showresults() } cdtime.prototype.showresults=function(){ var thisobj=this var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds if (timediff<0){ //if time is up this.timesup=true this.container.innerHTML=this.formatresults() return } var oneMinute=60 //minute unit in seconds var oneHour=60*60 //hour unit in seconds var oneDay=60*60*24 //day unit in seconds var dayfield=Math.floor(timediff/oneDay) var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour) var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute) var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute)) if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level hourfield=dayfield*24+hourfield dayfield="n/a" } else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level minutefield=dayfield*24*60+hourfield*60+minutefield dayfield=hourfield="n/a" } else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level var secondfield=timediff dayfield=hourfield=minutefield="n/a" } this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield) setTimeout(function(){thisobj.showresults()}, 1000) //update results every second } /////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW////////////////////////////// //Create your own custom format function to pass into cdtime.displaycountdown() //Use arguments[0] to access "Days" left //Use arguments[1] to access "Hours" left //Use arguments[2] to access "Minutes" left //Use arguments[3] to access "Seconds" left //The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown() //For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a" //For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc function formatresults(){ if (this.timesup==false){ // if target date/time not yet met //var displaystring=""+arguments[0]+" days "+arguments[1]+" hours "+arguments[2]+" minutes "+arguments[3]+" seconds"; displaystring=""+arguments[0]+" days "+arguments[1]+" hours "+arguments[2]+" min remaining"; } else{ // else if target date/time met displaystring="Fight closed"; } return displaystring } // **************** // // **************** // **************** // // **************** function sf(){ document.opform.name1.focus(); } // **************** // handles the submit button // **************** function onSubmit() { document.BPL.SUBMIT.disabled=true; document.BPL.SUBMIT.value='WORKING'; document.BPL.submit(); } // **************** // This has to automatically work with a input form that has // any number of checkboxes on it. // // Need to uncheck the last box checked. // **************** // make these global function anyCheck(value, max_select) { var max = 0; var idx = 0; var total = 0; if ( ! max_select ) { //max_select = 5; // default to 5 max_select = 10; // default to 5 } // alert("max_select: " + max_select); max = document.opform.FORM.length; var form_values = new Array(max); for (idx = 0; idx < max; idx++) { var new_val = document.opform.FORM[idx].value; form_values[new_val] = idx; //alert("form_value: " + form_values[idx]); } for (idx = 0; idx < max; idx++) { if ( document.opform.FORM[idx].value == "opcover" ) { continue; } if (eval("document.opform.FORM[" + idx + "].checked") == true) { total += 1; if ( total > max_select ) { alert("You selected " + total + " reports. The maximum allowed at any one time is " + max_select + "."); //alert("value: " + value + " idx: " + idx); var uncheck_idx = form_values[value]; //alert("value: " + value + " uncheck_idx: " + uncheck_idx); document.opform.FORM[uncheck_idx].checked = false; } } } } /************************************************************************************************************ (C) www.dhtmlgoodies.com, October 2005 This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. Updated: March, 11th, 2006 - Fixed positioning of tooltip when displayed near the right edge of the browser. April, 6th 2006, Using iframe in IE in order to make the tooltip cover select boxes. Terms of use: You are free to use this script as long as the copyright message is kept intact. However, you may not redistribute, sell or repost it without our permission. Thank you! www.dhtmlgoodies.com Alf Magne Kalleland ************************************************************************************************************/ var dhtmlgoodies_tooltip = false; var dhtmlgoodies_tooltipShadow = false; var dhtmlgoodies_shadowSize = 4; var dhtmlgoodies_tooltipMaxWidth = 200; var dhtmlgoodies_tooltipMinWidth = 100; var dhtmlgoodies_iframe = false; var tooltip_is_msie = (navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('opera')==-1 && document.all)?true:false; function showTooltip(e,tooltipTxt) { var bodyWidth = Math.max(document.body.clientWidth,document.documentElement.clientWidth) - 20; if(!dhtmlgoodies_tooltip){ dhtmlgoodies_tooltip = document.createElement('DIV'); dhtmlgoodies_tooltip.id = 'dhtmlgoodies_tooltip'; dhtmlgoodies_tooltipShadow = document.createElement('DIV'); dhtmlgoodies_tooltipShadow.id = 'dhtmlgoodies_tooltipShadow'; document.body.appendChild(dhtmlgoodies_tooltip); document.body.appendChild(dhtmlgoodies_tooltipShadow); if(tooltip_is_msie){ dhtmlgoodies_iframe = document.createElement('IFRAME'); dhtmlgoodies_iframe.frameborder='5'; dhtmlgoodies_iframe.style.backgroundColor='#FFFFFF'; dhtmlgoodies_iframe.src = '#'; dhtmlgoodies_iframe.style.zIndex = 100; dhtmlgoodies_iframe.style.position = 'absolute'; document.body.appendChild(dhtmlgoodies_iframe); } } dhtmlgoodies_tooltip.style.display='block'; dhtmlgoodies_tooltipShadow.style.display='block'; if(tooltip_is_msie)dhtmlgoodies_iframe.style.display='block'; var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop); if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; var leftPos = e.clientX + 10; dhtmlgoodies_tooltip.style.width = null; // Reset style width if it's set dhtmlgoodies_tooltip.innerHTML = tooltipTxt; dhtmlgoodies_tooltip.style.left = leftPos + 'px'; dhtmlgoodies_tooltip.style.top = e.clientY + 10 + st + 'px'; dhtmlgoodies_tooltipShadow.style.left = leftPos + dhtmlgoodies_shadowSize + 'px'; dhtmlgoodies_tooltipShadow.style.top = e.clientY + 10 + st + dhtmlgoodies_shadowSize + 'px'; if(dhtmlgoodies_tooltip.offsetWidth>dhtmlgoodies_tooltipMaxWidth){ /* Exceeding max width of tooltip ? */ dhtmlgoodies_tooltip.style.width = dhtmlgoodies_tooltipMaxWidth + 'px'; } var tooltipWidth = dhtmlgoodies_tooltip.offsetWidth; if(tooltipWidthbodyWidth){ dhtmlgoodies_tooltip.style.left = (dhtmlgoodies_tooltipShadow.style.left.replace('px','') - ((leftPos + tooltipWidth)-bodyWidth)) + 'px'; dhtmlgoodies_tooltipShadow.style.left = (dhtmlgoodies_tooltipShadow.style.left.replace('px','') - ((leftPos + tooltipWidth)-bodyWidth) + dhtmlgoodies_shadowSize) + 'px'; } if(tooltip_is_msie){ dhtmlgoodies_iframe.style.left = dhtmlgoodies_tooltip.style.left; dhtmlgoodies_iframe.style.top = dhtmlgoodies_tooltip.style.top; dhtmlgoodies_iframe.style.width = dhtmlgoodies_tooltip.offsetWidth + 'px'; dhtmlgoodies_iframe.style.height = dhtmlgoodies_tooltip.offsetHeight + 'px'; } } function hideTooltip() { dhtmlgoodies_tooltip.style.display='none'; dhtmlgoodies_tooltipShadow.style.display='none'; if(tooltip_is_msie)dhtmlgoodies_iframe.style.display='none'; } // http://xkr.us/code/javascript/XHConn/ /** XHConn - Simple XMLHTTP Interface - bfults@gmail.com - 2005-04-08 ** ** Code licensed under Creative Commons Attribution-ShareAlike License ** ** http://creativecommons.org/licenses/by-sa/2.0/ **/ function XHConn() { var xmlhttp, bComplete = false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; }}} if (!xmlhttp) return null; this.connect = function(sURL, sMethod, sVars, fnDone) { if (!xmlhttp) { return false; } bComplete = false; sMethod = sMethod.toUpperCase(); try { if (sMethod == "GET") { xmlhttp.open(sMethod, sURL+"?"+sVars, true); sVars = ""; } else { xmlhttp.open(sMethod, sURL, true); xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1"); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState == 4 && !bComplete) { bComplete = true; fnDone(xmlhttp); }}; xmlhttp.send(sVars); } catch(z) { return false; } return true; }; return this; } /** XHConn - Simple XMLHTTP Interface - bfults@gmail.com - 2005-04-08 **/ function Set_Cookie( name, value, expires, path, domain, secure ) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* if the expires variable is set, make the correct expires time, the current script below will set it for x number of days, to make it for hours, delete * 24, for minutes, delete * 60 * 24 */ if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } // this deletes the cookie when called function Delete_Cookie( name, path, domain ) { if ( Get_Cookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } function logon() { var myConn = new XHConn(); if (!myConn) { oldbrowseralert (); return; } var fnWhenDone = function (oXML) { var result = oXML.responseText; var mark = result.split("|"); var sel = mark[0]; var t_url = mark[1]; var tt_url = t_url.split("\n"); var url = tt_url[0]; // have JS split on the newline stringObject.split(separator, howmany); //document.write(sel); //alert("url: [" + url + "]"); //alert("t_url: [" + t_url + "]"); //alert("tt_url: [" + tt_url + "]"); if ( sel == 1) { // valid user window.location=url; } if ( sel == 2 ) { // invalid user displayError("

Error


Invalid login



"); } if ( sel == 3) { // BPL opt in displayMessage(url); } myConn = null; }; myConn.connect("/bplsite/ajax/login-post.html", "GET", "USER_ID=" + document.getElementById('USER_ID').value + "&PASSWD=" + document.getElementById('PASSWD').value + "×tamp=" + new Date().getTime(), fnWhenDone); } function displayMessage(url) { messageObj = new DHTML_modalMessage(); // We only create one object of this class messageObj.setShadowOffset(5); // Large shadow messageObj.setSource(url); messageObj.setCssClassMessageBox(false); messageObj.setSize(640,350); messageObj.setShadowDivVisible(true); // Enable shadow for these boxes messageObj.display(); } function displayError(url) { messageObj = new DHTML_modalMessage(); // We only create one object of this class messageObj.setShadowOffset(10); // Large shadow messageObj.setHtmlContent(url); messageObj.setSource(false); messageObj.setCssClassMessageBox(false); messageObj.setSize(250,150); messageObj.setShadowDivVisible(true); // Enable shadow for these boxes messageObj.display(); } function closeMessage() { messageObj.close(); }