window.analyticsCustomUrl="";$(document).ready(function(){ddMenu("primary");if($("#products").length){$("#accordion","#products").accordion({header:"dt",fillSpace:true})}$("#searchFrm").submit(function(){var searchInput=$("#s");if(searchInput.val()!="Search..."){ensureHtmlSafeControls(searchInput);ensureInvalidSearchCharacters(searchInput);if(searchInput.val()){return true}}alert("Enter keyword(s) to search");return false});$("input[type='text'], select, textarea").addClass("idleField");$("input[type='text'], textarea").focus(function(){$(this).removeClass("idleField").removeClass("requiredField").addClass("focusField")}).blur(function(){$(this).removeClass("focusField").addClass("idleField")});$("input[type='text'], select").focus(function(){$(this).parent("label").css("background-position","0 -25px");$(this).parent("label").children("div").css("display","none")}).blur(function(){$(this).parent("label").css("background-position","0 0")});$("textarea").focus(function(){$(this).parent("label").css("background-position","0 -102px");$(this).parent("label").children("div").css("display","none")}).blur(function(){$(this).parent("label").css("background-position","0 0")});if(jQuery.browser.msie){$("select").bind("focusin",function(){$(this).removeClass("idleField").removeClass("requiredField").addClass("focusField")}).bind("focusout",function(){$(this).removeClass("focusField").addClass("idleField")})}$(".defaultCheck").focus(function(){if(this.value==this.defaultValue){this.value=""}}).blur(function(){if($.trim(this.value)==""){this.value=(this.defaultValue?this.defaultValue:"")}});$("button").hover(function(){$(this).css("background-position","0 bottom")},function(){$(this).css("background-position","0 0")});$("#contactAdviserBtn").click(function(){$("#investNow").slideUp(500,function(){$("#investFrmWrapper").slideDown(500)});return false});$("#cancelContact").click(function(){$("#investFrmWrapper").slideUp(500,function(){$("#investNow").slideDown(500)});return false});var options={beforeSubmit:validateInvestNow,success:showInvestNowResponse,dataType:"json",timeout:600};$("#investFrm").submit(function(){$(this).ajaxSubmit(options);return false});$("#omSites","#footerNav").hoverIntent(function(){$(".footerPopup","#omSites").css("display","block")},function(){$(".footerPopup","#omSites").css("display","none")});$("#omBusinessPolicies","#footerNav").hoverIntent(function(){$(".footerPopup","#omBusinessPolicies").css("display","block")},function(){$(".footerPopup","#omBusinessPolicies").css("display","none")});if($.browser.msie&&parseInt($.browser.version)<=7){$("select","#investFrm").parent("label").css("background-image","none")}if($(".productsContainer").length){$(".productsContainer").equalHeights();if(!$("body.smi").length){$(".product").equalHeights()}}if($("body#whoAreWe").length){$(".accordion").accordion({header:"dt"})}$(".profileDialog").dialog({autoOpen:false,closeOnEscape:true,modal:true,width:600,height:"auto",open:function(){$(".ui-widget-overlay").css("opacity",0.8)}});$("a","#profileThumbs").click(function(){var profile=$(this).attr("href");$(profile).dialog("open");return false});if($("body#whoAreWe").length){$("a:nth-child(6n)","#profileThumbs").addClass("noMargin")}if($("body#eliteFunds").length){if($(".accordion").length){$(".accordion").accordion({header:"dt"})}}if($("body#articlePage").length){if($(".accordion").length){$(".accordion").accordion({header:"dt"})}}if($("#tabs").length){$("#tabs").tabs().tabs("option","disabled",false);$("#tabs").tabs()}if($("#tabs").length&&!$("body#fundCentre").length){$("#tabs").tabs()}$("tr:even",".zebra").addClass("stripe");$("tr",".fundsList").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$("#marquee").liScroll({travelocity:0.05});if($("#flash").length){$("#flash").flash({swf:"/Content/swf/slideshow/slideshow.swf",width:725,height:251,menu:false,wmode:"transparent",quality:"high"})}if($.browser.msie6=$.browser.msie&&parseInt($.browser.version)==6&&!window.XMLHttpRequest){$(".BR, .BL","#contentContainer").css("display","block")}var toggleOff=true;$("#toggleBar").click(function(){if(toggleOff){$("#sidebar").removeClass("off");if($.fn.bgiframe){$("#sidebar").bgiframe()}toggleOff=false}else{$("#sidebar").addClass("off");toggleOff=true}return false});$("a[rel~='blank']").attr("target","_blank");if($("#toggleBar").length){$("#sidebar").css("height",$("#content").height())}});$(window).bind("load",function(){if($("#toggleBar").length){$("#sidebar").css("height",$("#content").height())}});function ensureHtmlSafeControls(control){var value=control.val();var formattedValue=value.replace(/</g,"").replace(/>/g,"");if(value!=formattedValue){control.val(formattedValue)}}function ensureInvalidSearchCharacters(control){var value=jQuery.trim(control.val());if(value.length==0){control.val("")}else{control.val(value.replace(/[^a-zA-Z0-9 ]/g,""))}}function registerForDatePicker(controlId,properties){if(properties){$(controlId).datepicker(properties)}else{var maxYear=new Date().getFullYear()+10;$(controlId).datepicker({dateFormat:"dd/mm/yy",duration:"",changeYear:true,changeMonth:true,prevText:"<<",nextText:">>",yearRange:"1900:"+maxYear})}}(function($){$.fn.equalHeights=function(o){var maxHeight=0;var maxElement=null;$(this).each(function(i){if(($(this).height()+parseInt($(this).css("padding-bottom"))+parseInt($(this).css("padding-top")))>maxHeight){maxHeight=$(this).height()+parseInt($(this).css("padding-top"))+parseInt($(this).css("padding-bottom"));maxElement=$(this)}});$(this).not($(maxElement)).each(function(){$(this).height(maxHeight-parseInt($(this).css("padding-top"))-parseInt($(this).css("padding-bottom")))})}})(jQuery);function imagePreview(){var xOffset=30;var yOffset=0;var previewHeight=0;$("a.preview").hover(function(e){this.t=this.firstChild.alt;this.firstChild.alt="";var c=(this.t!="")?"<br />"+this.t:"";$("body").append('<p id="preview"><img src="'+this.href+'" alt="" />'+c+"</p>");previewHeight=$("#preview").height();yOffset=previewHeight/2;$("#preview").css("top",(e.pageY-yOffset)+"px").css("left",(e.pageX+xOffset)+"px").fadeIn(500)},function(){this.firstChild.alt=this.t;$("#preview").remove()});$("a.preview").mousemove(function(e){previewHeight=$("#preview").height();yOffset=previewHeight/2;$("#preview").css("top",(e.pageY-yOffset)+"px").css("left",(e.pageX+xOffset)+"px")})}(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode}catch(e){p=this}}if(p==this){return false}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.mouseover(handleHover).mouseout(handleHover)}})(jQuery);function validateInvestNow(){var valid=true;$("input[type='text'], select","#investFrm").each(function(){if($(this)[0].value==""||$(this)[0].value=="Your Contact Number"||$(this)[0].value=="Your Full Name"){$(this).parent("label").append('<div class="required" title="This field is required">!</div>');valid=false}});if(!valid){return false}else{$("button","#investFrm").hide();$("#cancelContact").hide();$("#investFrm").append('<p id="loader">Submitting...</p>');return true}}function showInvestNowResponse(responseMessage,statusText){$("#investFrm").html(eval(responseMessage).MessageText)}function ensureHtmlSafeControls(control){var value=control.val();var formattedValue=value.replace(/</g,"").replace(/>/g,"");if(value!=formattedValue){control.val(formattedValue)}}function ensureInvalidSearchCharacters(control){var value=jQuery.trim(control.val());if(value.length==0){control.val("")}else{control.val(value.replace(/[^a-zA-Z0-9 ]/g,""))}}function registerForDatePicker(controlId,properties){if(properties){$(controlId).datepicker(properties)}else{var maxYear=new Date().getFullYear()+10;$(controlId).datepicker({dateFormat:"dd/mm/yy",duration:"",changeYear:true,changeMonth:true,prevText:"<<",nextText:">>",yearRange:"1900:"+maxYear})}};
