PageSourceSearch

https://dab-bd.org/Layout/2008-September/Resources/js/uon-scripts.js

js dab-bd.org collected 2026-10-02 06:07:49 UTC 45,635 bytes, 892 lines download raw bytes

1/* 
2 * ====================================
3 * = CMS2 Javascripts =
4 * ====================================
5 * Authors: jp231, djr145, ama612
6 * Changelog:
7 *  1.0 (jp231):  Initial revision.
8 *  1.1 (djr145): Added menu function calls to onDomReady.
9 *				  Fixed Mootools 1.0 compatibilty for SearchBar.
10 *				  Modified SearchBar to allow output to work with moonu.js
11 *	2.0	(djr145): Completely re-written, using a different approach to work with YUI library.
12 *				  Built using an array of 'search options', array is populated using a standard select box.
13 *  2.0.1 (ama612): Added context path variable, and modified call to server resource to use this.
14 *	2.1 (djr145): Removed dynamic generation of search drop down.
15 *				  Fixed problem with form action not being assigned in IE.  
16 *	2.2 (djr145): Added NEWCAT support, code proposed by OM660
17 *	3.0 (djr145): Bringing all UoN scripts into one file, major code optimisation and cleanup.
18 *				  Menu code rebuilt from YUI examples.
19 *	3.0.1 (djr145): Fix for slideshow flicker problem. Ticket #582
20 *	3.0.2 (djr145): Fix for the 'null' links in slideshow. Ticket #775
21 *	4.0 (2008-May) : Rebuilt the menus to work with YUI 2.5.0, again from YUI examples (djr145)
22 *	                 Rewrote Searchbar code. (jp231)
23 *	4.1 (djr145): New version of slideshow script to handle text-based slides. It is backwards compatible.
24 *	4.1.1 (djr145): Changes to SearchBar for new staff directory
25 *	4.2 (djr145): Addtional Slide show scripts to handle "random" slideshows
26 *	4.3 (djr145): Adding optional onclick link tracking to slideshows
27 */
28
29
30/** ContextPath Variable - Contains the location of the server context (Set by Layout Engine) */
31var ContextPath;
32/* Setup the var for slideshow link tracking */
33var enableLinkTracking;
34
35var UoN;
36if (!UoN) UoN = { VERSION: '2008-May' };
37
38/** Dollar-sign function: Quick access to document.getElementById() */
39var $;
40if (!$) $ = function(e) { return document.getElementById(e) };
41
42/** Searchbar Code */
43new function(){
44
45	var DOM = YAHOO.util.Dom;
46	var EVENT = YAHOO.util.Event;
47	var ELEMENT = YAHOO.util.Element;
48	var ATTRIBUTE = YAHOO.util.Attribute;
49
50	UoN.SearchBar = {
51		init: function() {
52			this.container = $('global_searchBar');
53			this.form = $('searchForm');
54			this.query = $('SearchBarQuery');
55			this.query.name = 'q';
56			//this.sitesearch = $('SearchBarSiteSearch');
57			this.menu = $('global_searchMenu_menu');
58			this.menuTip = $('searchMenuTip');
59			EVENT.addListener(this.query, 'focus', this.focus);
60			EVENT.addListener(this.query, 'blur', this.blur);
61			var elems = this.menu.getElementsByTagName('a');
62			for (i=0;i<elems.length;i++) {
63				elems[i].onclick=this.selectItem;
64				if (elems[i].parentNode.className.indexOf('active') != -1) this.selected = elems[i].parentNode;
65			}
66		},
67
68		focus: function() {
69			DOM.addClass(UoN.SearchBar.container,'Selected');
70			var q = UoN.SearchBar.query;
71			q.focus();
72			if(q.value == 'Search') { q.value = ''; } else { q.select(); }
73		},
74
75		blur: function() { DOM.removeClass(UoN.SearchBar.container,'Selected'); },
76		setAction: function(action) { UoN.SearchBar.form.action = action; },
77		setMenuTip: function(tip) { UoN.SearchBar.menuTip.firstChild.data = tip; },
78		setQueryParam: function(q) { UoN.SearchBar.query.name = q; },
79		//setSubSiteSearch: function(ss) { UoN.SearchBar.sitesearch.value = ss; },
80
81		selectItem: function() {
82			var link = this;
83			var linkText = link.firstChild.data;
84			if (UoN.SearchBar.selected) DOM.removeClass(UoN.SearchBar.selected,'active');
85			UoN.SearchBar.selected = link.parentNode;
86			DOM.addClass(UoN.SearchBar.selected,'active');
87			UoN.SearchBar.setAction(link.href);
88			UoN.SearchBar.setMenuTip(linkText);
89			if (linkText=='NEWCAT') {
90				UoN.SearchBar.setQueryParam('search');
91			} else if (linkText=='University Website' || linkText=='Staff Directory') {
92				UoN.SearchBar.setQueryParam('q');
93			} else {
94				UoN.SearchBar.setQueryParam('query');
95			}
96			// if (linkText=='Staff Directory') { UoN.SearchBar.setSubSiteSearch('www.newcastle.edu.au/staff/directory/'); } else { UoN.SearchBar.setSubSiteSearch(''); }
97			UoN.SearchBar.focus();
98			return false;
99		}
100	};
101	YAHOO.util.Event.onContentReady("global_searchBar", function() { UoN.SearchBar.init() });
102};
103
104/**
105 * YUI Menu Initialisation
106 */
107
108/* Main Menu */
109YAHOO.util.Event.onContentReady("global_mainMenu_container", function () {
110	var oMenuBar = new YAHOO.widget.MenuBar("global_mainMenu_container", { autosubmenudisplay: true, showdelay: 0, hidedelay: 750, lazyload: true, effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: 0.1 } } );
111	oMenuBar.render();
112});
113
114
115/* Homepage Side Menu */
116/*YAHOO.util.Event.onContentReady("global_sideMenu_container", function () {
117	var oMenu = new YAHOO.widget.Menu("global_sideMenu_container", { position: "static", showdelay: 0, hidedelay: 750, lazyload: true, effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: 0.1 } } );
118	oMenu.render();
119});*/
120
121/* Quicklinks Menu */
122YAHOO.util.Event.onContentReady("global_quicklinksMenu_menu", function () {
123	YAHOO.util.Dom.addClass(document.getElementById('quickLinksTip'),'showQuickLinks'); //only show quicklinks if JS is enabled
124	var oMenu = new YAHOO.widget.Menu("global_quicklinksMenu_menu", { context:['quickLinksTip','tl','bl'], effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: 0.1 } } );
125	oMenu.render();
126	oMenu.subscribe("show", oMenu.focus);
127	YAHOO.util.Event.addListener("quickLinksTip", "click", oMenu.show, null, oMenu);
128});
129
130/* Search Menu */
131YAHOO.util.Event.onContentReady("global_searchMenu_menu", function () {
132	YAHOO.util.Dom.addClass(document.getElementById('searchMenuTip'),'showImage');
133	var oMenu = new YAHOO.widget.Menu("global_searchMenu_menu", { context:['searchMenuTip','tl','bl'], effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: 0.1 } } );
134	oMenu.render();
135	oMenu.subscribe("show", oMenu.focus);
136	YAHOO.util.Event.addListener("searchMenuTip", "click", oMenu.show, null, oMenu);
137});
138
139/* Subpage Side Menu */
140sideMenuAccordion = function() {
141	var oOptions= { dependent:false, openedIds:[], seconds:0.2, animation:true };
142	var setting = new AccordionMenu.setting('subpage_sideMenu',oOptions);
143};
144YAHOO.util.Event.onContentReady("sideMenu_accordion", sideMenuAccordion);
145
146
147/* Slideshow */
148var UoNSlide = new function() {
149
150	var currSlide = -1;
151
152	this.scrollSlides = function(){
153		removeInitial();
154		container = $('slideShow');
155		images = container.getElementsByTagName('li');
156		qlength = images.length;
157		ilength = imageList.length;
158		images[0].className = "slide visible";
159		images[1].className = "slide hidden";
160		if(typeof imageList[0] == 'object'){
161			if(urlList[0]==null){
162				slide1 = "<a href='#' id='firstLink' style='cursor:default'";
163				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
164				slide1 += "><div class='textSlide "+imageList[0].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[0].bigText+"</div><div class='mediumText'>"+imageList[0].mediumText+"</div><div class='smallText'>"+imageList[0].smallText+"</div></div></div></a>";
165			} else {
166				slide1 = "<a href='"+urlList[0]+"' id='firstLink' style='cursor:pointer'";
167				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
168				slide1 += "><div class='textSlide "+imageList[0].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[0].bigText+"</div><div class='mediumText'>"+imageList[0].mediumText+"</div><div class='smallText'>"+imageList[0].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
169			}
170		} else {
171			if(urlList[0]==null){
172				slide1 = "<a href='#' id='firstLink' style='cursor:default'";
173				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
174				slide1 += "><img src='"+imageList[0]+"' id='firstImage'/></a>";
175			} else {
176				slide1 = "<a href='"+urlList[0]+"' id='firstLink' style='cursor:pointer'";
177				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
178				slide1 += "><img src='"+imageList[0]+"' id='firstImage'/></a>";
179			}	
180		}
181		$('firstSlide').innerHTML = slide1;
182		if(typeof imageList[1] == 'object'){
183			if(urlList[1]==null){
184				slide2 = "<a href='#' id='secondLink' style='cursor:default'";
185				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
186				slide2 += "><div class='textSlide "+imageList[1].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[1].bigText+"</div><div class='mediumText'>"+imageList[1].mediumText+"</div><div class='smallText'>"+imageList[1].smallText+"</div></div></div></a>";
187			} else {
188				slide2 = "<a href='"+urlList[1]+"' id='secondLink' style='cursor:pointer'";
189				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
190				slide2 += "><div class='textSlide "+imageList[1].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[1].bigText+"</div><div class='mediumText'>"+imageList[1].mediumText+"</div><div class='smallText'>"+imageList[1].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
191			}
192		} else {
193			if(urlList[1]==null){
194				slide2 = "<a href='#' id='secondLink' style='cursor:default'";
195				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
196				slide2 += "><img src='"+imageList[1]+"' id='secondImage'/></a>";
197			} else {
198				slide2 = "<a href='"+urlList[1]+"' id='secondLink' style='cursor:pointer'";
199				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
200				slide2 += "><img src='"+imageList[1]+"' id='secondImage'/></a>";
201			}
202		}
203		$('secondSlide').innerHTML = slide2;
204		makeFlipper();
205		rotateInterval = setInterval("UoNSlide.rotate()",6000);
206	};
207
208	this.rotate = function(){
209		if(currSlide==ilength-1){
210			currSlide = 0;
211			nextSlide = 1;
212			if(ilength<3) { plusSlide = 0; } else { plusSlide = 2; }
213		} else {
214			currSlide = currSlide+1;
215			if(currSlide==ilength-1){
216				nextSlide = 0;
217				plusSlide = 1;
218			} else {
219				nextSlide = currSlide+1;
220				if(nextSlide+1==ilength) { plusSlide = 0; } else { plusSlide = nextSlide+1; }
221			}
222		}
223		activeFlip(nextSlide);
224		if(images[0].className == "slide visible") {
225			images[1].className = "slide visible";
226			if(currSlide==0) { YAHOO.util.Dom.setStyle(images[1],'opacity', 0); }
227			var attributes = { opacity: { from: 0, to: 1 } };
228			var anim = new YAHOO.util.ColorAnim('secondSlide', attributes);
229			anim.animate();
230			var onAnimationComplete = function(){
231				images[1].className = "slide visible";
232				images[0].className = "slide hidden";
233				if(typeof imageList[plusSlide] == 'object'){
234					if(urlList[plusSlide]==null){
235						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
236						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
237						slide1 += "><div class='textSlide "+imageList[plusSlide].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[plusSlide].bigText+"</div><div class='mediumText'>"+imageList[plusSlide].mediumText+"</div><div class='smallText'>"+imageList[plusSlide].smallText+"</div></div></div></a>";
238					} else {
239						slide1 = "<a href='"+urlList[plusSlide]+"' id='firstLink' style='cursor:pointer'";
240						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
241						slide1 += "><div class='textSlide "+imageList[plusSlide].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[plusSlide].bigText+"</div><div class='mediumText'>"+imageList[plusSlide].mediumText+"</div><div class='smallText'>"+imageList[plusSlide].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
242					}
243				} else {
244					if(urlList[plusSlide]==null){
245						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
246						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
247						slide1 += "><img src='"+imageList[plusSlide]+"' id='firstImage'/></a>";
248					} else {
249						slide1 = "<a href='"+urlList[plusSlide]+"' id='firstLink' style='cursor:pointer'";
250						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
251						slide1 += "><img src='"+imageList[plusSlide]+"' id='firstImage'/></a>";
252					}
253				}
254				$('firstSlide').innerHTML = slide1;
255			};
256			anim.onComplete.subscribe(onAnimationComplete);	
257		} else {
258			images[0].className = "slide visible";
259			var attributes2 = { opacity: { from: 1, to: 0 } };
260			var anim2 = new YAHOO.util.ColorAnim('secondSlide', attributes2);
261			anim2.animate();
262			var onAnimationComplete2 = function(){
263				images[1].className = "slide hidden";
264				if(typeof imageList[plusSlide] == 'object'){
265					if(urlList[plusSlide]==null){
266						slide2 = "<a href='#' id='secondLink' style='cursor:default'";
267						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
268						slide2 += "><div class='textSlide "+imageList[plusSlide].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[plusSlide].bigText+"</div><div class='mediumText'>"+imageList[plusSlide].mediumText+"</div><div class='smallText'>"+imageList[plusSlide].smallText+"</div></div></div></a>";
269					} else {
270						slide2 = "<a href='"+urlList[plusSlide]+"' id='secondLink' style='cursor:pointer'";
271						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
272						slide2 += "><div class='textSlide "+imageList[plusSlide].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[plusSlide].bigText+"</div><div class='mediumText'>"+imageList[plusSlide].mediumText+"</div><div class='smallText'>"+imageList[plusSlide].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
273					}
274				} else {
275					if(urlList[plusSlide]==null){
276						slide2 = "<a href='#' id='secondLink' style='cursor:default;'";
277						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
278						slide2 += "><img src='"+imageList[plusSlide]+"' id='secondImage'/></a>"; 
279					} else {
280						slide2 = "<a href='"+urlList[plusSlide]+"' id='secondLink' style='cursor:pointer;'";
281						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
282						slide2 += "><img src='"+imageList[plusSlide]+"' id='secondImage'/></a>";
283					}
284				}
285				$('secondSlide').innerHTML = slide2;
286			};
287			anim2.onComplete.subscribe(onAnimationComplete2);	
288		}
289	};
290
291	var activeFlip = function(x){
292		flipperX = $('flipper');
293		flips = flipperX.getElementsByTagName('a');
294		for(z=0;z<flips.length;z++){
295			if(x==z){
296				flips[z].className = "active";
297			} else {
298				flips[z].className = "";
299			}
300		}	
301	};
302
303	var makeFlipper = function() {
304		ilength = imageList.length;
305		for(x=0;x<ilength;x++){ $('flipper').innerHTML += "<li><a onclick=\"UoNSlide.skip("+x+");\">&nbsp;</a></li>"; }
306		activeFlip(0);
307	};
308
309	this.skip = function(x) {
310		clearInterval(rotateInterval);
311		activeFlip(x);
312		p = x+1;
313		if(p==ilength){ p=0; }
314		if(images[1].className == "slide visible") {
315			if(typeof imageList[x] == 'object'){
316				if(urlList[x]==null){
317					slide1 = "<a href='#' id='firstLink' style='cursor:default'";
318					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
319					slide1 += "><div class='textSlide "+imageList[x].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[x].bigText+"</div><div class='mediumText'>"+imageList[x].mediumText+"</div><div class='smallText'>"+imageList[x].smallText+"</div></div></div></a>";
320				} else {
321					slide1 = "<a href='"+urlList[x]+"' id='firstLink' style='cursor:pointer'";
322					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
323					slide1 += "><div class='textSlide "+imageList[x].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[x].bigText+"</div><div class='mediumText'>"+imageList[x].mediumText+"</div><div class='smallText'>"+imageList[x].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
324				}
325			} else {
326				if(urlList[x]==null){
327					slide1 = "<a href='#' id='firstLink' style='cursor:default'";
328					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
329					sldie1 += "><img src='"+imageList[x]+"' id='firstImage'/></a>";
330				} else {
331					slide1 = "<a href='"+urlList[x]+"' id='firstLink' style='cursor:pointer'";
332					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
333					slide1 += "><img src='"+imageList[x]+"' id='firstImage'/></a>";
334				}
335			}
336			$('firstSlide').innerHTML = slide1;
337			var attributess1 = { opacity: { from: 1, to: 0 } };
338			var anims1 = new YAHOO.util.ColorAnim('secondSlide', attributess1);
339			anims1.animate();
340			var onAnimationCompleteS1 = function(){
341				images[1].className = "slide hidden";
342				images[0].className = "slide visible";
343				if(typeof imageList[p] == 'object'){
344					if(urlList[p]==null){
345						slide2 = "<a href='#' id='secondLink' style='cursor:default'";
346						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
347						slide2 += "><div class='textSlide "+imageList[p].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[p].bigText+"</div><div class='mediumText'>"+imageList[p].mediumText+"</div><div class='smallText'>"+imageList[p].smallText+"</div></div></div></a>";
348					} else {
349						slide2 = "<a href='"+urlList[p]+"' id='secondLink' style='cursor:pointer'";
350						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
351						slide2 += "><div class='textSlide "+imageList[p].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[p].bigText+"</div><div class='mediumText'>"+imageList[p].mediumText+"</div><div class='smallText'>"+imageList[p].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
352					}
353				} else {
354					if(urlList[p]==null){
355						slide2 = "<a href='#' id='secondLink' style='cursor:default;'";
356						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
357						slide2 += "><img src='"+imageList[p]+"' id='secondImage'/></a>";
358					} else {
359						slide2 = "<a href='"+urlList[p]+"' id='secondLink' style='cursor:pointer;'";
360						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
361						slide2 += "><img src='"+imageList[p]+"' id='secondImage'/></a>";
362					}
363				}
364				$('secondSlide').innerHTML = slide2;
365			};
366			anims1.onComplete.subscribe(onAnimationCompleteS1);
367		} else {
368			images[1].className = "slide visible";
369			images[0].className = "slide hidden";
370			if(typeof imageList[x] == 'object'){
371				if(urlList[x]==null){
372					slide2 = "<a href='#' id='secondLink' style='cursor:default'";
373					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
374					slide2 += "><div class='textSlide "+imageList[x].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[x].bigText+"</div><div class='mediumText'>"+imageList[x].mediumText+"</div><div class='smallText'>"+imageList[x].smallText+"</div></div></div></a>";
375				} else {
376					slide2 = "<a href='"+urlList[x]+"' id='secondLink' style='cursor:pointer'";
377					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
378					slide2 += "><div class='textSlide "+imageList[x].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[x].bigText+"</div><div class='mediumText'>"+imageList[x].mediumText+"</div><div class='smallText'>"+imageList[x].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
379				}
380			} else {
381				if(urlList[x]==null){
382					slide2 = "<a href='#' id='secondLink' style='cursor:default;'";
383					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
384					slide2 += "><img src='"+imageList[x]+"' id='secondImage'/></a>";
385				} else {
386					slide2 = "<a href='"+urlList[x]+"' id='secondLink' style='cursor:pointer;'";
387					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
388					slide2 += "><img src='"+imageList[x]+"' id='secondImage'/></a>";
389				}
390			}
391			$('secondSlide').innerHTML = slide2;
392			var attributess2 = { opacity: { from: 0, to: 1 } };
393			var anims2 = new YAHOO.util.ColorAnim('secondSlide', attributess2);
394			anims2.an
394imate();
395			var onAnimationCompleteS2 = function(){
396				if(typeof imageList[p] == 'object'){
397					if(urlList[p]==null){
398						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
399						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
400						slide1 += "><div class='textSlide "+imageList[p].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[p].bigText+"</div><div class='mediumText'>"+imageList[p].mediumText+"</div><div class='smallText'>"+imageList[p].smallText+"</div></div></div></a>";
401					} else {
402						slide1 = "<a href='"+urlList[p]+"' id='firstLink' style='cursor:pointer'";
403						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
404						slide1 += "><div class='textSlide "+imageList[p].slideStyle+"'><div class='textWrapper'><div class='bigText'>"+imageList[p].bigText+"</div><div class='mediumText'>"+imageList[p].mediumText+"</div><div class='smallText'>"+imageList[p].smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
405					}
406				} else {
407					if(urlList[p]==null){
408						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
409						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
410						slide1 += "><img src='"+imageList[p]+"' id='firstImage'/></a>";
411					} else {
412						slide1 = "<a href='"+urlList[p]+"' id='firstLink' style='cursor:pointer'";
413						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
414						slide1 += "><img src='"+imageList[p]+"' id='firstImage'/></a>";
415					}
416				}
417				$('firstSlide').innerHTML = slide1;
418			};
419			anims2.onComplete.subscribe(onAnimationCompleteS2);
420		}
421		rotateInterval = setInterval("UoNSlide.rotate()",6000);
422	};
423	var removeInitial = function() {
424		var x = YAHOO.util.Dom.get('slideshowInitialImage');
425		x.parentNode.removeChild(x);
426	};
427};
428
429
430/* Slideshow */
431var RandomUoNSlide = new function() {
432
433	var currSlide = -1;
434	var slideList = [];
435
436	this.scrollSlides = function(){
437		RandomUoNSlide.removeInitial();
438		
439		/** setup new slideList objects **/
440		for(s=0;s<imageList.length;s++) {
441			slideList[s] = new Object();
442			slideList[s].image = imageList[s];
443			slideList[s].url = urlList[s];
444		}
445		slideList.sort(function(a,b){
446			return (Math.round(Math.random())-0.5);
447		});
448		/** end - set up new slideList objects **/
449
450		container = $('slideShow');
451		images = container.getElementsByTagName('li');
452		qlength = images.length;
453		ilength = slideList.length;
454		images[0].className = "slide visible";
455		images[1].className = "slide hidden";
456		if(typeof slideList[0].image == 'object'){
457			if(slideList[0].url==null){
458				slide1 = "<a href='#' id='firstLink' style='cursor:default'";
459				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
460				slide1 += "><div class='textSlide "+slideList[0].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[0].image.bigText+"</div><div class='mediumText'>"+slideList[0].image.mediumText+"</div><div class='smallText'>"+slideList[0].image.smallText+"</div></div></div></a>";
461			} else {
462				slide1 = "<a href='"+slideList[0].url+"' id='firstLink' style='cursor:pointer'";
463				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
464				slide1 += "><div class='textSlide "+slideList[0].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[0].image.bigText+"</div><div class='mediumText'>"+slideList[0].image.mediumText+"</div><div class='smallText'>"+slideList[0].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
465			}
466		} else {
467			if(slideList[0].url==null){
468				slide1 = "<a href='#' id='firstLink' style='cursor:default'";
469				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
470				slide1 += "><img src='"+slideList[0].image+"' id='firstImage'/></a>";
471			} else {
472				slide1 = "<a href='"+slideList[0].url+"' id='firstLink' style='cursor:pointer'";
473				if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
474				slide1 += "><img src='"+slideList[0].image+"' id='firstImage'/></a>";
475			}	
476		}
477		$('firstSlide').innerHTML = slide1;
478		if(typeof slideList[1].image == 'object'){
479			if(slideList[1].url==null){
480				slide2 = "<a href='#' id='secondLink' style='cursor:default'";
481				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
482				slide2 += "><div class='textSlide "+slideList[1].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[1].image.bigText+"</div><div class='mediumText'>"+slideList[1].image.mediumText+"</div><div class='smallText'>"+slideList[1].image.smallText+"</div></div></div></a>";
483			} else {
484				slide2 = "<a href='"+slideList[1].url+"' id='secondLink' style='cursor:pointer'";
485				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
486				slide2 += "><div class='textSlide "+slideList[1].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[1].image.bigText+"</div><div class='mediumText'>"+slideList[1].image.mediumText+"</div><div class='smallText'>"+slideList[1].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
487			}
488		} else {
489			if(slideList[1].url==null){
490				slide2 = "<a href='#' id='secondLink' style='cursor:default'";
491				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
492				slide2 += "><img src='"+slideList[1].image+"' id='secondImage'/></a>";
493			} else {
494				slide2 = "<a href='"+slideList[1].url+"' id='secondLink' style='cursor:pointer'";
495				if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
496				slide2 += "><img src='"+slideList[1].image+"' id='secondImage'/></a>";
497			}
498		}
499		$('secondSlide').innerHTML = slide2;
500		RandomUoNSlide.makeFlipper();
501		rotateInterval = setInterval("RandomUoNSlide.rotate()",6000);
502	};
503
504	this.rotate = function(){
505		if(currSlide==ilength-1){
506			currSlide = 0;
507			nextSlide = 1;
508			if(ilength<3) { plusSlide = 0; } else { plusSlide = 2; }
509		} else {
510			currSlide = currSlide+1;
511			if(currSlide==ilength-1){
512				nextSlide = 0;
513				plusSlide = 1;
514			} else {
515				nextSlide = currSlide+1;
516				if(nextSlide+1==ilength) { plusSlide = 0; } else { plusSlide = nextSlide+1; }
517			}
518		}
519		RandomUoNSlide.activeFlip(nextSlide);
520		if(images[0].className == "slide visible") {
521			images[1].className = "slide visible";
522			if(currSlide==0) { YAHOO.util.Dom.setStyle(images[1],'opacity', 0); }
523			var attributes = { opacity: { from: 0, to: 1 } };
524			var anim = new YAHOO.util.ColorAnim('secondSlide', attributes);
525			anim.animate();
526			var onAnimationComplete = function(){
527				images[1].className = "slide visible";
528				images[0].className = "slide hidden";
529				if(typeof slideList[plusSlide].image == 'object'){
530					if(slideList[plusSlide].url==null){
531						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
532						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
533						slide1 += "><div class='textSlide "+slideList[plusSlide].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[plusSlide].image.bigText+"</div><div class='mediumText'>"+slideList[plusSlide].image.mediumText+"</div><div class='smallText'>"+slideList[plusSlide].image.smallText+"</div></div></div></a>";
534					} else {
535						slide1 = "<a href='"+slideList[plusSlide].url+"' id='firstLink' style='cursor:pointer'";
536						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
537						slide1 += "><div class='textSlide "+slideList[plusSlide].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[plusSlide].image.bigText+"</div><div class='mediumText'>"+slideList[plusSlide].image.mediumText+"</div><div class='smallText'>"+slideList[plusSlide].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
538					}
539				} else {
540					if(slideList[plusSlide].url==null){
541						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
542						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
543						slide1 += "><img src='"+slideList[plusSlide].image+"' id='firstImage'/></a>";
544					} else {
545						slide1 = "<a href='"+slideList[plusSlide].url+"' id='firstLink' style='cursor:pointer'";
546						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
547						slide1 += "><img src='"+slideList[plusSlide].image+"' id='firstImage'/></a>";
548					}
549				}
550				$('firstSlide').innerHTML = slide1;
551			};
552			anim.onComplete.subscribe(onAnimationComplete);	
553		} else {
554			images[0].className = "slide visible";
555			var attributes2 = { opacity: { from: 1, to: 0 } };
556			var anim2 = new YAHOO.util.ColorAnim('secondSlide', attributes2);
557			anim2.animate();
558			var onAnimationComplete2 = function(){
559				images[1].className = "slide hidden";
560				if(typeof slideList[plusSlide].image == 'object'){
561					if(slideList[plusSlide].url==null){
562						slide2 = "<a href='#' id='secondLink' style='cursor:default'";
563						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
564						slide2 += "><div class='textSlide "+slideList[plusSlide].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[plusSlide].image.bigText+"</div><div class='mediumText'>"+slideList[plusSlide].image.mediumText+"</div><div class='smallText'>"+slideList[plusSlide].image.smallText+"</div></div></div></a>";
565					} else {
566						slide2 = "<a href='"+slideList[plusSlide].url+"' id='secondLink' style='cursor:pointer'";
567						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
568						slide2 += "><div class='textSlide "+slideList[plusSlide].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[plusSlide].image.bigText+"</div><div class='mediumText'>"+slideList[plusSlide].image.mediumText+"</div><div class='smallText'>"+slideList[plusSlide].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
569					}
570				} else {
571					if(slideList[plusSlide].url==null){
572						slide2 = "<a href='#' id='secondLink' style='cursor:default;'";
573						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
574						slide2 += "><img src='"+slideList[plusSlide].image+"' id='secondImage'/></a>"; 
575					} else {
576						slide2 = "<a href='"+slideList[plusSlide].url+"' id='secondLink' style='cursor:pointer;'";
577						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
578						slide2 += "><img src='"+slideList[plusSlide].image+"' id='secondImage'/></a>";
579					}
580				}
581				$('secondSlide').innerHTML = slide2;
582			};
583			anim2.onComplete.subscribe(onAnimationComplete2);	
584		}
585	};
586
587	this.activeFlip = function(x){
588		flipperX = $('flipper');
589		flips = flipperX.getElementsByTagName('a');
590		for(z=0;z<flips.length;z++){
591			if(x==z){
592				flips[z].className = "active";
593			} else {
594				flips[z].className = "";
595			}
596		}	
597	};
598
599	this.makeFlipper = function() {
600		ilength = slideList.length;
601		for(x=0;x<ilength;x++){ $('flipper').innerHTML += "<li><a onclick=\"RandomUoNSlide.skip("+x+");\">&nbsp;</a></li>"; }
602		RandomUoNSlide.activeFlip(0);
603	};
604
605	this.skip = function(x) {
606		clearInterval(rotateInterval);
607		RandomUoNSlide.activeFlip(x);
608		p = x+1;
609		if(p==ilength){ p=0; }
610		if(images[1].className == "slide visible") {
611			if(typeof slideList[x].image == 'object'){
612				if(slideList[x].url==null){
613					slide1 = "<a href='#' id='firstLink' style='cursor:default'";
614					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
615					slide1 += "><div class='textSlide "+slideList[x].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[x].image.bigText+"</div><div class='mediumText'>"+slideList[x].image.mediumText+"</div><div class='smallText'>"+slideList[x].image.smallText+"</div></div></div></a>";
616				} else {
617					slide1 = "<a href='"+slideList[x].url+"' id='firstLink' style='cursor:pointer'";
618					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
619					slide1 += "><div class='textSlide "+slideList[x].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[x].image.bigText+"</div><div class='mediumText'>"+slideList[x].image.mediumText+"</div><div class='smallText'>"+slideList[x].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
620				}
621			} else {
622				if(slideList[x].url==null){
623					slide1 = "<a href='#' id='firstLink' style='cursor:default'";
624					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
625					slide1 += ">
625<img src='"+slideList[x].image+"' id='firstImage'/></a>";
626				} else {
627					slide1 = "<a href='"+slideList[x].url+"' id='firstLink' style='cursor:pointer'";
628					if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
629					slide1 += "><img src='"+slideList[x].image+"' id='firstImage'/></a>";
630				}
631			}
632			$('firstSlide').innerHTML = slide1;
633			var attributess1 = { opacity: { from: 1, to: 0 } };
634			var anims1 = new YAHOO.util.ColorAnim('secondSlide', attributess1);
635			anims1.animate();
636			var onAnimationCompleteS1 = function(){
637				images[1].className = "slide hidden";
638				images[0].className = "slide visible";
639				if(typeof slideList[p].image == 'object'){
640					if(slideList[p].url==null){
641						slide2 = "<a href='#' id='secondLink' style='cursor:default'";
642						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
643						slide2 += "><div class='textSlide "+slideList[p].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[p].image.bigText+"</div><div class='mediumText'>"+slideList[p].image.mediumText+"</div><div class='smallText'>"+slideList[p].image.smallText+"</div></div></div></a>";
644					} else {
645						slide2 = "<a href='"+slideList[p].url+"' id='secondLink' style='cursor:pointer'";
646						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
647						slide2 += "><div class='textSlide "+slideList[p].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[p].image.bigText+"</div><div class='mediumText'>"+slideList[p].image.mediumText+"</div><div class='smallText'>"+slideList[p].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
648					}
649				} else {
650					if(slideList[p].url==null){
651						slide2 = "<a href='#' id='secondLink' style='cursor:default;'";
652						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
653						slide2 += "><img src='"+slideList[p].image+"' id='secondImage'/></a>";
654					} else {
655						slide2 = "<a href='"+slideList[p].url+"' id='secondLink' style='cursor:pointer;'";
656						if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
657						slide2 += "><img src='"+slideList[p].image+"' id='secondImage'/></a>";
658					}
659				}
660				$('secondSlide').innerHTML = slide2;
661			};
662			anims1.onComplete.subscribe(onAnimationCompleteS1);
663		} else {
664			images[1].className = "slide visible";
665			images[0].className = "slide hidden";
666			if(typeof slideList[x].image == 'object'){
667				if(slideList[x].url==null){
668					slide2 = "<a href='#' id='secondLink' style='cursor:default'";
669					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
670					slide2 += "><div class='textSlide "+slideList[x].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[x].image.bigText+"</div><div class='mediumText'>"+slideList[x].image.mediumText+"</div><div class='smallText'>"+slideList[x].image.smallText+"</div></div></div></a>";
671				} else {
672					slide2 = "<a href='"+slideList[x].url+"' id='secondLink' style='cursor:pointer'";
673					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
674					slide2 += "><div class='textSlide "+slideList[x].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[x].image.bigText+"</div><div class='mediumText'>"+slideList[x].image.mediumText+"</div><div class='smallText'>"+slideList[x].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
675				}
676			} else {
677				if(slideList[x].url==null){
678					slide2 = "<a href='#' id='secondLink' style='cursor:default;'";
679					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
680					slide2 += "><img src='"+slideList[x].image+"' id='secondImage'/></a>";
681				} else {
682					slide2 = "<a href='"+slideList[x].url+"' id='secondLink' style='cursor:pointer;'";
683					if(enableLinkTracking=='true') { slide2 += " onClick='recordSlideshowLink(this);'"; }
684					slide2 += ">
684<img src='"+slideList[x].image+"' id='secondImage'/></a>";
685				}
686			}
687			$('secondSlide').innerHTML = slide2;
688			var attributess2 = { opacity: { from: 0, to: 1 } };
689			var anims2 = new YAHOO.util.ColorAnim('secondSlide', attributess2);
690			anims2.animate();
691			var onAnimationCompleteS2 = function(){
692				if(typeof slideList[p].image == 'object'){
693					if(slideList[p].url==null){
694						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
695						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
696						slide1 += "><div class='textSlide "+slideList[p].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[p].image.bigText+"</div><div class='mediumText'>"+slideList[p].image.mediumText+"</div><div class='smallText'>"+slideList[p].image.smallText+"</div></div></div></a>";
697					} else {
698						slide1 = "<a href='"+slideList[p].url+"' id='firstLink' style='cursor:pointer'";
699						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
700						slide1 += "><div class='textSlide "+slideList[p].image.slideStyle+"'><div class='textWrapper'><div class='bigText'>"+slideList[p].image.bigText+"</div><div class='mediumText'>"+slideList[p].image.mediumText+"</div><div class='smallText'>"+slideList[p].image.smallText+"</div><div class='clickMore'>&gt; Click here for more info</div></div></div></a>";
701					}
702				} else {
703					if(slideList[p].url==null){
704						slide1 = "<a href='#' id='firstLink' style='cursor:default'";
705						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
706						slide1 += "><img src='"+slideList[p].image+"' id='firstImage'/></a>";
707					} else {
708						slide1 = "<a href='"+slideList[p].url+"' id='firstLink' style='cursor:pointer'";
709						if(enableLinkTracking=='true') { slide1 += " onClick='recordSlideshowLink(this);'"; }
710						slide1 += "><img src='"+slideList[p].image+"' id='firstImage'/></a>";
711					}
712				}
713				$('firstSlide').innerHTML = slide1;
714			};
715			anims2.onComplete.subscribe(onAnimationCompleteS2);
716		}
717		rotateInterval = setInterval("RandomUoNSlide.rotate()",6000);
718	};
719	this.removeInitial = function() {
720		var x = YAHOO.util.Dom.get('slideshowInitialImage');
721		x.parentNode.removeChild(x);
722	};
723};
724
725/* Accordion Scripts */
726newsAccordion = function() {
727	var oOptions = { openedIds:['newsItemTitle-1'], seconds:0.2, animation:true }; var setting = new AccordionMenu.setting('news-dl',oOptions);
728};
729YAHOO.util.Event.onContentReady("news_accordion", newsAccordion);
730
731eventsAccordion = function() {
732	var oOptions = { openedIds:['eventItemTitle-1'], seconds:0.2, animation:true };
733	var setting = new AccordionMenu.setting('events-dl',oOptions);
734};
735YAHOO.util.Event.onContentReady("events_accordion", eventsAccordion);
736
737sideMenuAccordion = function() {
738	var oOptions = { dependent:false, openedIds:[], seconds:0.2, animation:true };
739	var setting = new AccordionMenu.setting('subpage_sideMenu',oOptions);
740};
741YAHOO.util.Event.onContentReady("sideMenu_accordion", sideMenuAccordion);
742
743promoAccordion = function() {
744	var oOptions = { openedIds:[], seconds:0.2, animation:true };
745	var setting = new AccordionMenu.setting('promo-dl',oOptions);
746};
747YAHOO.util.Event.onContentReady("promo_accordion", promoAccordion);
748
749/* 
750 * ====================================
751 * = Form Functions =
752 * ====================================
753 * Authors: djr145
754 * Changelog:
755 *  1.0 (djr145):  	Initial revision.
756 *					Handles the focus/blur styles for the forms
757 *  1.1 (djr145):   Added the tableRowFunction
758 * 
759 */
760
761/*	
762 *	This function runs through the form and sets the onfocus and onblur actions
763 *	which handle the highlighting of the current form field.
764 */
765formFunction = function() {
766	var root = document.getElementById(this.id);
767	var input = root.getElementsByTagName('input');
768	var select = root.getElementsByTagName('select');
769	var textarea = root.getElementsByTagName('textarea');
770	function rowfocus(e, y) {
771		if(y.type == "checkbox" || y.type == "radio") {
772			YAHOO.util.Dom.addClass(y.parentNode.parentNode.parentNode.parentNode, "focus");
773		} else {
774			YAHOO.util.Dom.addClass(y.parentNode, "focus");
775		}
776	}
777	function rowblur(e, y) {
778		if(y.type == "checkbox" || y.type == "radio") {
779			YAHOO.util.Dom.removeClass(y.parentNode.parentNode.parentNode.parentNode, "focus");
780		} else {
781			YAHOO.util.Dom.removeClass(y.parentNode, "focus");
782		}
783	}
784	for(var x=0;x<input.length;x++) {
785		YAHOO.util.Event.addListener(input[x], "focus", rowfocus, input[x]);
786		YAHOO.util.Event.addListener(input[x], "blur", rowblur, input[x]);
787	}
788	for(var x=0;x<select.length;x++) {
789		YAHOO.util.Event.addListener(select[x], "focus", rowfocus, select[x]);
790		YAHOO.util.Event.addListener(select[x], "blur", rowblur, select[x]);
791	}
792	for(var x=0;x<textarea.length;x++) {
793		YAHOO.util.Event.addListener(textarea[x], "focus", rowfocus, textarea[x]);
794		YAHOO.util.Event.addListener(textarea[x], "blur", rowblur, textarea[x]);
795	}
796};
797
798getForm = function() {
799	var formId = YAHOO.util.Dom.getElementsByClassName('formStyle','form');
800	for(var x=0;x<formId.length;x++) { YAHOO.util.Event.onContentReady(formId[x].id, formFunction); }
801};
802YAHOO.util.Event.onDOMReady(getForm);
803
804rowcheck = function(y) { if(y.checked) { rowfocus(y); } else { rowblur(y); } };
805
806rowfocus = function(y) {
807	if(y.type == "checkbox" || y.type == "radio") {
808		YAHOO.util.Dom.addClass(y.parentNode.parentNode, "selected");
809	} else {
810		YAHOO.util.Dom.addClass(y.parentNode, "selected");
811	}
812};
813
814rowblur = function(y) {
815	if(y.type == "checkbox" || y.type == "radio") {
816		YAHOO.util.Dom.removeClass(y.parentNode.parentNode, "selected");
817	} else {
818		YAHOO.util.Dom.removeClass(y.parentNode, "selected");
819	}
820};
821
822selectall = function(x) {
823	var checks = document.forms[0];
824	if(x.checked) {
825		for(var i = 1; i < checks.length; i++) {
826			checks[i].checked = true;
827			YAHOO.util.Dom.addClass(checks[i].parentNode.parentNode, "selected");
828		};
829	} else {
830		for(var i=0;i<checks.length;i++) {
831			checks[i].checked = false;
832			YAHOO.util.Dom.removeClass(checks[i].parentNode.parentNode, "selected");
833		};
834	}
835};
836
837tableRowFunction = function() {
838	var root = document.getElementById(this.id);
839	var input = root.getElementsByTagName('input');
840	function rowcheck(e, y) { if(y.checked) { rowfocus(e,y); } else { rowblur(e,y); } }
841	function rowfocus(e, y) {
842		if(y.type == "checkbox" || y.type == "radio") {
843			YAHOO.util.Dom.addClass(y.parentNode.parentNode.parentNode, "selected");
844		} else {
845			YAHOO.util.Dom.addClass(y.parentNode, "selected");
846		}
847	}
848	function rowblur(e, y) {
849		if(y.type == "checkbox" || y.type == "radio") {
850			YAHOO.util.Dom.removeClass(y.parentNode.parentNode.parentNode, "selected");
851		} else {
852			YAHOO.util.Dom.removeClass(y.parentNode, "selected");
853		}
854	}
855	for(var x=0;x<input.length;x++) { YAHOO.util.Event.addListener(input[x], "click", rowcheck, input[x]); }
856};
857
858getTable = function() {
859	var tableId = YAHOO.util.Dom.getElementsByClassName('tableSelect','table');
860	for(var x=0;x<tableId.length;x++) { YAHOO.util.Event.onContentReady(tableId[x].id, tableRowFunction); }
861};
862YAHOO.util.Event.onDOMReady(getTable);
863
864// tiles, normal links
865function recordOutboundLink(category,link) {
866	try {
867		var pageTracker=_gat._getTracker("UA-306795-1");
868		pageTracker._trackEvent(category, link);
869		var pageTracker2=_gat._getTracker("UA-18648026-1");
870		pageTracker2._trackEvent(category, link);
871		setTimeout('document.location = "' + link + '"', 100)
872	}catch(err){}
873}
874// slideshows only
875function recordSlideshowLink(t) {
876	try {
877		if(t.href.indexOf('http://newcastle.edu.au')!=-1 || t.href.indexOf('http://www.newcastle.edu.au')!=-1) {
878			if(t.pathname.substring(0,1) == '/') {
879				the_link = t.pathname;
880			} else {
881				the_link = '/'+t.pathname;
882			}
883		} else {
884			the_link = t.href;
885		}
886		var pageTracker=_gat._getTracker("UA-306795-1");
887		pageTracker._trackEvent('Slideshow - '+window.location.pathname, the_link);
888		var pageTracker2=_gat._getTracker("UA-18648026-1");
889		pageTracker2._trackEvent('Slideshow - '+window.location.pathname, the_link);
890		setTimeout('document.location = "' + t.href + '"', 100)
891	}catch(err){}
892}

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.