Event.observe(window,'load', outLinks)function outLinks(){	exlinks = $$('external');	exlinks.each(function(s) {  	s.setAttribute('target','_blank');	});}// FORM HANDLERfunction checkForm(e){	thisForm = Event.element(e);	//alert(thisForm);	var error = 'no'	var required = $(thisForm).getElementsByClassName('required');		// Prototype 1.5	//var required = $$('input.required');					// Prototype 1.6 +		$A(required).each(function(n){				myDaddy = n.up();		if (n.next('img') !== undefined) n.next('img').remove();		if ($F(n) == '' || typeof $F(n) == 'undefined'){			new Insertion.After(n,"<img src=\"images/alert.gif\" />");			error = 'yes';		}	});	if (error === 'yes'){		Event.stop(e);		alert("There are one or more errors in your enquiry. Please check the highlighted fields and try again.");	}}/* TABS */if (typeof Effect == 'undefined')	throw("Tabs system requires including script.aculo.us' effects.js library!");	var tabset = Class.create();tabset.prototype = {  tabs:           [],   panels:         [],  showPanel:     null,  currentPanel:  null,    initialize: function(container, options) {    this.options = Object.extend({      classNames: {        tab:        'tab',        panel:      'panel',        tabActive:  'selected'      },      ids: {        tab:        'tab_',        panel:      'panel_'      },      onEvent:      'click',      effects:      true    }, options || {} );        container = $(container);        this.tabs = container.select('.'+this.options.classNames.tab);    this.tabs.each(function(tab) {      Event.observe(tab, this.options.onEvent, this.activate.bind(this, tab), false);    }.bind(this));        this.panels = container.select('.'+this.options.classNames.panel);    this.panels.invoke('hide');  },    activate: function(tab) {    var tabName = tab.id.replace(this.options.ids.tab,'');    this.currentPanel = this.options.ids.panel+tabName;    if (this.showPanel == this.currentPanel) {      return false;    }        if (this.showPanel) {      if (this.options.effects) {        new Effect.Fade(this.showPanel, {queue: 'front'});      } else {        $(this.currentPanel).hide();      }    }        if (this.options.effects) {      new Effect.Appear(this.currentPanel, {queue: 'end'});    } else {      $(this.showPanel).show();    }    this.tabs.invoke('removeClassName', this.options.classNames.tabActive);    tab.addClassName(this.options.classNames.tabActive);    this.showPanel = this.currentPanel;  },    getHash: function() {    var hash = window.location.hash;    return hash.substring(1); // remove #  },    autoActivate: function(tab) {    var canDoAuto = false;    var hash = this.getHash();    if (hash) {      var autoTab = $(this.options.ids.tab+hash);      if (autoTab) {        this.activate(autoTab);        canDoAuto = true;      }    }    if (!canDoAuto && tab) {      this.activate(tab);    }  }}/* Admin Functions */function approveCounsel(id){	var url = 'counselajx.php';	var pars = 'cmd=approve&id='+id;	var target='counsel-'+id;		var myProcess = new Ajax.Updater (	target,	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);	}function denyCounsel(id){	var url = 'counselajx.php';	var pars = 'cmd=delete&id='+id;	var target='counsel-'+id;		var myProcess = new Ajax.Updater (	target,	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);		}function killMe(id){	var kill = 'counsel-'+id	Effect.Fade(kill);}// SLIDESHOWfunction slider() {var container = $('slider');var showtime = 3; // secondsvar slides = container.childElements();slides.invoke('addClassName','slide');slides[0].addClassName('currentSlide');slides[1].addClassName('nextSlide');slides[0].fade({delay:showtime, afterFinish: NextSlide});function NextSlide(eff) {	var slide = eff.element.next();	if(slide == null)	{slide = eff.element.up().down();}	// previous slide is no longer current	eff.element.removeClassName('currentSlide');	eff.element.removeClassName('nextSlide');		// current slide is current and no longer next	slide.addClassName('currentSlide');	slide.removeClassName('nextSlide');	// next slide	var next = slide.next();	if( next == null ){ next = slide.up().down(); }	next.style.display='';	next.addClassName('nextSlide');		slide.fade({delay:showtime, afterFinish: NextSlide});}}
