// JavaScript Document
function afrund(i) {
	i = i+'';i = (i.indexOf(','))?i.replace(',','.'):i;
	i = Math.round(i*100)/100;i = (i+0.001)+'';
	return i.substring(0,i.indexOf('.')+3);		
}

function kroner(input){
	icheck = input;input = afrund(input);
	kro = parseInt(input.substring(0,input.indexOf('.')));
	ore = parseFloat((input.substring(input.indexOf('.')+1)));
	ore = (ore/100)+0.001;
	ore = (ore < 0.13)?0.00:(ore >= 0.13 && ore <= 0.37)?0.25:(ore > 0.37 && ore <= 0.63)?0.50:(ore > 0.63 && ore <= 0.83)?0.75:1.00;
	result = kro+ore;result = afrund(result);
	if (isNaN(result)) {
		alert('Fuktionens input : '+icheck+' er ikke gyldigt...\n\n ¤ Forkert talformat...');return '';
	} else {
		return result = result.replace('.',',');
	}
}

function fn_HideAllDescriptions(input)
{
	var oEle = document.getElementsByTagName('DIV');
	
	for(var i = 0; i < oEle.length; i++)
	{
		if(oEle[i].id.indexOf('_description') != -1)
		{
			if(oEle[i].id == input)
			{		
				if(oEle[i].style.display=='none')
				{
					oEle[i].style.display='block';
				
				} else {
				
					oEle[i].style.display='none';
				}

			} else {
			
				oEle[i].style.display='none';
			}
		}
	}
}

function fn_PrintProduct(sInput)
{
	var myWin = window.open('print.asp?sId='+sInput,'myWin','');
}

function hint(input, html, pv)
{
	var oEle = input;
	var oParent = oEle.parentNode;
	while(oParent.id != 'finder')
	{
		oParent = oParent.parentNode;
	}
	
	var sHtml = ''
		sHtml += '<div class="popbox_outer"><table border="0" cellpadding="0" cellspacing="0" width="100%">'
		sHtml += '<tr>'
		sHtml += '	<td width="10" height="10"><img src="images/website/popbox_top_l.gif" width="10" height="10" /></td>'
		sHtml += '	<td width="100%" style="background:url(images/website/popbox_top_m.gif) repeat-x;"><img src="images/website/popbox_top_m.gif" width="10" height="10" /></td>'
		sHtml += '	<td width="10" height="10"><img src="images/website/popbox_top_r.gif" width="10" height="10" /></td>'
		sHtml += '</tr>'
		sHtml += '<tr>'
		sHtml += '	<td colspan="3" class="popbox_inner">'+html+'</td>'
		sHtml += '</tr>'
		sHtml += '<tr>'
		sHtml += '	<td width="10" height="10"><img src="images/website/popbox_bot_l.gif" width="10" height="10" /></td>'
		sHtml += '	<td width="100%" style="background:url(images/website/popbox_bot_m.gif) repeat-x;"><img src="images/website/popbox_bot_m.gif" width="10" height="10" /></td>'
		sHtml += '	<td width="10" height="10"><img src="images/website/popbox_bot_r.gif" width="10" height="10" /></td>'
		sHtml += '</tr>'
		sHtml += '</table></div>'
		
	var oObj = document.getElementById('demoer');
	
		oObj.innerHTML = sHtml;
		oObj.style.display = 'block';
		oObj.style.top = parseInt(oParent.offsetTop - oObj.offsetHeight + ((document.all)?19:12), 10) +'px';
		oObj.style.left = parseInt(oParent.offsetLeft + pv, 10) +'px';
}
function hintClose()
{
	var oObj = document.getElementById('demoer');
		oObj.style.display = 'none';
}

