﻿window.onload=startCheck;function startCheck(){var dir=document.location.href;var pos=dir.lastIndexOf('://');if(pos!=-1){dir=dir.substring(pos+3);pos=dir.indexOf('/');if(pos!=-1){var rootDir="http://"+dir.substring(0,pos);pos=dir.indexOf('/');if(pos!=-1){dir=location.href.substring(rootDir.length+1,location.href.length);pos=dir.indexOf('/');if(pos!=-1){var str=dir.substring(0,pos);str=str.substring(0,pos)}else{str=dir}var objID="";switch(str){case"pregnancy":document.getElementById("subNavPregnancy").style.display="";objID="subNavPregnancy";break;case"new_mum":document.getElementById("subNavNewMum").style.display="";objID="subNavNewMum";break;case"my_baby":document.getElementById("subNavMyBaby").style.display="";objID="subNavMyBaby";break;case"my_toddler":document.getElementById("subNavMyToddler").style.display="";objID="subNavMyToddler";break;case"young_children":document.getElementById("subNavMyChild").style.display="";objID="subNavMyChild";break;case"dads":document.getElementById("subNavMyDads").style.display="";objID="subNavMyDads";break;case"feeding_and_nutrition":document.getElementById("subNavMyFeeding").style.display="";objID="subNavMyFeeding";break;case"our_products":document.getElementById("subNavOurProducts").style.display="";objID="subNavOurProducts";break;default:break}if(objID!=""){var parent=document.getElementById(objID).parentNode;parent.childNodes[0].className=parent.childNodes[0].className+"On"}}}}}function move_arrow(button_id){try{if(button_id==1){element="navPregnancy";arrow="hero_arrow_pregnancy"}if(button_id==2){element="navNewMum";arrow="hero_arrow_newmum"}if(button_id==3){element="navMyBaby";arrow="hero_arrow_mybaby"}if(button_id==4){element="navMyToddler";arrow="hero_arrow_mytoddler"}if(button_id==5){element="navMyChildren";arrow="hero_arrow_mychildren"}if(button_id==6){element="navDads";arrow="hero_arrow_dads"}if(button_id==7){element="navImmunity";arrow="hero_arrow_Immunity"}if(button_id==8){element="navFeeding";arrow="hero_arrow_feeding_and_nutrition"}if(button_id==9){element="navProducts";arrow="hero_arrow_products"}if(button_id==10){element="navExperts";arrow="hero_arrow_expert"}if(button_id==11){element="navWhatNew";arrow="hero_arrow_forum"}if(button_id==12){element="navImmunity";arrow="hero_arrow_Immunity"}left_offset=-135;top_offset=-27;var h_a=document.getElementById(arrow);h_a.style.position="absolute";h_a.style.zIndex=100;var image=document.getElementById(element);var image_coords=findPos(image);var new_left_offset=image_coords[0]+left_offset;var new_top_offset=image_coords[1]+top_offset;h_a.style.left=new_left_offset+"px";h_a.style.top=new_top_offset+"px";h_a.style.display="block"}catch(e){}}function hide_arrow(button_id){try{if(button_id==1){element="navPregnancy";arrow="hero_arrow_pregnancy"}if(button_id==2){element="navNewMum";arrow="hero_arrow_newmum"}if(button_id==3){element="navMyBaby";arrow="hero_arrow_mybaby"}if(button_id==4){element="navMyToddler";arrow="hero_arrow_mytoddler"}if(button_id==5){element="navMyChildren";arrow="hero_arrow_mychildren"}if(button_id==6){element="navDads";arrow="hero_arrow_dads"}if(button_id==7){element="navImmunity";arrow="hero_arrow_Immunity"}if(button_id==8){element="navFeeding";arrow="hero_arrow_feeding_and_nutrition"}if(button_id==9){element="navProducts";arrow="hero_arrow_products"}if(button_id==10){element="navExperts";arrow="hero_arrow_expert"}if(button_id==11){element="navWhatNew";arrow="hero_arrow_forum"}if(button_id==12){element="navImmunity";arrow="hero_arrow_Immunity"}var h_a=document.getElementById(arrow);h_a.style.display="none"}catch(e){}}function swap_hero(button_id){try{document.getElementById('hoverBackground').style.display="block";document.getElementById('swfHoverBackground').style.display="none";var heroes=new Array('/assets/779252_Pregnancy.jpg','/assets/779252_Mum.jpg','/assets/779252_Baby.jpg','/assets/779252_Toddler.jpg','/assets/779252_Children.jpg','/assets/779252_Dads.jpg','/assets/779252_Immunity.jpg','/assets/779252_Feeding.jpg','/assets/779252_Product.jpg');var mC=document.getElementById('hoverBackground');mC.style.background="url('"+heroes[button_id-1]+" ')";move_arrow(button_id)}catch(e){}}function clear_hero(button_id){try{document.getElementById('hoverBackground').style.display="none";document.getElementById('swfHoverBackground').style.display="block";hide_arrow(button_id)}catch(e){}}