<!--
function Showhide(obj){
	if (document.all[obj].style.display == 'none'){
		//Vis menuen!
		document.all[obj].style.display='';
		setCookie(obj,'on');
	}else{
		//Skjul menuen!
		document.all[obj].style.display='none';
		deleteCookie(obj);
	}
}

function StartMenu(obj){
	if (getCookie(obj) == 'on'){
		document.all[obj].style.display='';
		}
	}
	
function CheckFields(obj){
	if (obj.searchfield.value=='' || obj.searchfield.value=='Søgetekst her..'){
		alert('Du skal skrive noget!');
		obj.searchfield.focus();
	}else{
		obj.submit();
	}
}

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function PicPopup(link) {
	window.open(link, 'pic', 'height=10,width=10,top=150,left=125,status=yes');
}

function OpenWin(link,h,w,other) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	window.open(link, 'popup', 'height='+h+',width='+w+',top=50,left=25,'+other);
}

function AdminPopup() {
	var winl = (screen.width - 217) / 2;
	var wint = (screen.height - 110) / 2;
	window.open('/admin/smalllogin.asp', 'admin', 'height=110,width=217,top='+wint+',left='+winl+'');
}

function maskKeyPress(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode==44) return true;
	  if(iKeyCode>=48 && iKeyCode<=57) return true;
	  if(iKeyCode==13) return true;
	  return false;
	}

function printpage(){
	window.print();
	}
	
function findMatch(val){
	sel = document.getElementById('productID');
	for(i=0;sel.length>i;i++){
		if(sel.options[i].value==val){
			sel.options[i].selected = true;
			sel.selectedIndex = i;
			displayprice(sel.options[i].text);
		break;
		}
		
	}
	
}

function findMatch3(val){
	sel = document.getElementById('catalogID');
	for(i=0;sel.length>i;i++){
		if(sel.options[i].value==val){
			sel.options[i].selected = true;
			sel.selectedIndex = i;
		break;
		}
	}
	
}

function findMatch2(val){
    sel = document.getElementById('productID');
    var strFindVal = val.toUpperCase();
    for(i=0;sel.length>i;i++)
    {
        var strSelText = sel.options[i].text.toUpperCase();
        
        if(strSelText.indexOf(sel.options[i].value + ' - ' + strFindVal ) == 0)
        {
            sel.options[i].selected = true;
            sel.selectedIndex = i;
            displayprice(sel.options[i].text);
            break;
        }
    }
    
}



function loadImages() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hidepage.visibility = 'hidden';
}
else { // IE 4
document.all.hidepage.style.visibility = 'hidden';
}
}
}

function UpdateBasket(mycount,textvalue,pid){
		if (textvalue==0){
			parent.main.location='basket.asp?ProductID='+pid+'&action=remove&count='+mycount;
		}else{
			parent.main.location='basket.asp?ProductID='+pid+'&action=update&count='+textvalue;
		}
}

function StartUpdateBasket(mycount,textvalue,pid){
	if (event.keyCode == 13) {
		UpdateBasket(mycount,textvalue,pid);
	}
}

function checkout(val)
{
	if (val == 'none')
	{
		alert('Du skal vælge en betaling!');
	}else{
		document.location.href='/checkout.asp?ShippingID='+val;
	}
}

function stopenter(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode==13) return false;
	  return true;
	}
function displayprice(text)
{
	if (document.getElementById('oldprice'))
	{
		oldprice = document.getElementById('oldprice');
		price = new String(text);
		kommapos = price.lastIndexOf(', ')+2;
		oldprice.value = price.substring(kommapos,price.length);
	}
	
}
-->
