// JavaScript Document



// Jquery tab settings



function closeAllAccordians() { 



	$('#procedure1').slideUp(400);$('#procedure1-link-up').hide(0);$('#procedure1-link').show(0);

	$('#procedure2').slideUp(400);$('#procedure2-link-up').hide(0);$('#procedure2-link').show(0);

	$('#procedure3').slideUp(400);$('#procedure3-link-up').hide(0);$('#procedure3-link').show(0);

	$('#procedure4').slideUp(400);$('#procedure4-link-up').hide(0);$('#procedure4-link').show(0);			

	$('#procedure5').slideUp(400);$('#procedure5-link-up').hide(0);$('#procedure5-link').show(0);

	$('#procedure6').slideUp(400);$('#procedure6-link-up').hide(0);$('#procedure6-link').show(0);

	$('#procedure7').slideUp(400);$('#procedure7-link-up').hide(0);$('#procedure7-link').show(0);  

	$('#procedure8').slideUp(400);$('#procedure8-link-up').hide(0);$('#procedure8-link').show(0); 

	$('#procedure9').slideUp(400);$('#procedure9-link-up').hide(0);$('#procedure9-link').show(0); 

	$('#procedure10').slideUp(400);$('#procedure10-link-up').hide(0);$('#procedure10-link').show(0); 

	$('#procedure11').slideUp(400);$('#procedure11-link-up').hide(0);$('#procedure11-link').show(0); 

	$('#procedure12').slideUp(400);$('#procedure12-link-up').hide(0);$('#procedure12-link').show(0); 

	$('#procedure13').slideUp(400);$('#procedure13-link-up').hide(0);$('#procedure13-link').show(0); 

	$('#procedure14').slideUp(400);$('#procedure14-link-up').hide(0);$('#procedure14-link').show(0); 	

	$('#procedure15').slideUp(400);$('#procedure15-link-up').hide(0);$('#procedure15-link').show(0); 		

	$('#procedure-all-link1-up').hide(0);$('#procedure-all-link1').show(0);

	$('#procedure-all-link2-up').hide(0);$('#procedure-all-link2').show(0);

	$('#procedure-all-link3-up').hide(0);$('#procedure-all-link3').show(0);

	$('#procedure-all-link4-up').hide(0);$('#procedure-all-link4').show(0);

	$('#procedure-all-link5-up').hide(0);$('#procedure-all-link5').show(0);

	

	}

	

	







$(window).load(function() {



$(function() {



        // handle a hash on load

		// from Tony: one issue remains - that when the URL is changed for the second time it doesn't automatically refresh. manual refresh makes it work

        var hash_id = document.location.toString().split('#')[1];



        // if there wasn't a hash in the url i think hash_id will be null

        // or false

        if (hash_id) {



                // call our custom function with hash_id as first parameter

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			$(('div.tabs > div#')+hash_id).show(); 

			$('div.tabs ul.contentTabs a').removeClass('current');	

			$(('div.tabs ul.contentTabs li.')+hash_id+(' a')).addClass('current');



        }



        // handle a click event

        $('#portfolioThumbs .cross-link').click(function() {



                // call our custom function with the $(this) jQuery object

                // as a parameter which is the item that was clicked

                // leave first parameter false as its for hash_id

                handlePanelSlide(false, $(this));

        });



});

		

		}); 



 $(document).ready(function()  {



			

			

			 // bind click event to link

			$("A[href='#first']").click( function() {

			//close all accordian menus

			closeAllAccordians();												  

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.first a').addClass('current');

			return false;		

			});

			

			 // bind click event to link

			$("A[href='#second']").click( function() {

			//close all accordian menus

			closeAllAccordians();

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.second a').addClass('current');

			

			return false;		

			});

			

			 // bind click event to link

			$("A[href='#third']").click( function() {

			//close all accordian menus

			closeAllAccordians();												  

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.third a').addClass('current');

			return false;		

			});

			

			 // bind click event to link

			$("A[href='#fourth']").click( function() {

			//close all accordian menus

			closeAllAccordians();												   

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.fourth a').addClass('current');

			return false;		

			});



			

			 // bind click event to link

			$("A[href='#fifth']").click( function() {

			//close all accordian menus

			closeAllAccordians();												  

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.fifth a').addClass('current');

			return false;		

			});



			

			 // bind click event to link

			$("A[href='#sixth']").click( function() {

			//close all accordian menus

			closeAllAccordians();												  

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.sixth a').addClass('current');

			return false;		

			});

			

			

			

			 // bind click event to link

			$("A[href='#seventh']").click( function() {

			//close all accordian menus

			closeAllAccordians();													

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.seventh a').addClass('current');

			return false;		

			});




			 // bind click event to link

			$("A[href='#eighth']").click( function() {

			//close all accordian menus

			closeAllAccordians();													

   			var tabContainers = $('div.tabs > div');

			tabContainers.hide();

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');				

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs li.eighth a').addClass('current');

			return false;		

			});

			

  });



					



 $(document).ready(function(){

    	var tabContainers = $('div.tabs > div');

		tabContainers.hide().filter(':first').show();

		

		$('div.tabs ul.contentTabs a').click(function () {

			//hide all tab containers

			tabContainers.hide();

			//show the selected tab container

			tabContainers.filter(this.hash).show();

			// clear the 'current' tab class

			$('div.tabs ul.contentTabs a').removeClass('current');	

			// set the the 'current' tab class for newly selected tab	

			$('div.tabs ul.contentTabs a')

			$(this).addClass('current');

			return false;		

			}).filter(':first').click();
 
 
 
 // start remember omniture vars

	var r_pageName = s.pageName;
	var r_channel = s.channel;
	var r_prop1 = s.prop1;
	var r_prop2 = s.prop2;
	var r_prop3 = s.prop3;
	var r_prop4 = s.prop4;
	var r_prop22 = s.prop22;
	var r_prop24 = s.prop24;
	var r_hier1 = s.hier1;
	
// end remember omniture tags

// Omniture Tracking Codes	

	if(window.location.host == 'professional.medtronic.com'){
		var report_suite_id ="medtronicprofessionalprod"
	};
	if(window.location.host == 'professional-test.medtronic.com'){
		var report_suite_id ="medtronicprofessionaldev"
	};

	$("ul.contentTabs a:not([href='#first'])").click(function() {
		//void(s.t());
		
		var c_html = $(this).attr("href");
		c_html = c_html.slice(1);
		c_html = "#" + c_html;
		var c_pageName = $(this).parent().parent().parent().children(c_html).children('.prose-container').children().html();
		
		s.pageName = r_pageName + ":" + c_pageName;
		s.prop4 = r_prop3 + ":" + c_pageName;
		s.eVar4  = r_prop3 + ":" + c_pageName;
		s.prop22 = r_prop22 + " - " + c_pageName;
		s.eVar22 = r_prop22 + " - " + c_pageName;
		s.hier1 = r_hier1 + "," + c_pageName;
		
		// call omniture
		s.t();
		
	});
	$("ul.contentTabs a[href='#first']").click(function() {
		//void(s.t());
		
		s.pageName = r_pageName;
		s.prop4 = r_prop3;
		s.eVar4 = r_prop3;
		s.prop22 = r_prop22;
		s.eVar22 = r_prop22;
		s.hier1 = r_hier1;

	// call omniture
		s.t();
		
	});

  });