function activesearch() { // July 17, 2007 - Rommil Santiago // Added a cookie to preserve tab choice // Feb 21, 2007 - Rommil Santiago - rommil.santiago@concordia.ca // Activates the search options // Read from the cookie if it exists /* var searchtabcookie = readCookie('searchtab'); if (searchtabcookie) { document.getElementById('search_selected').setAttribute('name', searchtabcookie); document.getElementById('search_option_list').className = searchtabcookie; } */ //ADDED BY Sothea Nim (snim@alcor.concordia.ca, info@sotheanim.com) //var searchtab_id_list = array( "li_thissite", "li_entire", "li_staff", "li_news", "li_events" ); //for( var i=0; i < searchtab_id_list.length; i++ ) { document.getElementById(searchtab_id_list[i]).href = "#searchoption"; } /* var search_option_list = document.getElementById('search_option_list').getElementsByTagName('li'); for (var i = 0; i < search_option_list.length; i++){ search_option_list[i].getElementsByTagName('a')[0].onclick = function(){ document.getElementById('search_selected').setAttribute('name',this.id); document.getElementById('search_option_list').className = this.id; // Write to cookie to preserve tab choice createCookie('searchtab', document.getElementById('search_option_list').className, 365); }; search_option_list[i].getElementsByTagName('a')[0].href = '#searchoption'; } // Javascript is active - so allow javascript version of Custom Google Search if (document.getElementById("javascript_enabled")){ var js_on = document.getElementById("javascript_enabled"); js_on.setAttribute('value',true); } */ } function queryclick(){ var search_toplevel_query = document.getElementById('search_toplevel_query'); if (search_toplevel_query.value == '') search_toplevel_query.value = 'Enter your Query here'; search_toplevel_query.onclick = function(){ this.value=''; this.onclick = function(){return false;}; } } function queryclick_media(){ if (document.getElementById('expertsearch_query')){ var expertsearch_query = document.getElementById('expertsearch_query'); if (expertsearch_query.value == '') expertsearch_query.value = 'Enter a Phrase or Keyword'; expertsearch_query.onclick = function(){ this.value=''; this.onclick = function(){return false;}; } } } function queryclick_media_fr(){ if (document.getElementById('expertsearch_query')){ var expertsearch_query = document.getElementById('expertsearch_query'); if (expertsearch_query.value == '') expertsearch_query.value = 'Entrer le mot-clŽ en anglais'; expertsearch_query.onclick = function(){ this.value=''; this.onclick = function(){return false;}; } } } function breakawaynav_arrows(){ if (document.getElementById('breakawaynav')){ var bodyclasses = document.body.className.split(' '); for (var i = 1; i < bodyclasses.length; i++){ if (document.getElementById(bodyclasses[i])){ var target = document.getElementById(bodyclasses[i]).getElementsByTagName("a")[0]; target.className = "list_header_link"; var last_target = target; } } } if (last_target){ if (last_target.parentNode.getElementsByTagName("ul").length == 0) last_target.className="list_header_link active_with_no_arrow"; else last_target.className="list_header_link active_with_arrow"; } } function tablelinks(){ var table; var tablelinksexist = document.getElementsByTagName("table"); var tablenumber = tablelinksexist.length; var j; if (tablenumber > 0){ for (table = 0; table < tablenumber; table ++){ if (tablelinksexist[table].className == 'expertlist'){ var row = tablelinksexist[table].getElementsByTagName("tr"); for (j = 0; j < row.length; j++){ if (row[j].className == 'vcard expertentry'){ row[j].onclick = function(){window.open(this.getElementsByTagName("td")[0].getElementsByTagName("a")[0].href,"_self");} } } } } } } function populateForm (netname, first, last, email, extension, perm) { if( netname == '' || netname == null) { alert("Netname must be provided"); return; } if(chkValid(perm) == false) { alert("Please select permissions"); return; } document.userform.netname.value = netname; document.userform.firstname.value = first; document.userform.lastname.value = last; document.userform.email.value = email; document.userform.extension.value = extension; document.userform.access.options[perm].selected = true; } function chkValid(strString) { var strValidChars = "012"; var strChar; var blnResult = true; if (strValidChars.indexOf(strString) == -1){ blnResult = false; } return blnResult; } function myVoid() { } function myOpen(URL,properties) { windowHandle = window.open(URL,'address_display',properties); if (!windowHandle.opener) windowHandle.opener=self; windowHandle.focus(); } function showbookmarks(){ if (window.external || window.sidebar || window.opera) { if (document.getElementById('bookmark')){ var bookmark = document.getElementById('bookmark'); bookmark.className = 'show'; } } } function bookmark(url,title){ if (window.sidebar) { window.sidebar.addPanel(title,url,""); }else if (window.external) { window.external.AddFavorite(url,title); }else{ alert("Please use CTRL-D to bookmark"); } } function alternateRows(){ if (tables = document.getElementsByTagName("table")){ for (var counter = 0; counter < tables.length; counter ++){ var tableclass = tables[counter].className.split(' '); for (var j = 0; j < tableclass.length; j++){ if (tableclass[j] == 'zebra'){ var rows = document.getElementsByTagName("tr"); for (i = 0; i < rows.length; i++){ if (i % 2 == 1){ rows[i].className = "lowlight"; }else{ rows[i].className = "highlight"; } // Make things clickable here if (rows_href = rows[i].firstChild.firstChild){ rows[i].onclick = function(){ window.open(this.firstChild.firstChild.getAttribute("href"),"_self"); }; } }//for } }//for } // tables for }//if }//function function homebutton(){ if(homebutton = document.getElementById("concordialogo")){ homebutton.onmouseover = function(){ homebutton.className = "homebutton_ie6"; } homebutton.onmouseout = function(){ homebutton.className = "homebutton_ie6_off"; } } } // Cross-browser implementation of element.addEventListener() function addListener(element, type, expression, bubbling){ bubbling = bubbling || false; if(window.addEventListener) { // Standard element.addEventListener(type, expression, bubbling); return true; } else if(window.attachEvent) { // IE element.attachEvent('on' + type, expression); return true; } else return false; } //This is what i want to do whenever someone clicks on the page function itHappened(evt){ //Get the clicket element var tg = (window.event) ? evt.srcElement : evt.target; //If it is an A element if(tg.nodeName == 'A'){ //And it is not an internal link if(tg.href.indexOf(location.host) == -1){ //Replace all odd characters, so that it works with Analytics Niavgation analysis var url = tg.href.replace(/[^a-z|A-Z]/g, "_"); var thisURL = document.location.href.replace(/[^a-z|A-Z]/g, "_"); var txt = tg.innerHTML.replace(/[^a-z|A-Z]/g, "_"); var str = '?targetURL=' + url + '&sourceURL=' + thisURL + '&LinkTEXT=' + txt + '&startDATE=052708_1523&outgoinglink=true'; try{ //Track it if (document.getElementById("pageTracker")) pageTracker._trackPageview(str); if (document.getElementById("pageTracker_central")) centralTracking._trackPageview(str); } catch(err){ //alert('error: ' + err); } } } } addListener(document, 'click', itHappened); // Parse the URL function URL(url){ if(url.length==0) eval('throw "Invalid URL ['+url+'];'); this.url=url; this.port=-1; this.query=(this.url.indexOf('?')>=0)?this.url.substring(this.url.indexOf('?')+1):''; if(this.query.indexOf('#')>=0) this.query=this.query.substring(0,this.query.indexOf('#')); this.protocol=''; this.host=''; var protocolSepIndex=this.url.indexOf('://'); if(protocolSepIndex>=0){ this.protocol=this.url.substring(0,protocolSepIndex).toLowerCase(); this.host=this.url.substring(protocolSepIndex+3); if(this.host.indexOf('/')>=0) this.host=this.host.substring(0,this.host.indexOf('/')); var atIndex=this.host.indexOf('@'); if(atIndex>=0){ var credentials=this.host.substring(0,atIndex); var colonIndex=credentials.indexOf(':'); if(colonIndex>=0){ this.username=credentials.substring(0,colonIndex); this.password=credentials.substring(colonIndex); }else{ this.username=credentials; } this.host=this.host.substring(atIndex+1); } var portColonIndex=this.host.indexOf(':'); if(portColonIndex>=0){ this.port=this.host.substring(portColonIndex); this.host=this.host.substring(0,portColonIndex); } this.file=this.url.substring(protocolSepIndex+3); this.file=this.file.substring(this.file.indexOf('/')); }else{ this.file=this.url; } if(this.file.indexOf('?')>=0) this.file=this.file.substring(0, this.file.indexOf('?')); var refSepIndex=url.indexOf('#'); if(refSepIndex>=0){ this.file=this.file.substring(0,refSepIndex); this.reference=this.url.substring(this.url.indexOf('#')); }else{ this.reference=''; } this.path=this.file; if(this.query.length>0) this.file+='?'+this.query; if(this.reference.length>0) this.file+='#'+this.reference; this.getPort=getPort; this.getQuery=getQuery; this.getProtocol=getProtocol; this.getHost=getHost; this.getUserName=getUserName; this.getPassword=getPassword; this.getFile=getFile; this.getReference=getReference; this.getPath=getPath; this.getArgumentValue=getArgumentValue; this.getArgumentValues=getArgumentValues; this.toString=toString; /* Returns the port part of this URL, i.e. '8080' in the url 'http://server:8080/' */ function getPort(){ return this.port; } /* Returns the query part of this URL, i.e. 'Open' in the url 'http://server/?Open' */ function getQuery(){ return this.query; } /* Returns the protocol of this URL, i.e. 'http' in the url 'http://server/' */ function getProtocol(){ return this.protocol; } /* Returns the host name of this URL, i.e. 'server.com' in the url 'http://server.com/' */ function getHost(){ return this.host; } /* Returns the user name part of this URL, i.e. 'joe' in the url 'http://joe@server.com/' */ function getUserName(){ return this.username; } /* Returns the password part of this url, i.e. 'secret' in the url 'http://joe:secret@server.com/' */ function getPassword(){ return this.password; } /* Returns the file part of this url, i.e. everything after the host name. */ function getFile(){ return this.file; } /* Returns the reference of this url, i.e. 'bookmark' in the url 'http://server/file.html#bookmark' */ function getReference(){ return this.reference; } /* Returns the file path of this url, i.e. '/dir/file.html' in the url 'http://server/dir/file.html' */ function getPath(){ return this.path; } /* Returns the FIRST matching value to the specified key in the query. If the url has a non-value argument, like 'Open' in '?Open&bla=12', this method returns the same as the key: 'Open'... The url must be correctly encoded, ampersands must encoded as & I.e. returns 'value' if the key is 'key' in the url 'http://server/?Open&key=value' */ function getArgumentValue(key){ var a=this.getArgumentValues(); if(a.length<1) return ''; for(i=0;i, MIT Style License. var MooTools={version:'1.11'};function $defined(obj){return(obj!=undefined);};function $type(obj){if(!$defined(obj))return false;if(obj.htmlElement)return'element';var type=typeof obj;if(type=='object'&&obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}} if(type=='object'||type=='function'){switch(obj.constructor){case Array:return'array';case RegExp:return'regexp';case Class:return'class';} if(typeof obj.length=='number'){if(obj.item)return'collection';if(obj.callee)return'arguments';}} return type;};function $merge(){var mix={};for(var i=0;i-1:this.indexOf(string)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,'\\$1');}});Array.extend({rgbToHex:function(array){if(this.length<3)return false;if(this.length==4&&this[3]==0&&!array)return'transparent';var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?'0'+bit:bit);} return array?hex:'#'+hex.join('');},hexToRgb:function(array){if(this.length!=3)return false;var rgb=[];for(var i=0;i<3;i++){rgb.push(parseInt((this[i].length==1)?this[i]+this[i]:this[i],16));} return array?rgb:'rgb('+rgb.join(',')+')';}});Function.extend({create:function(options){var fn=this;options=$merge({'bind':fn,'event':false,'arguments':null,'delay':false,'periodical':false,'attempt':false},options);if($chk(options.arguments)&&$type(options.arguments)!='array')options.arguments=[options.arguments];return function(event){var args;if(options.event){event=event||window.event;args=[(options.event===true)?event:new options.event(event)];if(options.arguments)args.extend(options.arguments);} else args=options.arguments||arguments;var returns=function(){return fn.apply($pick(options.bind,fn),args);};if(options.delay)return setTimeout(returns,options.delay);if(options.periodical)return setInterval(returns,options.periodical);if(options.attempt)try{return returns();}catch(err){return false;};return returns();};},pass:function(args,bind){return this.create({'arguments':args,'bind':bind});},attempt:function(args,bind){return this.create({'arguments':args,'bind':bind,'attempt':true})();},bind:function(bind,args){return this.create({'bind':bind,'arguments':args});},bindAsEventListener:function(bind,args){return this.create({'bind':bind,'event':true,'arguments':args});},delay:function(delay,bind,args){return this.create({'delay':delay,'bind':bind,'arguments':args})();},periodical:function(interval,bind,args){return this.create({'periodical':interval,'bind':bind,'arguments':args})();}});Number.extend({toInt:function(){return parseInt(this);},toFloat:function(){return parseFloat(this);},limit:function(min,max){return Math.min(max,Math.max(min,this));},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;},times:function(fn){for(var i=0;i';} el=document.createElement(el);} el=$(el);return(!props||!el)?el:el.set(props);}});var Elements=new Class({initialize:function(elements){return(elements)?$extend(elements,this):this;}});Elements.extend=function(props){for(var prop in props){this.prototype[prop]=props[prop];this[prop]=$native.generic(prop);}};function $(el){if(!el)return null;if(el.htmlElement)return Garbage.collect(el);if([window,document].contains(el))return el;var type=$type(el);if(type=='string'){el=document.getElementById(el);type=(el)?'element':false;} if(type!='element')return null;if(el.htmlElement)return Garbage.collect(el);if(['object','embed'].contains(el.tagName.toLowerCase()))return el;$extend(el,Element.prototype);el.htmlElement=function(){};return Garbage.collect(el);};document.getElementsBySelector=document.getElementsByTagName;function $$(){var elements=[];for(var i=0,j=arguments.length;i0&&fKey<13)this.key='f'+fKey;} this.key=this.key||String.fromCharCode(this.code).toLowerCase();}else if(this.type.test(/(click|mouse|menu)/)){this.page={'x':event.pageX||event.clientX+document.documentElement.scrollLeft,'y':event.pageY||event.clientY+document.documentElement.scrollTop};this.client={'x':event.pageX?event.pageX-window.pageXOffset:event.clientX,'y':event.pageY?event.pageY-window.pageYOffset:event.clientY};this.rightClick=(event.which==3)||(event.button==2);switch(this.type){case'mouseover':this.relatedTarget=event.relatedTarget||event.fromElement;break;case'mouseout':this.relatedTarget=event.relatedTarget||event.toElement;} this.fixRelatedTarget();} return this;},stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this;},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this;}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3)this.relatedTarget=this.relatedTarget.parentNode;},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this);}catch(e){this.relatedTarget=this.target;}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({'enter':13,'up':38,'down':40,'left':37,'right':39,'esc':27,'space':32,'backspace':8,'tab':9,'delete':46});Element.Methods.Events={addEvent:function(type,fn){this.$events=this.$events||{};this.$events[type]=this.$events[type]||{'keys':[],'values':[]};if(this.$events[type].keys.contains(fn))return this;this.$events[type].keys.push(fn);var realType=type;var custom=Element.Events[type];if(custom){if(custom.add)custom.add.call(this,fn);if(custom.map)fn=custom.map;if(custom.type)realType=custom.type;} if(!this.addEventListener)fn=fn.create({'bind':this,'event':true});this.$events[type].values.push(fn);return(Element.NativeEvents.contains(realType))?this.addListener(realType,fn):this;},removeEvent:function(type,fn){if(!this.$events||!this.$events[type])return this;var pos=this.$events[type].keys.indexOf(fn);if(pos==-1)return this;var key=this.$events[type].keys.splice(pos,1)[0];var value=this.$events[type].values.splice(pos,1)[0];var custom=Element.Events[type];if(custom){if(custom.remove)custom.remove.call(this,fn);if(custom.type)type=custom.type;} return(Element.NativeEvents.contains(type))?this.removeListener(type,value):this;},addEvents:function(source){return Element.setMany(this,'addEvent',source);},removeEvents:function(type){if(!this.$events)return this;if(!type){for(var evType in this.$events)this.removeEvents(evType);this.$events=null;}else if(this.$events[type]){this.$events[type].keys.each(function(fn){this.removeEvent(type,fn);},this);this.$events[type]=null;} return this;},fireEvent:function(type,args,delay){if(this.$events&&this.$events[type]){this.$events[type].keys.each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);} return this;},cloneEvents:function(from,type){if(!from.$events)return this;if(!type){for(var evType in from.$events)this.cloneEvents(from,evType);}else if(from.$events[type]){from.$events[type].keys.each(function(fn){this.addEvent(type,fn);},this);} return this;}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({'mouseenter':{type:'mouseover',map:function(event){event=new Event(event);if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseenter',event);}},'mouseleave':{type:'mouseout',map:function(event){event=new Event(event);if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseleave',event);}},'mousewheel':{type:(window.gecko)?'DOMMouseScroll':'mousewheel'}});Element.NativeEvents=['click','dblclick','mouseup','mousedown','mousewheel','DOMMouseScroll','mouseover','mouseout','mousemove','keydown','keypress','keyup','load','unload','beforeunload','resize','move','focus','blur','change','submit','reset','select','error','abort','contextmenu','scroll'];Function.extend({bindWithEvent:function(bind,args){return this.create({'bind':bind,'arguments':args,'event':Event});}});Element.Events.domready={add:function(fn){if(window.loaded){fn.call(this);return;} var domReady=function(){if(window.loaded)return;window.loaded=true;window.timer=$clear(window.timer);this.fireEvent('domready');}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(['loaded','complete'].contains(document.readyState))domReady();}.periodical(50);}else if(document.readyState&&window.ie){if(!$('ie_ready')){var src=(window.location.protocol=='https:')?'://0':'javascript:void(0)';document.write('