
		
		$(document).ready(function(){
        // Address handler
        
        					
		
		        $('a.ajaxLink').address(function() {
								
		            var url = $(this).attr('href').replace(/^#!/, '')
		            $('.ui-tabs-nav a').not('.page-item-148 a').each(function(){
		            	var href = $(this).attr('href');
		            	if (url == href) {
		            		$(this).addClass('current');
		            		} else {
		            		$(this).removeClass('current');
		            		}
		            });
		            return url;        
		        });					
					


        $.address.init(function(event) {
        }).change(function(event) {
        	
        	if(event.value != "") {
		//       	val = event.value;
		//        	fval = val.substring(1, val.length);
					$('.loader').show();
					$('.content').animate({opacity: .25},0);
					var offset = $('.content').offset().top;
					$('html,body').animate({scrollTop: offset - 157}, 1000);				
		        	$.get('http://investor-advantage.com' + event.value, {}, function(data) {
						$('.content').html(data);
						$.address.title(document.title);
						$('.loader').hide();
						$('.content').animate({opacity: 1},200);
					});
    			}
    			
        }).externalChange(function(event) {
        	if(event.value != "") {
        	
		
			
			} else {
			


			}
        }).history(true);
        	
		});        
        
        


/***************************************************
 * jQuery Infinite Side-Scrolling News Ticker
 * Author: Bryan Mytko bryanmytko@gmail.com
 * Version: 0.1 (3-09-11)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires:
 * jQuery v1.2.x or later
****************************************************/

$(document).ready(function(){
	

	var tickerhtml = $('#ticker').html();
	var tickerwidth = parseInt($('#ticker').css('width'));
	var onetickerwidth = parseInt($('#ticker').css('width'));
	  
  setInterval(function() {

		$('#ticker').animate({marginLeft:'-=150px'},{ "duration": 5000, "easing": "linear" });


		var left = 500 - parseInt($('#ticker').offset().left);
		if(tickerwidth < left){
				$('#ticker').append(tickerhtml);
				tickerwidth = tickerwidth + onetickerwidth;
			}

  }, 5000);	
   
   
	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").live('click',function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});


$.fn.rotator = function() { 
	setInterval(function(){
	
		var sequence = 0 - (parseInt($('.mainBanners ul').css('marginLeft'))/940) + 2;
		
		if(sequence == 7) {
		
			sequence = 1;
		
		}
		
	
		if( parseInt($('.mainBanners ul').css('marginLeft')) < -4600 ) {
	
			$('.mainBanners ul').animate({marginLeft:'0'},500);
			$('.bannerTriggers li').removeClass('active');			
			$('.bannerTriggers li#slider1').addClass('active');
	
		} else {
		
			$('.mainBanners ul').animate({marginLeft:'-=940px'},500);
			$('.bannerTriggers li').removeClass('active');	
//			alert('.bannerTriggers li#slide'+sequence);		
			$('.bannerTriggers li#slider'+sequence).addClass('active');


			
		}
	
	}, 6000);
	
}
$.fn.rotator();


	$('.bannerTriggers li').live('click',function(){

		var order = $(this).attr('id').substring(6);
//		alert(order);
		if(order == 1) {
		 var marginleft = 0;
		} else {

		var marginleft = (order - 1) * 940;
		
		}
		

		var nm = marginleft;
		$('.mainBanners ul').animate({marginLeft:'-'+nm},500);
			$('.bannerTriggers li').removeClass('active');	
//			alert('.bannerTriggers li#slide'+sequence);		
			$('.bannerTriggers li#slider'+order).addClass('active');
			
			
	});

});
