$(document).ready(function () {
	$("ul.topNav li").not('ul.topNav li ul li').mouseenter(function() {
		$(this).css("border-bottom-style", "solid");
		$(this).css("border-bottom-color", "#E6008C");
	});
	$("ul.topNav li").not('ul.topNav li ul li').mouseleave(function() {
		$(this).css("border-bottom-color", "#ffffff");
	}); 

    //$('.topNav li ul').hide(); // hides the menu

    $('.topNav li').hover(function() { // hover function for the li

		$(this).find('ul').show(); // shows the menu whilst hovering the li

		}, function() {

		$(this).find('ul').hide(); // hides the menu after leaving the li

		}

    );

   
 	// Setting body class to do active states

        var page_url = window.location.href;


        if ( (page_url.search("painful-intercourse-menopause.aspx") >= 0) || (page_url.search("vaginal-atrophy-symptoms.aspx") >= 0) || (page_url.search("vaginal-atrophy.aspx") >= 0) ) {
          $('body').addClass("painful_intercourse_menopause_page");
        }

        else if ( (page_url.search("about.aspx") >= 0) || (page_url.search("vaginal-cream-treatment.aspx") >= 0) || (page_url.search("usage.aspx") >= 0) || (page_url.search("side-effects.aspx") >= 0) || (page_url.search("how-to-apply.aspx") >= 0) ) {
          $('body').addClass("about_page");
        }
     
        else if ( (page_url.search("talking-to-your-doctor.aspx") >= 0) || (page_url.search("doctor-discussion.aspx") >= 0) ) {
          $('body').addClass("talking_to_your_doctor_page");
        }

        else if ( (page_url.search("prescription.aspx") >= 0) || (page_url.search("coupon.aspx") >= 0) ) {
          $('body').addClass("prescription_page");
        }
 
        else if ( (page_url.search("menopause-questions") >= 0) || (page_url.search("real-womens-stories.aspx") >= 0) ) {
          $('body').addClass("menopause_questions_page");
        }
		
		
		
		//moving premarin logo in header on subpages only
		//if ( page_url.search("aspx") >= 0 ) {
		//  $('.topLogo').css("left", "0px");
        //}


		
 		//hover functionality
		
        $('.link_line_one a, .link_line_two a').hover(function() {

          $('.link_line_one a, .link_line_two a').css({'color': '#FC71C4'});

        }, function() {

          $('.link_line_one a, .link_line_two a').css({'color': '#E6008C'}); 

        });
		
		//content pages coupon arrow
        $('.callout_arrow_link').hover(function() {

          $('.callout_arrow_link').css({'background-image': 'url("../images/arrowRolloverCoupon.gif")', 'width': '17px', 'height': '17px'});

        }, function() {

          $('.callout_arrow_link').css({'background-image': 'none'}); 

        });
});


//more hover functionality
function findOutArrowRollIn(){ 
	document.getElementById('findOutArrow').setAttribute('src','images/callout_topRollover.gif'); 
} 
function findOutArrowRollOut(){ 
	document.getElementById('findOutArrow').setAttribute('src','images/callout_top.gif'); 
} 

function doctorArrowRollIn(){ 
	document.getElementById('doctorArrow').setAttribute('src','images/callout_topRollover.gif'); 
} 
function doctorArrowRollOut(){ 
	document.getElementById('doctorArrow').setAttribute('src','images/callout_top.gif'); 
} 

function painArrowRollIn(){ 
	document.getElementById('painArrow').setAttribute('src','images/callout_topRollover.gif'); 
} 
function painArrowRollOut(){ 
	document.getElementById('painArrow').setAttribute('src','images/callout_top.gif'); 
} 
