/* Health Advisor */
jQuery(document).ready(function(){ jQuery("#healthadvisor img[src$='.png']").ifixpng(); });

jQuery(function(){
	// Site Search
	jQuery("#frmSearch").submit(function(){
		if (jQuery("#searchTerm").val() == '')
		{
			alert('Please enter a search term');
			return false;
		}
		else if (jQuery("#searchTerm").val().length < 3)
		{
			alert('Your search term must be at least 3 characters in length');
			return false;
		}
	});
	
	// Join The Discussions Slide-Down
	jQuery("#askPharmacist ul li span").click(function(){ jQuery("#discussionList").slideToggle("slow"); });
		
	// Hovers
	jQuery("#askPharmacist ul li span, #askPharmacist li.askPharmacist, .subSection a h4, .subSection a h3").hover(function(){ jQuery(this).css('text-decoration','underline'); }, function(){ jQuery(this).css('text-decoration','none');});
	

	// Social Share Light Window
	jQuery(".socialShare").live('click', function(){ 
		if (shareAlt == '')
			shareAlt = jQuery(this).attr('alt');

		var socials = shareAlt.split('|');
		jQuery.post(ajax + 'sessions.php', { 'session':'socialShare', 'url':socials[0], 'title':socials[1]}, function(data) { 	jQuery("#dialog").jqmShow(); openInFrame(lightwindows + 'socialshare'); });
	});
	
	// Print Light Window
	jQuery(".print").live('click', function(){ 
		var attributes = printAlt.split('|');
		jQuery("#dialog").jqmShow();
		openInFrame(lightwindows + 'print?type=' + attributes[0] + "&id=" + attributes[1]);
	});
});
