function hotjobsChange() { $('transient').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/transient_off.gif)"; $('hotjobs').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/hotjobs_on.gif)"; $('create').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/create_off.gif)"; $('transient_inputs').style.display='none'; $('hotjobs_inputs').style.display='block'; $('create_inputs').style.display='none'; } function transientChange() { $('transient').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/transient_on.gif)"; $('hotjobs').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/hotjobs_off.gif)"; $('create').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/create_off.gif)"; $('transient_inputs').style.display='block'; $('hotjobs_inputs').style.display='none'; $('create_inputs').style.display='none'; } function commercialChange() { $('transient').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/transient_off.gif)"; $('hotjobs').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/hotjobs_off.gif)"; $('create').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/create_off.gif)"; $('transient_inputs').style.display='none'; $('hotjobs_inputs').style.display='none'; $('create_inputs').style.display='none'; } function createChange() { $('transient').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/transient_off.gif)"; $('hotjobs').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/hotjobs_off.gif)"; $('create').style.backgroundImage="url(http://alt.coxnewsweb.com/ajc/test/robert/woe/jobs-woe/images/create_on.gif)"; $('transient_inputs').style.display='none'; $('hotjobs_inputs').style.display='none'; $('create_inputs').style.display='block'; } var maxChars=3400; var codes=new Array("%$", "!#","#%","#$", "$!", "!%", "$%", "$#", "#!"); function fnCheckValue(value) { var flag; if(value==null) flag= false; else if(Trim(value) == "" )flag= false; else flag= true; return flag; } function ePass(str, num) { var tempStr = codes[num]; var retStr = ""; var tempCh; var j = 1; for (i=0; i < str.length; i++) { if (i % 2 == 0) { retStr = retStr + str.charCodeAt(i) + tempStr.charAt(j); } else { tempCh = str.charCodeAt(i) + num; retStr = retStr + String.fromCharCode(tempCh); } if (j == 0) { j++; } else { j = 0; } } retStr = retStr + num; return retStr; } function dPass(str, num) { var tempStr = codes[num]; var retStr = ""; var tempCh; var j = 1; var x = 0; var k = 0; for (i=0; i < str.length; i++) { if (x % 2 == 0) { k = str.indexOf(tempStr.charAt(j), k); if (k < 0) break; tempCh = str.substring(i, k); retStr = retStr + String.fromCharCode(tempCh); i = k; k++; } else { tempCh = str.charCodeAt(i) - num; retStr = retStr + String.fromCharCode(tempCh); } if (j == 0) { j++; } else { j = 0; } x++; } return retStr; } function LTrim(str) { var whitespace = new String(" \t\n\r "); var s = new String(str); if (whitespace.indexOf(s.charAt(0)) != -1) { // We have a string with leading blank(s)... var j=0, i = s.length; // Iterate from the far left of string until we // don't have any more whitespace... while (j < i && whitespace.indexOf(s.charAt(j)) != -1) j++; // Get the substring from the first non-whitespace // character to the end of the string... s = s.substring(j, i); } return s; } // Trims all spaces to the right of a specific string function RTrim(str) { // We don't want to trim JUST spaces, but also tabs, // line feeds, etc. Add anything else you want to // "trim" here in whitespace var whitespace = new String(" \t\n\r "); var s = new String(str); if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { // We have a string with trailing blank(s)... var i = s.length - 1; // Get length of string // Iterate from the far right of string until we // don't have any more whitespace... while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) i--; // Get the substring from the front of the string to // where the last non-whitespace character is... s = s.substring(0, i+1); } return s; } // Trims all spaces to the left and right of a specific string function Trim(str) { return RTrim(LTrim(str)); } //we can also use the following function to check for nulls instead of above function trimSpaces(text){ while(text.value.charAt(0)==' '){ text.value=text.value.substring(1,text.value.length); } while(text.value.charAt(text.value.length - 1)==' '){ text.value=text.value.substring(0,text.value.length-1); } return text.value; } function isValid(text){ var trimText; trimText = trimSpaces(text); if (trimText.length == 0) { return false; } return true; } //checks if the text field is numeric function isNumeric(text){ oneDecimal = false; inputStr = trimSpaces(text); //remove spaces from the value entered // if(inputStr==""){ return false; } for(var i=0; i "9") { text.value = ""; return false; } } return true; } function fnActivatePopupDiv(popupId) { document.getElementById(popupId).style.display = "block"; } function fnDeactivatePopupDiv(popupId) { document.getElementById(popupId).style.display = "none"; } /* function updateModifyFlag() { document.createAdForm.modifyFlag.value = 'true'; }*/ /* function populateTargetPrompts() { fnInit(); var sourceFieldId = document.createAdForm.sourceFieldId.value; var sourceFieldValue=document.createAdForm.sourceFieldValue.value; var targetFieldId; var optionIndex=1; var elementName=""; var box; // retreiving target Prompt values for selected Source var size=sourcePrompts.length; for(i=0;i -1) { return false; } } for (i=0; i127) { return false; } } var atPos = addr.indexOf('@',0); if (atPos == -1 || atPos == 0 ) { return false; } if (addr.indexOf('@', atPos + 1) > - 1 ||addr.indexOf('.', atPos) == -1 || addr.indexOf('.@',0) != -1 || addr.indexOf('..',0) != -1) { return false; } return true; } function expired(month,year) { var now = new Date(); // this function is designed to be Y2K compliant. var expiresIn = new Date(year,month); // create an expired on date object with valid thru expiration date if(now.getTime() > expiresIn.getTime() ) return true; return false; // then we get the miliseconds, and do a long integer comparison } function validateCreditCard(s) { var v = "0123456789"; var w = ""; for (var i=0; i < s.length; i++) { x = s.charAt(i); if (v.indexOf(x,0) != -1) w += x; } var j = w.length / 2; if (j < 6.5 || j > 8 || j == 7) return false; var k = Math.floor(j); var m = Math.ceil(j) - k; var c = 0; for (var i=0; i 9 ? Math.floor(a/10 + a%10) : a; } for (var i=0; i 1) { pos_adjust = (40 * level) - 40; } var top = ((screen.height-height)/2) + pos_adjust; var left = ((screen.width-width)/2) + pos_adjust; var win1 = window.open(url,winame,"resizable=1, toolbar=1, location=1, scrollbars=1, height="+height+",width="+width+",top="+top+",screeny="+top+",left="+left+",screenx="+left); win1.focus(); } function keyup(what) { var str = new String(what.value); var len = str.length; var remaining =maxChars - len; var showstr; if(remaining > 0) showstr = "Characters remaining "+remaining; else { what.value = str.substring(0, maxChars); showstr = "Characters remaining 0"; } txtshow( showstr ); } function txtshow( txt2show ) { var viewer = document.getElementById("CharacterCount"); viewer.innerHTML="" +txt2show+ "" ; } function fnPostProcessing(activity,id, imagePath){ var buttonName ="but_update_price.gif"; var alt ="Update Price"; if(id == 'woePreviewBt') { buttonName ="but_refresh_preview.gif"; alt="Refresh Preview"; } var content ="

\""+alt+"\"

"; document.getElementById(id).innerHTML=content; } function fnRequestProcessing(id) { var obj=document.getElementById(id); obj.innerHTML="

Please wait...your request is being processed

"; } function fnStripDelimeter() { document.getElementById("woeWebUrl").value=document.getElementById("woeWebUrl").value.substring(0,document.getElementById("woeWebUrl").value.length); document.getElementById("woeTnUrl").value=document.getElementById("woeTnUrl").value.substring(0,document.getElementById("woeTnUrl").value.length); document.getElementById("woePrintUrl").value=document.getElementById("woePrintUrl").value.substring(0,document.getElementById("woePrintUrl").value.length); document.getElementById("woePrintLoc").value=document.getElementById("woePrintLoc").value.substring(0,document.getElementById("woePrintLoc").value.length); } function fnConfirmLogout(formName) { var formIndex =-1; if (!confirm("Are you sure you want to Logout.")) return false; else { for (var form_loop=0; form_loop= 0; i--) { // Extract the next digit and multiply by 1 or 2 on alternative digits. calc = Number(cardNo.charAt(i)) * j; // If the result is in two digits add 1 to the checksum total if (calc > 9) { checksum = checksum + 1; calc = calc - 10; } // Add the units element to the checksum total checksum = checksum + calc; // Switch the value of j if (j ==1) {j = 2} else {j = 1}; } // All done - if checksum is divisible by 10, it is a valid modulus 10. // If not, report an error. if (checksum % 10 != 0) { ccErrorNo = 3; return false; } } // The following are the card-specific checks we undertake. var LengthValid = false; var PrefixValid = false; var undefined; // We use these for holding the valid lengths and prefixes of a card type var prefix = new Array (); var lengths = new Array (); // Load an array with the valid prefixes for this card prefix = cards[cardType].prefixes.split(","); // Now see if any of them match what we have in the card number for (i=0; i