$(document).ready(function(){
	
	// AXA on the web
	$('#axaWebContent').mouseenter(function(){$('.axaValues').show();});
	$('#axaWebContent').mouseleave(function(){$('.axaValues').hide();});
	
	//Footer Expand/Collapse
	$(".footerLinks2_3 #link").click(function(){			
		$(this).siblings("#expcoll").slideToggle("slow",fun);
		$(this).toggleClass("active"); return false;
	});	
	
	$(".customer_content .Plans-content1 h3 img").click(function(){
		$(".customer_content .Plans-content1 h3").each(function(){
			$(this).children("img").attr("src", ($(this).children("img").attr("src").replace("_act.gif", ".gif")));	
		});
		$(this).attr("src",($(this).attr("src").replace(".gif", "_act.gif")));		
		$(".ExpandCollapse").hide();
		var classname=$(this).parent().attr("class");
		$("#" + classname + "_content").show();
	});
	
	$("#premium-rates-tbl").click(function(){
		$(".premium-rates").slideToggle();
	})
	
	
});

function fun()
{
	$("html,body").animate({'scrollTop':+$('#bot_div').offset().top },1000);
}


function cal_premium()
{
	window.open('../cal_premium.htm','mywin','left=350,top=250,width=350,height=250,toolbar=0,resizable=0');
}

/*mainNav Menu

$(document).ready(function(){
	$('.menu01').mouseenter(function(){$('#menu01').show();});
	$('#menu01,.menu01').mouseleave(function(){$('#menu01').hide();})
}); */


$(document).ready(function(){   

	/*$(".ExpandCollapse ul li .btmcurve1 h3").click(function(){			
		$(this).parent().next(".excoll_content1").slideToggle(300).parent().siblings("li").children(".excoll_content1").slideUp("slow");
		$(this).toggleClass("active").parent().parent().siblings("li").children(".btmcurve1").children("h3").removeClass("active");; return false;
	});	
	// Expandall/Collapse-(all)
	
		$(".expandall").click(function(){
		$(".excoll_content1").slideDown(500,function(){$(this).prev().children().addClass("active");});
		return false;
	});
	
	$(".collapseall").click(function(){
		$(".excoll_content1").slideUp(500,function(){$(this).prev().children().removeClass("active");});
		return false;
	});*/
	
	
});


/* new homepage secure condfident slide show start */
var activeBanner = 1;
$(document).ready(function(){
	if($('.secureConfidentWrapper').length)
	{
		$('.secureConfidentWrapper .images li').hide();
		$('.secureConfidentWrapper .images li').each(function(i){//Applying ID to each 'li' code		
			$(this).attr('id', 'img'+(i+1));
		});	
		$('.secureConfidentWrapper .images li#img1').delay(100).fadeIn();
		
		for(p=1; p<=$('.secureConfidentWrapper .images li').length; p++){//pagination code
			$("<li id='pag"+p+"'><a href='javascript:;' title='Slide No."+p+"' onclick='changeBannerImg("+p+",0);stopAni();'><\/a><\/li>").appendTo(".pagination");
		}
		$(".secureConfidentWrapper .pagination li#pag1").children('a').addClass('active');
		playPause(); 
	}
});

var num = 1;
function changeBannerImg(param, np){
	if(num == $('.secureConfidentWrapper .images li').length && parseInt(np) == 1){
		param = 0;
	}
	num = param;
	//$('.secureConfidentWrapper .images li').hide();
	$(".secureConfidentWrapper .images li#img"+activeBanner).delay(100).fadeOut();
	//
	$(".secureConfidentWrapper .images li#img"+(num+parseInt(np))).delay(600).fadeIn();
	$(".secureConfidentWrapper .pagination li").children('a').delay(600).removeClass('active');
	$(".secureConfidentWrapper .pagination li#pag"+(num+parseInt(np))).children('a').delay(600).addClass('active');
	
	num += parseInt(np);
	activeBanner = num;
}
var inter;
function playPause(){
	if($('.controls li #pp').text() == 'play'){
		inter = setInterval(function() {
		  changeBannerImg(num,1);
		}, 4600);
		document.getElementById('pp').innerHTML = 'pause';
	}
	else if($('.controls li #pp').text() == 'pause'){
		clearInterval(inter);
		document.getElementById('pp').innerHTML = 'play';
	}	
}
function stopAni(){
	clearInterval(inter);
	document.getElementById('pp').innerHTML = 'play';
}
/* new homepage secure condfident slide show start */


/****Expand/Collapse functionality for plan finder****/
$(document).ready(function(){
	$(".btn a").click(function(){
		$(this).parents(".safe-confident").find(".safe-confident-hover").slideToggle();
	});
});

/****Expand/Collapse functionality for navs page ****/
$(document).ready(function(){
	$(".navpg-form-btn").click(function(){
		$(".navpg-form").slideToggle();
	});
});

function changetab()
{
	var currIndex=$(".assets").parents(".tab_content").index();
	
	$(".assets").find("input").each(function(){
		if($(this).attr("value")!="")
		{
			//alert($(this).attr("value"));
			$(".assets").parents(".tab_content").parent().prev().find("li").each(function(){
				$(this).removeClass("selected");
			})
			$(".assets").parents(".tab_content").parent().children(".tab_content").hide();
			$(".assets").parents(".tab_content").parent().prev().find("li").eq(currIndex).addClass("selected");
			$(".assets").parents(".tab_content").show();			
		}
	});	
}
