jQuery.fn.activeXOverlap = function() {   
        $(this).each(function(i){  
                var h   = $(this).outerHeight();  
                var w   = $(this).outerWidth();  
                var iframe  = '<!--[if IE 6]>' +  '<iframe src="javascript:false;" style="height: ' +  h +  'px; width: ' +  w +  'px" class="selectOverlap">' +  '</iframe>' + '<![endif]-->'  
                $(this).prepend(iframe);  
        });  
} 


$(function() {
    $('.PE_dropDown').activeXOverlap();
});


function hasJS(){
	$("body").addClass("hasJS");
}

function popup(){
	var els=Twicommon.fuzzyClassName("a","popup:");
	for (var i=0;i<els.length;i++)	{
		els[i].onclick = function ()
		{
			this.removeAttribute("target");
			var cc=this.className;var cs=cc.substr(cc.indexOf("popup:")+6,cc.length);
                var dma=(cs.substr(1,cs.indexOf(")")-1)).split(",");
				var extras="";

			window.open(this.href+extras,'popupwindow','width='+dma[0]+',height='+dma[1]+',resizable=1,scrollbars=1,true,true');
			return false;
		}
	}
}

function navSelect(){
	var navItems= $(".mainNav li");
	if($(navItems).length !== 0){
		var sectionName = $("body").attr("rel");
		var relId = "#" + sectionName;
		$(relId).addClass("active");
	}
}



var Twidata = {
	flashPath : "flash/",
	flashPlayer : "flash/player-viral.swf",
	flashType : {
		flashVideo : {
			height : 480,
			width : 640
		}
	},
	videoOptions : {
		params : {allowScriptAccess : "sameDomain", wmode: "transparent", allowFullScreen: "true"},
		attributes : null
	}
};

var Twidgets = {
        equalColumns: function(){
		
		
                var sectionCont = $(".otherSections");
				
		
                
                $(sectionCont).each(function(){
                        var columns = $(".section", this);
                        var colheight= 0;
						
					
                        
                        for(k=0; k<$(columns).length; k++){
                                var elHeight = $(columns[k]).height();
                                if(colheight < elHeight){
                                        colheight = elHeight;
                                }
                             
                        }
                        
                        $(columns).each(function(){
                                $(".borderMod",this).css("height",colheight);
                        })
                        
                })
        
        },      
        
 //header dropdown
 dropDowns: function(){
     var dropDownLinks = $(".PE_hasDropDown");
     
     if(dropDownLinks.length > 0 ){
         $(dropDownLinks).each(function(){
             var dropHeight = $(".PE_dropDown", this).height();
             $(".PE_dropDown", this).removeClass("hidden");
             $(".PE_dropDown", this).css("height", 0);
             var dropContainer = $(".PE_dropDown", this);
             var toggleLink = $(".PE_dropLink", this);
             $(this).hover(
                 function(){
                     $(dropContainer).animate({height: dropHeight});
                     $(toggleLink).addClass("dropped");
                     $(dropContainer).css({"left": "0"});
                 },
                 function(){
                     $(dropContainer).animate({height: 0});
                     $(toggleLink).removeClass("dropped");
                     $(dropContainer).css({"left": "-9999em"});
                 }
             )
         })
     }
 },
 
 //Carousel
 carousel: function(){
     if($(".carouselContainer").length !== 0){
                 var carouselNumbers = $(".carouselContainer");
                 
                 //configurable options for each of the carousel
                 //$(".carousel01 .carouselContent").css("height", 100);
                 
                 
                 //general set up 
                 $(".carouselContent ul").css("position", "absolute");
                 $(".alternateControls").css("display", "block");
                 
                 $(carouselNumbers).each(function(){
                     //setting up carousel's static values
                     var carouselWidth = $(".carouselContent", this).css("width");					
                     var carouselItems = $(".carouselContent .item", this);
                 
                     var initialHeight = $(carouselItems[0]).height();
                     $(".carouselContent", this).css("height", initialHeight);
                     
                     var itemWidth = parseInt(carouselWidth);
                     var carouselSpeed = 600;
                     var fadeValue = 0;
                     
                     var carouselItems = $(".carouselContent li", this);
                     var containerWidth = carouselItems.length * itemWidth;
                     $(".carouselContent ul", this).css("width",containerWidth);
                     var finalXpos = itemWidth - containerWidth;
                     
                     //create controls
                     var cControls = $(".controls", this);		
                     var cBack = document.createElement("a");
                     $(cBack).attr( {
                         href: "#"
                     });
                     $(cBack).addClass("left");
                     cControls[0].appendChild(cBack);
                     var lArrow = document.createElement("span");
                     $(lArrow).text("< Go left");
                     cBack.appendChild(lArrow);
                     
                     var cFrwd = document.createElement("a");
                     $(cFrwd).attr( {
                         href: "#"
                     } );
                     $(cFrwd).addClass("right");
                     cControls[0].appendChild(cFrwd);
                     var rArrow = document.createElement("span");
                     $(rArrow).text("Go right >");
                     cFrwd.appendChild(rArrow);
                     
                     //Assigning the current carousel
                     var currentCarousel = $(".carouselContent ul", this);
                     var currentCarouselContent = $(".carouselContent", this);
                     var rightButton = $(".right", this);
                     var leftButton = $(".left", this);
                     var alternateControlItems = $('.alternateControls li a', this);
                     var alternateControl = $('.alternateControls', this);
                     
                     //Setting default opacity to the left button
                     $(leftButton).fadeTo("slow", fadeValue);
                     $(rightButton).fadeTo("slow", 1.0);
                     
                     //Alternate controls to the carousel
                     $(alternateControlItems).click(function tabCont(event) {
                           // if the ul is already moving, then do nothing
                           if ($(".carouselContent ul:animated").length > 0)return false; 
                      
                           var clicked_item = $(event.target);			  
                           var current_active = $(".active", alternateControl);
                          
                           var current_index = $(".active", alternateControl).attr("rel");			  
                           var new_index = $(clicked_item).attr("rel");
                           
                           var move = new_index; // get how many items it should be moved
                           var contentIndex = move-1;
                      
                           if (new_index != current_index) {
                             var moveValue = "-" + (itemWidth*(move -1));
                             
                             $(currentCarousel).animate({left: moveValue}, carouselSpeed);
                             
                             var newHeight = $(carouselItems[contentIndex]).height();
                             $(currentCarouselContent).animate( { height:newHeight}, carouselSpeed );
                             
                             clicked_item.addClass("active");
                             current_active.removeClass("active");
                             
                             if(new_index == carouselItems.length){
                                 $(rightButton).fadeTo("slow", fadeValue);
                                 $(leftButton).fadeTo("slow", 1.0);
                             }
                             else if (new_index == 1){
                                 $(leftButton).fadeTo("slow", fadeValue);
                                 $(rightButton).fadeTo("slow", 1.0);
                             }
                             else {
                                 $(rightButton).fadeTo("slow", 1.0);
                                 $(leftButton).fadeTo("slow", 1.0);
                             }				
                             return false
                           }		 
                           return false;
                         });
                     
                     //Assigning function for right controls
                     $(rightButton).click(			
                         function goRight(){				
                             $(leftButton).fadeTo("slow", 1.0);
                             if ($(".carouselContent ul:animated").length > 0)return false;
                             var currentXpos = $(currentCarousel).css("left");
 
                             var currentX = parseInt(currentXpos);
                             
                             if(currentX !== finalXpos){
                                 currentX = currentX-itemWidth;
                                 
                                 $(currentCarousel).animate( { left:currentX}, carouselSpeed );					
                                 
                                 $(currentCarousel).css({left:currentX});										
                                 if(currentX === finalXpos){
                                     $(this).fadeTo("slow", fadeValue);
                                 }
                                                     
                                 var currentTabValue = currentX/itemWidth;
                                 if (currentTabValue < 0){
                                     var currentTabValue = -1 * currentTabValue;
                                 }
                                 var currentTabValue = currentTabValue;
                                 
                                 var newHeight = $(carouselItems[currentTabValue]).height();
                                 $(currentCarouselContent).animate( { height:newHeight}, carouselSpeed );
                                 
                                 var alternateTabs = $("a", alternateControl);
                                 $(alternateTabs).removeClass("active");
                                 $(alternateTabs[currentTabValue]).addClass("active");
                                 
                                 return false;					
                             }				
                             return false;				
                         }	
                     )
                     
                     //Assigning function for left controls
                     $(leftButton).click(		
                         function goLeft(){
                             $(rightButton).fadeTo("slow", 1.0);
                             if ($(".carouselContent ul:animated").length > 0)return false;
                             var currentXpos = $(currentCarousel).css("left");
                             var currentX = parseInt(currentXpos);
                             if(currentX !== 0){
                                 currentX = currentX+itemWidth;
                                 
                                 $(currentCarousel).animate( { left:currentX}, carouselSpeed );
                                 
                                 $(currentCarousel).css({left:currentX});										
                                 if(currentX === 0){
                                     $(this).fadeTo("slow", fadeValue);
                                 }
                                 
                                 var currentTabValue = currentX/itemWidth;
                                 if (currentTabValue < 0){
                                     var currentTabValue = -1 * currentTabValue;
                                 }
                                 var currentTabValue = currentTabValue;
                                 
                                 var newHeight = $(carouselItems[currentTabValue]).height();
                                 $(currentCarouselContent).animate( { height:newHeight}, carouselSpeed );
                                 
                                 var alternateTabs = $("a", alternateControl);
                                 $(alternateTabs).removeClass("active");
                                 $(alternateTabs[currentTabValue]).addClass("active");
                                 
                                 return false;
                             }
                             return false;
                         }		
                     )
             
                 })
             }
 },
 
 //accordion trigger
 accordionTrigger: function(){
     $(".PE_accordion").accordion();
 },
 
 //tabs trigger
 tabsTrigger: function(){
     $(".PE_tabs").tabs();
 },
 
 //toggle trigger
 toggleTrigger: function(){
     if($(".PE_toggle").length !== 0){
      
      $(".PE_toggleCont").hide();
      $(".PE_toggleHead").removeClass("active");
      $(".PE_toggle").each(function(){
       
       var toggleHead = $(".PE_toggleHead", this);
       var toggleCont = $(".PE_toggleCont", this)
       $(toggleHead).click(function(){
          $(toggleCont).slideToggle("fast");
          if($(this).hasClass("active")=== true){
            $(toggleHead).removeClass("active");
          } 
          else{
           $(toggleHead).addClass("active")
          }
          
          return false;
        })
       
      })
     }
 },
 
 flashCarousel: function() {
		 
       if ($(".flashContent").length !==0){
			$(".videoHolder").removeClass("hidden");
			$(".fallback").addClass("hidden");
			
			var videoItems = $(".videoItem");
			//alert(videoItems.length)
			var videoLinks = $(".videoItem a.videoLink");
			
			if ($(".onHit").length !==0){					
				$(videoLinks).click(function(){
                    $(videoItems).removeClass("activeVideo");
					$(this).parent().addClass("activeVideo");
					var flashType = Twicommon.getPEClassInfo(this,"F_");
					var videoId = Twicommon.getPEClassInfo(this,"V_");
					var height = Twicommon.getPEClassInfo(this,"H_") + "px";
					var width = Twicommon.getPEClassInfo(this,"W_") + "px";
					var videoHeight = Twicommon.getPEClassInfo(this,"H_");
					var videoWidth = Twicommon.getPEClassInfo(this,"W_");
                    var videoSkin = Twidata.flashPath + "modieus.swf";
                    
					var flashvars = {};
					if (this.href.indexOf(".flv") !== -1) {
						var videoLink = this.href;
						flashvars.file= videoLink;
						flashvars.width = videoWidth;
						flashvars.height = videoHeight;
						flashvars.autostart = true;
						flashvars.mute = false;
						flashvars.controlbar = "over";
						flashvars.skin = videoSkin;
						//flashvars.image = fallBackImage;
                        
						swfobject.embedSWF(Twidata.flashPlayer, videoId, width, height, "9.0.0", "expressInstall.swf",flashvars, Twidata.videoOptions.params);
					} else {
						var flashFile = this.href;
						swfobject.embedSWF(flashFile, videoId, width, height, "9.0.0", "expressInstall.swf");
					}
					
					return false;
				})
			}
		}
	}
 
}





var Twicommon= {
	isLtIE7 : false,
    detectLtIE7 : function() {
        var getIEMajorVersion = function() {
            if(navigator.appName === "Microsoft Internet Explorer"){
                var regExp = /MSIE\s(\d+)\./gi;
                var testUA = regExp.exec(navigator.userAgent);
                return testUA[1];
            }else{
                return false;
            }
        }
        var IEVersion = getIEMajorVersion();		
        if (IEVersion && IEVersion < 7) {
            this.isLtIE7 = true;
        }else {
            this.isLtIE7 = false;
        }
    },
	addDecimal : function(objOpt) {
		var places = [10, 100, 1000];
		var multi = places[(objOpt['places'] - 1)];
		if (objOpt['action'] === 'add') {
			result = parseInt((objOpt['item1'] * multi) + (objOpt['item2'] * multi), 10) / multi;
		} else {
			result = parseInt((objOpt['item1'] * multi) - (objOpt['item2'] * multi), 10) / multi;
		}
		return result;
	},
	objOpacity :  {
		set : function(elm, opacity) {
			$(elm).css({ 'opacity' : opacity});						
		},
		get : function(elm) {
			if(elm.filters !== undefined) { 
				return (elm.filters.alpha) ?  (elm.filters.alpha.opacity / 100) : 1;
			} else {
				return $(elm).css( 'opacity' );
			};			
		}
	},
	//get events, cross browser
	readEvent : function(oEvent, prop) {
		if(!oEvent) { var oEvent = window.event; }
		if(prop === "eventObj") { return oEvent; }
		if(prop === "target") {
			return (oEvent.target !== undefined) ? oEvent.target : oEvent.srcElement;
		}
	},
	//handle cross-browser reading of CSS-set styles
	getStyle : function(el,stylename){
		if(el.style[stylename]){
			return el.style[stylename];
		}
		else if(el.currentStyle){
			//handle IE's style-name to styleName convention
			if(stylename.indexOf("-") != -1 && !el.currentStyle[stylename]){
				//get 1st char after -, uppercase, rem -
				var preHyphen = stylename.substr(0,stylename.indexOf("-"));
				var postHyphenFirstLetter = stylename.substr(stylename.indexOf("-")+1,1).toUpperCase();
				var postHyphenRemainder = stylename.substr(stylename.indexOf("-")+2);
				stylename = preHyphen + postHyphenFirstLetter + postHyphenRemainder;
			}
			return el.currentStyle[stylename];
		}
		else if(document.defaultView && document.defaultView.getComputedStyle){
			return document.defaultView.getComputedStyle(el,null).getPropertyValue(stylename);
		}
		else{return false;}
	},
	//handle cross-browser viewport height
	getViewPortHeight : function(){
		if(window.innerHeight){
			return window.innerHeight;
		}
		else if(document.documentElement && document.documentElement.clientHeight){
			return document.documentElement.clientHeight;
		}
		else if(document.body){
			return document.body.clientHeight;
		}
		else{return false;}
	},
	//handle cross-browser viewport width
	getViewPortWidth : function(){
		if(window.innerWidth){
			return window.innerWidth;
		}
		else if(document.documentElement && document.documentElement.clientWidth){
			return document.documentElement.clientWidth;
		}
		else if(document.body){
			return document.body.clientWidth;
		}
		else{return false;}
	},
	//find and compare viewport and body heights and widths. return the largest of each dimension in array
	getFullPageDimensions : function(){
		var newHeight = Twidgets.Common.getViewPortHeight();
		var newWidth  = Twidgets.Common.getViewPortWidth();
		/*compare with body */
		if(newWidth < document.body.clientWidth){
			newWidth = document.body.clientWidth;
			newWidth += parseInt(Twidgets.Common.getStyle(document.body,"margin-left")) + parseInt(Twidgets.Common.getStyle(document.body,"margin-right"));
		}
		if(newHeight < document.body.clientHeight){
			newHeight = document.body.clientHeight;
			newHeight += parseInt(Twidgets.Common.getStyle(document.body,"margin-top")) + parseInt(Twidgets.Common.getStyle(document.body,"margin-bottom"));
			if(window.innerWidth && window.innerWidth > document.body.scrollWidth){newWidth -= 17;}//handle Firefox bug where it counts the scrollbar too for scrolling pages
		}
		else if(newHeight < document.body.scrollHeight){//quirksmode handling
			newHeight = document.body.scrollHeight;
		}
		
		return [newWidth,newHeight];
	},
	//handle cross-browser retrieval of how far user has scrolled down
	getScrollTop : function(){
		if(window.pageYOffset){
			return window.pageYOffset;
		}
		else if(document.documentElement && document.documentElement.scrollTop){
			return document.documentElement.scrollTop;
		}
		else if(document.body){
			return document.body.scrollTop;
		}
		else{return false;}
	},
	// returns values of all select options
	getSelectVals : function(oWrapper)	{
			var els=oWrapper.getElementsByTagName("select");var o=new Array();
			for (var aSelV=0;aSelV<els.length;aSelV++)	{o[aSelV]=els[aSelV].value;}
			return o;
	},
	// returns true if radio buttons inside object oWrapper is checked, else false
	getRadioSelected: function(oWrapper)	{
		var els=oWrapper.getElementsByTagName("input");
		for (var aSel=0;aSelels.length;aSel++)	{
			if(els[aSel].checked)	{
				return true;
			}
		}
		return false;
	},	
	// returns check Boolean of first checkbox element inside object oWrapper
	getCheckboxVal: function(oWrapper)	{
		return oWrapper.getElementsByTagName("input")[0].checked;
	},
	// returns value of first textarea element inside object oWrapper
	getTextareaVal: function(oWrapper)	{
		return oWrapper.getElementsByTagName("textarea")[0].value;
	},
	// returns value of first input element inside object oWrapper
	getInputVal: function(oWrapper)	{
		return oWrapper.getElementsByTagName("input")[0].value;
	},
	// removes given node obj (oNode). returns true/false status on node removal
	removeNodeByObj: function(oNode)	{
		if (oNode)	{
			oNode.parentNode.removeChild(oNode);
			return true;
		}	else	{
			return false;
		}
	},
	// removes given node string (nodeId). returns true/false status on node removal
	removeNodeById: function(strNodeId)	{
		if (document.getElementById(strNodeId))	{
			var oNode=document.getElementById(strNodeId);
			return this.removeNodeByObj(oNode);
		}	else	{
			return false;
		}
	},
	// returns an absolute y position of the given element object 'o'.
	getAbsoluteY: function(o) {
		oTop=o.offsetTop;            
		while(o.offsetParent!=null) { 
			oParent=o.offsetParent;
			oTop+=oParent.offsetTop;
			o=oParent;
		}
		return oTop
	},
	// returns an absolute x position of the given element object 'o'.
	getAbsoluteX: function(o) {
		var oLeft = o.offsetLeft;
		while(o.offsetParent!=null) { 
			oParent=o.offsetParent;
			oLeft+=oParent.offsetLeft;
			o=oParent;
		}
		return oLeft
	},	
	// returns the object of the next parent/grand-parent etc. of the element object oEl of the tag type strTagName. Returns false if fails
	getParentByTagName: function(el,tagName){
	            var parent=el.parentNode;
	            while(tagName.toLowerCase()!=parent.nodeName.toLowerCase()){
	                        parent=parent.parentNode;
	                        if(!parent || parent.nodeName==="#document"){return false;}
	            }
	            return parent;
	},
	// simplifies fetching of first element by classname. returns element obj or false
	getFirstInstanceByClassName: function(oElm,strTagName,strClassName)	{
		var els=getElementsByClassName(oElm,strTagName,strClassName);
		if (els.length>0)	{
			return els[0];
		}
		return false;
	},
	//handle cross-browser adding events
	addEvent: function(obj,evt,fn){
		if(document.addEventListener){
			this.addEvent = function(obj,evt,fn){
				obj.addEventListener(evt,fn,false);
			}
		}
		else if(document.attachEvent){
			this.addEvent = function(obj,evt,fn){
				obj["e"+evt+fn] = fn;
				obj[evt+fn] = function() { obj["e"+evt+fn]( window.event ); }
				obj.attachEvent( "on"+evt, obj[evt+fn] );
			}
		}
		else{
			return false;
		}
		this.addEvent(obj,evt,fn);
	},
	fuzzyClassName: function(tag,fClass)	{
		var el = (tag === "*" && document.all) ? document.all : document.getElementsByTagName(tag);
		var o=new Array();
		for (var i=0;i<el.length;i++)	{
			if (el[i].className.indexOf(fClass)!=-1)	{
				o.push(el[i]);
			}
		}
		return o;
	},
	//as fuzzyClassName, but restriced to self and children of a specific DOM object
	fuzzyClassNameBlock : function(block,tag,fClass)	{
		var el = (tag === "*" && block.all) ? block.all : block.getElementsByTagName(tag);
	
		var o=new Array();
		for (var i=0;iel.length;i++)	{
			if (el[i].className.indexOf(fClass)!=-1)	{
				o.push(el[i]);
			}
		}
		if(block.className.indexOf(fClass)!=-1){
			o.push(block);
		}
		return o;
	},
	//get the contents between ( and ) marks attached to a classname that starts with a given marker
 	getPEClassInfo: function(el,marker){
		var fullClass = el.className;
		var info = fullClass.substring(fullClass.indexOf(marker+"(")+marker.length+1);
		info = info.substring(0,info.indexOf(")"));
		return info;
	},
	/* function for making panels equal height */

	equalisePanelHeights: function() {
		var equal_container_divs = getElementsByClassName(document,'div','equalPanelHeights');
		for (var i=0; i<equal_container_divs.length; i++) {
			equalise(equal_container_divs[i]);
		}
		// the equaliser;
		function equalise(container_div) {
			var max_height = 0;
			//Get all the homePromos
			var content_divs = getElementsByClassName(container_div,'div','equalMe');
			//If there are more than 1 homePromos
			if(content_divs.length > 1) {
				//find the max height of the homePromos
				for (var i=0; i<content_divs.length; i++) {
						max_height = (content_divs[i].offsetHeight > max_height) ? content_divs[i].offsetHeight : max_height;
				}
				//set all the homePromo conts to be equivalent to this max height minus top and base
				for (var i=0; i<content_divs.length; i++) {
					//get each cont
					var innerDivToEnlarge = getElementsByClassName(content_divs[i], 'div', 'cont');
					//if there are conts
					if(innerDivToEnlarge.length > 0){
						//calculate new height
						var newHeight = equalPanel(max_height, 20)+"px";
						if (Twidgets.Common.isLtIE7 === true) {
							innerDivToEnlarge[0].style.height = newHeight;
						}
						innerDivToEnlarge[0].style.minHeight = newHeight;
					}
				}
			}
		}
		function equalPanel(intHeight, intExcess) {
		
		return intHeight - intExcess;
		
		}
	},
	//accessibility hack: updates the value of a hidden field to trigger a buffer refresh. called in the functions that are run when an AJAX call has returned data or error
	updateBuffer : function() {
		var bufferReset = document.getElementById("bufferReset");
		if(!bufferReset){
			var bufferReset = document.createElement("input");
			bufferReset.type="hidden";
			bufferReset.name="bufferReset";
			bufferReset.value=1;
			bufferReset.id="bufferReset";
			document.body.appendChild(bufferReset);
		}
		bufferReset.value++;
	},	
	getPEName: function(strFullClass){
		var intPEStart = strFullClass.indexOf("PE_");
		return strFullClass.substring(intPEStart, strFullClass.indexOf("("));
	},
	applyAnim: function(oElm, action, anim, oAnimOpt){		
		var applyAnim = function() {
			var css = oAnimOpt.style;
			if(action !== undefined) {
				// if the action is set as a callback, run it as one. Otherwise, it gets called before the animation
				if(oAnimOpt.callback === true) {
					$(oElm).animate(css, oAnimOpt.time, oAnimOpt.tween, action);											
				} else {
					action();
					$(oElm).animate(css, oAnimOpt.time, oAnimOpt.tween);
				}
			} else {
					$(oElm).animate(css, oAnimOpt.time, oAnimOpt.tween);
			}
		};		
		var alterElm = function() {
			//if you want an animation					
			if(anim === true) {
				//run the function sent as the animation parameter
				applyAnim();						
			} else {
				action(oElm);
			}
		}
		alterElm();			
	},	
	stopAnim : function(arrAnims, arrTimeouts) {
		if(timeout !== undefined) {
			for(var timeout in arrTimeouts) {
				window.clearTimeout(arrTimeouts[timeout]);
			}
		}
		if(arrAnims !== undefined) {
			for(var anim in arrAnims) {
				$(arrAnims[anim]).stop();
			}
		}
	},
	/* ajaxLoader is a shell function for running a library-based ajax call 
	 * Parameters stored in an oOptions object are: 
	 * 	url (string)
	 * 	errorLog : function to run on error
	 * 	timer : how long before call times out (integer)
	 *  dataType : data type to request, i.e. xml (string)
	 *  coreObj : a reference to the oOptions object so it can use it's methods - usually this
	 *  successLog : function to run on success (for calls that need resulting data to be processed). Is passed resulting object as 1st param
	 */ 
	ajaxLoader : function(oOptions) {
		var strUrl = oOptions.url;
		var errorLog = oOptions.errorLog;		
		var intTimer = oOptions.timer;
		var successLog = oOptions.successLog;
		var strData = oOptions.data;
			$.ajax({
					type : "GET",
					url : strUrl,
					success : function(data) {
						successLog(data);
					},
					error : errorLog,
					timeout : intTimer,
					dataType : strData
			});	
	}
};


 $(document).ready(function(){
	hasJS();
    popup();
    navSelect();
    Twidgets.dropDowns();
	Twidgets.accordionTrigger();
	Twidgets.tabsTrigger();
    //Twidgets.carousel();
    Twidgets.flashCarousel();
    Twidgets.toggleTrigger();
    Twidgets.equalColumns();
 });

