function enter(Lan){
	var val = ""
	var moms = ""
	if (Lan == "DKK"){
		val = "Danmark"
		moms = "1"
	}
	if (Lan == "23"){
		val = "Sweden"
		moms = "1"
	}
	if (Lan == "18"){
		val = "Norway"
		moms = "0"
	}
	if (Lan == "1"){
		val = "Finland"
		moms = "1"
	}
	if (Lan == "11"){
		val = "Great Britain"
		moms = "1"
	}
	if (Lan == "2"){
		val = "France"
		moms = "1"
	}
	if (Lan == "3"){
		val = "Netherlands"
		moms = "1"
	}
	if (Lan == "4"){
		val = "Greece"
		moms = "1"
	}
	if (Lan == "5"){
		val = "Spain"
		moms = "1"
	}
	if (Lan == "6"){
		val = "Australia"
		moms = "0"
	}
	if (Lan == "7"){
		val = "Bulgaria"
		moms = "1"
	}
	if (Lan == "8"){
		val = "China"
		moms = "0"
	}
	if (Lan == "9"){
		val = "Estonia"
		moms = "1"
	}
	if (Lan == "10"){
		val = "Germany"
		moms = "1"
	}
	if (Lan == "12"){
		val = "Hong Kong"
		moms = "0"
	}
	if (Lan == "13"){
		val = "Italy"
		moms = "1"
	}
	if (Lan == "14"){
		val = "Japan"
		moms = "0"
	}
	if (Lan == "15"){
		val = "Latvia"
		moms = "1"
	}
	if (Lan == "16"){
		val = "Lithuania"
		moms = "1"
	}
	if (Lan == "17"){
		val = "Malaysia"
		moms = "0"
	}
	if (Lan == "19"){
		val = "Poland"
		moms = "1"
	}
	if (Lan == "20"){
		val = "Romania"
		moms = "1"
	}
	if (Lan == "21"){
		val = "Russia"
		moms = "0"
	}
	if (Lan == "22"){
		val = "Singapore"
		moms = "0"
	}
	if (Lan == "24"){
		val = "Thailand"
		moms = "0"
	}
	if (Lan == "25"){
		val = "Turkey"
		moms = "0"
	}
	if (Lan == "26"){
		val = "Ukraine"
		moms = "0"
	}
	if (Lan == "27"){
		val = "United Arab Emirates"
		moms = "0"
	}
	
	//alert(val)
	
	
	if (val == "USA" || val == "Danmark"){
		Cur = Lan
	}
	else{
		Cur = "EURO"
	}
	if (val == "Canada"){
		Cur = "USD"
	}

	var Split = false
	var expires = new Date();
	expires.setTime(expires.getTime()+(1000*60*60*24*1));
	document.cookie = "divbox="+Lan+"; expires="+expires.toGMTString()+"; path=/";
	document.cookie = "CheckReload=0; expires="+expires.toGMTString()+"; path=/";
	var CurrentLocation_tmp = location.href
	if(CurrentLocation_tmp.split("?")){
		CurrentLocation_tmp2 = CurrentLocation_tmp.split("?")
		if(CurrentLocation_tmp2.length > 1){
			Split = true
		}
	}
	
	//if(moms == "1"){
			CurrentLocation = CurrentLocation_tmp
	//} else {
	//	if(Split == true){
	//		CurrentLocation = CurrentLocation_tmp+"&togglevat=1"
	//	} else {
	//		CurrentLocation = CurrentLocation_tmp+"?togglevat=1"
	//	}
	//}
	
	//alert(CurrentLocation_tmp)
	location.href = CurrentLocation
	
}

function SetCur(Val){
	//alert(Val)
	if (Val == "USD" || Val == "DKK"){
		ChangeCurrency(Val)
	}
	else if(Val == "USD2"){
		ChangeCurrency("USD")
	}
	else{
		ChangeCurrency("EUR")
	}
}

function leave(){
window.close()
}

function forget(){
	var expires = new Date();
	expires.setTime(expires.getTime()-1);
	document.cookie = "divbox=; expires="+expires.toGMTString()+"; path=/";
	Loc = location.href;
	location.href = Loc;
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) 
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function exist(){
	var dc = document.cookie;

	if(dc.length > 0){
		begin = dc.indexOf("divbox");
		if(begin != -1){
			begin += "divbox".length+1;
			end = dc.indexOf(";", begin);
			
        	if(end == -1){
				end = dc.length;
			}
			
			str = dc.substring(begin, end);
			
			if(str.length > 0){
				return(str);
			}else{
				return(false);
			}
		}else{
			return(false);
		}
	}else{
		return(false);
	}
}

check = readCookie("divbox");

if(check == null)
{

	document.write ("<DIV id='Warning' bgcolor='#ff0000' align='center'>"
	+					"<TABLE border='0' align='center' cellspacing='0' cellpadding='0' id='WarningInner'>"
	+						"<TR>"
	+							"<TD id='PopUpImg' style='padding:25px 0px 0px 0px;'>"
	+								"<SELECT id='SelectBox' name='Country' onchange='SetCur(this.value),enter(this.value);'>"
	+									"<OPTION selected value='chose'>Choose Country</OPTION>"
	+ 									"<OPTION value='DKK'>Denmark</OPTION>"
	+ 									"<OPTION value='6'>Australia</OPTION>"
	+									"<OPTION value='7'>Bulgaria</OPTION>"
	+ 									"<OPTION value='8'>China</OPTION>"
	+									"<OPTION value='9'>Estonia</OPTION>"
	+ 									"<OPTION value='1'>Finland</OPTION>"
	+									"<OPTION value='2'>France</OPTION>"
	+									"<OPTION value='10'>Germany</OPTION>"
	+ 									"<OPTION value='11'>Great Britain</OPTION>"
	+ 									"<OPTION value='4'>Greece</OPTION>"
	+ 									"<OPTION value='12'>Hong Kong</OPTION>"
	+ 									"<OPTION value='13'>Italy</OPTION>"
	+ 									"<OPTION value='14'>Japan</OPTION>"
	+ 									"<OPTION value='15'>Latvia</OPTION>"
	+ 									"<OPTION value='16'>Lithuania</OPTION>"
	+ 									"<OPTION value='17'>Malaysia</OPTION>"
	+ 									"<OPTION value='3'>Netherlands</OPTION>"
	+ 									"<OPTION value='18'>Norway</OPTION>"
	+ 									"<OPTION value='19'>Poland</OPTION>"
	+ 									"<OPTION value='20'>Romania</OPTION>"
	+ 									"<OPTION value='21'>Russia</OPTION>"
	+ 									"<OPTION value='22'>Singapore</OPTION>"
	+ 									"<OPTION value='5'>Spain</OPTION>"
	+ 									"<OPTION value='23'>Sweden</OPTION>"
	+ 									"<OPTION value='24'>Thailand</OPTION>"
	+ 									"<OPTION value='25'>Turkey</OPTION>"
	+ 									"<OPTION value='26'>Ukraine</OPTION>"
	+ 									"<OPTION value='27'>United Arab Emirates</OPTION>"
	+								"</SELECT>"
	+							"</TD>"
	+						"</TR>"
	+						"<TR>"
	+						"<td><div id='Link' style='position:relative;left:418px;'><a href='http://www.kleemann.dk/contact.aspx' target='_Blank' style='text-decoration:underline;'><font color='#828282' style='font-size:11px;text-decoration:underline;'>here</font></a></div></td>"
	+						"</TR>"
	+					"</TABLE>"
	+				"</DIV>");
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		Height = $(window).height()//screen.height-205
		Width = $(window).width()//screen.width-21
		document.getElementById("warning").style.width = Width;
		document.getElementById("warning").style.height = Height;
		document.getElementById("Link").style.top = "-88px";
	}
	else
	{
		Height = $(window).height()//screen.height-205
		Width = $(window).width()
		//alert(Width)
		document.getElementById("Warning").style.position = "absolute";
		document.getElementById("Warning").style.width = Width;
		document.getElementById("Warning").style.height = Height;
		document.getElementById("Link").style.top = "-87px";
	}
}


$(window).resize(function() {
  document.getElementById("Warning").style.width = $(window).width();
  document.getElementById("Warning").style.height = $(window).height();
});

jQuery.each(jQuery.browser, function(i, val) {
	if(i == "safari" && val == true){
		var Select = $('#SelectBox');
		Select.css({
			'top': '15px'//document.getElementById('fancy_outer').style.top
		}); 
		var Link = $('#Link');
		Link.css({
			'top' : '-59px'
		});
	}
});
	
	  

