	if(document.location.search != ''){
	var pURL = document.location.search
	var url = String(window.location);
	//alert('cookie');
}
else {
}

if(!pURL){
	//alert('no cookie');
	}
else {
	var undef = url.split("?");
	
	var args = undef[1].split("&");
	for(i = 0; i<args.length; i++) {
		var a = args[i].split("=");
		if (a[0].toUpperCase() == "BELBOON") {
			createCookie( "_LAST",'belboon',60);
			createCookie( "_BELBOON",a[1],60);
			//Belboon
		}
		
		 if (a[0].toUpperCase() == "BID") {
			createCookie( "_LAST",'adcell',60);
			createCookie( "_ADCELL",a[1],60);
			var afid = a[1];
			//Adcell
			
		}
		//if (a[0].toUpperCase() == "ZXID") {
		//	createCookie( "_LAST",a[0],60);
		//	createCookie( "_ZXID",a[1],60);
		//	var zxid = a[1];
			//Zanox	
			
		//}
		if (a[0].toUpperCase() == "CJID") {
			createCookie( "_LAST",'cj',60);
			createCookie( "_CJ",a[1],60);
			var afid = a[1];
			//Commission Junction
			
		}
		
		
		if (a[0].toUpperCase() == "MGMREFID") {
			createCookie( "_LAST",a[0],60);
			createCookie( "_MGMREFID",a[1],60);
			var zxid = a[1];
			//Freundschaftswerbung	
			
		}
		
			
	
	}
	
}





function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function find_id(url)
{
		var val = url.split("?");
		var nval = val[1].split("=");
		var value = nval[1];
		return value;
	}
