/*
	googleAnalytics.js
*/

var ga_secondary_code = 'N';
var _gaq = _gaq || [];

function initializeGA (jsInternalRequestFlag, jsDefaultDomainFlag, jsHostName, jsNetlookTrackingCode, jsPluginsTrackingCode, jsSubdomainTrackingCode) {
	if (jsInternalRequestFlag == 'Y' || jsDefaultDomainFlag == 'Y') {
		<!--- Traffic in www.netlook.com and in jobs, homes is reported under a different code --->	
		_gaq.push(['_setAccount', jsNetlookTrackingCode]);
		_gaq.push(['_setDomainName', jsHostName]);	
		_gaq.push(['_trackPageview']);		
	}
	else {
		<!--- This is for traffic in all plugin pages --->
		_gaq.push(['_setAccount', jsPluginsTrackingCode]);		
		_gaq.push(['_trackPageview']);	
		if (jsSubdomainTrackingCode != '') {
			<!--- If customer has its own tracking code, use it too --->
			_gaq.push(['b._setAccount', jsSubdomainTrackingCode]);		
			_gaq.push(['b._setDomainName', jsHostName]);	
			_gaq.push(['b._trackPageview']);	
			ga_secondary_code = 'Y';	
		}
	}
}

function gaTrackPageViews(){
/*trackPageView(); */
  _gaq.push(['_trackPageview']);
  if (ga_secondary_code == 'Y'){
	  _gaq.push(['b._trackPageview']);  
  }
}

function trackGAEvent(category, action, label, value){
		if (value == '') {	
	 		_gaq.push(['_trackEvent', category, action, label]);
		    if (ga_secondary_code == 'Y'){				
		 		_gaq.push(['b._trackEvent', category, action, label]);			
			}
		}
		else {
	 		_gaq.push(['_trackEvent', category, action, label, value]);	
		    if (ga_secondary_code == 'Y'){				
		 		_gaq.push(['b._trackEvent', category, action, label, value]);			
			}						
		}
}	  
 
function trackVirtualPageView(virtual_page){
	 _gaq.push(['_trackPageview', virtual_page]);	
	  if (ga_secondary_code == 'Y'){	 	 
		 _gaq.push(['b._trackPageview', virtual_page]);	
	  }

} 

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

	 



