function SetCookie(country_code) {

var name = 'vm_land';
var value = country_code;
var expDays = 30;
var path = '/';
var domain = '';
var secure = '';

// Set cookie with name, value etc provided
// in function call and date from above
// Number of days the cookie should persist NB expDays='' or undef. => non-persistent
if (expDays != null ) {
var expires = new Date();
expires.setTime(expires.getTime() + (expDays*24*60*60*1000));
}
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;

var URL = unescape(window.document.location);
if (URL.indexOf("?") > -1) {
var list1 = URL.split("ref=");

var addtoPath = '';
if(value == 'de'){
 var addtoPath = 'L=0'; 
}
if(value == 'ch'){
 var addtoPath = 'L=1';
}
if(value == 'at'){
 var addtoPath = 'L=2';
}
if(value == 'lb'){
 var addtoPath = 'L=3';
}

if (list1[1].indexOf("?") > -1) {
	var getas = '&';
}else{
	var getas = '?';
	
}

//http://www.vermoegensmanufaktur.com
//window.location=(list1[1] + getas + addtoPath);
window.location=('http://www.vermoegensmanufaktur.com/' + getas + addtoPath);
}

}