
function trackEvent(el,type,o){

	delete s.events;
	/*
	delete s.channel;
	delete s.campaign;
	delete s.products;
	delete s.state;
	delete s.transactionID;
	delete s.purchaseID;
	*/
	for(var i=0; i<=50; i++){
		delete s['eVar'+i];
		delete s['prop'+i];
	}
	
	for(key in o){
		s[key] = o[key];
	}

	s.pageName = pageNamePrefix+o.pageName;

	if(type=='page'){
		void(s.t());
	}else{
		
		var t = 'o';
		if(type=='download'){t='d'; el=false;}
		if(type=='click'){t='o'; el=false;}
		if(type=='link'){t='o';}
		if(type=='exit'){t='e';}
		if(type=='other'){t='o';}
		void(s.tl(el,t,s.pageName));
	
	}
	try{
		debugOmniture(s,type,s.pageName)
	}catch(e){}
}

jQuery.fn.trackEvent = function(t,o){ $(this).click(function(){trackEvent($(this)[0],t,o)}) }


$(function(){ 

	$(".trackevent-search-note").trackEvent('click',{pageName:'Search:Note',channel:'Search'});

	$(".trackevent-product-events").trackEvent('page',{pageName:'Product:Events',channel:'Product' });
	$(".trackevent-product-services").trackEvent('page',{pageName:'Product:Services',channel:'Product'});
	$(".trackevent-product-dates").trackEvent('page',{pageName:'Product:Dates',channel:'Product'});
	$(".trackevent-product-countryinfos").trackEvent('page',{pageName:'Product:CountryInfos',channel:'Product'});
	$(".trackevent-product-gallery a").trackEvent('page',{pageName:'Product:Gallery',channel:'Product'});
	$(".trackevent-product-map>*").trackEvent('page',{pageName:'Product:Map',channel:'Product'});
	$(".trackevent-product-print").trackEvent('page',{pageName:'Product:Print',channel:'Product'});
	$(".trackevent-product-recommend").trackEvent('page',{pageName:'Product:Recommend',channel:'Product'});

	$(".trackevent-press-release").trackEvent('page',{pageName:'Press:Release',channel:'Press'});
	$(".trackevent-press-comments").trackEvent('page',{pageName:'Press:Comments',channel:'Press'});
	$(".trackevent-press-pictures").trackEvent('page',{pageName:'Press:Pictures',channel:'Press'});

	
	$(".trackevent-notepad-addremove").click(function(){
		trackEvent(false, 'click', {
			pageName: $(this).hasClass('unchecked') ? 'Notepad:Remove' : 'Notepad:Add', //umgekehrte Logik, weil class zu erst geändert wird
			channel: 'Notepad', 
			products: ';'+$(this).attr('id').split('-')[1]
		}); 
	});
	
	$(".trackevent-notepad-clear").click(function(){
		trackEvent(false, 'click', {pageName: 'Notepad:Clear', channel: 'Notepad'}); 
	});
	
	$(".trackevent-compare-addremove").click(function(){
		trackEvent(false, 'click', {
			pageName: $(this).hasClass('unchecked') ? 'Compare:Remove' : 'Compare:Add', //umgekehrte Logik, weil class zu erst geändert wird
			channel: 'Compare', 
			products: ';'+$(this).attr('id').split('-')[1] 
		}); 
	});
	
	$(".trackevent-compare-remove").click(function(){
		trackEvent(false, 'click', {pageName: 'Compare:Remove',	channel: 'Compare',	products: ';'+$(this).attr('rel')}); 
	});
	
	$(".trackevent-compare-clear").click(function(){
		trackEvent(false, 'click', {pageName: 'Compare:Clear',	channel: 'Compare'}); 
	});
	
	
	$(".trackevent-tuv").trackEvent('page',{pageName:'TÜV',channel:'TÜV'});
	

	//$(".item").trackEvent('click',{pageName:'TEST',channel:'TEST'});
	//$(".trackevent-").trackEvent('',{pageName:'',channel:''});

	
	/*
	$("input").click(function(){ alert('return false'); this.blur(); return false });
	$("input").bind('click',function(){ alert('bind'); })
	$("input").live('click',function(){ alert('live'); })
	*/
	
	
	
	
});


