1// 2013-08-02 JWC Added loadjscssfile.js and topNav.min.js to this file 2// Use this as original to make edits to and then minify to 3// replace recipetips-combined-vX.min.js 4function writeAnalyticImg(sDivId, sSrc, sName) { 5 var e = document.getElementById(sDivId); 6 e.innerHTML = '<img name="' + sName + '" src="' + sSrc + '" />'; 7 return false; 8} 9 10function writeAnalyticDiv(sId) { 11 document.write('<div id="' + sId + '" display="none"></div>'); 12 return false; 13} 14var IE = document.all; 15var winPop = null; 16 17function popChildWindow(popname, url, w, h, options) { 18 if (options == '' || options == null || options.length == 0) 19 winPop = window.open(url, popname); 20 else 21 winPop = window.open(url, popname, popWindowOptions(w, h, options)); 22 winPop.focus(); 23 return false; 24} 25 26function popWindowOptions(w, h, options) { 27 var winTop = (IE) ? window.screenTop : window.screenY; 28 var winLeft = (IE) ? window.screenLeft : window.screenX; 29 var width = (w) ? w : 360; 30 var height = (h) ? h : 360; 31 return 'height=' + height + ',width=' + width + ',top=' + parseInt(winTop + 25) + ',left=' + parseInt(winLeft + 75) + options; 32} 33 34function validateRating(formName, action) { 35 if (action == 'submit') { 36 document.forms[formName].submit(); 37 } 38 return false; 39} 40 41function clickStars(formName, rating, fieldName) { 42 document.forms[formName].elements[fieldName].value = rating; 43 return true; 44} 45 46function restoreStars(formName, fieldName) { 47 var rating = document.forms[formName].elements[fieldName].value; 48 hoverStars(rating); 49} 50 51function hoverStars(rating) { 52 for (i = 1; i <= 5; ++i) { 53 if (rating < i) { 54 document.images['star' + i].src = 'https://files.recipetips.com/images/common/star_empty.jpg'; 55 } else { 56 document.images['star' + i].src = 'https://files.recipetips.com/images/common/star.jpg'; 57 } 58 } 59} 60 61function replaceCalculator(calcInd) { 62 calculatorFrame.location.href = calcInd; 63} 64 65function initValue(field) { 66 field.value = ''; 67} 68 69function checkValue(field, defaultValue) { 70 if (field.value == '') { 71 field.value = defaultValue; 72 } 73} 74 75function validateFields(formName) { 76 if (formName == 'SearchRecipesQuick') { 77 if (document.forms[formName].elements['ingredients'].value == 'Included Ingredients') { 78 document.forms[formName].elements['ingredients'].value = ''; 79 } 80 if (document.forms[formName].elements['not_ingredients'].value == 'Excluded Ingredients') { 81 document.forms[formName].elements['not_ingredients'].value = ''; 82 } 83 } else if (formName == 'SearchRecipesCommunity') { 84 if (document.forms[formName].elements['querytext'].value == 'Enter Keyword(s)') { 85 document.forms[formName].elements['querytext'].value = ''; 86 } 87 if (document.forms[formName].elements['ingredients'].value != 'Enter Ingredient(s)') { 88 document.forms[formName].elements['ingredients'].value += ' ' + document.forms[formName].elements['ingredients'].value; 89 } 90 } else if (formName == 'ScaleRecipe') { 91 submit = true; 92 } else { 93 if (document.forms[formName].elements['querytext'].value == 'Enter Keyword(s)') { 94 document.forms[formName].elements['querytext'].value = ''; 95 } 96 if (document.forms[formName].elements['title'].value == 'Enter Title') { 97 document.forms[formName].elements['title'].value = ''; 98 } 99 if (document.forms[formName].elements['ingredients'].value == 'Included Ingredients') { 100 document.forms[formName].elements['ingredients'].value = ''; 101 } 102 } 103 document.forms[formName].submit(); 104} 105 106function validatePostRecipeFields(formName, formAction, guid) { 107 var submit = false; 108 if (formAction == 'parse') { 109 if (document.forms[formName].elements['RecipeTitle'].value == "") { 110 alert("A valid entry for 'Title' is required!"); 111 document.forms[formName].elements['RecipeTitle'].focus(); 112 } else if (document.forms[formName].elements['ParseRecipeIngredients'].value == "") { 113 alert("A valid entry for 'Ingredients' is required!"); 114 document.forms[formName].elements['ParseRecipeIngredients'].focus(); 115 } else if (document.forms[formName].elements['ParseRecipeDirections'].value == "") { 116 alert("A valid entry for 'Directions' is required!"); 117 document.forms[formName].elements['ParseRecipeDirections'].focus(); 118 } else if (document.forms[formName].elements['ReadRules'].value != 'true' || document.forms[formName].elements['ReadRules'].checked == false) { 119 alert("You must agree to our Terms of Use Policy."); 120 } else { 121 submit = true; 122 } 123 } else if ((formAction == 'create') || (formAction == 'publish')) { 124 if (document.forms[formName].elements['RecipeTitle'].value == "") { 125 alert("A valid entry for 'Title' is required!"); 126 document.forms[formName].elements['RecipeTitle'].focus(); 127 } else if (document.forms[formName].elements['RecipeDirections'].value == "") { 128 alert("A valid entry for 'Directions' is required!"); 129 document.forms[formName].elements['RecipeDirections'].focus(); 130 } else if (document.forms[formName].elements['ReadRules'].value != 'true' || document.forms[formName].elements['ReadRules'].checked == false) { 131 alert("You must agree to our Terms of Use Policy."); 132 } else { 133 submit = true; 134 } 135 } 136 if (submit == true) { 137 var submitUrl = '/upload-post.asp?UPL_GUID=' + guid; 138 if (formAction == 'parse') { 139 submitUrl = ''; 140 } else { 141 document.forms[formName].encoding = 'multipart/form-data'; 142 } 143 if (submitUrl != '') { 144 document.forms[formName].action = submitUrl; 145 } 146 document.forms[formName].elements['FormAction'].value = formAction; 147 document.forms[formName].submit(); 148 return true; 149 } else { 150 return false; 151 } 152} 153 154function validatePageTag(formName, action) { 155 if (action == 'submit') { 156 document.forms[formName].submit(); 157 } 158 return false; 159} 160 161function validateMenuPlanner(formName, action) { 162 var submit = false; 163 if (action == 'updateplans') { 164 if ((document.forms[formName].elements['UserMealPlanID'].value == '') && (document.forms[formName].elements['NewUserMealPlanName'].value == '')) { 165 alert("A Meal Plan must be selected."); 166 document.forms[formName].elements['UserMealPlanID'].focus(); 167 } else if ((document.forms[formName].elements['UserMealPlanID'].value == '0') && (document.forms[formName].elements['NewUserMealPlanName'].value == '')) { 168 alert("A Meal Plan must be specified."); 169 document.forms[formName].elements['NewUserMealPlanName'].focus(); 170 } else if (document.forms[formName].elements['DayID'].value == '') { 171 alert("A Day must be selected."); 172 document.forms[formName].elements['DayID'].focus(); 173 } else if (document.forms[formName].elements['MealID'].value == '') { 174 alert("A Meal must be selected."); 175 document.forms[formName].elements['MealID'].focus(); 176 } else { 177 submit = true; 178 } 179 } else if (action == 'updatemenus') { 180 if ((document.forms[formName].elements['UserMenuID'].value == '') && (document.forms[formName].elements['NewUserMenuName'].value == '')) { 181 alert("A Menu must be selected."); 182 document.forms[formName].elements['UserMenuID'].focus(); 183 } else if ((document.forms[formName].elements['UserMenuID'].value == '0') && (document.forms[formName].elements['NewUserMenuName'].value == '')) { 184 alert("A Menu must be specified."); 185 document.forms[formName].elements['NewUserMenuName'].focus(); 186 } else if (document.forms[formName].elements['MenuCourseID'].value == '') { 187 alert("A Course must be selected."); 188 document.forms[formName].elements['MenuCourseID'].focus(); 189 } else { 190 submit = true; 191 } 192 } 193 if (submit == true) { 194 document.forms[formName].elements['FormAction'].value = action; 195 document.forms[formName].submit(); 196 } 197 return false; 198} 199 200function showCookbookSection(divName, textName) { 201 if (document.getElementById(divName).style.display == 'none') { 202 document.getElementById(divName).style.display = ""; 203 document.getElementById(textName).innerHTML = "Minimize -"; 204 } else { 205 document.getElementById(divName).style.display = 'none'; 206 document.getElementById(textName).innerHTML = "Expand +"; 207 } 208} 209 210function showDiv(divName) { 211 if (document.getElementById(divName).style.display == 'none') { 212 document.getElementById(divName).style.display = ""; 213 } else { 214 document.getElementById(divName).style.display = 'none'; 215 } 216} 217 218function showTabSection(sectionName) { 219 document.getElementById("tabSectionMyRecipes").style.display = "none"; 220 document.getElementById("tabSectionMyKnowledge").style.display = "none"; 221 document.getElementById("tabSectionMyGlossary").style.display = "none"; 222 document.getElementById("tabSectionMyCommunity").style.display = "none"; 223 document.getElementById("tabSectionShare").style.display = "none"; 224 document.getElementById("tabSectionNewsletters").style.display = "none"; 225 document.getElementById("tabSectionMenuPlanner").style.display = "none"; 226 document.getElementById("tabSection" + sectionName).style.display = ""; 227} 228 229function togglePantry(sectionName, imgId) { 230 if (document.getElementById("tabSection" + sectionName).style.display == "none") { 231 document.getElementById("tabSection" + sectionName).style.display = ""; 232 document.images[imgId].src = '/images/tabs/header_on.gif'; 233 } else { 234 document.getElementById("tabSection" + sectionName).style.display = "none"; 235 document.images[imgId].src = '/images/tabs/header_top.gif'; 236 } 237} 238 239function validateEmail(str) { 240 var at = "@"; 241 var dot = "."; 242 var lat = str.indexOf(at); 243 var lstr = str.length; 244 var ldot = str.indexOf(dot); 245 if (str == '') { 246 return true; 247 } 248 if (str.indexOf(at) == -1) { 249 return false; 250 } 251 if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) { 252 return false 253 } 254 if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) { 255 return false; 256 } 257 if (str.indexOf(at, (lat + 1)) != -1) { 258 return false; 259 } 260 if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) { 261 return false; 262 } 263 if (str.indexOf(dot, (lat + 2)) == -1) { 264 return false; 265 } 266 if (str.indexOf(" ") != -1) { 267 return false; 268 } 269 return true; 270} 271 272function ltrim(s) { 273 return s.replace(/^\s*/, ""); 274} 275 276function rtrim(s) { 277 return s.replace(/\s*$/, ""); 278} 279 280function trim(s) { 281 return rtrim(ltrim(s)); 282} 283 284function MM_preloadImages() { 285 var d = document; 286 if (d.images) { 287 if (!d.MM_p) d.MM_p = new Array(); 288 var i, j = d.MM_p.length, 289 a = MM_preloadImages.arguments; 290 for (i = 0; i < a.length; i++) 291 if (a[i].indexOf("#") != 0) { 292 d.MM_p[j] = new Image; 293 d.MM_p[j++].src = a[i]; 294 } 295 } 296} 297 298function MM_swapImgRestore() { 299 var i, x, a = document.MM_sr; 300 for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc; 301} 302 303function MM_findObj(n, d) { 304 var p, i, x; 305 if (!d) d = document; 306 if ((p = n.indexOf("?")) > 0 && parent.frames.length) { 307 d = parent.frames[n.substring(p + 1)].document; 308 n = n.substring(0, p); 309 } 310 if (!(x = d[n]) && d.all) x = d.all[n]; 311 for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
312 for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document); 313 if (!x && d.getElementById) x = d.getElementById(n); 314 return x; 315} 316 317function MM_swapImage() { 318 var i, j = 0, 319 x, a = MM_swapImage.arguments; 320 document.MM_sr = new Array; 321 for (i = 0; i < (a.length - 2); i += 3) 322 if ((x = MM_findObj(a[i])) != null) { 323 document.MM_sr[j++] = x; 324 if (!x.oSrc) x.oSrc = x.src; 325 x.src = a[i + 2]; 326 } 327} 328 329function popEmail(id, zoneid, action, category, siteInd) { 330 //alert(action); 331 //return false; 332 var setFocus = 'true'; 333 var width = 300; 334 var height = 400; 335 var bgcolor = "White"; 336 var ewin = window.open("", "email", 'WIDTH=' + width + ',HEIGHT=' + height); 337 var doc = ewin.document 338 doc.write('<HTML>\n'); 339 doc.write('<HEAD>\n'); 340 // BAT - 20161201 - Captcha 341 doc.write('<SCRIPT src="https://www.google.com/recaptcha/api.js" async defer></SCRIPT>\n'); 342 doc.write('<SCRIPT Language="Javascript">\n'); 343 doc.write('function trim_string() {\n'); 344 doc.write('var ichar, icount;\n'); 345 doc.write('var strValue = this;\n'); 346 doc.write('ichar = strValue.length - 1;\n'); 347 doc.write('icount = -1;\n'); 348 doc.write('while (strValue.charAt(ichar)==\' \' && ichar > icount)\n'); 349 doc.write('--ichar;\n'); 350 doc.write('if (ichar!=(strValue.length-1))\n'); 351 doc.write('strValue = strValue.slice(0,ichar+1);\n'); 352 doc.write('ichar = 0;\n'); 353 doc.write('icount = strValue.length - 1;\n'); 354 doc.write('while (strValue.charAt(ichar)==\' \' && ichar < icount)\n'); 355 doc.write('++ichar;\n'); 356 doc.write('if (ichar!=0)\n'); 357 doc.write('strValue = strValue.slice(ichar,strValue.length);\n'); 358 doc.write('return strValue;\n'); 359 doc.write('}\n'); 360 doc.write('function validateEmailForm(item, itemName) {\n'); 361 doc.write('return (isValidEmail(document.forms[0].elements[\'Email/AddressTo\'], "To Address"))\n'); 362 doc.write('}\n'); 363 doc.write('function isValidEmail(item, itemName) {\n'); 364 doc.write('var strErrorMsg = "Please enter a valid e-mail address in the " + itemName + " field.";\n'); 365 doc.write('item.value=item.value.Trim();\n'); 366 doc.write('if (!(/.+\@.+\..+/.test(item.value))) {\n'); 367 doc.write('item.focus();\n'); 368 doc.write('alert(strErrorMsg);\n'); 369 doc.write('return false;\n'); 370 doc.write('}\n'); 371 doc.write('return true;\n'); 372 doc.write('}\n'); 373 doc.write('</SCRIPT>\n'); 374 doc.write('<META HTTP-EQUIV="Expires" CONTENT="0"><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">\n'); 375 doc.write('<TITLE>' + category + 'E-mail</TITLE>\n'); 376 doc.write('<STYLE>\n.smallText {font-size:11px;color:black}\n.medText {font-size:12px;color:black}\n</STYLE>\n'); 377 doc.write('</HEAD>\n'); 378 doc.write('<BODY style="font-family: Verdana, Helvetica, Arial, \'San Serif\'; font-size: 10pt"'); 379 doc.write(' topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"'); 380 doc.write(' bgcolor="' + bgcolor + '"'); 381 doc.write('>\n'); 382 // BAT - 20161201 - captcha 383 doc.write('<SCRIPT Language="VBScript">\n'); 384 //doc.write('<%\n'); 385 doc.write('If Request.ServerVariables("REQUEST_METHOD") = "POST" Then\n'); 386 doc.write('Dim recaptcha_secret, sendstring, objXML\n'); 387 doc.write('recaptcha_secret = "xx"\n'); 388 //doc.write('recaptcha_secret = "6LfUUwgTAAAAAMQy5tz9u1BMSnCQV1CVh5tuBcEF"\n'); 389 doc.write('sendstring = "https://www.google.com/recaptcha/api/siteverify?secret=" & recaptcha_secret & "&response=" & Request.form("g-recaptcha-response")\n'); 390 doc.write('Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")\n'); 391 doc.write('objXML.Open "GET", sendstring, False\n'); 392 doc.write('objXML.Send\n'); 393 //doc.write('Response.write "<h3>Response: " & objXML.responseText & "</h3>"\n'); 394 doc.write('Set objXML = Nothing\n'); 395 doc.write('End If\n'); 396 //doc.write('%>\n'); 397 doc.write('</SCRIPT>\n'); 398 // BAT - 20161201 - end captcha code 399 doc.write('<FORM name="EmailForm" id="EmailForm" method="POST" action="' + action + '" onSubmit="return validateEmailForm();">\n'); 400 doc.write('<CENTER>\n'); 401 doc.write('<TABLE width="100%" cellpadding="10" cellspacing="0" border="0"><TR><TD>'); 402 doc.write('<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">'); 403 doc.write('<TR>'); 404 doc.write('<TD align="left">\n'); 405 doc.write('<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">'); 406 doc.write('<TR>'); 407 doc.write('<TD align="left">\n'); 408 doc.write('<FONT class="smallText">\nEnter to and from information below along with any additional comments you would like to include with your e-mail, then click the "Send" button</FONT><HR>\n'); 409 doc.write('</TD>'); 410 doc.write('</TR>'); 411 doc.write('</TABLE>\n'); 412 doc.write('<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">'); 413 doc.write('<TR>'); 414 doc.write('<TD align="left">\n'); 415 doc.write('<FONT class="medText"><b>TO</b></FONT>\n'); 416 doc.write('</TD>'); 417 doc.write('<TD align="left">\n'); 418 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 419 doc.write('</TD>'); 420 doc.write('</TR>'); 421 doc.write('<TR>'); 422 doc.write('<TD align="left">\n'); 423 doc.write('<FONT class="smallText">E-mail:</FONT>\n'); 424 doc.write('</TD>'); 425 doc.write('<TD align="left">\n'); 426 if (category == 'images' && zoneid != '0') { 427 doc.write('<INPUT type="text" size="25" name="Email/AddressTo" id="Email/AddressTo" VALUE="' + zoneid + '" disabled>\n'); 428 setFocus = 'false'; 429 } else { 430 doc.write('<INPUT type="text" size="25" name="Email/AddressTo" id="Email/AddressTo" VALUE="">\n'); 431 } 432 doc.write('</TD>'); 433 doc.write('</TR>'); 434 doc.write('<TR>'); 435 doc.write('<TD align="left">\n'); 436 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 437 doc.write('</TD>'); 438 doc.write('<TD align="left">\n'); 439 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 440 doc.write('</TD>'); 441 doc.write('</TR>'); 442 doc.write('<TR>'); 443 doc.write('<TD align="left">\n'); 444 doc.write('<FONT class="medText"><b>FROM</b></FONT>\n'); 445 doc.write('</TD>'); 446 doc.write('<TD align="left">\n'); 447 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 448 doc.write('</TD>'); 449 doc.write('</TR>'); 450 doc.write('<TR>'); 451 doc.write('<TD align="left">\n'); 452 doc.write('<FONT class="smallText">Name:</FONT>\n'); 453 doc.write('</TD>'); 454 doc.write('<TD align="left">\n'); 455 doc.write('<INPUT type="text" size="25" name="Email/NameFrom" id="Email/NameFrom"
455VALUE="">\n'); 456 doc.write('</TD>'); 457 doc.write('</TR>'); 458 doc.write('<TR>'); 459 doc.write('<TD align="left">\n'); 460 doc.write('<FONT class="smallText">E-mail:</FONT>\n'); 461 doc.write('</TD>'); 462 doc.write('<TD align="left">\n'); 463 doc.write('<INPUT type="text" size="25" name="Email/AddressFrom" id="Email/AddressFrom" VALUE="">\n'); 464 doc.write('</TD>'); 465 doc.write('</TR>'); 466 doc.write('<TR>'); 467 doc.write('<TD align="left" valign="top">\n'); 468 doc.write('<FONT class="smallText">Comments:</FONT>\n'); 469 doc.write('</TD>'); 470 doc.write('<TD align="left" valign="top">\n'); 471 doc.write('<TEXTAREA cols="20" rows="5" name="Email/Comments" id="Email/Comments"></TEXTAREA>\n'); 472 doc.write('<INPUT type="hidden" name="Email/Id" id="Email/Id" VALUE="' + id + '">'); 473 doc.write('<INPUT type="hidden" name="Email/ZoneId" id="Email/ZoneId" VALUE="' + zoneid + '">'); 474 doc.write('<INPUT type="hidden" name="Email/ProcessEmail" id="Email/ProcessEmail" VALUE="1">'); 475 doc.write('<INPUT type="hidden" name="Email/Category" id="Email/Category" VALUE="' + category + '">'); 476 doc.write('<INPUT type="hidden" name="Email/Template" id="Email/Template" VALUE="' + action + '">'); 477 doc.write('</TD>'); 478 doc.write('</TR>'); 479 doc.write('<TR>'); 480 doc.write('<TD align="left" valign="top">\n'); 481 doc.write('<FONT class="smallText"> </FONT>\n'); 482 doc.write('</TD>'); 483 doc.write('<TD align="left" valign="top">\n'); 484 doc.write('<INPUT type="submit" name="Email/Send" id="Email/Send" VALUE=" Send ">\n'); 485 doc.write('</TD>'); 486 doc.write('</TR>'); 487 doc.write('</TABLE>\n'); 488 doc.write('</TD>'); 489 doc.write('</TR>'); 490 doc.write('</TABLE>\n'); 491 doc.write('</TD></TR></TABLE>'); 492 doc.write('<SCRIPT Language="Javascript">\n'); 493 doc.write('String.prototype.Trim = trim_string;\n'); 494 if (setFocus == 'true') { 495 doc.write('document.forms[0].elements[\'Email/AddressTo\'].focus();\n'); 496 } else { 497 doc.write('document.forms[0].elements[\'Email/NameFrom\'].focus();\n'); 498 } 499 doc.write('document.forms[0].elements[\'Email/AddressFrom\'].value = \'\';\n'); 500 if (category != 'images') { 501 doc.write('document.forms[0].elements[\'Email/NameFrom\'].value = \'' + siteInd + ' ' + category + '\';\n'); 502 } 503 doc.write('</SCRIPT>\n'); 504 doc.write('</BODY></HTML>\n'); 505 doc.close(); 506 doc = null; 507} 508 509function popEmail2(id, zoneid, action, category, emailNameFrom, headerHTML, w, h) { 510 return false; 511 var setFocus = 'true'; 512 var width = w ? w : 300; 513 var height = h ? h : 400; 514 var bgcolor = "White"; 515 var ewin = window.open("", "email", 'WIDTH=' + width + ',HEIGHT=' + height); 516 var doc = ewin.document 517 doc.write('<HTML>\n'); 518 doc.write('<HEAD>\n'); 519 doc.write('<SCRIPT Language="Javascript">\n'); 520 doc.write('function trim_string() {\n'); 521 doc.write('var ichar, icount;\n'); 522 doc.write('var strValue = this;\n'); 523 doc.write('ichar = strValue.length - 1;\n'); 524 doc.write('icount = -1;\n'); 525 doc.write('while (strValue.charAt(ichar)==\' \' && ichar > icount)\n'); 526 doc.write('--ichar;\n'); 527 doc.write('if (ichar!=(strValue.length-1))\n'); 528 doc.write('strValue = strValue.slice(0,ichar+1);\n'); 529 doc.write('ichar = 0;\n'); 530 doc.write('icount = strValue.length - 1;\n'); 531 doc.write('while (strValue.charAt(ichar)==\' \' && ichar < icount)\n'); 532 doc.write('++ichar;\n'); 533 doc.write('if (ichar!=0)\n'); 534 doc.write('strValue = strValue.slice(ichar,strValue.length);\n'); 535 doc.write('return strValue;\n'); 536 doc.write('}\n'); 537 doc.write('function validateEmailForm(item, itemName) {\n'); 538 doc.write('return (isValidEmail(document.forms[0].elements[\'Email/AddressTo\'], "To Address"))\n'); 539 doc.write('}\n'); 540 doc.write('function isValidEmail(item, itemName) {\n'); 541 doc.write('var strErrorMsg = "Please enter a valid e-mail address in the " + itemName + " field.";\n'); 542 doc.write('item.value=item.value.Trim();\n'); 543 doc.write('if (!(/.+\@.+\..+/.test(item.value))) {\n'); 544 doc.write('item.focus();\n'); 545 doc.write('alert(strErrorMsg);\n'); 546 doc.write('return false;\n'); 547 doc.write('}\n'); 548 doc.write('return true;\n'); 549 doc.write('}\n'); 550 doc.write('</SCRIPT>\n'); 551 doc.write('<META HTTP-EQUIV="Expires" CONTENT="0"><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">\n'); 552 doc.write('<TITLE>' + category + 'E-mail</TITLE>\n'); 553 doc.write('<STYLE>\n.smallText {font-size:11px;color:black}\n.medText {font-size:12px;color:black}\n</STYLE>\n'); 554 doc.write('</HEAD>\n'); 555 doc.write('<BODY style="font-family: Verdana, Helvetica, Arial, \'San Serif\'; font-size: 10pt"'); 556 doc.write(' topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"'); 557 doc.write(' bgcolor="' + bgcolor + '"'); 558 doc.write('>\n'); 559 if (headerHTML) { 560 doc.write(headerHTML + '<BR/>'); 561 } 562 doc.write('<FORM name="EmailForm" id="EmailForm" method="POST" action="' + action + '" onSubmit="return validateEmailForm();">\n'); 563 doc.write('<CENTER>\n'); 564 doc.write('<TABLE width="100%" cellpadding="10" cellspacing="0" border="0"><TR><TD>'); 565 doc.write('<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">'); 566 doc.write('<TR>'); 567 doc.write('<TD align="left">\n'); 568 doc.write('<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">'); 569 doc.write('<TR>'); 570 doc.write('<TD align="left">\n'); 571 doc.write('<FONT class="smallText">\nEnter to and from information below along with any additional comments you would like to include with your e-mail, then click the "Send" button</FONT><HR>\n'); 572 doc.write('</TD>'); 573 doc.write('</TR>'); 574 doc.write('</TABLE>\n'); 575 doc.write('<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">'); 576 doc.write('<TR>'); 577 doc.write('<TD align="left">\n'); 578 doc.write('<FONT class="medText"><b>TO</b></FONT>\n'); 579 doc.write('</TD>'); 580 doc.write('<TD align="left">\n'); 581 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 582 doc.write('</TD>'); 583 doc.write('</TR>'); 584 doc.write('<TR>'); 585 doc.write('<TD align="left">\n'); 586 doc.write('<FONT class="smallText">E-mail:</FONT>\n'); 587 doc.write('</TD>'); 588 doc.write('<TD align="left">\n'); 589 if (category == 'images' && zoneid != '0') { 590 doc.write('<INPUT type="text" size="25" name="Email/AddressTo" id="Email/AddressTo" VALUE="' + zoneid + '" disabled>\n'); 591 setFocus = 'false'; 592 } else { 593 doc.write('<INPUT type="text" size="25" name="Email/AddressTo" id="Email/AddressTo" VALUE="">\n'); 594 } 595 doc.write('</TD>'); 596 doc.write('</TR>'); 597 doc.write('<TR>'); 598 doc.write('<TD align="left">\n'); 599 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 600 doc.write('</TD>'); 601 doc.write('<TD align="left">\n'); 602 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 603 doc.write('</TD>'); 604 doc.write('</TR>'); 605 doc.write('<TR>'); 606 doc.write('<TD align="left">\n'); 607 doc.write('<FONT class="medText"><b>FROM</b></FONT>\n'); 608 doc.write('</TD>'); 609 doc.write('<TD align="left">\n'); 610 doc.write('<IMG src="images/spacer.gif" width="1" height="1" border="0">\n'); 611 doc.write('</TD>'); 612 doc.write('</TR>'); 613 doc.write('<TR>'); 614 doc.write('<TD align="left">\n'); 615 doc.write('<FONT class="smallText">Name:</FONT>\n'); 616 doc.write('</TD>'); 617 doc.write('<TD align="left">\n'); 618 doc.write('<INPUT type="text" size="25" name="Email/NameFrom" id="Email/NameFrom"
618VALUE="">\n'); 619 doc.write('</TD>'); 620 doc.write('</TR>'); 621 doc.write('<TR>'); 622 doc.write('<TD align="left">\n'); 623 doc.write('<FONT class="smallText">E-mail:</FONT>\n'); 624 doc.write('</TD>'); 625 doc.write('<TD align="left">\n'); 626 doc.write('<INPUT type="text" size="25" name="Email/AddressFrom" id="Email/AddressFrom" VALUE="">\n'); 627 doc.write('</TD>'); 628 doc.write('</TR>'); 629 doc.write('<TR>'); 630 doc.write('<TD align="left" valign="top">\n'); 631 doc.write('<FONT class="smallText">Comments:</FONT>\n'); 632 doc.write('</TD>'); 633 doc.write('<TD align="left" valign="top">\n'); 634 doc.write('<TEXTAREA cols="20" rows="5" name="Email/Comments" id="Email/Comments"></TEXTAREA>\n'); 635 doc.write('<INPUT type="hidden" name="Email/Id" id="Email/Id" VALUE="' + id + '">'); 636 doc.write('<INPUT type="hidden" name="Email/ZoneId" id="Email/ZoneId" VALUE="' + zoneid + '">'); 637 doc.write('<INPUT type="hidden" name="Email/ProcessEmail" id="Email/ProcessEmail" VALUE="1">'); 638 doc.write('<INPUT type="hidden" name="Email/Category" id="Email/Category" VALUE="' + category + '">'); 639 doc.write('<INPUT type="hidden" name="Email/Template" id="Email/Template" VALUE="' + action + '">'); 640 doc.write('</TD>'); 641 doc.write('</TR>'); 642 doc.write('<TR>'); 643 doc.write('<TD align="left" valign="top">\n'); 644 doc.write('<FONT class="smallText"> </FONT>\n'); 645 doc.write('</TD>'); 646 doc.write('<TD align="left" valign="top">\n'); 647 doc.write('<INPUT type="submit" name="Email/Send" id="Email/Send" VALUE=" Send ">\n'); 648 doc.write('</TD>'); 649 doc.write('</TR>'); 650 doc.write('</TABLE>\n'); 651 doc.write('</TD>'); 652 doc.write('</TR>'); 653 doc.write('</TABLE>\n'); 654 doc.write('</TD></TR></TABLE>'); 655 doc.write('<SCRIPT Language="Javascript">\n'); 656 doc.write('String.prototype.Trim = trim_string;\n'); 657 if (setFocus == 'true') { 658 doc.write('document.forms[0].elements[\'Email/AddressTo\'].focus();\n'); 659 } else { 660 doc.write('document.forms[0].elements[\'Email/NameFrom\'].focus();\n'); 661 } 662 doc.write('document.forms[0].elements[\'Email/AddressFrom\'].value = \'\';\n'); 663 doc.write('document.forms[0].elements[\'Email/NameFrom\'].value = \'' + emailNameFrom + '\';\n'); 664 doc.write('</SCRIPT>\n'); 665 doc.write('</BODY></HTML>\n'); 666 doc.close(); 667 doc = null; 668} 669 670function popPrint(id, zoneid, action, category, siteInd) { 671 var width = 600; 672 var height = 400; 673 var bgcolor = "White"; 674 var url = action; 675 if (url.indexOf('?') == -1) 676 url = url + '?' 677 else 678 url = url + '&' 679 var ewin = window.open(url + "ProcessPrint=true&Print/Category=" + category + "&Print/Id=" + id + "&Print/ZoneId=" + zoneid + "&Print/Alt=" + siteInd + "&Print/Template=" + action, "print", 'SCROLLBARS=1,RESIZABLE=1,MENUBAR=1,TOOLBAR=1,WIDTH=' + width + ',HEIGHT=' + height); 680} 681 682function popPrintWithOptions(id, zoneid, action, category, siteInd, strParameters) { 683 var width = 600; 684 var height = 400; 685 var bgcolor = "White"; 686 var url = action; 687 if (url.indexOf('?') == -1) 688 url = url + '?' 689 else 690 url = url + '&' 691 url += "ProcessPrint=true&Print/Category=" + category + "&Print/Id=" + id + "&Print/ZoneId=" + zoneid + "&Print/Template=" + action; 692 if (strParameters != '') 693 url += '&' + strParameters; 694 var ewin = window.open(url, "print", 'SCROLLBARS=1,RESIZABLE=1,MENUBAR=1,TOOLBAR=1,WIDTH=' + width + ',HEIGHT=' + height); 695} 696 697function popPrintWithReview(id, zoneid, action, category, siteInd, fieldName, strParameters) { 698 var width = 800; 699 var height = 500; 700 var bgcolor = "White"; 701 var url = action; 702 var reviewIds = ''; 703 if (url.indexOf('?') == -1) 704 url = url + '?'; 705 else 706 url = url + '&'; 707 url += "ProcessPrint=true&Print/Category=" + category + "&Print/Id=" + id + "&Print/ZoneId=" + zoneid + "&Print/Template=" + action 708 if (strParameters != '') 709 url += '&' + strParameters; 710 var elems = document.getElementsByName(fieldName); 711 for (var i = 0; i < elems.length; i++) { 712 if (elems(i).checked == true) { 713 if (reviewIds != '') 714 reviewIds += ','; 715 reviewIds += elems(i).value; 716 } 717 } 718 if (reviewIds != '') 719 url += '&Print/Reviews=' + reviewIds; 720 var ewin = window.open(url, "print", 'SCROLLBARS=1,RESIZABLE=1,MENUBAR=1,TOOLBAR=1,WIDTH=' + width + ',HEIGHT=' + height); 721} 722 723function popPrintLarge(id, zoneid, action, category, siteInd) { 724 var width = 800; 725 var height = 600; 726 if (category == 'recipeimage') { 727 width = 600; 728 height = 500; 729 } 730 var bgcolor = "White"; 731 var url = action; 732 if (url.indexOf('?') == -1) 733 url = url + '?' 734 else 735 url = url + '&' 736 var ewin = window.open(url + "ProcessPrintLarge=true&Print/Category=" + category + "&Print/Id=" + id + "&Print/ZoneId=" + zoneid + "&Print/Template=" + action, "print", 'SCROLLBARS=1,RESIZABLE=1,MENUBAR=1,TOOLBAR=1,WIDTH=' + width + ',HEIGHT=' + height); 737} 738 739function popPrintShoppingList(action) { 740 var width = 600; 741 var height = 400; 742 var bgcolor = "White"; 743 var url = action; 744 if (url.indexOf('?') == -1) 745 url = url + '?' 746 else 747 url = url + '&' 748 var ewin = window.open(url + "PrintList=true", "print", 'SCROLLBARS=1,RESIZABLE=1,MENUBAR=1,TOOLBAR=1,WIDTH=' + width + ',HEIGHT=' + height); 749} 750 751function MM_preloadImages() { 752 var d = document; 753 if (d.images) { 754 if (!d.MM_p) d.MM_p = new Array(); 755 var i, j = d.MM_p.length, 756 a = MM_preloadImages.arguments; 757 for (i = 0; i < a.length; i++) { 758 if (a[i].indexOf("#") != 0) { 759 d.MM_p[j] = new Image; 760 d.MM_p[j++].src = a[i]; 761 } 762 } 763 } 764} 765 766function MM_swapImgRestore() { 767 var i, x, a = document.MM_sr; 768 for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc; 769} 770 771function MM_findObj(n, d) { 772 var p, i, x; 773 if (!d) 774 d = document; 775 if ((p = n.indexOf("?")) > 0 && parent.frames.length) { 776 d = parent.frames[n.substring(p + 1)].document; 777 n = n.substring(0, p); 778 } 779 if (!(x = d[n]) && d.all) { 780 x = d.all[n]; 781 } 782 for (i = 0; !x && i < d.forms.length; i++) { 783 x = d.forms[i][n];
784 } 785 for (i = 0; !x && d.layers && i < d.layers.length; i++) { 786 x = MM_findObj(n, d.layers[i].document); 787 } 788 if (!x && d.getElementById) { 789 x = d.getElementById(n); 790 } 791 return x; 792} 793 794function MM_swapImage() { 795 var i, j = 0, 796 x, a = MM_swapImage.arguments; 797 document.MM_sr = new Array; 798 for (i = 0; i < (a.length - 2); i += 3) { 799 if ((x = MM_findObj(a[i])) != null) { 800 document.MM_sr[j++] = x; 801 if (!x.oSrc) 802 x.oSrc = x.src; 803 x.src = a[i + 2]; 804 } 805 } 806} 807 808function recordOutboundLink(link, category, action) { 809 //this is the new async code 810 _gaq.push(['_trackEvent', category, action]); 811 //this is old traditional code 812 //_gat._getTrackerByName()._trackEvent(category, action); 813 return true; 814} 815 816function recordEvent(category, action, opt_label, opt_value, opt_noninteraction) { 817 if (typeof opt_label == 'undefined') opt_label = 'not assigned'; 818 if (typeof opt_vlaue == 'undefined') opt_value = 1; 819 if (typeof opt_noninteraction == 'undefined') opt_noninteraction = false; 820 //this is the new async code 821 _gaq.push(['_trackEvent', category, action, opt_label, opt_value, opt_noninteraction]); 822 //this is old traditional code 823 //_gat._getTrackerByName()._trackEvent(category, action, opt_label, opt_value, opt_noninteraction); 824 return true; 825} 826 827function validatePostImageFields(formName, formAction, uplGuid) { 828 //alert('validatePostImageFields...formName=' + formName + ' formAction=' + formAction); //JWC999 829 var submit = false; 830 if (document.forms[formName].elements['ContentTitle'].value == "") { 831 alert("A valid entry for 'Title' is required!"); 832 document.forms[formName].elements['ContentTitle'].focus(); 833 } else if (document.forms[formName].elements['ContentImagePath'].value == "") { 834 alert("Please select a photo to be posted."); 835 } else { 836 submit = true; 837 } 838 839 if (submit == true) { 840 //alert('validatePostImageFields...formName=' + formName + ' formAction=' + formAction); //JWC999 841 document.forms[formName].action = '/upload-post.asp?UPL_GUID=' + uplGuid; 842 document.forms[formName].elements['FormAction'].value = formAction; 843 document.forms[formName].submit(); 844 } 845} 846 847function validateSelectImageFields(formName, formAction, imgSrc, uplGuid) { 848 //alert('validateSelectImageFields...formName=' + formName + ' formAction=' + formAction); //JWC999 849 var submit = false; 850 document.forms[formName].elements['ContentImagePath'].value = imgSrc; 851 submit = true; 852 853 if (submit == true) { 854 //alert('validateSelectImageFields...formName=' + formName + ' formAction=' + formAction); //JWC999 855 document.forms[formName].action = '/upload-post.asp?UPL_GUID=' + uplGuid; 856 document.forms[formName].elements['FormAction'].value = formAction; 857 document.forms[formName].submit(); 858 } 859} 860 861function clearShoppingList2(formName) { 862 if (document.forms[e].updateShoppingList.value != 'true') { 863 document.forms[formName].clearShoppingList.value = 'true'; 864 document.forms[formName].submit(); 865 } 866} 867 868function submitShoppingList(formName) { 869 document.forms[formName].updateShoppingList.value = 'true'; 870 document.forms[formName].submit(); 871 return false; 872} 873 874function validateUnsubscribeFields(formName) { 875 document.forms[formName].elements['SendEmail'].value = 'true'; 876 document.forms[formName].submit(); 877} 878 879function ValidateMediaFields(formName) { 880 if (document.forms[formName].elements['Company'].value == '') { 881 alert("The < Company > field must have a value."); 882 document.forms[formName].elements['Company'].focus(); 883 } else if (document.forms[formName].elements['FirstName'].value == '') { 884 alert("The < First Name > field must have a value."); 885 document.forms[formName].elements['FirstName'].focus(); 886 } else if (document.forms[formName].elements['LastName'].value == '') { 887 alert("The < Last Name > field must have a value."); 888 document.forms[formName].elements['LastName'].focus(); 889 } else if (document.forms[formName].elements['FirstName'].value == document.forms[formName].elements['LastName'].value) { 890 alert("The < First Name > and < Last Name > field must be valid."); 891 document.forms[formName].elements['FirstName'].focus(); 892 } else if (document.forms[formName].elements['PostalCode'].value == '') { 893 alert("The < PostalCode > field must have a value."); 894 document.forms[formName].elements['PostalCode'].focus(); 895 } else if (document.forms[formName].elements['Email'].value == '') { 896 alert("The < Email > field must have a value."); 897 document.forms[formName].elements['Email'].focus(); 898 } else if (document.forms[formName].elements['Message'].value == '') { 899 alert("The < Message > field must have a value."); 900 document.forms[formName].elements['Message'].focus(); 901 } else if (validateEmail(document.forms[formName].elements['Email'].value) == false) { 902 alert("Please double check your email address."); 903 document.forms[formName].elements['Email'].focus(); 904 } else { 905 document.forms[formName].submit(); 906 } 907} 908 909function validateContactUsFields(formName) { 910 if (trim(document.forms[formName].FirstName.value) == "") { 911 alert("The < First Name > field must have a value."); 912 document.forms[formName].FirstName.focus(); 913 } else if (trim(document.forms[formName].LastName.value) == "") { 914 alert("The < Last Name > field must have a value."); 915 document.forms[formName].LastName.focus(); 916 } else if (trim(document.forms[formName].FirstName.value) == trim(document.forms[formName].LastName.value)) { 917 alert("The < First Name > and < Last Name > field must be valid."); 918 document.forms[formName].FirstName.focus(); 919 } 920 //else if(trim(document.forms[formName].Address1.value)=="") 921 //{ 922 // alert("The first < Address > field must have a value."); 923 // document.forms[formName].Address1.focus(); 924 //} 925 //else if(trim(document.forms[formName].City.value)=="") 926 //{ 927 // alert("The < City > field must have a value."); 928 // document.forms[formName].City.focus(); 929 //} 930 //else if(trim(document.forms[formName].State.value)=="") 931 //{ 932 // alert("The < State > field must have a value."); 933 // document.forms[formName].State.focus(); 934 //} 935 else if (trim(document.forms[formName].PostalCode.value) == "") { 936 alert("The < PostalCode > field must have a value."); 937 document.forms[formName].PostalCode.focus(); 938 } else if (trim(document.forms[formName].Email.value) == "") { 939 alert("The < Email > field must have a value."); 940 document.forms[formName].Email.focus(); 941 } else if (trim(document.forms[formName].Message.value) == "") { 942 alert("The < Message > field must have a value."); 943 document.forms[formName].Message.focus(); 944 } else if (validateEmail(document.forms[formName].Email.value) == false) { 945 alert("Please double check your email address."); 946 document.forms[formName].Email.focus(); 947 } else { 948 document.forms[formName].submit(); 949 } 950} 951 952function submitForm(formName) { 953 document.forms[formName].submit(); 954} 955 956function validateNewsletterSignup(formName, category) { 957 //alert("validateNewsletterSignup...formName=" + formName + ' category=' + category); //JWC999 958 if (document.forms[formName].elements['Email'].value == "") { 959 alert("A valid entry for 'Email Address' is required!"); 960 document.forms[formName].elements['Email'].focus(); 961 } else if (document.forms[formName].elements['FirstName'].value == "") { 962 alert("A valid entry for 'First Name' is required!"); 963 document.forms[formName].elements['FirstName'].focus(); 964 } else if (document.forms[formName].elements['LastName'].value == "") { 965 alert("A valid entry for 'Last Name' is required!"); 966 document.forms[formName].elements['LastName'].focus(); 967 }
967 else if (document.forms[formName].elements['Sex'].value == "") { 968 alert("A valid entry for 'Sex' is required!"); 969 } else { 970 //alert("validateNewsletterSignup...form submission"); //JWC999 971 document.forms[formName].action = '/newsletterSignupThanks.asp'; 972 document.forms[formName].submit(); 973 } 974 return false; 975} 976 977function validateNewsletterSignupShort(formName, category) { 978 if (document.forms[formName].elements['Email'].value == "") { 979 alert("A valid entry for 'Email Address' is required!"); 980 document.forms[formName].elements['Email'].focus(); 981 return false; 982 } else { 983 // document.forms[formName].action = '/newsletterSignupThanksShort.asp'; 984 // document.forms[formName].submit(); 985 return true; 986 } 987} 988 989function openSignupConfirmationShort(strEmail) { 990 //2013-04-23 JWC removed Lot18 991 //var temp; temp = { state0: { html: '<div class="rtConfirmBody"><p class="textBody">A confirmation email has been sent from RecipeTips.com to ' + strEmail + '</p></div>', submit: closeConfirmation, buttons: { 'Continue to RecipeTips': 1 }, footer: '<div class="rtFooter"><a href="http://www.lot18.com/invite/1_recipetips" target="_blank" rel="nofollow" onclick="return recordOutboundLink(this, 'Outbound Links', 'http://www.lot18.com/invite/1_recipetips');"><img src="/images/spacer.gif" width="180" height="48" alt="Lot 18" border="0" /></a></div>', focus: 1} } 992 var temp; 993 temp = { 994 state0: { 995 html: '<div class="rtConfirmBody"><p class="textBody">A confirmation email has been sent from RecipeTips.com to ' + strEmail + '</p></div>', 996 submit: closeConfirmation, 997 buttons: { 998 'Continue to RecipeTips': 1 999 }, 1000 footer: '<div class="rtFooter"></div>', 1001 focus: 1 1002 } 1003 } 1004 $.prompt(temp, { 1005 prefix: 'rtconfirmJqi' 1006 }); 1007} 1008 1009function validateCookbookFields(formName, formAction) { 1010 //alert("validateCookbookFields...formName=" + formName + ' formAction=' + formAction); //JWC999 1011 document.forms[formName].elements['FormAction'].value = formAction; 1012 document.forms[formName].submit(); 1013} 1014 1015function validateAccount(formName, formAction) { 1016 //alert('validateAccount...formName=' + formName + ' formAction=' + formAction); //JWC999 1017 var submit = false; 1018 if (formAction == 'categorize') { 1019 submit = true; 1020 } else if (formAction == 'forgotpassword') { 1021 if (document.forms[formName].elements['Email/AddressTo'].value == "") { 1022 alert("A valid entry for 'Email' is required!"); 1023 document.forms[formName].elements['Email/AddressTo'].focus(); 1024 } else { 1025 submit = true; 1026 } 1027 } else if (formAction == 'activate') { 1028 if (document.forms[formName].elements['Email'].value == "") { 1029 alert("A valid entry for 'Email' is required!"); 1030 document.forms[formName].elements['Email'].focus(); 1031 } else { 1032 submit = true; 1033 } 1034 } else if (formAction == 'create') { 1035 if (document.forms[formName].elements['Email'].value == "") { 1036 alert("A valid entry for 'Email Address' is required!"); 1037 document.forms[formName].elements['Email'].focus(); 1038 } else if (document.forms[formName].elements['Password'].value == "") { 1039 alert("A valid entry for 'Password' is required!"); 1040 document.forms[formName].elements['Password'].focus(); 1041 } else if (document.forms[formName].elements['ReadRules'].value != 'true') { 1042 alert("You must be at least 13 years old and agree to our Terms of Use Policy."); 1043 } else { 1044 if (formName == 'PromoForm') { 1045 submit = validatePromoForm(formName, formAction); 1046 } else { 1047 submit = true; 1048 } 1049 } 1050 } else if (formAction == 'update') { 1051 if (document.forms[formName].elements['OldEmail'].value == "") { 1052 alert("A valid entry for 'Current E-mail Address' is required!"); 1053 document.forms[formName].elements['OldEmail'].focus(); 1054 } else if (document.forms[formName].elements['OldPassword'].value == "") { 1055 alert("A valid entry for 'Current Password' is required!"); 1056 document.forms[formName].elements['OldPassword'].focus(); 1057 } else if (document.forms[formName].elements['Email'].value == "") { 1058 alert("A valid entry for 'New E-mail Address' is required!"); 1059 document.forms[formName].elements['Email'].focus(); 1060 } else if (validatePassword(formName) == false) { 1061 alert("A valid entry for 'New Password' is required!"); 1062 document.forms[formName].elements['Password'].focus(); 1063 }
1063 else if (document.forms[formName].elements['ScreenName'].value == "") { 1064 alert("A valid entry for 'New Screen Name' is required!"); 1065 document.forms[formName].elements['ScreenName'].focus(); 1066 } else { 1067 submit = true; 1068 } 1069 } else { 1070 submit = true; 1071 } 1072 1073 if (submit == true) { 1074 document.forms[formName].elements['FormAction'].value = formAction; 1075 document.forms[formName].submit(); 1076 } 1077} 1078 1079function LoadImage(imageName, imageFile) { 1080 if (!document.images) return; 1081 document.images[imageName].src = imageFile; 1082} 1083 1084 1085//-------------------------------------- begin loadjscssfile.js -------------------------------------// 1086 1087//mwt 20130802 ****** the following functions allow us to load a .js or .css file from javascript 1088//mwt 20130802 ****** used for inline placement of .js tags like crosspixel or chango 1089//mwt 20130802 ****** these were in a separate file loadjscssfile.js and consolidated into this file so the other does not need loading 1090// this function will load filename of filetype just before the end of a tag "tagname" 1091// added ability to designate a tagid also for the script tag 1092// if no tagname is passed in it defaults to just before the end of the "head" tag 1093//dynamically load and add this .js file - loadjscssfilebytagname("myscript.js", "js", "head") 1094//dynamically load "javascript.php" as a JavaScript file - loadjscssfilebytagname("javascript.php", "js", "head") 1095//dynamically load and add this .css file - loadjscssfilebytagname("mystyle.css", "css", "head") 1096function loadjscssfilebytagname(filename, filetype, tagname, tagid) { 1097 //alert("Hello! I am an alert box!!"); 1098 //alert("filename=" + filename + " filetype=" + filetype + " tagname=" + tagname); 1099 if (filetype == "js") { //if filename is a external JavaScript file 1100 var fileref = document.createElement('script') 1101 fileref.setAttribute("type", "text/javascript") 1102 fileref.setAttribute("src", filename) 1103 fileref.setAttribute("id", tagid) 1104 } else if (filetype == "css") { //if filename is an external CSS file 1105 var fileref = document.createElement("link") 1106 fileref.setAttribute("rel", "stylesheet") 1107 fileref.setAttribute("type", "text/css") 1108 fileref.setAttribute("href", filename) 1109 } 1110 if (typeof fileref != "undefined") { 1111 if (tagname == "") { 1112 //alert("Test from byTagName empty tag name") 1113 document.getElementsByTagName("head")[0].appendChild(fileref) 1114 } else { 1115 //alert("Test from byTagName NOT empty tag name " + tagname) 1116 document.getElementsByTagName(tagname)[0].appendChild(fileref) 1117 } 1118 } 1119} 1120// this function will load filename of filetype just before the end of a tag with the id of "tagid" 1121// if no tagid is passed in it defaults to just before the end of the "body" tag 1122//dynamically load and add this .js file - loadjscssfilebytagid("myscript.js", "js", "ad_AdLocation_div") 1123//dynamically load "javascript.php" as a JavaScript file - loadjscssfilebytagid("javascript.php", "js", "ad_AdLocation_div") 1124//dynamically load and add this .css file - loadjscssfilebytagid("mystyle.css", "css", "ad_AdLocation_div") 1125function loadjscssfilebytagid(filename, filetype, tagid) { 1126 //alert("Hello! I am an alert box!!"); 1127 //alert("filename=" + filename + " filetype=" + filetype + " tagid=" + tagid); 1128 if (filetype == "js") { //if filename is a external JavaScript file 1129 var fileref = document.createElement('script') 1130 fileref.setAttribute("type", "text/javascript") 1131 fileref.setAttribute("src", filename) 1132 } else if (filetype == "css") { //if filename is an external CSS file 1133 var fileref = document.createElement("link") 1134 fileref.setAttribute("rel", "stylesheet") 1135 fileref.setAttribute("type", "text/css") 1136 fileref.setAttribute("href", filename) 1137 } 1138 if (typeof fileref != "undefined") { 1139 if (tagid == "") { 1140 //alert("Test from byTagId empty tag id") 1141 document.getElementsByTagName("body")[0].appendChild(fileref) 1142 } else { 1143 //alert("Test from byTagId NOT empty tagid " + tagid) 1144 document.getElementById(tagid).appendChild(fileref) 1145 1146 } 1147 } 1148} 1149// this function will load filename of filetype just before the end of the head tag 1150// same as loadjscssfilebytagname but always in the "head" tag without argument 1151//dynamically load and add this .js file - loadjscssfile("myscript.
1151js", "js") 1152//dynamically load "javascript.php" as a JavaScript file - loadjscssfile("javascript.php", "js") 1153//dynamically load and add this .css file - loadjscssfile("mystyle.css", "css") 1154function loadjscssfilehead(filename, filetype) { 1155 if (filetype == "js") { //if filename is a external JavaScript file 1156 var fileref = document.createElement('script') 1157 fileref.setAttribute("type", "text/javascript") 1158 fileref.setAttribute("src", filename) 1159 } else if (filetype == "css") { //if filename is an external CSS file 1160 var fileref = document.createElement("link") 1161 fileref.setAttribute("rel", "stylesheet") 1162 fileref.setAttribute("type", "text/css") 1163 fileref.setAttribute("href", filename) 1164 } 1165 if (typeof fileref != "undefined") 1166 //alert("Test from head empty tag name") 1167 document.getElementsByTagName("head")[0].appendChild(fileref) 1168} 1169//mwt 20130802 ****** used for inline placement of .js tags like crosspixel or chango 1170//mwt 20130802 ****** the above functions allow us to load a .js or .css file from javascript 1171 1172//-------------------------------------- end loadjscssfile.js --------------------------------------// 1173 1174 1175//-------------------------------------- begin topNav.js -------------------------------------------// 1176 1177var rt_cm = null; 1178document.onclick = new Function("show(null);") 1179 1180function getPos(el, sProp) { 1181 var iPos = 0; 1182 while (el != null) { 1183 iPos += el["offset" + sProp]; 1184 el = el.offsetParent; 1185 } 1186 return iPos; 1187} 1188 1189function showTopNav(el, mName, leftPos, imgEl, imgSrc) { 1190 var m = document.getElementById(mName); 1191 show(el, m, 20, leftPos); 1192 if (imgSrc.length > 0) { 1193 document.getElementById(imgEl).src = imgSrc; 1194 } 1195} 1196 1197function show(el, m, topPos, leftPos) { 1198 if (m) { 1199 if (document.layers) { 1200 m.display = "block"; 1201 } else { 1202 m.style.display = 'block'; 1203 m.style.pixelLeft = leftPos; 1204 m.style.pixelTop = topPos; 1205 } 1206 } 1207 if ((m != rt_cm) && (rt_cm)) { 1208 hideEl(rt_cm); 1209 } 1210 rt_cm = m; 1211} 1212 1213function showToolbox(el, mName, topPos, leftPos, imgEl, imgSrc) { 1214 var m = document.getElementById(mName); 1215 show(el, m, topPos, leftPos); 1216 if (imgSrc.length > 0) { 1217 document.getElementById(imgEl).src = imgSrc; 1218 } 1219} 1220 1221function hideTopNav(elName, imgEl, imgSrc) { 1222 var el = document.getElementById(elName); 1223 hideEl(el); 1224 if (imgSrc.length > 0) { 1225 document.getElementById(imgEl).src = imgSrc; 1226 } 1227} 1228 1229function hideEl(el) { 1230 if (el != null) { 1231 if (document.layers) { 1232 el.display = "block"; 1233 } else { 1234 el.style.display = 'none'; 1235 } 1236 } 1237} 1238 1239//-------------------------------------- end topNav.js ---------------------------------------------//
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.