| animation | animation0 | browser | checkForm |
| documentURL | footer | include0 | lastModified |
| mailForm | mailForm0 | mailForm1 | mailForm2 |
| mailForm3 | popUpWindow | quickSearch | quicksearch |
| redirect |
Note: Scripts with a digit (0, 1, ...) suffix after the name are beta software. Use at your own risk.
File: animation.js An Animation object. Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/animation.js"> </script> Example: animationTest1.html <!-- load animation.js --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/animation.js"> </script> <!-- a juggler --> <script type="text/javascript"> var juggler = new Animation(); juggler.addFrame( "http://www.bgsu.edu/scripts/juggler0.gif" ); juggler.addFrame( "http://www.bgsu.edu/scripts/juggler1.gif" ); juggler.addFrame( "http://www.bgsu.edu/scripts/juggler2.gif" ); juggler.addFrame( "http://www.bgsu.edu/scripts/juggler3.gif" ); juggler.setAlt( "The Juggler!" ); juggler.setDelay( 200 ); // delay in milleseconds juggler.write(); juggler.start(); </script> Example: animationTest2.html <!-- load animation.js --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/animation.js"> </script> <!-- a fast juggler, counterclockwise --> <script type="text/javascript"> var jugglerLeft = new Animation(); jugglerLeft.addFrame( "http://www.bgsu.edu/scripts/juggler0.gif" ); jugglerLeft.addFrame( "http://www.bgsu.edu/scripts/juggler1.gif" ); jugglerLeft.addFrame( "http://www.bgsu.edu/scripts/juggler2.gif" ); jugglerLeft.addFrame( "http://www.bgsu.edu/scripts/juggler3.gif" ); jugglerLeft.setAlt( "Juggle to the left..." ); jugglerLeft.setDelay( 25 ); // delay in milleseconds jugglerLeft.write(); jugglerLeft.start(); </script> <!-- a stationary juggler --> <img src="http://www.bgsu.edu/scripts/juggler1.gif" alt="I don't know how to juggle!"> <!-- a fast juggler, clockwise --> <script type="text/javascript"> var jugglerRight = new Animation(); jugglerRight.addFrame( "http://www.bgsu.edu/scripts/juggler3.gif" ); jugglerRight.addFrame( "http://www.bgsu.edu/scripts/juggler2.gif" ); jugglerRight.addFrame( "http://www.bgsu.edu/scripts/juggler1.gif" ); jugglerRight.addFrame( "http://www.bgsu.edu/scripts/juggler0.gif" ); jugglerRight.setAlt( "Juggle to the right..." ); jugglerRight.setDelay( 25 ); // delay in milleseconds jugglerRight.write(); jugglerRight.start(); </script>
File: animation0.js An Animation object. Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/animation0.js"> </script> Example: animation0Test1.html <!-- load animation0.js --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/animation0.js"> </script> <!-- a juggler --> <script type="text/javascript"> var juggler = new Animation( 4 ); // number of frames = 4 juggler.frames[0] = "http://www.bgsu.edu/scripts/juggler0.gif"; juggler.frames[1] = "http://www.bgsu.edu/scripts/juggler1.gif"; juggler.frames[2] = "http://www.bgsu.edu/scripts/juggler2.gif"; juggler.frames[3] = "http://www.bgsu.edu/scripts/juggler3.gif"; juggler.setDelay( 200 ); // delay in milleseconds juggler.animate(); </script> Example: animation0Test2.html <!-- load animation0.js --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/animation0.js"> </script> <!-- a fast juggler, counterclockwise --> <script type="text/javascript"> var jugglerLeft = new Animation( 4 ); // no. of frames jugglerLeft.frames[0] = "http://www.bgsu.edu/scripts/juggler0.gif"; jugglerLeft.frames[1] = "http://www.bgsu.edu/scripts/juggler1.gif"; jugglerLeft.frames[2] = "http://www.bgsu.edu/scripts/juggler2.gif"; jugglerLeft.frames[3] = "http://www.bgsu.edu/scripts/juggler3.gif"; jugglerLeft.setDelay( 25 ); // delay in milleseconds jugglerLeft.animate(); </script> <!-- a slow juggler, counterclockwise --> <script type="text/javascript"> var jugglerLeft = new Animation( 4 ); // no. of frames jugglerLeft.frames[0] = "http://www.bgsu.edu/scripts/juggler0.gif"; jugglerLeft.frames[1] = "http://www.bgsu.edu/scripts/juggler1.gif"; jugglerLeft.frames[2] = "http://www.bgsu.edu/scripts/juggler2.gif"; jugglerLeft.frames[3] = "http://www.bgsu.edu/scripts/juggler3.gif"; jugglerLeft.setDelay( 400 ); // delay in milleseconds jugglerLeft.animate(); </script> <!-- a stationary juggler --> <img src="http://www.bgsu.edu/scripts/juggler1.gif"> <!-- a slow juggler, clockwise --> <script type="text/javascript"> var jugglerRight = new Animation( 4 ); // no. of frames jugglerRight.frames[0] = "http://www.bgsu.edu/scripts/juggler3.gif"; jugglerRight.frames[1] = "http://www.bgsu.edu/scripts/juggler2.gif"; jugglerRight.frames[2] = "http://www.bgsu.edu/scripts/juggler1.gif"; jugglerRight.frames[3] = "http://www.bgsu.edu/scripts/juggler0.gif"; jugglerRight.setDelay( 400 ); // delay in milleseconds jugglerRight.animate(); </script> <!-- a fast juggler, clockwise --> <script type="text/javascript"> var jugglerRight = new Animation( 4 ); // no. of frames jugglerRight.frames[0] = "http://www.bgsu.edu/scripts/juggler3.gif"; jugglerRight.frames[1] = "http://www.bgsu.edu/scripts/juggler2.gif"; jugglerRight.frames[2] = "http://www.bgsu.edu/scripts/juggler1.gif"; jugglerRight.frames[3] = "http://www.bgsu.edu/scripts/juggler0.gif"; jugglerRight.setDelay( 25 ); // delay in milleseconds jugglerRight.animate(); </script>
File: browser.js Browser checking routines (for popular browsers v3.0 and above) Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/browser.js"> </script> Insert the <script> element into the <head> or <body> of your document. This script adds the following properties to the navigator object: String properties: navigator.appVer Boolean properties: navigator.isNN, navigator.isIE navigator.isNN3, navigator.isIE3 navigator.isNN4, navigator.isIE4 navigator.isNN5, navigator.isIE5 navigator.isNN6, navigator.isIE6 navigator.isNN7, navigator.isIE7 navigator.isWin, navigator.isMac The script also fixes a screen redraw bug in Netscape Navigator v4. Example: browserTest.html
File: checkForm.js Automatic form checking (for ver 4.0 browsers and above) Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/checkForm.js"> </script> ... <form ... onsubmit="return checkForm( this )"> Insert the <script> tags in the <head> or <body> of your document. Insert the <form> tag in the <body> of your document. Example: checkFormTest.html The following input elements are recognized by checkForm: Checked? Element Yes No Result ------------------------------------------------------------------ button X NA checkbox X Warning if none in a group are checked file X Error if input field is empty hidden X NA password X Error if input field is empty radio X Error if none in a group are checked reset X NA select-one X Warning if no option is selected select-multiple X Warning if no options are selected submit X NA text X Error if input field is empty textarea X Error if input field is empty Note: A select-multiple element is a select element with the MULTIPLE attribute, whereas a select-one element has no MULTIPLE attribute. For custom form checking, simply override the checkForm() function. For example, to check a subset of the input elements, try this: <script type="text/javascript" src="http://www.bgsu.edu/scripts/checkForm.js"> </script> <script type="text/javascript"> // Overrides checkForm() (skips over some input elements): function checkForm( form ) { return checkText( form.mailTo ) && checkText( form.mailFrom ) && checkText( form.mailSubject ) && checkSelectOne( form.group ) && checkTextarea( form.message ); } </script> ... <form ... onsubmit="return checkForm( this )"> where mailTo, mailFrom, mailSubject, group, and message are the names of specific input elements that require checking (all other input elements are ignored). Here is a complete list of the functions called by checkForm(): Element Function ------------------------------------------------------------------ text checkText textarea checkTextarea radio checkRadio checkbox checkCheckbox select-one checkSelectOne select-multiple checkSelectMultiple file checkFile password checkPassword These boolean functions may be used separately (as above) or may be overridden for further customization. For example, here's how to use a more restrictive form of the checkSelectMultiple() function: <script type="text/javascript" src="http://www.bgsu.edu/scripts/checkForm.js"> </script> <script type="text/javascript"> // checkSelectStrict returns true if an option is selected: var checkSelectMultiple = checkSelectStrict; </script> ... <form ... onsubmit="return checkForm( this )"> Finally, here is an example that handles select elements with attribute SIZE="1" (which is the default size in HTML): <script type="text/javascript" src="http://www.bgsu.edu/scripts/checkForm.js"> </script> <script type="text/javascript"> // checkSelectSpecial returns true if the user makes a // selection other than options[0]: var checkSelectOne = checkSelectSpecial; </script> ... <form ... onsubmit="return checkForm( this )"> The checkSelectSpecial() function returns true if the user makes a selection other than options[0].
File: documentURL.js Insert the URL of the current document into itself Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/documentURL.js"> </script> Insert this code in the <body> of your document.
File: footer.js Customize footer of BGSU webpages Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/footer.js"> </script> Insert the <script> element into the <body> of your document. Constructor: Footer() Create footer object Properties: logoDisplayed Whether or not logo is displayed (default: true) logoURL URL of logo (default: http://www.bgsu.edu/images/images3/BGseal.gif) URL URL of the homepage (default: http://www.bgsu.edu/) name name of the office or department (default: empty string) location location of the office or department (default: empty string) phone phone number of the office or department (default: empty string) Methods: insertLogo specify whether a logo is displayed setLogoURL specify the URL of logo setOfficeURL specify the URL of the homepage of the office setDepartmentURL specify the URL of the homepage of the department setOfficeName specify the name of the office setDepartmentName specify the name of the department setOfficeLocation specify the location of the office setDepartmentLocation specify the location of the department setOfficePhone specify the phone of the office setDepartmentPhone specify the phone of the department write() write the footer object into the current document Static methods: Footer.openPrivacyPolicyWindow open privacy policy window Footer.openDisclaimerWindow open disclaimer window Example 1: footerTest1.html <!-- basic BGSU footer --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/footer.js">' </script> <!-- insert the following script into the body of the document --> <script type="text/javascript"> var BGSUFooter = new Footer(); BGSUFooter.write(); </script> Example 2: footerTest2.html <!-- footer of the webpage of an office of BGSU --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/footer.js">' </script> <!-- insert the following script into the body of the document --> <script type="text/javascript"> var ITSFooter = new Footer(); ITSFooter.setOfficeName( "Information Technology Services" ); ITSFooter.setOfficeLocation( "Hayes Hall 209" ); ITSFooter.setOfficePhone( "419-372-2911" ); ITSFooter.setOfficeURL( "http://www.bgsu.edu/offices/its/" ); ITSFooter.write(); </script> Example 3: footerTest3.html <!-- footer without logo --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/footer.js">' </script> <!-- insert the following script into the body of the document --> <script type="text/javascript"> var ITSFooter = new Footer(); ITSFooter.insertLogo(false); ITSFooter.setOfficeName( "Information Technology Services" ); ITSFooter.setOfficeLocation( "Hayes Hall 209" ); ITSFooter.setOfficePhone( "419-372-2911" ); ITSFooter.setOfficeURL( "http://www.bgsu.edu/offices/its/" ); ITSFooter.write(); </script> Example 4: footerTest4.html <!-- footer of the webpage of a department at BGSU --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/footer.js">' </script> <!-- insert the following script into the body of the document --> <script type="text/javascript"> var DeptFooter = new Footer(); DeptFooter.setDepartmentName( "Department of Future Science" ); DeptFooter.setDepartmentLocation( "Future Hall" ); DeptFooter.setDepartmentPhone( "419-372-xxxx" ); DeptFooter.setDepartmentURL( "http://www.bgsu.edu/departments/" ); DeptFooter.write(); </script> Example 5: footerTest5.html <!-- footer with a logo other than BGSeal --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/footer.js">' </script> <!-- insert the following script into the body of the document --> <script type="text/javascript"> var DeptFooter = new Footer(); DeptFooter.setLogoURL( "http://www.bgsu.edu/scripts/footerLogo.gif" ); DeptFooter.setDepartmentName( "Department of Future Science" ); DeptFooter.setDepartmentLocation( "Future Hall" ); DeptFooter.setDepartmentPhone( "419-372-xxxx" ); DeptFooter.setDepartmentURL( "http://www.bgsu.edu/departments/" ); DeptFooter.write(); </script>
File: include0.js Include an HTML document into the current document Example: include0Test.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/include0.js"> </script> <!-- Insert this code in the <body> of your document --> <script type="text/javascript"> include( "foo.html" ); </script>
File: lastModified.js Insert the "last modified" date into the current document Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/lastModified.js"> </script> Insert this code in the <body> of your document.
File: mailForm.js Send e-mail to selected addresses Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> Insert the <script> element into the <body> of your document. Constructor: MailForm() Create mail form window Methods: addRecipient( name, email ) Add single recipient addRecipients( name1, email1, Add multiple recipients name2, email2, ... ) addGroup( group ) Add single group addGroups( group1, group2, ... ) Add multiple groups close() Close mail form window open() Open mail form window setGroupLineDisplayed( boolean ) Turn group line on/off setMailFromAddress( email ) Set hard-coded "From" address setMailFromDefaultText( text ) Set "From" default text Note: A "boolean" value is either true or false Example 1: mailFormTest1.html <!-- a simple mailform with multiple recipients --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipients( "Admissions Office", "admissions@bgnet.bgsu.edu", "Human Resources", "ohr@bgnet.bgsu.edu", "Registration and Records", "registrar@bgnet.bgsu.edu", "Tech Support Center", "tsc@bgnet.bgsu.edu", "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a> Example 2: mailFormTest2.html <!-- a single recipient renders differently --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact the Webmaster!" onclick="mailForm.open()"> </form> Note: According to the HTML 4.0 specification, the <form> tag is not needed in the above code, but a lone <input> tag will not render in Netscape Navigator 4 without it. Example 3: mailFormTest3.html <!-- groups are configurable --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); mailForm.addRecipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); mailForm.addRecipient( "Registration and Records", "registrar@bgnet.bgsu.edu" ); mailForm.addRecipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); mailForm.addRecipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); mailForm.addGroup( "Prospective Student" ); mailForm.addGroups( "Parent", "Guest" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a> Example 4: mailFormTest4.html <!-- groups may be eliminated altogether --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); mailForm.setGroupLineDisplayed( false ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact the TSC!" onclick="mailForm.open()"> </form> Example 5: mailFormTest5.html <!-- a single group will be hidden from the user --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipients( "Admissions Office", "admissions@bgnet.bgsu.edu", "Human Resources", "ohr@bgnet.bgsu.edu", "Registration and Records", "registrar@bgnet.bgsu.edu", "Tech Support Center", "tsc@bgnet.bgsu.edu", "Webmaster", "webmaster@bgnet.bgsu.edu" ); // a single group will not be shown on the form: mailForm.addGroup( "student" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a> Example 6: mailFormTest6.html <!-- the sender may be fixed, rather than input --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); // sender could be used in an authenticated environment: mailForm.setMailFromAddress( "someone@somewhere.com" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact Admissions!" onclick="mailForm.open()"> </form> Example 7: mailFormTest7.html <!-- the default text in the mailFrom field may be modified --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipients( "Admissions Office", "admissions@bgnet.bgsu.edu", "Human Resources", "ohr@bgnet.bgsu.edu", "Registration and Records", "registrar@bgnet.bgsu.edu", "Tech Support Center", "tsc@bgnet.bgsu.edu", "Webmaster", "webmaster@bgnet.bgsu.edu" ); // Use with care. For example, the default text should not // take the form of an email address (someone@somewhere) // since this might confuse the user. mailForm.setMailFromDefaultText( "Your email here" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a>
File: mailForm0.js Note: This script has been deprecated (use mailForm1.js instead) Send e-mail to selected addresses Example 1: mailForm0Test1.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm0.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); recipients[3] = new Recipient( "Registration and Records", "registrar@bgnet.bgsu.edu" ); recipients[4] = new Recipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); recipients[5] = new Recipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a> Example 2: mailForm0Test2.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm0.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact the Webmaster!" onclick="openMailForm()"> </form> Note: According to the HTML 4.0 specification, the <form> is not needed, but a lone <input> tag will not render in Netscape Navigator 4.
File: mailForm1.js Note: This script has been deprecated (use mailForm2.js instead) Send e-mail to selected addresses Example 1: mailForm1Test1.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm1.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); recipients[3] = new Recipient( "Registration and Records", "registrar@bgnet.bgsu.edu" ); recipients[4] = new Recipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); recipients[5] = new Recipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a> Example 2: mailForm1Test2.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm1.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact the Webmaster!" onclick="openMailForm()"> </form> Note: According to the HTML 4.0 specification, the <form> is not needed, but a lone <input> tag will not render in Netscape Navigator 4.
File: mailForm2.js Note: This script has been deprecated (use mailForm3.js instead) Send e-mail to selected addresses Example 1: mailForm2Test1.html <!-- a simple mailform with multiple recipients --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); recipients[3] = new Recipient( "Registration and Records", "registrar@bgnet.bgsu.edu" ); recipients[4] = new Recipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); recipients[5] = new Recipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a> Example 2: mailForm2Test2.html <!-- a single recipient renders differently --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" onclick="openMailForm()" value="Contact the Webmaster!"> </form> Note: According to the HTML 4.0 specification, the <form> tag is not needed in the above example, but a lone <input> tag will not render in Netscape Navigator 4, for example. Example 3: mailForm2Test3.html <!-- groups are configurable --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); groups[1] = "Prospective Student"; groups[2] = "Parent"; groups[3] = "Guest"; </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a> Example 4: mailForm2Test4.html <!-- groups may be eliminated altogether --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); displayGroupLine = false; </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a> Example 5: mailForm2Test5.html <!-- a single group will be hidden from the user --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); groups[1] = "prospective student"; </script> <!-- Put this link in the <body> of your document --> <a href="javasctip:openMailForm()">Contact us!</a> Example 6: mailFrom2Test6.html <!-- the sender may be fixed, rather than input --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); // useful in an authenticated environment: senderEmailAddress = "someone@somewhere"; </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a> Example 7: mailFrom2Test7.html <!-- the default text in the mailFrom field may be modified --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm2.js"> </script> <script type="text/javascript"> recipients[1] = new Recipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); recipients[2] = new Recipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); // Use with care. For example, the default text should not // take the form of an email address (someone@somewhere) // since this might confuse the user. fromLineDefaultText = "Your email here"; </script> <!-- Put this link in the <body> of your document --> <a href="javascript:openMailForm()">Contact us!</a>
File: mailForm3.js Note: This script has been deprecated (use mailForm.js instead) Send e-mail to selected addresses Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> Insert the <script> element into the <body> of your document. Constructor: MailForm() Create mail form window Methods: open() Open mail form window close() Close mail form window addRecipients( name1, email1, Add multiple recipients name2, email2, ... ) addRecipient( name, email ) Add single recipient addGroups( group1, group2, ... ) Add multiple groups addGroup( group ) Add single group setGroupLineDisplayed( boolean ) Turn group line on/off setMailFromAddress( email ) Set hard-coded "From" address setMailFromDefaultText( text ) Set "From" default text Note: A "boolean" value is either true or false Example 1: mailForm3Test1.html <!-- a simple mailform with multiple recipients --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipients( "Admissions Office", "admissions@bgnet.bgsu.edu", "Human Resources", "ohr@bgnet.bgsu.edu", "Registration and Records", "registrar@bgnet.bgsu.edu", "Tech Support Center", "tsc@bgnet.bgsu.edu", "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a> Example 2: mailForm3Test2.html <!-- a single recipient renders differently --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact the Webmaster!" onclick="mailForm.open()"> </form> Note: According to the HTML 4.0 specification, the <form> tag is not needed in the above code, but a lone <input> tag will not render in Netscape Navigator 4 without it. Example 3: mailForm3Test3.html <!-- groups are configurable --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); mailForm.addRecipient( "Human Resources", "ohr@bgnet.bgsu.edu" ); mailForm.addRecipient( "Registration and Records", "registrar@bgnet.bgsu.edu" ); mailForm.addRecipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); mailForm.addRecipient( "Webmaster", "webmaster@bgnet.bgsu.edu" ); mailForm.addGroup( "Prospective Student" ); mailForm.addGroups( "Parent", "Guest" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a> Example 4: mailForm3Test4.html <!-- groups may be eliminated altogether --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Tech Support Center", "tsc@bgnet.bgsu.edu" ); mailForm.setGroupLineDisplayed( false ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact the TSC!" onclick="mailForm.open()"> </form> Example 5: mailForm3Test5.html <!-- a single group will be hidden from the user --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipients( "Admissions Office", "admissions@bgnet.bgsu.edu", "Human Resources", "ohr@bgnet.bgsu.edu", "Registration and Records", "registrar@bgnet.bgsu.edu", "Tech Support Center", "tsc@bgnet.bgsu.edu", "Webmaster", "webmaster@bgnet.bgsu.edu" ); // a single group will not be shown on the form: mailForm.addGroup( "student" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a> Example 6: mailForm3Test6.html <!-- the sender may be fixed, rather than input --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipient( "Admissions Office", "admissions@bgnet.bgsu.edu" ); // sender could be used in an authenticated environment: mailForm.setMailFromAddress( "someone@somewhere.com" ); </script> <!-- Put this form in the <body> of your document --> <form> <input type="button" value="Contact Admissions!" onclick="mailForm.open()"> </form> Example 7: mailForm3Test7.html <!-- the default text in the mailFrom field may be modified --> <script type="text/javascript" src="http://www.bgsu.edu/scripts/mailForm3.js"> </script> <script type="text/javascript"> var mailForm = new MailForm(); mailForm.addRecipients( "Admissions Office", "admissions@bgnet.bgsu.edu", "Human Resources", "ohr@bgnet.bgsu.edu", "Registration and Records", "registrar@bgnet.bgsu.edu", "Tech Support Center", "tsc@bgnet.bgsu.edu", "Webmaster", "webmaster@bgnet.bgsu.edu" ); // Use with care. For example, the default text should not // take the form of an email address (someone@somewhere) // since this might confuse the user. mailForm.setMailFromDefaultText( "Your email here" ); </script> <!-- Put this link in the <body> of your document --> <a href="javascript:mailForm.open()">Contact us!</a>
File: popUpWindow.js Open a new window with the specified content Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/popUpWindow.js"> </script> Insert the <script> element into the <head> or <body> of your document. Constructors: PopUpWindow() create an empty PopUpWindow object suitable for writing PopUpWindow( url ) create a PopUpWindow object and load the specified URL Methods: open() open the new window close() close the new window Window feature methods: setWidth( pixels ) setHeight( pixels ) setDirectories( boolean ) setLocation( boolean ) setMenubar( boolean ) setResizable( boolean ) setScrollbars( boolean ) setStatus( boolean ) setToolbar( boolean ) Note: A "boolean" value is either true or false (see Example 2 below). Example 1: popUpWindowTest1.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/popUpWindow.js"> </script> <script type="text/javascript"> var newWindow = new PopUpWindow( "http://www.bgsu.edu/" ); newWindow.open(); </script> Example 2: popUpWindowTest2.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/popUpWindow.js"> </script> <script type="text/javascript"> var url = "http://www.bgsu.edu/scripts/contact.html"; var newWindow = new PopUpWindow( url ); newWindow.setWidth( 465 ); newWindow.setHeight( 375 ); newWindow.setScrollbars( true ); newWindow.setResizable( true ); </script> <!-- Insert this link in the <body> of your document --> <a href="javascript:newWindow.open()" onmouseover="window.status = 'Click to open a new window'; return true" onmouseout="window.status = ''">Contact BGSU!</a> Example 3: popUpWindowTest3.html <!-- General test of PopUpWindow( url ) constructor --> Example 4: popUpWindowTest4.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/popUpWindow.js"> </script> <script type="text/javascript"> var win = new PopUpWindow(); win.setWidth( 300 ); win.setHeight( 200 ); win.open(); // open an empty window win.document.open(); // open document for writing win.document.write( "<p>This is a test. " ); win.document.writeln( "It is <em>only</em> a test!</p>" ); win.document.close(); // close document for writing </script> Example 5: popUpWindowTest5.html <!-- General test of PopUpWindow() constructor -->
File: quickSearch.js Write a BGSU QuickSearch form into the current document Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/quickSearch.js"> </script> Insert the <script> element into the <head> or <body> of your document. Constructors: QuickSearch() create a QuickSearch object QuickSearch( url, name ) employ a special search option Methods: setColumns( cols ) set the width of the text field setLabel( label ) set the label for the search button useImage( img ) use an image as the search button useImages( img1, img2 ) use dynamic images (rollovers) setBorder( border ) set border of image (in pixels) setAlign( align ) set alignment of image setTarget( target ) set the target of search results page (default: "_self") write() write the search tool into the doc Example 1: quickSearchTest1.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/quickSearch.js"> </script> <script type="text/javascript"> var quicksearch = new QuickSearch(); quicksearch.write(); </script> Example 2: quickSearchTest2.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/quickSearch.js"> </script> <script type="text/javascript"> var quicksearch = new QuickSearch(); quicksearch.setColumns( 12 ); quicksearch.setLabel( "Go!" ); quicksearch.write(); </script> Example 3: quickSearchTest3.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/quickSearch.js"> </script> <script type="text/javascript"> var url = "http://www.bgsu.edu/offices/execvp/"; var name = "Exec VP"; var quicksearch = new QuickSearch( url, name ); quicksearch.setColumns( 10 ); quicksearch.write(); </script> Example 4: quickSearchTest4.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/quickSearch.js"> </script> <script type="text/javascript"> var button = new Image(); button.src = "http://www.bgsu.edu/scripts/quickSearchGo.gif"; var quicksearch = new QuickSearch(); quicksearch.setColumns( 10 ); quicksearch.useImage( button ); quicksearch.write(); </script> Example 5: quickSearchTest5.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/quickSearch.js"> </script> <script type="text/javascript"> var buttonUp = new Image(); buttonUp.src = "http://www.bgsu.edu/scripts/quickSearchUp.gif"; var buttonDown = new Image(); buttonDown.src = "http://www.bgsu.edu/scripts/quickSearchDown.gif"; var quicksearch = new QuickSearch(); quicksearch.setColumns( 12 ); quicksearch.useImages( buttonUp, buttonDown ); quicksearch.setBorder( 0 ); quicksearch.setAlign( "top" ); quicksearch.setTarget( "_blank" ); quicksearch.write(); </script>
File: quicksearch.js Note: This script has been deprecated (use quickSearch.js instead) Insert a BGSU QuickSearch form into the current document Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/quicksearch.js"> </script> Variables: textLength Length of textfield buttonLabel Button label buttonURL URL of custom button searchName Name of special search option searchURL URL of special search option Note: buttonLabel and buttonURL are mutually exclusive. Example 1: quicksearchTest1.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/quicksearch.js"> </script> Example 2: quicksearchTest2.html <script type="text/javascript"> var textLength = 12; var buttonLabel = "Go!"; </script> <script type="text/javascript" src="http://www.bgsu.edu/scripts/quicksearch.js"> </script> Example 3: quicksearchTest3.html <script type="text/javascript"> var searchName = "Firelands"; var searchURL = "http://www.firelands.bgsu.edu/"; </script> <script type="text/javascript" src="http://www.bgsu.edu/scripts/quicksearch.js"> </script> Example 4: quicksearchTest4.html <script type="text/javascript"> var buttonURL = "http://www.bgsu.edu/scripts/quickSearchUp.gif"; </script> <script type="text/javascript" src="http://www.bgsu.edu/scripts/quicksearch.js"> </script> Insert one of these scripts into the <body> of your document.
File: redirect.js Timed redirection Usage: <script type="text/javascript" src="http://www.bgsu.edu/scripts/redirect.js"> </script> Insert the <script> element into the <head> or <body> of your document. Constructor: Redirect( url ) create a Redirect object Methods: delay( secs ) delay the redirect write() write the redirect into the current doc go() start the countdown! Example 1: redirectTest1.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/redirect.js"> </script> <script type="text/javascript"> var redirect = new Redirect( "http://www.bgsu.edu/offices/its/" ); redirect.go(); // redirect NOW! </script> Example 2: redirectTest2.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/redirect.js"> </script> <script type="text/javascript"> var redirect = new Redirect( "http://www.bgsu.edu/offices/president/" ); redirect.delay( 5 ); redirect.go(); // redirect in 5 seconds </script> Example 3: redirectTest3.html <script type="text/javascript" src="http://www.bgsu.edu/scripts/redirect.js"> </script> <!-- Put the following script in the <body> of your document --> <script type="text/javascript"> var redirect = new Redirect( "http://www.bgsu.edu/" ); redirect.delay( 8 ); redirect.write(); redirect.go(); </script>