



$(function () {
			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
});


$(document).ready( function()
	{
	
		// external link warnings
		
		$( 'a' ).each(function(i)
		{
			var http = "http://";
			
			if( $( this ).attr( "href" ) )
			{
			
				var fullLink =  $( this ).attr( "href" );
				
				var linkUrl = fullLink.substring( fullLink.indexOf( http ) + http.length );
				if( linkUrl.indexOf( "/" ) > -1 )
				{
					linkUrl = linkUrl.substring( 0, linkUrl.indexOf( "/" ) );
				}
				
				// 'siteroot' is set in 'header'
				if( ( 	fullLink.slice( 0, http.length ) == http ) 
							&& ( fullLink.slice( 0, siteroot.length ) != siteroot ) 
							&& ( linkUrl != 'www.gsk.com.au' )
							&& ( linkUrl != 'www.knockoutcoldsores.com.au' ) )
				{
					$( this ).click( function( e ){
						
						$.popup.show("Warning!", 
									"You are about to leave this site. <br />Please be aware we are not responsible for the content in the new website.<br /> Please note:<ul><li>that the information a reader is about to be referred to may not comply with the Australian regulatory environment and that readers should refer to the CMI for products to fully understand the terms of a product's registration in Australia;</li><li>that the intent of providing this material is informational and not as advice; and</li><li>any information provided by this source should be discussed with the reader's healthcare professional and does not replace their advice</li></ul> <a class='popup_close_alt' href='"+ fullLink +"' target='_blank' >Click here to continue</a>");
	
						$( '#popup_bg' ).css( "zIndex", 200 );
						$( '#popup' ).css( "zIndex", 201 );
						
						$( '.popup_close_alt' ).click( function( e )
						{
							$( '#popup_close' ).click();
						});
						
						$.scrollTo( {top:0}, 500 );
						
						e.stopPropagation();
						e.preventDefault();
						
					} );
				}
			
			};
			
		});
		
	
		// glosary rollovers
		
		
		$( '.glossary' ).each(function(i){
	
			
				$( this ).css( "zIndex", ( $( '.glossary' ).length + 20 ) - i );
				
				$( this ).click( function( e ){
					e.stopPropagation();
					e.preventDefault();
				} );
			
		});

		
		$('.glossary .gloss_link').mouseover( function( e ){
			
			$( this ).next( '.glossary_box' ).css( 'display','block' );
			
			e.stopPropagation();
			e.preventDefault();
			
		} );
		
		$('.glossary .gloss_link').mouseout( function( e ){
			
			$( this ).next( '.glossary_box' ).css( 'display','none' );
			
			e.stopPropagation();
			e.preventDefault();
			
		} );
		
		// pt menu at the top
		$( '.menu' ).css( "zIndex", ( $( '.glossary' ).length + 20 ) + 1 );
		
		
    });