// JavaScript Document
var accountName = 'baftc-i-net';
// -------------------------------------------
// will add target to external links (jQuery)
// -------------------------------------------
function externalLinks(){
	$('a[@rel^="external"]').attr('target', '_blank').click(function(){
		hideAmbassador();
	});
}

$(document).ready(
	function(){
		
	$('#jobApplication').submit(function() {
		
	})
	
	// Support FAQ section
	$('.faq-showall a').click(function(){
		$(this).parent().parent().siblings('.faq-hidden').toggle();
		return false;
	});
	
	$('#faq-search input').focus(function(){
		if($(this).val() == "Enter search terms") {
			$(this).val('');
		}
	});
	$(".faq-topics").hide();
	
	//toggle the componenet with 	
	$(".faq-cat").click(function(){
		if($(this).next(".faq-topics").hasClass('open')){
			$(this).next(".faq-topics").slideUp(250).addClass('closed').removeClass('open');
			$(this).children(".close-button").html('');
		} else {
			$(this).next(".faq-topics").slideDown(250).addClass('open').removeClass('closed');
			$(this).children(".close-button").html('&Delta; Close');
			s=s_gi(accountName);
			s.linkTrackVars= "prop30";
			s.prop30 = $(this).attr('title').toLowerCase();
			s.tl(this,'o','FAQ sub category click');
		} 
		return false;
	});
			
	
	$('#billPayment').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop6";
			s.prop6 = "Bill Payment";
			s.tl(this,'o','Bill Payment Click');		
	});
	$('#cse-search-box').submit(function (){
		s=s_gi(accountName);
		s.linkTrackVars= "prop5";
		s.prop5 = $('#keywords').val();
		s.tl(this,'o','Search Term');
	});
	$('.newsletter_pdf').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop7";
			s.prop7 = $(this).attr('rel');
			s.tl(this,'o','Newsletter Download');		
	});
	
	$('.blogview').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop8";
			s.prop8 = $(this).attr('rel');
			s.tl(this,'o','Blog article');		
	});
	
	$('#clearBtn').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop9";
			s.prop9 = "Clear Form";
			s.tl(this,'o','Teleplus Clear Form');		
	});
	$('.feature').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop10";
			s.prop10 = $(this).attr('rel');
			s.tl(this,'o','Teleplus Feature');		
	});
	$('.phonepdf').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop14";
			s.prop14 = $(this).attr('rel');
			s.tl(this,'o','Phones PDF');		
	});
	$('#Inet_App').submit(function (){
		s=s_gi(accountName);
		s.linkTrackVars= "prop15,eVar4";
		s.prop15 = $('.radio:checked').val();
		s.eVar4 = s.prop15.toLowerCase();
		s.tl(this,'o','I-net Service');
	});
	
	
	$('#teleplus').submit(function (){
		s=s_gi(accountName);
		s.linkTrackVars= "prop16,eVar5";
		option = '';
		$('.features:checked').each(function()
			{
			option = option + $(this).val() + '/';
			}
		);
		s.prop16 = option;
		s.eVar5 = s.prop16.toLowerCase();
		s.tl(this,'o','I-net Service');
	});
	
	$('.exit-util').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop25";
			s.prop25 = $(this).html().toLowerCase();
			s.tl(this,'o','Exit from the Nav');		
	});
	
	$('.featuredPhone').click(function(){
			s=s_gi(accountName);
			s.linkTrackVars= "prop26";
			s.prop26 = $(this).attr('rel');
			s.tl(this,'o','Featured Phone');		
	});
	
	if($('.banner-click').length > 0){
		$('.banner-click').click(function(){
				s=s_gi(accountName);
				s.linkTrackVars= "prop29";
				s.prop29 = $(this).attr('rel');
				s.tl(this,'o','Page Banner click');		
		});
	}
	
	if($('#adholder-340x90').length > 0){
		$('#adholder-340x90').click(function(){
			s=s_gi(s_account);
			s.linkTrackVars='prop28';
			s.prop28=window.location;
			s.tl(this, 'o', 'Pick 3 banner click');
		});
	 }
	
	$('#textRegBlue, #textLargeBlue, #textLargestBlue').hover(
		function() {
			$(this).css('cursor','pointer');
		},
		function() {
			$(this).css('cursor','default');
		}
	);

	$('#textRegBlue').click(function(){
		var currentSize = $('#mainhome p,#main,#mainleft').css('font-size');
		
		$('#mainhome p,#main,#mainleft').css('font-size','12px');
		$('#mainhome p,#main,#mainleft').css('line-height','18px');
		return false;
	});
	
	$('#textLargeBlue').click(function(){
		var currentSize = $('#mainhome p,#main,#mainleft').css('font-size');
		
		$('#mainhome p,#main,#mainleft').css('font-size','14px');
		$('#mainhome p,#main,#mainleft').css('line-height','20px');
		return false;
	});
	
	$('#textLargestBlue').click(function(){
		var currentSize = $('#mainhome p,#main,#mainleft').css('font-size');
		
		$('#mainhome p,#main,#mainleft').css('font-size','18px');
		$('#mainhome p,#main,#mainleft').css('line-height','24px');
		return false;
	});
	
});
