/*============================================================================*/ /* Copyright (c) 2002-2003 Church of Scientology International */ /* All rights reserved. */ /*============================================================================*/ function stripSpaces(x) { x = x.replace(/^ */, ""); x = x.replace(/ +$/, ""); return x; } function isEmpty(x) { x = stripSpaces (x.value); if (x.length > 0) { return false; } else { return true; } } function isValidEmail(s) { var myString = s.value; var myLength = myString.length; var myAt = "@"; var myAtIndex = myString.indexOf (myAt); var myPeriod = "."; var myPeriodindex = myString.indexOf (myPeriod); if ((myAtIndex == -1) || (myAtIndex == 0) || (myAtIndex >= (myLength - 1))) { return false; } if ((myPeriodindex == -1) || (myPeriodindex == 0) || (myPeriodindex == myLength)) { return false; } if (myString.indexOf (myAt, (myAtIndex + 1)) != -1) { return false; } if ((myString.substring ((myAtIndex - 1), myAtIndex) == myPeriod) || (myString.substring ((myAtIndex + 1), (myAtIndex + 2)) == myPeriod)) { return false; } if (myString.indexOf (myPeriod, (myAtIndex + 2)) == -1){ return false; } if (myString.indexOf (" ") != -1) { return false; } return true; } function isValidLength (s, length) { return (s.value.length == length); } function isLengthBetween (s, length1, length2) { return ((s.value.length >= length1) && (s.value.length <= length2)); } function isValidName (s) { // if (s.value.search (/^[-,' &A-Za-z]+$/) == -1) { // return false; // } return true; } function isValidAddress (s) { // if (s.value.search (/^[-\,\/()%#&'".\ A-Za-z0-9]+$/) == -1) { // return false; // } return true; } function isValidNumeric (s) { if (s.value.search (/^[0-9]+$/) == -1) { return false; } return true; } function isValidPin (s) { if (s.value.search (/^[A-Za-z0-9]+$/) == -1) { return false; } return (isValidLength (s, 8)); } function isValidUserId (s) { return (isLengthBetween (s, 1, 100)); } function isValidPassword (s) { return (isLengthBetween (s, 6, 30)); } /*=========================================*/ /* This the function for the dictionary word select */ /*========================================*/ function getSelected () { selected=""; if (document.selection) { selected=document.selection.createRange().text; } else { if (document.getSelection) { selected=document.getSelection(); } } return selected; } function launch_quickLookup (myPopUpUrl) { var mySelectedText=getSelected(); if (mySelectedText) { var myValidText=mySelectedText.toString(); var myLookupText =(myValidText.replace(/^\W+/,'')).replace(/\W+$/,''); showDictionary (myPopUpUrl + '?query=' + myLookupText ); } } /*======================================================*/ /* This the functions for the windows to open - dico and materials */ /*======================================================*/ function showDictionary (aUrl) { window.open (aUrl,'dictionary','directories=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=yes,top=10,left=0,width=490,height=580').focus(); } function showSourceMaterial (aUrl) { window.open (aUrl + '#marker','sourcematerial','directories=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=yes,top=10,left=0,width=700,height=580').focus(); } function showHelp (aUrl) { window.open (aUrl,'helppage','directories=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=yes,top=10,left=0,width=490,height=580').focus(); } /*======================================================*/ /* This the functions for email to a friend - dn/contact/article.html */ /*======================================================*/ var hexChars = '0123456789ABCDEF'; function makeHexCharCode(c) { var cn = c.charCodeAt(0); var n1 = parseInt(new String(cn/16)); var n2 = parseInt(new String(cn%16)); return hexChars.charAt(n1)+hexChars.charAt(n2); } var noEncodeChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; function encodeURL(url) { var ret = ''; for (var i = 0; i < url.length; i++) { var c = url.charAt(i); if (c == ' ') c = '+'; else if (noEncodeChars.indexOf(c)<0) { c = '%'+makeHexCharCode(c); } ret += c; } return ret; } function sendToAFriend(tgt) { var u = tgt + "?dnTitle=" + encodeURL(document.title) + "&dnLink=" + encodeURL(new String(document.location)); window.open (u,'email','toolbar=0,location=0,width=444,height=484,left=0,top=0,status=0,scrollbars=0,resizable').focus(); } /*======================================================*/ /* This the functions for add to favorite - dn toolkit */ /*======================================================*/ function addToFavorites() { if (window.external) { window.external.AddFavorite(document.location,document.title); } else { alert('Browser error: Please manually add this page to your favorites'); } } /*======================================================*/ /* Pop up back to main window from search snipet */ /*======================================================*/ function targetopener(mylink, closeme, closeonly) { if (! (window.focus && window.opener))return true; window.opener.focus(); if (! closeonly)window.opener.location.href=mylink.href; if (closeme)window.close(); return false; } /*======================================================*/ /* Stock Dreamweaver Functions */ /*======================================================*/ function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; 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= 0 && u.length-1 > pos) { var uars = u.substring(pos+1, u.length); var uar = uars.split('&'); var parms = new Object(); for (var i = 0; i < uar.length; i++) { var v = uar[i]; var ps = v.split('=', 2); parms[ps[0]] = urlDecode(ps[1]); } } document.parms = parms; } return parms[n]; } /* String replace (only replaces first occurrence) */ function stringReplace(haystack, needle, repl) { var p; var o = haystack; if ((p = haystack.indexOf(needle)) >= 0) { o = ''; if (p) { o = haystack.substring(0, p); } o += repl; var endp = p + needle.length; if (endp < haystack.length) { o += haystack.substring(endp, haystack.length); } } return o; } /* parses a string that is in the format name=value%sep%name2=value2 and allows you to choose your separators */ function parseNameValueString(origstr, pairsep, eqsep) { var strs = origstr.split(pairsep); var strsl = strs.length; var outobj = new Object(); for (var i = 0; i < strsl; i++) { var pair = strs[i].split(eqsep, 2); outobj[pair[0]] = pair[1]; } return outobj; } /*======================================================*/ /* Netscape video plugin detection (IE has to be done with VBS */ /*======================================================*/ // NS windows media player detection var fHasWMP = false; if (navigator.mimeTypes) { fHasWMP = navigator.mimeTypes && navigator.mimeTypes["application/x-mplayer2"] && navigator.mimeTypes["application/x-mplayer2"].enabledPlugin; } var fHasQT = false; if (navigator.plugins) { for (i=0; i < navigator.plugins.length; i++ ) { if (navigator.plugins[i].name.indexOf("QuickTime") >= 0) { fHasQT = true; } } } function getDomainAndPort() { var domain = new String(document.location); var pos = domain.indexOf("/", 7); domain = domain.substring(0, pos); pos = domain.lastIndexOf("/"); domain = domain.substring(pos+1, domain.length) return domain; } /*======================================================*/ /* Core video code that parses the available video types and can */ /* output the actual video */ /*======================================================*/ /* Video code */ /* Properties: video_formats - mov=Quicktime|wmv=Windows Media video_modes - mov!hi=DSL!320x240|mov!low=Dialup (Modem)!190x150|mov!med=ISDN (or slow DSL)!240x200|wmv!hi=DSL!320x240|wmv!low=Dialup (Modem)!190x150|wmv!med=ISDN (or slow DSL)!240x200 video_name - /pics/cos/dianetics/en_US/success/video/vid01_%MODE%.%TYPE% Sample: var videofmts = videoParseStrings(fmts,modes); // Values as above for (fmtname in videofmts.formats) { var fmt = videofmts.formats[fmtname]; document.write(fmt.description); // Outputs 'Quicktime' - for example for (modename in fmt.modes) { var mode = fmt.modes[modename]; document.write(mode.description); // Outputs "DSL" or "Dialup (Modem)" etc. document.write(mode.width); // Outputs width, e.g., 240 document.write(mode.height); // Outputs height, e.g., 190 } alert(o.formats['mov'].modes['low'].description); // alerts 'Dialup (Modem)' } */ function videoParseStrings(fmts,modes) { var n,v; var retobj = new Object(); retobj.formats = parseNameValueString(fmts, '|', '='); // Load formats into retobj.formats for (n in retobj.formats) { v = retobj.formats[n]; retobj.formats[n] = new Object(); retobj.formats[n].description = v; } // Cycle through the modes and assign them to the formats var modesobj = parseNameValueString(modes, '|', '='); for (var n in modesobj) { v = modesobj[n]; var p0 = n.split('!', 2); // for the mode name var p1 = v.split('!', 2); // for the description and the dimensions var p2 = p1[1].split('x', 2); // split the dimensions apart // Make the mode object var mode = new Object(); mode.description = p1[0]; mode.width = p2[0]; mode.height = p2[1]; // Asign it to the mode if (!retobj.formats[p0[0]].modes) { retobj.formats[p0[0]].modes = new Object(); } retobj.formats[p0[0]].modes[p0[1]] = mode; } // Return our object return retobj; } function videoMakePath(namepattern, t, m) { return stringReplace(stringReplace(namepattern, '%TYPE%', t), '%MODE%', m); } /* Outputs the video code Sample: ed.wmv_error_img = '/pics/cos/dianetics/en_US/myvideos/wmv_error_img.jpg'; ed.mov_error_img = '/pics/cos/dianetics/en_US/myvideos/mov_error_img.jpg'; videoOutput('/pics/cos/dianetics/en_US/myvideos/01_%MODE%.%TYPE%', 'wmv', 'hi', ed); */ function videoOutput(namepattern, t, m, obj, ed/* exception data */) { if (!t) { for (var t1 in obj.formats) { t = t1; break; } } if (!m) { for (var m1 in obj.formats[t].modes) { m = m1; break; } } if (t == 'wmv') { // Windows Media format var mode = obj.formats[t].modes[m]; var fname = videoMakePath(namepattern, t, m); var dnp = getDomainAndPort(); if (fname.indexOf(dnp) < 0) { fname = 'http://' + dnp + '/' + fname; } if (fHasWMP) { // flag already set earlier // Load up the code to output var tgtcode = " \ \ \ \ "; var w = window; // HACK: NS7 + WMP9 (and probably other version combinations) don't work when embedded in the document, so pop up a window as a hack solution if (navigator.appName == 'Netscape') { w = window.open(new String(document.location), 'nsvideo', 'width=' + new String(parseInt(mode.width)+10) + ',height=' + new String(parseInt(mode.height)+40)); w.focus(); w.document.write('Video
'+tgtcode+'
'); w.document.close(); document.write('
 
'); } else { // Just write it out to the document if we are not Netscape document.write(tgtcode); } } else { if (ed && ed.wmv_error_img) { document.write(''); } return false; } } else if (t == 'mov') { // Quicktime format var mode = obj.formats[t].modes[m]; var fname = videoMakePath(namepattern, t, m); if (fHasQT) { document.write(" \ \ \ \ "); } else { if (ed && ed.mov_error_img) { document.write(''); } return false; } } else { // Unknown format } return true; } /*======================================================*/ /* Popup Windows: Targeting the Opener for the pop up extcrs */ /*======================================================*/ function targetopener(mylink, closeme, closeonly) { if (! (window.focus && window.opener))return true; window.opener.focus(); if (! closeonly)window.opener.location.href=mylink.href; if (closeme)window.close(); return false; } /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ function tdMouseOver() { // placeholder } function tdMouseOut() { // placeholder } /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /* RTC Matters of Concern choices scripting */ /* Author: Brad Peabody */ /***************************************************************************/ /***************************************************************************/ /* Statically define the RTC matters of concern text */ /***************************************************************************/ document.rtcMatters = new Object(); /***************************************************************************/ /* ETHICS */ /***************************************************************************/ document.rtcMatters.ethics = new Array( 'Any suppressive act against Scientology or Scientologists as listed in HCO PLs and HCOBs.', 'Any violation of a Trademark License.', 'Acts calculated to misuse, invalidate or alter-is legally or in any other way the trademarks and service marks of the Scientology religion.', 'Use of the trademarks and service marks of the Scientology religion without express permission or license from RTC or its authorized licensees.', 'Holding, using, copying, printing, publishing or reproducing in any manner, confidential materials of Dianetics and Scientology without the express permission of RTC.', 'Any violation of LRH copyrights, including any manner of reproduction, publishing or selling without the express permission of L. Ron Hubbard Library.', 'Any attempted or accomplished change or squirreling of the technology of Scientology Ethics, Tech or Administration as listed in LRH books, bulletins, policies and writings.', 'Issuing alter-ised Scientology technical data or information or instructional or admin procedures, calling it Scientology or calling it something else to confuse or deceive people as to the true source, beliefs and practices of Scientology.', 'Organizing splinter groups to diverge from Scientology practices, still calling it Scientology or calling it something else, or using Scientology data to distract people from standard Scientology.', 'Any individual or group falsely designating their service or product as "Dianetics" or "Scientology."', 'Any misrepresentation of Dianetics or Scientology.', 'Developing and/or using squirrel processes and checksheets.', 'Unauthorized use of the materials of Dianetics and Scientology.', 'Infiltrating a Scientology group or organization or staff to stir up discontent or protest at the instigation of hostile forces.', 'Any anti-Scientology, anti-Source, anti-org or anti-Church management actions or intentions.', 'Any person who is hypercritical of Scientology or the Church.', 'Publicly departing Scientology.', 'Public statements against Scientology or Scientologists but not to Committees of Evidence duly convened.', 'Civil suits brought against a Scientology organization or Scientologist without first calling the matter to the attention of the International Justice Chief and receiving a reply.', 'Theft, dissemination or sale of the confidential upper-level material of Scientology.', 'Impersonating a Sea Org officer/member, Scientology org staff member or Scientologist.', 'Any theft of Church documents or materials.', 'Any felony against person or property, threatened or accomplished.', 'Anyone forbidding or advising against the writing of Knowledge Reports.', 'Anyone forbidding or advising one not to send Knowledge Reports to RTC.', 'Anyone advocating or inducing you or another to do something illegal.', 'Blackmail, threatened or accomplished.', 'Sexual or sexually perverted conduct contrary to the well-being or good state of mind of a Scientologist in good standing or under the charge of Scientology, such as a student or preclear.', 'Willful or negligent out-security of the advanced material of Scientology.', 'False reports or false advices which bring about apathy or defeatism.', 'Anyone refusing a confessional or refusing to answer a reading question.', 'Anyone implanted this lifetime.', 'Any person who acts Type III PTS (Potential Trouble Source).', 'Employment of org staff members to the detriment of the production or the establishment of a Scientology organization.', 'Violation of Mission charters.', 'Instigation of destructive activities.', 'Any actions or omissions undertaken to knowingly suppress, reduce or impede Scientology or Scientologists, such as the suppressive acts/high crimes listed in HCO PL 7 March 1965RB, SUPPRESSIVE ACTS, SUPPRESSION OF SCIENTOLOGY AND SCIENTOLOGISTS, HCO PL 10 September 1983, PTSNESS AND DISCONNECTION, and any crime listed in HCO PL 7 March 1965RA, Issue III, OFFENSES AND PENALTIES which has been reclassed as a high crime due to it being severe, of magnitude, harmful to many and committed repeatedly.' ); /***************************************************************************/ /* TECH */ /***************************************************************************/ document.rtcMatters.tech = new Array( 'Violations of any of the ten points of HCO PL 7 February 1965, KEEPING SCIENTOLOGY WORKING.', 'Technical degrades per HCO PL 17 June 1970RB, TECHNICAL DEGRADES.', 'Willful perversion or corruption of the tech.', 'Any instances of out-tech or squirreling.', 'Quickied tech.', 'Any gross auditing errors as per HCOBs.', 'Any misprogramming of cases.', 'Scattering around on the Grade Chart, mixing rundowns or using wrong repair.', 'Any person knowingly falsifying an auditing report.', 'Any person feeding the Clear cognition to any individual, evaluating for a preclear on this subject or coaxing him to any cognition.', 'Admitting a preclear to higher-level processing who has not fully attained lower-level processing.', 'Any students or preclears who seek to resign or leave courses or sessions and refuse to return despite normal efforts.', 'Violations of HCOB 30 October 1978R, COURSES — THEIR IDEAL SCENE which are not being handled immediately.', 'Any actions or omissions undertaken to knowingly suppress, reduce or impede Scientology or Scientologists, such as the suppressive acts/high crimes listed in HCO PL 7 March 1965RB, SUPPRESSIVE ACTS, SUPPRESSION OF SCIENTOLOGY AND SCIENTOLOGISTS, HCO PL 17 January 1979, A NEW TYPE OF CRIME, TECHNICAL PERVERSIONS and any crime listed in HCO PL 7 March 1965RA, Issue III, OFFENSES AND PENALTIES which has been reclassed as a high crime due to it being severe, of magnitude, harmful to many and committed repeatedly.', 'Violations of HCO PL 11 November 1981R, POLICIES ON FILM USAGE, including any instances of the technical or public dissemination films not set up, not used, not shown, damaged or degraded.', 'Violations of the Purification Rundown Delivery Manual which are not immediately handled.' ); /***************************************************************************/ /* ADMIN */ /***************************************************************************/ document.rtcMatters.admin = new Array( 'Violations of HCO PL 10 July 1986, Issue I, KEEPING ADMIN WORKING.', 'Violations of HCO PL 10 July 1986, Issue II, ADMIN DEGRADES.', 'Financial irregularities.', 'Any calculated efforts to disrupt Church services or the flow of public up The Bridge through the Churches.', 'Any actions or omissions undertaken to knowingly suppress, reduce or impede Scientology or Scientologists, such as the suppressive acts/high crimes listed in HCO PL 7 March 1965RB, SUPPRESSIVE ACTS, SUPPRESSION OF SCIENTOLOGY AND SCIENTOLOGISTS, HCO PL 17 March 1965, Issue IV, ORGANIZATIONAL SUPPRESSIVE ACTS and any crime listed in HCO PL 7 March 1965RA, Issue III, OFFENSES AND PENALTIES which has been reclassed as a high crime due to it being severe, of magnitude, harmful to many and committed repeatedly.' ); /***************************************************************************/ /* OPERATION: getRTCMatterIDs */ /* */ /* Retrieve the list of id numbers for a given category. This method */ /* does not return the text, just an array of index numbers - each of */ /* which is an alphanumeric value such as 'e0' for ethics number 0, etc. */ /***************************************************************************/ function getRTCMatterIDs(kind) { if (kind == 'all') { return getRTCMatterIDs("ethics").concat(getRTCMatterIDs("tech")).concat(getRTCMatterIDs("admin")); } else if (kind == 'ethics') { return getRTCMatterIDs_internal(document.rtcMatters.ethics, "e"); } else if (kind == 'tech') { return getRTCMatterIDs_internal(document.rtcMatters.tech, "t"); } else if (kind == 'admin') { return getRTCMatterIDs_internal(document.rtcMatters.admin, "a"); } } /***************************************************************************/ /* OPERATION: getRTCMatterIDs_internal */ /* */ /* Internal helper function which loops through and builds the array of */ /* ids. */ /***************************************************************************/ function getRTCMatterIDs_internal(o, prefix) { var ret = new Array(); for (n in o) { ret.push(prefix + n); } return ret; } /***************************************************************************/ /* OPERATION: getRTCMatterText */ /* */ /* Lookup the text for a given id. */ /***************************************************************************/ function getRTCMatterText(id) { var o = null; var prefix = id.substring(0, 1); if (prefix == 'e') { o = document.rtcMatters.ethics; } else if (prefix == 't') { o = document.rtcMatters.tech; } else if (prefix == 'a') { o = document.rtcMatters.admin; } return o[parseInt(id.substring(1))]; } /***************************************************************************/ /* OPERATION: arrayToSepString */ /* */ /* Converts a JavaScript array to a comma-separated string (the string */ /* both starts and ends with a comma for simplicity's sake) */ /***************************************************************************/ function arrayToSepString(a) { var ret = ""; for (v in a) { ret = ret + "," + a[v]; } return ret + ","; } /***************************************************************************/ /* OPERATION: sepStringToArray */ /* */ /* Converts a comma-separated string to a JavaScript array */ /***************************************************************************/ function sepStringToArray(s) { var a = s.split(','); var ret = Array(); for (v in a) { if (a[v].length) { ret.push(a[v]); } } return ret; } /***************************************************************************/ /* OPERATION: sepStringRemove */ /* */ /* Removes an element from a comma separated string */ /***************************************************************************/ function sepStringRemove(s, i) { s = stringReplace(s, ',' + i + ',', ','); return s; } /***************************************************************************/ /* OPERATION: sepStringAdd */ /* */ /* Adds an element to a comma separated string */ /***************************************************************************/ function sepStringAdd(s, i) { s = stringReplace(s, ',' + i + ',', ','); if (s == "") { s = ','; } s = s + i + ','; return s; } /***************************************************************************/ /* OPERATION: sepStringContains */ /* */ /* Returns true if a comma separated string contains the given item */ /***************************************************************************/ function sepStringContains(s, i) { if (s.indexOf(',' + i + ',') >= 0) { return true; } return false; } /***************************************************************************/ // RTC Matter functions used in the pages themselves // (the high level stuff) /***************************************************************************/ function getSelectedMatters() { var c = getCookie('rtcMatters'); if (c) { } else { c = ","; } return c; } function setSelectedMatters(sm) { setCookie('rtcMatters', sm, 0, '/'); } function removeSelectedMatter(i) { setSelectedMatters(sepStringRemove(getSelectedMatters(), i)); } function addSelectedMatter(i) { setSelectedMatters(sepStringAdd(getSelectedMatters(), i)); } function isMatterSelected(i) { return sepStringContains(getSelectedMatters(), i); } function visualToggleMatter(elemId) { var e = document.getElementById(elemId); if (!isMatterSelected(elemId)) { e.style.color="#0000AA"; e.style.fontWeight = "bold"; addSelectedMatter(elemId); } else { e.style.color="#000000"; e.style.fontWeight = "normal"; removeSelectedMatter(elemId); } } /***************************************************************************/ // Cookie helper functions /***************************************************************************/ /** * Sets a Cookie with the given name and value. * * name Name of the cookie * value Value of the cookie * [expires] Expiration date of the cookie (default: end of current session) * [path] Path where the cookie is valid (default: path of calling document) * [domain] Domain where the cookie is valid * (default: domain of calling document) * [secure] Boolean value indicating if the cookie transmission requires a * secure transmission */ function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } /** * Gets the value of the specified cookie. * * name Name of the desired cookie. * * Returns a string containing value of specified cookie, * or null if cookie does not exist. */ function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } /** * Deletes the specified cookie. * * name name of the cookie * [path] path of the cookie (must be same as path used to create cookie) * [domain] domain of the cookie (must be same as domain used to create cookie) */ function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } }