$(document).ready(function() {
	if(typeof sIFR == "function"){
		sIFR.replaceElement(".subTitle", named({sFlashSrc: "fileadmin/templates/swf/optima.swf", sColor: "#000000", sWmode: "transparent"}));
                sIFR.replaceElement(".box_title", named({sFlashSrc: "fileadmin/templates/swf/newGotham.swf", sColor: "#000000", sWmode: "transparent"}));
		sIFR.replaceElement("#below_sub_navigation h3", named({sFlashSrc: "fileadmin/templates/swf/optima.swf", sColor: "#000000", sWmode: "transparent"}));
		sIFR.replaceElement(".inner_description .bodytext", named({sFlashSrc: "fileadmin/templates/swf/newGotham.swf", sColor: "#ffffff", sWmode: "transparent", nPaddingLeft: "600"}));
		sIFR.replaceElement("#content_description .bodytext", named({sFlashSrc: "fileadmin/templates/swf/newGotham.swf", sColor: "#ffffff", sWmode: "transparent", nPaddingLeft: "600"}));
		sIFR.replaceElement(".pageTitle", named({sFlashSrc: "fileadmin/templates/swf/gotham.swf", sColor: "#9d0a0e", sWmode: "transparent"}));
                
	}
	$("a.zoom").fancybox({
		'zoomSpeedIn':500,
		'zoomSpeedOut':500
	});
	$("a.zoom2").fancybox({
		'zoomSpeedIn':500,
		'zoomSpeedOut':500
	});
	$("a.zoom").each(function(){
		var title = $(this).attr('title');
		$(this).after('<span class="imgTitle">'+title+'</span>');
	});
	$(".teamMember").each(function(){
		$(this).mouseenter(function(){
			$(this).css('text-decoration', 'underline');
		});
		$(this).mouseleave(function(){
			$(this).css('text-decoration', 'none');
		});
		$(this).click(function () {
			if ($(this).parent('dd').next('dd:first').css('display') == 'block')
			{
				$(this).parent('dd').next('dd:first').slideUp("slow");
				$(this).removeClass('arrow-up');
				$(this).addClass('arrow-down');

			}
			else
			{
				$('.memberDescription').slideUp("slow");
				$('.teamMember').removeClass('arrow-up');
				$('.teamMember').addClass('arrow-down');
				
				$(this).parent('dd').next('dd:first').slideDown("slow");
				$(this).removeClass('arrow-down');
				$(this).addClass('arrow-up');
			}
		});
	});
	
	
	
	$('.small_images').click(function(){
		var id = $(this).attr('id');
		$('.medium_images').fadeOut('slow');
		$('#medium_'+id).fadeIn('slow');
		$('.propertyName div').fadeOut('slow');
		$('#image_title_'+id).fadeIn('slow');
		return false;
	});

	/* LANGUAGE */
	
	$('#login-lang-menu div.sublang').hide();
            
    $('#login-lang-menu .lang ').click(

		function() {
					if ($(".tx-language-pi1 div.sublang").is(":hidden")) {
						$('.tx-language-pi1 div.sublang').slideDown('fast');
                        $('.loginBox').slideUp('fast');
						}

					else if ($(".tx-language-pi1 div.sublang").is(":visible")) {
							$('.tx-language-pi1 div.sublang').slideUp('fast');
							}
						}
	);
            
     /* ----- FORGOT PASS ----- */   
     
     $('#navlogin a.forgotpass').click(

		function() {					
			
                        $('.recovering_pass').show();
    });   
    
     /* ----------------------- */
    $('.targetline').change(function() {
        if($("select option:selected").attr("rel")=="line1") {
            window.location="https://www.boltonsinvestments.com/my-account/line-investment-grade-100-index.html";
        }
        if($("select option:selected").attr("rel")=="line2") {
            window.location="https://www.boltonsinvestments.com/my-account/boltons-indices/line-blue-chip-index.html";
        }
        if($("select option:selected").attr("rel")=="line3") {
            window.location="https://www.boltonsinvestments.com/my-account/boltons-indices/line-bi-small-caps-index.html";
        }
        //if bar accessed from here
        if($("select option:selected").attr("rel")=="bar1") {
            window.location ="https://www.boltonsinvestments.com/my-account/boltons-indices/bar-investment-grade-100-index.html";
        }
        if($("select option:selected").attr("rel")=="bar2") {
           window.location="https://www.boltonsinvestments.com/my-account/boltons-indices/bar-bi-blue-chip-index.html";
        }
        if($("select option:selected").attr("rel")=="bar3") {
            window.location="https://www.boltonsinvestments.com/my-account/boltons-indices/bar-bi-small-cap-index.html";
        }
    });

});
