	function registerTabs(){
		// Track clicks to the tabs and toggles:
		Event.observe($('tab'+_nsdlalignedTab.getTabId()),'click', trackTopPicks);
		Event.observe($('tab'+_nsdlrelatedTab.getTabId()),'click', trackRelatedResources);
		Event.observe($('tab'+_nsesTab.getTabId()),'click', trackNSES);
		Event.observe($('tab'+_bmTab.getTabId()),'click', trackRelatedBenchmarks);	
	}
	
	function trackMisconceptions(){
		var mapId = StrandMap.getMapId();
		// if open register a close
		// if closed register an open
		//$$('.misconceptionLinkOpen')
		if(!isMisconceptionsDown){
			googleTrack('/content_click/student_misconceptions/'+mapId+'/');
		}
	}
	
	function trackViewLink() {
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		if(id){
			googleTrack('/ui_click/link/link_to_this_page/'+mapId+'/'+id+'/');
		} else {
			googleTrack('/ui_click/link/link_to_this_page/'+mapId+'/');
		}
	}
	
	function trackPrintPdf(){
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		if(id){
			googleTrack('/content_click/map_pdf_button/'+mapId+'/'+id+'/');
		} else {
			googleTrack('/content_click/map_pdf_button/'+mapId+'/');
		}
	}
	function trackTopPicks(){
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		googleTrack('/content_click/tab/top_picks/'+mapId+'/'+id+'/'+resStrictPager+'/');
	}
	function trackRelatedResources(){
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		
		googleTrack('/content_click/tab/related_resources/'+mapId+'/'+id+'/'+resPager+'/');
	}

	function trackNSES(){
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		
		googleTrack('/content_click/tab/nses/'+mapId+'/'+id+'/');
	}

	function trackRelatedBenchmarks(){
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		
		googleTrack('/content_click/tab/related_benchmarks/'+mapId+'/'+id+'/');
	}
	function trackPrintButtons(){
		var id = StrandMap.getSelectedBenchmarkId();
		var mapId = StrandMap.getMapId();
		if(id){
			googleTrack('/ui_click/print_command_button/'+mapId+'/'+id+'/');
		} else {
			googleTrack('/ui_click/print_command_button/'+mapId+'/');
		}
	}	
	
	function gaTrackResource(gaURL,collections,resource,position){
		// clickType possibilities
		   // open_resource
		   // send the shortened domain along with each collection id to google
		   var collection = collections.split('|');
		   var coll_len = collection.length;
		   
		   for(var i= 0;i<coll_len;i++){
		   	googleTrack(gaURL+collection[i]+'/'+resource+'/'+position);
		   	// send resource clicks to nsdl as well
		   	if(typeof(nsdlTracker) != 'undefined') {
			   	var path = '/sms/resource_click/'+collection[i]+'/'+resource+'/'+position;
                nsdlTracker._trackPageview(path);
   
                log("google tracker: " + path);
        	}
		   }
	}
	function gaTrackResViewMore(gaURL,collections,resource,position){
		// clickType possibilities
		   // open_resource
		   // send the shortened domain along with each collection id to google
		   var collection = collections.split('|');
		   var coll_len = collection.length;
		   
		   for(var i= 0;i<coll_len;i++){
			var path = gaURL+collection[i]+'/'+resource+'/'+position;
		   	googleTrack(path);
		   }
	}
	
	
	function resPagerTrack(path,pager){
		resPager = pager;
		googleTrack(path);
	}
	function resStrictPagerTrack(path,pager){
		resStrictPager = pager;
		googleTrack(path);
	}
	
	//Google analytics tracking for links, clicks, etc.
	function googleTrack(path) {
		
        if(typeof(nsdlSmsTracker) != 'undefined') {
                nsdlSmsTracker._trackPageview(path);
   
                log("google tracker: " + path);
        }
	}

	function log(m) {
        if(window.console)
                window.console.log(m);
        //else
                //alert(m);
	}

