// Bust frames
if (window != top) top.location.href = location.href;

function encodemail(country,domain,name,linktekst) {
	if(linktekst != "") {
	document.write('<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;'+name+'&#064;'+domain+'&#46;'+country+'">'+linktekst+'</a>');
	}
	else {
	document.write('<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;'+name+'&#064;'+domain+'&#46;'+country+'">'+name+'&#064;'+domain+'&#46;'+country+'</a>');
	}
}

// AJAX
var ajaxresponse = '';


// Newsletter
function checkvalue(sprog) {
var newsletterok1 = false;
var newsletterok2 = false;
var newsletterok3 = false;
var nbstring = document.newsletter.newsemail.value;
	if(sprog=='da') {
		js_news1 = "Din e-mail";
		js_news2 = "Husk at indtaste din e-mail";
		js_news3 = "Vælg nyhedsbrev";
		js_news4 = "Husk at vælge nyhedsbrev";
		js_news5 = "Indtast en korrekt e-mail-adresse."
	}
	else {
		js_news1 = "Your email";
		js_news2 = "Please enter your email";
		js_news3 = "Choose newsletter";
		js_news4 = "Remember to choose newsletter";
		js_news5 = "Please enter correct email-addres."
	}
	if (document.newsletter.newsemail.value != js_news1 && document.newsletter.newsemail.value !='') {
	newsletterok1 = true;
	} else alert(js_news2);
	if (document.newsletter.newstype.value != js_news3 && document.newsletter.newstype.value !='') {
	newsletterok2 = true;
	} else alert(js_news4);
	
	for (i=0; i< nbstring.length; i++) {
			if (nbstring.charAt(i) == '@') newsletterok3 = true;
			}
	if (newsletterok3) { // vis kun én gang
	for (i=0; i< nbstring.length; i++) {
			if (nbstring.charAt(i) == '.') newsletterok3 = true;
			}
	}
	if (newsletterok3 == false) alert(js_news5);
	if (newsletterok1 && newsletterok2 && newsletterok3) {
	document.newsletter.submit();
	}
}


// Skype
var skypeNum = -1
	function getSkypeStatus() {
		if (ajaxresponse == 2) { // online fundet!
			 if (document.images) { // Vis billede
				document.getElementById("skypeustekst").style.display = "block";
				document.getElementById("skypeuspic").style.display = "block";
				document.getElementById("skype_getstatus").style.display = "none";
				document.getElementById("skype_no_online").style.display = "none";
				document['skypepic'].src = eval("skype"+skypeNum+".src");
				document.getElementById("skypelink_1").href = "skype:"+arrSkypeName[skypeNum]+"?call";
				document.getElementById("skypelink_2").href = "skype:"+arrSkypeName[skypeNum]+"?call";
				document.getElementById("skypelink_3").href = "skype:"+arrSkypeName[skypeNum]+"?call";
				document.getElementById("skypelink_4").href = "skype:"+arrSkypeName[skypeNum]+"?call";
				document.getElementById("skypelink_3").childNodes[0].nodeValue = arrSkypeNavn[skypeNum]
  			}
		AJAX('GET','skype_session.asp?skypename='+arrSkypeName[skypeNum]+'&skypenavn='+arrSkypeNavn[skypeNum],'') // set session
		}
		else if (skypeNum < skypeTotal) { // test bruger
		skypeNum = skypeNum +1;
		AJAX('GET','ajax_redirect.asp?ajaxurl=http://mystatus.skype.com/'+arrSkypeName[skypeNum]+'.num','');
		setTimeout("getSkypeStatus();",1500); // 1,5 sekund
		}
		else if (skypeNum == skypeTotal) { // ingen online
		AJAX('GET','skype_session.asp',''); // set session
		document.getElementById("skypeustekst").style.display = "none";
		document.getElementById("skypeuspic").style.display = "none";
		document.getElementById("skype_getstatus").style.display = "none";
		document.getElementById("skype_no_online").style.display = "block";
		}
	}


function GetFlash(flashdata,flashwidth,flashheight,hmtlcontent) {
	hmtlcontent = '<a class="nohover" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" onclick="this.target=\'_blank\'"><img src="pics/hent_flash.gif" border="0" width="89" height="85" alt="Hent Flash" /></a>';
	hmtlcontent = hmtlcontent.replace(/&lt;/g,"<");
	hmtlcontent = hmtlcontent.replace(/&gt;/g,">");
	strFlash = '<object type="application/x-shockwave-flash" data="'+flashdata+'" width="'+flashwidth+'" height="'+flashheight+'">\n'
		+ '<param name="movie" value="'+flashdata+'" />'
		+ hmtlcontent
		+ '</object>'
	document.write(strFlash);
}

function PlayFlashFLV(flashdata,flashwidth,flashheight,autostart,startimage) {
	hmtlcontent = '<a class="nohover" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" onclick="this.target=\'_blank\'"><img src="pics/hent_flash.gif" border="0" width="89" height="85" alt="Hent Flash" /></a>';
	hmtlcontent = hmtlcontent.replace(/&lt;/g,"<");
	hmtlcontent = hmtlcontent.replace(/&gt;/g,">");
	flashdata = escape(flashdata);
	if (startimage !='') {flashdata = "flvplayer.swf?autostart="+autostart+"&file="+flashdata+"&image=pics%2Fbilleder%2F"+startimage;}
	else flashdata = "flvplayer.swf?autostart="+autostart+"&file="+flashdata;
	strFlash = '<object type="application/x-shockwave-flash" data="'+flashdata+'" width="'+flashwidth+'" height="'+flashheight+'">\n'
		+ '<param name="movie" value="'+flashdata+'" />'
		+ hmtlcontent
		+ '</object><br />';
	document.write(strFlash);
}

function NoPlayFlashFLV(flashdata,flashwidth,flashheight,autostart,startimage) {
	hmtlcontent = '<div style="height:'+flashheight+'px"><a class="nohover" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" onclick="this.target=\'_blank\'"><img src="pics/hent_flash.gif" border="0" width="89" height="85" alt="Hent Flash" /></a></div>';
	hmtlcontent = hmtlcontent.replace(/&lt;/g,"<");
	hmtlcontent = hmtlcontent.replace(/&gt;/g,">");
	document.write(hmtlcontent);
}


