//	Browsertype
ie4		= (document.all && !document.getElementById)?1:0						//IE 4+
ie5		= (document.all && document.getElementById)?1:0							//IE 5.0
ie55	= (document.all && document.fireEvent && !document.createComment)?1:0	//IE 5.5
ie6		= (document.all && document.fireEvent && document.createComment)?1:0	//IE 6.0
ns4		= (document.layers)?1:0								//NN 4+
ns6		= (document.getElementById && !document.all)?1:0	//NN 6+ & Opera
op7		= (window.opera && document.createComment)?1:0		//Opera 7.0
op6		= (window.opera && !document.createComment)?1:0		//Opera 6.0 og under


//	-----------------------------------
//		Questionnaire
//	-----------------------------------
function closeQ(){
	document.getElementById("div-block").style.display = "none";
	document.getElementById("div-questions").style.display = "none";
}

//	-----------------------------------
//		Webshop
//	-----------------------------------
function showDoc(Doc_ID, wWidth, wHeight)
{
	window.open('view.asp?doc_id='+Doc_ID,'win_st', 'directories=0,location=0,toolbar=1,menubar=0,status=0,resizable=1,dependent=1,scrollbars=0,fullscreen=0, left=5, top=5, width='+wWidth+', height='+wHeight);
}

function displayDiv(ident)
{
	displayStatus = document.getElementById([ident]).style.display;
	
	if(displayStatus == 'none')
	{
		document.getElementById([ident]).style.display = 'block';
	}else{
		document.getElementById([ident]).style.display = 'none';
	}
}

function changeCType(inpVal) {
	if (inpVal==1) {
		document.getElementById('tr_company').style.display='none';
		document.getElementById('tr_cvr').style.display='none';
	}
	else if (inpVal==2) {
		document.getElementById('tr_company').style.display='block';
		document.getElementById('tr_cvr').style.display='block';
	}
}



function openPrintWin(docID)
{
	win_pf = window.open('win_print.asp?id='+docID,'win_pf2','locationbar=no,menubar=no,resizable=no,toolbar=yes,status=yes,scrollbars=yes,width=664,height=500');
	win_pf.moveTo (5, 5);
	win_pf.focus();
}

function openTevWin(docID)
{
	win_tev = window.open('win_tip_friend.asp?action=display&id='+docID,'win_tev2','locationbar=no,menubar=no,resizable=no,toolbar=no,status=no,scrollbars=no,width=320,height=440');
	win_tev.moveTo (5, 5);
	win_tev.focus();
}

function openTevGeneric(ps_url){
	win_tev = window.open('win_tip_gen.asp?action=display&url='+ps_url,'win_tev2','locationbar=no,menubar=no,resizable=no,toolbar=no,status=no,scrollbars=no,width=320,height=440');
	win_tev.moveTo (5, 5);
	win_tev.focus();	
}

function gotoid(id)
{
	self.location.href = 'default.asp' + id;
}

function gotopage(page, id)
{
	self.location.href = page + id;
}

function statusTxt(txt)
{
	window.status = txt;
}

function openwin(ident)
{
	switch(ident)
	{
		case 'ident':
			kWin = window.open('kampagner/periode/x.asp','k_win','locationbar=no,menubar=no,resizable=no,toolbar=no,status=no,scrollbars=yes,width=480,height=370');
			kWin.moveTo (5, 5);
			kWin.focus();
			break
	}
}

function defaultPage()
{
	if (ns4||ns6||op6||op7)
	{
		alert('Denne facilitet virker kun, hvis du benytter Internet Explorer.');
	}else{
		strThisPage = self.location.href;
		dpLink.style.behavior='url(#default#homepage)';
		dpLink.setHomePage(strThisPage);
	}
}

function addToFav()
{
	if (ns4||ns6||op6||op7)
	{
		alert('Klik på [CTRL + D] for at tilføje denne side under \'Foretrukne\'.');
	}else{
		strThisPage = self.location.href;
		window.external.AddFavorite(strThisPage, strThisPage);
	}
}

function chkFrmPoll(frm)
{
	var blnSelection = false
	tagLength	= frm.rad_qps.length

	for(var i = 0; i <= tagLength-1; i++)
	{
		chkStatus = frm.rad_qps[i].checked
		if(chkStatus == true)
		{
			qps_id = frm.rad_qps[i].value;
			blnSelection = true;
		}
	}

	if(blnSelection == true)
	{
		document.getElementById("qps_id").value = qps_id;
	}else{
		alert('Du skal vælge en besvarelse.');
		return (false);
	}
}

//	-----------------------------------
//		Newsletter
//	-----------------------------------
function checkNewsletterForm(frm)
{
	//	Checker om brugeren har klikket på "Tilmeld"- eller "Afmeld"-knappen (tryk på [Return] for submit er dermed deaktiveret)
	btnStatus = document.getElementById('btn_status').value
	if (btnStatus == "0"){return(false)};
	
	//	Checker email-adresse
	if (frm.txt_email.value!="")
	{
		if (checkEmail(frm.txt_email)==false)
		{
			frm.txt_email.focus();
			return(false);
		}
	}else{
		alert('Du skal indtaste din email-adresse for at blive tilmeldt/afmeldt.');
		frm.txt_email.focus();
		return(false);
	}
}
function changeBtnStatus(ident)
{
	document.getElementById('btn_status').value = ident;
}


//	-----------------------------------
//		Gallerier
//	-----------------------------------
function fncGallery_Pic_Vis(id)
{
	window.open('gal_pic_001.asp?id='+id,'win_picshow', 'directories=1,location=0,toolbar=1,menubar=0,status=0,resizable=1,dependent=1,scrollbars=1,fullscreen=0,left=5,top=5,width=700,height=600');
}
function openGallery(inpG_ID)
{
	location.href = '?action=show_gal_pics&g_id='+inpG_ID;
}
