/*--------------------------------------------------------------------------------

	iframeReplace pluigin
	Used to control button / iframe replacement

---------------------------------------------------------------------------------*/
(function($){
	$.fn.iframeReplace = function(options){
		   var defaults = {
		   }
		   var options = $.extend(defaults,options);
		   return this.each(function() {
				var obj = $(this); 
				var o=options;
				var src = $(this).attr('href')	
				$(this).parent().css('height','auto')
   				
				$(this).attr('href','javascript:void(0)')
				$(this).parent().append('<iframe frameborder="0" scrolling="no" width="100%" allowtransparency="true" src="'+src+'"  id="dynamic-iframe" > </iframe>')	
				$('#dynamic-iframe').css('display', 'none')

				$(obj).click(function(){
					$(this).css('display', 'none')
					$('#dynamic-iframe').fadeIn()
				})
		   })
	}
})(jQuery);
/*--------------------------------------------------------------------------------

	Multi-feature
	Controls multiple feature banners

---------------------------------------------------------------------------------*/
(function($){
	$.fn.multiFeature = function(options){
		   var defaults = {
				current: 1,
				sideController: false,
				navigationController: true,
				showContent: false,
				autoPlay: true,
				timer: 15000
		   }
		   var options = $.extend(defaults,options);
		   return this.each(function() {
				var obj = $(this); 
				var o=options;
				$('ul:nth-child(1) li',obj).css({'position':'absolute', 'display':'none'})
				if (o.navigationController){
					$(obj).append('<ul class="feature-navigator"></ul>')
					$('ul:nth-child(1) li', obj).each(function(){
						$('ul.feature-navigator').append('<li><a>&bull;</a></li>')
					})
					$('ul.feature-navigator li').click(function(){
						$('ul.feature-navigator li:nth-child('+current+')').removeClass('current')
						$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeOut('slow')
						$('ul:nth-child(1) li:nth-child('+(($(this).index())+1)+')', obj).fadeIn('slow')
						current = ($(this).index())+1
						$('ul.feature-navigator li:nth-child('+current+')').addClass('current')
					})
				}
				$('ul:nth-child(1) li', obj).each(function(x){
					if($(this).find('img').attr('alt')!= null ){
						$('#'+ $(this).find('img').attr('alt').toLowerCase().replace(' ', '-')).css('display','none')
						$(this).parent().parent().parent().height($(this).height())
					}
				})	 
				if (o.sideController){
					if ((obj.parent().attr('class')).indexOf('white')>=1){
						$(obj).parent().append('<a class="next-white-button" id="next-button"></a>')
						$(obj).parent().append('<a class="previous-white-button" id="previous-button"></a>')
	
					} else {
						$(obj).parent().append('<a class="next-black-button" id="next-button"></a>')
						$(obj).parent().append('<a class="previous-black-button" id="previous-button"></a>')
					}
				}
				listLen = ($('ul:nth-child(1) li', obj).length)
				current=o.current
				show(current); 
				
				if(o.autoPlay){
					$(document).everyTime(o.timer, 'controlled', function(){
						if (current>=listLen){
							$('ul.feature-navigator li:nth-child('+current+')').removeClass('current')
							$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeOut('slow')
							current=0;
						}
						next(current)
					})
				}
				
				$('#next-button').click(function(){	
					if (current>=listLen){
						$('ul.feature-navigator li:nth-child('+current+')').removeClass('current')
						$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeOut('slow')
						current=0;
					}
					next(current)
				}) 
				$('#previous-button').click(function(){
					if (current<=1){
						$('ul.feature-navigator li:nth-child('+current+')').removeClass('current')
						$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeOut('slow')
						current=listLen+1
					}
					previous(current)
				})	
				
				function show(i){
					$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeIn('slow')
					if (o.showContent){
						$('#'+$('ul:nth-child(1) li:nth-child('+current+')', obj).find('img').attr('alt').toLowerCase().replace(' ', '-')).fadeIn('slow')
					}
					$('ul.feature-navigator li:nth-child('+current+')').addClass('current')
				}
				function next(i){
					$('ul:nth-child(1) li', obj).each(function(){
						if (o.showContent){
							$('#'+ $(this).find('img').attr('alt').toLowerCase().replace(' ', '-')).css('display','none')		
						}
					})	
					$('ul.feature-navigator li:nth-child('+current+')').removeClass('current')
					$('ul:nth-child(1) li:nth-child('+current+')',obj).fadeOut('slow')
					current++
					$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeIn('slow')
					if (o.showContent){
						$('#'+$('ul:nth-child(1) li:nth-child('+current+')', obj).find('img').attr('alt').toLowerCase().replace(' ', '-')).fadeIn('slow')
					}
					$('ul.feature-navigator li:nth-child('+current+')').addClass('current')
				}		
				function previous(i){
					$('ul li', obj).each(function(){
						if($(this).find('img').attr('alt')!= null ){
							$('#'+ $(this).find('img').attr('alt').toLowerCase().replace(' ', '-')).css('display','none') 		
						}
					})
					$('ul.feature-navigator li:nth-child('+current+')').removeClass('current')
					$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeOut('slow')
					current--
					$('ul:nth-child(1) li:nth-child('+current+')', obj).fadeIn('slow')
					if (o.showContent){
						$('#'+$('ul:nth-child(1) li:nth-child('+current+')', obj).find('img').attr('alt').toLowerCase().replace(' ', '-')).fadeIn('slow')
					}
					$('ul.feature-navigator li:nth-child('+current+')').addClass('current')
				}
		   })
	}
})(jQuery);

/*  
  
  Developed by Danny Famularo - March 2010
  XML Reader for schema outlined below 
  Can be used as a ticker or static feeder.

  <article>
    <title>News article 1</title>
    <url>http://www.google.com.au</url>
    <date>DD-MM-YYYY</date>
    <description>This is a short description of the article</description>
  </article>

  Requirements:
   * jquery.timers-1.2.js 
  Recommended:
   * news-ticker.css 
   
  Usage: 
  $(selector).newsfeeder({url:['urllocation'], target:['_blank'/'_self'], autoplay: [true/false], timer: ['5s'], fadeSpeed: ['slow'/'fast'/2000], navigation: [true/false], results: [0, x]})
*/

(function($){
		$.fn.newsfeeder = function(options){
			   var defaults = {
					url: "/au/_shared/xml/news-feed.xml", //Location of XML file
					target: "_self", // select to open a new window or use existing
					autoplay: true, // Auto scroll items
					timer: '10s', //control time between scroll of item
					fadeSpeed: "slow", //controls speed of transition
					navigation: true, // Turns up down navigation on/off
					ticker: true, //Enables ticker type scrolling
					results: 0 //Specify the number of XML results to return -  0 for all 
			   }
			   var options = $.extend(defaults,options);
			   return this.each(function() {
					var obj = $(this); 
					var o=options;
					
					 $.ajax({
					 type: "GET",
					 url: o.url,
					 dataType: "xml",
					 cache: false,
					 success: function(xml) {
						 //alert('success')
						 if (o.navigation){
							 $(obj).prepend('<div class="cycler"><span class="up"></span><span class="down"></span></div>')
						 }
						 $(obj).append('<ul></ul>')						 
						 var i = 1 //Count Length
						 var pos = 1 //Current Array Position	
						 
						 if (o.results==0){
						 $(xml).find('article').each(function(){
															  
								var title = $(this).find('title').text();
								var url = $(this).find('url').text();
								var date = $(this).find('date').text();
								var description = $(this).find('description').text();
								$('ul', obj).append('<li><span class="title">'+title+'</span></li>')
								$('ul li:nth-child('+i+')', obj).prepend('<span class="date">'+date+'</span>')
								if(url!=''){
									$('ul li:nth-child('+i+') .title', obj).wrapInner('<a href="'+url+'" target='+o.target+'> </a>')
								}
								$('ul li:nth-child('+i+') ', obj).append('<span class="description">' + description + "</span>")
								i++		
							})
						 }else{
							 $(xml).find('article').each(function(){
								if(i<=o.results){
									var title = $(this).find('title').text();
									var url = $(this).find('url').text();
									var date = $(this).find('date').text();
									var description = $(this).find('description').text();
									$('ul', obj).append('<li><span class="title">'+title+'</span></li>')
									$('ul li:nth-child('+i+')', obj).prepend('<span class="date">'+date+'</span>')
									if(url!=''){
										$('ul li:nth-child('+i+') .title', obj).wrapInner('<a href="'+url+'" target='+o.target+'> </a>')
									}
									$('ul li:nth-child('+i+') ', obj).append('<span class="description">' + description + "</span>")
									i++	
								}
							   })							
						 }
						if (o.ticker) {
							for(x=2; x<=i; x++){
								$('ul li:nth-child('+x+')',obj).css('display','none')
							}						
							$('.up', obj).click(function(){
								$('ul li:nth-child('+pos+')',obj).fadeOut(o.fadeSpeed)
								pos--
								$('ul li:nth-child('+pos+')',obj).fadeIn(o.fadeSpeed)
								if (pos==0){
								pos = (i-1)
								$('ul li:nth-child('+pos+')',obj).fadeIn(o.fadeSpeed)
								}
							})
							$('.down', obj).click(function(){
								$('ul li:nth-child('+pos+')',obj).fadeOut(o.fadeSpeed)
								pos++		
								if (pos < i ) {
								$('ul li:nth-child('+pos+')',obj).fadeIn(o.fadeSpeed)
								}
								else {
									pos = 1
									$('ul li:nth-child('+pos+')',obj).fadeIn(o.fadeSpeed)
								}
							})	
						}
						if (o.autoplay){
							$(document).everyTime(o.timer,function(){
								$('ul li:nth-child('+pos+')',obj).fadeOut(o.fadeSpeed)
								pos++		
								if (pos < i ) {
								$('ul li:nth-child('+pos+')',obj).fadeIn(o.fadeSpeed)
								}
								else {
									pos = 1
									$('ul li:nth-child('+pos+')',obj).fadeIn(o.fadeSpeed)
								}
							})
						}
					 },//close success
					 error: function(){
						 //alert('ERROR')
					 }
					}) //close $.ajax(
			   })
		}
	})(jQuery);

/* ----------------------------------------------------------------

	Image/HTML reel plugin
	Controls Awards and logo pages.

-------------------------------------------------------------------*/
(function($){
	$.fn.reel = function(options){	
		   var defaults = {
				resize: 0.6,
				current: 1,
				desaturate: true
		   }
		   var options = $.extend(defaults,options);
		   return this.each(function() {
				var obj = $(this); 
				var o=options;
				var current = o.current;
					$(obj).append('<ul class="selector">')
						$('ul.reel li', obj).each(function (index) {	 //sets up navigator and hides all non current items											
							$(this).css('display','none') 
							$('ul.selector', obj).append('<li><div class="selected"></div><div class="selector-image">' +$(this).html() + '</div></li>')
							$('ul.selector .description').remove()
							
						})
						$('ul.selector li', obj).each(function(){
							$(this).find('img').height($(this).height()*o.resize)
							$(this).find('img').width($(this).width()*o.resize)
							if (o.desaturate == true) {
								$(this).find('img').pixastic('desaturate')
								
							}
						})
						$('ul.selector li', obj).click(function(){
							$('ul.selector li:nth-child('+current+')', obj).removeClass('current')
							current = $(this).index()+1	
							show(current)
						})
						show(current)
						
						function show(i) {
							$('ul.reel li', obj).each(function (){
								$(this).fadeOut('slow') 
							})
							$('ul.reel li:nth-child('+i+')', obj).fadeIn('slow')
							$('ul.selector li:nth-child('+i+')', obj).addClass('current')
						}
		});
	};
})(jQuery);
/* ----------------------------------------------------------------

	Current nav selector
	Applies a current class to the active navigation item

-------------------------------------------------------------------*/
(function($){
		$.fn.current = function(options){
			   var defaults = {
				   
			   }
			   var options = $.extend(defaults,options);
			   return this.each(function() {
					var obj = $(this); 
					var o=options;	
					var urlLocLong = String(window.location); //Get Long URL location - including domain details
					urlLocLong = urlLocLong.toLowerCase(); //convert to Uppercase
					var urlRoot = "/au/";
					var urlRoot = urlRoot.toLowerCase();
					var urlDomain = urlLocLong.indexOf(urlRoot); //Find where the root of the folder starts to remove domain details
					var urlLoc = urlLocLong.substr(urlDomain+(urlRoot.length-1)); //Removes domain details
					var urlFile = urlLoc.lastIndexOf("/") // get the location of the last slash to remove all file details of the URL
					var urlLoc = urlLoc.substr(0,urlFile) // Remove everything after the last forward slash in the URL 
					
					$(obj).children('li').each(function(x){
						var linkLoc = $(this).children('a').attr('href')//.toUpperCase()
						
						var urlLocLen = urlLoc.length + 4
						//console.log(urlLoc +"="+ urlLocLen +" : "+ linkLoc +"="+ linkLocLen)
						if (linkLoc!=null) {
							var linkLocLen = linkLoc.length
							linkLoc = linkLoc.toUpperCase()
							urlLoc = urlLoc.toUpperCase()
							var urlDomain = linkLoc.indexOf('/AU/')
							linkLoc = linkLoc.substr(urlDomain)		
							var linkFile = linkLoc.lastIndexOf("/")
							linkLoc = linkLoc.substr(3,(linkFile-3))
							linkLoc = linkLoc.toUpperCase()
							//console.log($(this).attr('id'))
							if(urlLoc.indexOf(linkLoc)>= 0 ){
								if ($(this).attr('id')!='home') {
									$(this).addClass('current')
								}
								if ($(this).attr('id')=='home') {
									if (urlLocLen == linkLocLen){
										$(this).addClass('current')
									}
								}
							}
						}
					})	
			   })
		}
})(jQuery);

/* ----------------------------------------------------------------

	Navigation builder
	- Formats site north navigation (both first level and second level)
	- Generates west-nav
	- Applies Current class to active navigation items
	- Adds mega menu hover effect.

-------------------------------------------------------------------*/

(function($){
		$.fn.navigation = function(options){
			   var defaults = {}
			   var options = $.extend(defaults,options);
			   return this.each(function() { 
					var obj = $(this); 
					var o=options;	
					
					var urlLocLong = String(window.location); //Get Long URL location - including domain details
					urlLocLong = urlLocLong.toLowerCase(); //convert to Uppercase
					var urlRoot = "/au/";
					var urlRoot = urlRoot.toLowerCase();
					var urlDomain = urlLocLong.indexOf(urlRoot); //Find where the root of the folder starts to remove domain details
					var urlLoc = urlLocLong.substr(urlDomain+(urlRoot.length-1)); //Removes domain details
					var urlFile = urlLoc.lastIndexOf("/") // get the location of the last slash to remove all file details of the URL
					var urlLoc = urlLoc.substr(0,urlFile) // Remove everything after the last forward slash in the URL 
					urlFull = urlLoc.split("/")
					var selectorValue = ""
					

					function show(){
					$(this).children(".sub").fadeIn('fast')
					if ($.browser.msie && $.browser.version.substr(0,1)<7) {
						if (parseInt($(this).find(".sub").css('width')) > 0 ){				
						}else{
							ie6Width = 0
								if($(this).find(".sub").find('.nav').html() != null ) {
									$(this).find(".sub").find('.nav').each(function(){
										ie6Width = ie6Width + $(this).width()+20
									})
									ie6Width = (ie6Width + $(this).find('.intro').width() + $(this).find('.intro').width() + $(this).find('.feature').width())
									$(this).find('.sub').width(ie6Width)
								} 						
							}
						}
					}
					function hide(){
						$(this).children(".sub").fadeOut('fast')
					}
					var config = {
						interval:200,
						sensitivity: 4,
						over: show,
						timeout: 300,
						out: hide
					};
					
					//Turn on double layered navigation & sets up west nav for individual section
					if (urlFull[1]=="individuals" && urlFull.length >= 3 && urlFull[2]!="about-russell") {
						$(".navigation").addClass('two-level')
						$("ul:nth-child(1)", obj).addClass("first-level")
						$(obj).append("<ul class='navigation second-level'></ul>")
						$("ul.second-level",obj).append($(obj).find("#" +urlFull[2]+ " .nav").html())
						$(".west-nav").append("<ul>"+$(".navigation.second-level").find('#'+urlFull[3]).html()+"</ul>")
						if (urlFull.length > 4 ) {
							$(".west-nav").find("#"+urlFull[4]).parent().addClass('expanded')
							$(".west-nav").find("#"+urlFull[4]).css('display','block')
						}
					} else {
						//console.log(urlFull[1])
						var q = 0
						//move indexing of URL forward by one if page URL contains an underscore "_" - for use of directories such as the campaigns directory
						if (urlFull[1].indexOf("_")==0){
							q = 1
						}
						$('.west-nav').append("<ul></ul>")
						$("#"+urlFull[1+q]).find("#"+urlFull[2+q]).find(".nav").each(function(){
							$('.west-nav ul').append($(this).html())
						})
						if (urlFull.length > 3 ) {
							$(".west-nav").find("#"+urlFull[3+q]).parent().addClass('expanded')
							$(".west-nav").find("#"+urlFull[3+q]).css('display','block')
						}						
					} 	
					$("ul:nth-child(1)  ul.nav li ul", obj).remove()
					$("ul.navigation:nth-child(1)", obj).current() 
					$("ul.navigation:nth-child(2)", obj).current() 
					$(".west-nav ul").current() 
					$("li", obj).hoverIntent(config)	
		       })
		}
})(jQuery);



/*
 * jQuery Table Plugin
 * version: 1.1 (26-JAN-2010)
 * author: CREATIVE0809 <trance_creative@mail.ru>
 * 
 * Plugin provide functionality for creating table from multidimensional arrays, and manipulating rows in tables.
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($) {
	$.fn.table = function(options) {
		var defaults = {
			replace : false,
			data : []
		}, opts = $.extend(defaults, options);

		if (typeof opts.data != 'object')
			return this;

		var table = document.createElement('table');

		for ( var row_id in opts.data) {
			if (typeof opts.data[row_id] != 'object')
				continue;

			var row = table.insertRow(-1);

			for ( var col_id in opts.data[row_id]) {
				var col = row.insertCell(-1);
				$(col).html(opts.data[row_id][col_id]);
			}
		}
		this.each((function(opts, table) {
			return function() {
				if (opts.replace)
					$(this).replaceWith(table);
				else
					$(this).html(table);
			};
		})(opts, table));

		return this;
	};

	$.fn.tableInsertRows = function(options) {
		var defaults = {
			replace : false,
			index : -1,
			data : []
		}, opts = $.extend(defaults, options);

		if (typeof opts.data != 'object')
			return this;

		this.each((function(opts) {
			return function() {
				if (this.tagName != 'TABLE' || !opts.data.length)
					return;

				for ( var row_id in opts.data) {
					if (typeof opts.data[row_id] != 'object')
						continue;

					var curr_index;
					if (opts.index != -1) {
						curr_index = row_id * 1 + opts.index;
						if (opts.replace) {
							this.deleteRow(curr_index);
						}
					} else
						curr_index = -1;

					var row = this.insertRow(curr_index);

					for ( var col_id in opts.data[row_id]) {
						var col = row.insertCell(-1);
						$(col).html(opts.data[row_id][col_id]);
					}
				}
			};
		})(opts));

		return this;
	};

	$.fn.tableRemoveRows = function(options) {
		var defaults = {
			from : 0,
			length : 0
		}, opts = $.extend(defaults, options);

		this.each((function(opts) {
			return function() {
				if (this.tagName != 'TABLE')
					return;
				var size = this.rows.length;
				var from = opts.from < 0 ? size - opts.from : opts.from;
				var length = Math.abs(opts.length);

				for ( var row_id = from; row_id < from + length
						&& row_id < size; row_id++)
					this.deleteRow(from);
			};
		})(opts));

		return this;
	};
})(jQuery);



/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 * 
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 *
 * Version: 1.3.1 (05/03/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

(function(b){var m,u,x,g,D,i,z,A,B,p=0,e={},q=[],n=0,c={},j=[],E=null,s=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,S=/[^\.]\.(swf)\s*$/i,H,I=1,k,l,h=false,y=b.extend(b("<div/>")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})},
K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r;
w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+
a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+a+'</span><span id="fancybox-title-right"></span></span>'}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('<div id="fancybox-title" class="'+f+'" />').css({width:d,paddingLeft:c.padding,
paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==
37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a=
j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb",
b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+
"px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding-
20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});
x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*
2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity=
0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("<img />").attr({id:"fancybox-img",
src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f=
"image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false;
return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();
s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';w="";b.each(e.swf,function(r,R){t+='<param name="'+r+'" value="'+R+'"></param>';w+=" "+r+'="'+R+'"'});t+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";m.html(t);
F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div",
u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),u=b('<div id="fancybox-loading"><div></div></div>'),x=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);
D.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),A=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),B=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height",
"document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}};
b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]==
"object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}if(p>q.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-
1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false}
if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,
step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("<div style='overflow:auto'></div>").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+
d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",
easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery);

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
/**
 * jQuery.timers - Timer abstractions for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/10/16
 *
 * @author Blair Mitchelmore
 * @version 1.2
 *
 **/
jQuery.fn.extend({
	everyTime: function(interval, label, fn, times) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.extend({
	timer: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result[2]) {
				var num = parseFloat(result[1]);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times) {
			var counter = 0;
			
			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}
			
			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval < 0)
				return;

			if (typeof times != 'number' || isNaN(times) || times < 0) 
				times = 0;
			
			times = times || 0;
			
			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
			
			if (!timers[label])
				timers[label] = {};
			
			fn.timerID = fn.timerID || this.guid++;
			
			var handler = function() {
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
			};
			
			handler.timerID = fn.timerID;
			
			if (!timers[label][fn.timerID])
				timers[label][fn.timerID] = window.setInterval(handler,interval);
			
			this.global.push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = jQuery.data(element, this.dataKey), ret;
			
			if ( timers ) {
				
				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.timerID ) {
							window.clearInterval(timers[label][fn.timerID]);
							delete timers[label][fn.timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}
					
					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}
				
				for ( ret in timers ) break;
				if ( !ret ) 
					jQuery.removeData(element, this.dataKey);
			}
		}
	}
});
jQuery(window).bind("unload", function() {
	jQuery.each(jQuery.timer.global, function(index, item) {
		jQuery.timer.remove(item);
	});
});

$(document).ready(function() {
	
	if ($('.feature-full .feature-wrapper ul li').html()==null){
		var tagURL = $('.feature-wrapper').find('a').attr('href')
		if (tagURL!=null){
			if (tagURL.indexOf("?")<=0){
				tagURL = tagURL + "?"
			} else {
				tagURL = tagURL + "&"
			}
		}
		$('.feature-wrapper a').attr({
			href: tagURL+'referrer=FeatureBanner'
		})
	} else {
		$.each($('.feature-full .feature-wrapper ul li'),function(){
			var url = $(this).find('a').attr('href')
			if (url!=null){
				if (url.indexOf("?")<=0){
					url = url + "?"
				} else {
					url = url + "&"
				}
			}
			$(this).find('a').attr({
				href: url+'referrer=FeatureBanner'
			})
		})
	}
	
	var urlLocLong = String(window.location); //Get Long URL location - including domain details
	urlLocLong = urlLocLong.toLowerCase(); //convert to Uppercase
	var urlRoot = "/au/";
	var urlRoot = urlRoot.toLowerCase();
	var urlDomain = urlLocLong.indexOf(urlRoot); //Find where the root of the folder starts to remove domain details
	var urlLoc = urlLocLong.substr(urlDomain+(urlRoot.length-1)); //Removes domain details
	var urlFile = urlLoc.lastIndexOf("/") // get the location of the last slash to remove all file details of the URL
	var urlLoc = urlLoc.substr(0,urlFile) // Remove everything after the last forward slash in the URL 
	urlFull = urlLoc.split("/")
	var selectorValue = ""

	if (urlFull.length <= 3){
		for (x=1; x < urlFull.length ;  x++){
			selectorValue = selectorValue +  "#" + urlFull[x] + " "
		}
	} else {
		for (x=1; x < 4 ;  x++){
			selectorValue = selectorValue +  "#" + urlFull[x] + " "
		}		
	}

	$('.north-navigation').navigation()
	if (urlFull.length >2 && urlFull[1]=='individuals'){
		$('a.login').iframeReplace()
	}
	
	$('.content tbody tr:nth-child(odd)').addClass('odd');
	
	// Accordion code insertion
	//snippet to grab variables from the URL using post!
	var getUrlVars = function() {
		var vars = {};
		var parts =
			window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
			function(m,key,value) { 
				vars[key] = value; 
			});
		return vars;
	}
	
	var startImage = getUrlVars()['id'];
		
	if (!startImage) {
		$(".accordion").accordion({autoHeight: false, collapsible: true, icons: {'header': 'ui-icon-down', 'headerSelected': 'ui-icon-up'}});
    	$(".accordion-closed").accordion({autoHeight: false, active: false, collapsible: true, icons: {'header': 'ui-icon-down', 'headerSelected': 'ui-icon-up'}});
	};
	
	var startImage = parseInt(startImage);
	
	if (startImage == 0) {
		$(".accordion").accordion({autoHeight: false, active: false, collapsible: true, icons: {'header': 'ui-icon-down', 'headerSelected': 'ui-icon-up'}});
		$(".accordion-closed").accordion({autoHeight: false, active: false, collapsible: true, icons: {'header': 'ui-icon-down', 'headerSelected': 'ui-icon-up'}});
	} else {
		startImage = startImage - 1;
		$(".accordion").accordion({autoHeight: false, active: startImage, collapsible: true, icons: {'header': 'ui-icon-down', 'headerSelected': 'ui-icon-up'}});
		$(".accordion-closed").accordion({autoHeight: false, active: startImage, collapsible: true, icons: {'header': 'ui-icon-down', 'headerSelected': 'ui-icon-up'}});
	};

// FancyBox code insertion
	$("a.fancy").fancybox({'titlePosition': 'inside'});
	
	$("a.iframe").each(function(){
		$(this).fancybox(
			{
				'type'					:	'iframe',
				'hideOnContentClick'	: 	false,
				'width'					:	650, 
				'height'				:	450, 
				'overlayShow'			:	true,
				'autoScale'         	: 	false
			});
	});

	$(".dynamic").each(function(){
		dwidth = parseInt($(this).attr('href').match(/width=[0-9]+/i)[0].replace('width=',''));
		dheight = parseInt($(this).attr('href').match(/height=[0-9]+/i)[0].replace('height=',''));
		$(this).fancybox(
			{
				'type'					:	'iframe',
				'hideOnContentClick'	: 	false,
				'width'					:	dwidth, 
				'height'				:	dheight, 
				'overlayShow'			:	true,
				'autoScale'         	: 	false
			});
	});


	$("div.content-inner").wrap("<div class='content-wrapper'></div>");
	
// Sized launch code
// Platform selector launch code
	$(".platform form#sortBy input").change(function() {
			$(".platform a.platform").attr("rel", $(this).val());
		}
	);
	
	launchFancybox = function(launchURL) {
		$.fancybox(
			{
			'type'					:	'iframe',
			'padding'				:	0,
			'hideOnContentClick'	: 	false,
			'width'					:	635, 
			'height'				:	550, 
			'overlayShow'			:	true,
			'href'					:	launchURL
			}
		);
	}	
		
	$(".platform a.platform").click(function(event){
		launchURL = "/au/financial-professionals/_shared/platforms/platform.asp?sortBy=" + $(".platform a.platform").attr("rel");
		$.fancybox(
			{

			'type'					:	'iframe',
			'padding'				:	0,
			'hideOnContentClick'	: 	false,
			'width'					:	635, 
			'height'				:	550, 
			'overlayShow'			:	true,
			'href'					:	launchURL
			}
		);
		event.preventDefault();
		}
	);	
	
	//Global current nav assigner  if ($.browser.msie && $.browser.version.substr(0,1)<7) {
	$('.global-nav').children('ul').children('li').each(function(x){
		//if (x>=2 && $.browser.msie == false && $.browser.version.substr(0,1)>7 ){
			var linkLoc = $(this).children('a').attr('href').toUpperCase()
			var urlDomain = linkLoc.indexOf('/AU/')
			linkLoc = linkLoc.substr(urlDomain)									
			var linkFile = linkLoc.lastIndexOf("/")
			linkLoc = linkLoc.substr(0,linkFile)
			linkLoc = linkLoc.toUpperCase()	
			urlLoc = urlLoc.toUpperCase()
			//console.log(('/AU'+urlLoc).indexOf(linkLoc))
			if (('/AU'+urlLoc).indexOf(linkLoc) >= 0 ){
				$(this).addClass('current')
			}
			$('.global-nav').children('ul').children('li.nosplit').each(function(x){
			$(this).removeClass('current')
			})
		//}		
	})
	 
	//font resize
	var fontSizeCount = 0 
	var fontSizeArrayP = ['14px','16px','12px']
	var fontSizeArrayIntro = ['16px','18px','14px']
	$('.content-options .text-resize').click(function(){
		if (fontSizeCount >= 3 ) {fontSizeCount = 0 }
		$('.content.four-col-2 p').css('font-size', fontSizeArrayP[fontSizeCount])
		$('.content.four-col-2 p.intro').css('font-size', fontSizeArrayIntro[fontSizeCount])
		fontSizeCount++
	})
	
	function showRegion(){
		$(this).find('.sub').fadeIn()
	}
	function hideRegion(){
		$(this).find('.sub').fadeOut()
	}
	
	var regionSelector = {
		interval:200,
		sensitivity: 4,
		over: showRegion,
		timeout: 300,
		out: hideRegion
	}
	
	$('.content-options .print').click(function(){
		window.print()
	})
	$('#region-selector').hoverIntent(regionSelector)

 /*SHOW BROWSER ALERT IN IE6 UNLESS THE USER HAS CANCELLED THE NOTIFICAITON*/
 if ($.browser.msie && $.browser.version.substr(0,1)<7) {
 	 $('body').prepend('<div id="ie6warning"> <img src="/AU/_images/system/error.gif" width="15" height="15" alt="Error" />Your browser is no longer supported. Please upgrade to a <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">modern browser</a>.<a href="javascript:void(0)" id="ignore">[Ignore]</a></div>')
	 showAlert = readCookie('ie6browser')
	 if (showAlert == null){
		 $("#ie6warning").animate({
			marginTop: "0px"
		  },2000)
		 $('.nav-fill-left').animate({
			top: "101px"
		 },2000)
		 $('.nav-fill-right').animate({
			top: "101px"
		 },2000) 
	 }
	 $("#ie6warning a#ignore").click(function(){
		 createCookie('ie6browser', 'hide', 100);
		 $("#ie6warning").animate({
			marginTop: "-30px"
		  },2000)
		 $('.nav-fill-left').animate({
			top: "71px"
		 },2000)
		 $('.nav-fill-right').animate({
			top: "71px"
		 },2000) 	 
	 })
  }
  
  // Applies Google tracking to all PDF links within the content-outer container.
  $('.content-outer').find('a').each(function(){
      var href = $(this).attr('href')
	  var href = href.toLowerCase()
	  if (href.indexOf('.pdf')>=1){
		$(this).attr('onClick','pageTracker._trackPageview("'+$(this).attr('href')+'");')
	  }
	  if (href.indexOf('www.yoursupersolution.com.au')>=1){
		 $(this).attr('onClick','pageTracker._trackPageview("'+$(this).attr('href')+'");')
	  }
  })
  
  //Search box functionality
  var focusCount = 0
  $('#cse-search-box input').focus(function(){
	if (focusCount==0){
		$(this).val('')
		$(this).removeClass('inactive')
	}
	focusCount++
  })
  $('#cse-search-box input').blur(function(){
  	if ($(this).val().length==0){
		$(this).val('Enter search here')
		$(this).addClass('inactive')
	}
	focusCount = 0
  })
  
});
