document.write('<script type="text/javascript">jsver = 1.0;</script><script language="Javascript1.1">jsver = 1.1;</script><script language="Javascript1.2">jsver = 1.2;</script><script language="Javascript1.3">jsver = 1.3;</script><script language="Javascript1.4">jsver = 1.4;</script><script language="Javascript1.5">jsver = 1.5;</script><script language="Javascript1.6">jsver = 1.6;</script>');
function Set_Cookie( name, value, expires, path, domain, secure )
{

var expires_date = new Date();
	expires_date.setHours(expires_date.getHours() + expires);
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function Clone_Cookie( name, value, expires, path, domain, secure )
{
expires = decodeURIComponent(expires).replace(/\+/g, '%20');
var expires_date = new Date(expires);
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}

function gup( name ){  
	
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";  
	var regex = new RegExp( regexS );  
	var results = regex.exec( window.location.href );  
	if( results == null )    
		return "";  
	else    
		return results[1];
}


function adtraffic_sem_tracking_image(turnover, action){//, param_a, param_b, param_c) {
	var session_id = '';
	var performance_id = '';
	var adtraffic_is_first_request = false;
	var adtraffic_is_reentrant_request = false;
	
	
	if (action == undefined || action == null) { action = ''; } 
	if (turnover == undefined || turnover == null) { turnover = 0; } 
	if (gup('dsadtraid')!='')
	{
			if (gup('dsadtrasessiondate')!=''){
			Clone_Cookie('adtraffic_sessionid', gup('dsadtrasession'), gup('dsadtrasessiondate'));
			Clone_Cookie('adtraffic_performanceid', gup('dsadtraid'), gup('dsadtrasessiondate'));
			}
			else
			{
			Set_Cookie('adtraffic_sessionid', gup('dsadtrasession'), 24*30,'/');
			Set_Cookie('adtraffic_performanceid', gup('dsadtraid'), 24*30,'/');
			}
			Set_Cookie('adtraffic_currentsession',gup('dsadtraid'),1,'/');
	
	}
	if(gup('adtraid') != ''){
			session_id = gup('adtrasession');
			Set_Cookie('adtraffic_sessionid', session_id, 24*30,'/');
			var adtraffic_is_first_request = true;
			performance_id = gup('adtraid');
			Set_Cookie('adtraffic_performanceid', performance_id, 24*30,'/');
	}
	else
	if( Get_Cookie('adtraffic_performanceid')!=null)
	{
		if(Get_Cookie('adtraffic_currentsession')==null){
		adtraffic_is_reentrant_request = true;
		}
		performance_id = Get_Cookie('adtraffic_performanceid');
		session_id 	   = Get_Cookie('adtraffic_sessionid');
		
		
	}
	
	Set_Cookie('adtraffic_currentsession',performance_id,1,'/');
	
	if (session_id != '') {
			if(action == '')
			{
				action = "VIEW";
				if (adtraffic_is_first_request === true) {
					action = "START";
					adtraffic_is_first_request = false;
				}					
				if (adtraffic_is_reentrant_request === true) {
					action = "REENTRY";
					adtraffic_is_reentrant_request = false;
				}
			
				if (turnover > 0) {
					action = "CONVERSION";
			}
	}
			

	var trackHost = (("https:" == document.location.protocol) ? "https://" : "http://");
	var image_url = trackHost + "tracking.adtraffic.de/tracker/track.gif?";
	// test value
	//	var image_url = "images/at_seo.gif?"; 
	//
	image_url += "sessionid=" + session_id;
	image_url += "&performanceid=" + performance_id;
	image_url += "&code=" + action;
	if( turnover > 0){
		image_url += "&turnover=" + turnover;
	}
			
			//if (param_a != undefined && param_a != null) {
			//	image_url += "&paramA=" + param_a;
			//} 
			//if (param_b != undefined && param_b != null) {
			//	image_url += "&paramB=" + param_b;
			//} 
			//if (param_c != undefined && param_c != null) {
			//	image_url += "&paramC=" + param_c;
			//} 

		
		document.write('<img src="' + image_url + '" alt="Image" />');
		//for testing:
		//document.write(' src="' + image_url + '" alt="Image" ');
		}
		//else
		//document.write('\r\nDEBUGGING INFO: there is no information about trakcing in the url\n');
	}

