﻿function makeLeftMenus(navid)
    {   
	var x = document.getElementsByTagName('ul');
	for (var i=0;i<x.length;i++)
	{
		
		{
			var lis = x[i].getElementsByTagName('li');
			for (var j=0;j<lis.length;j++)
			{
				lis[j].onclick = showhide;
			}

 		}
 	}
}

function showhide()
{
	var uls = this.getElementsByTagName('ul');
	for (var a=0;a<uls.length;a++)
	{
		if(uls[a].style.display == 'block')
		{
			uls[a].style.display = 'none';
		}
		else
		{
			uls[a].style.display = 'block';
		}
	}
}

function print_product(productid)
{
    if (isNaN(productid))
    {
        alert('Fejl i parametre');
        return false;
    } else
    {
        window.open('vis_produkt_print.aspx?ProductID=' + productid);
        return false;        
    }
}

function print_artikel(artikelid)
{
    if (isNaN(artikelid))
    {
        alert('Fejl i parametre');
        return false;
    } else
    {
        window.open('vis_artikel_print.aspx?id=' + artikelid);
        return false;        
    }
}

// Email.js version 5
var tld_ = new Array()
tld_[0] = "com";
tld_[1] = "org";
tld_[2] = "net";
tld_[3] = "ws";
tld_[4] = "info";
tld_[10] = "dk";
tld_[11] = "org.uk";
tld_[12] = "gov.uk";
tld_[13] = "ac.uk";
var topDom_ = 13;
var m_ = "mailto:";
var a_ = "@";
var d_ = ".";

function mail(name, dom, tl, params)
{
	var s = e(name,dom,tl);
	document.write('<a href="'+m_+s+params+'">'+s+'</a>');
}
function mail2(name, dom, tl, params, display)
{
	document.write('<a href="'+m_+e(name,dom,tl)+params+'">'+display+'</a>');
}
function e(name, dom, tl)
{
	var s = name+a_;
	if (tl!=-2)
	{
		s+= dom;
	}
	else
		s+= swapper(dom);
	return s;
}
function swapper(d)
{
	var s = "";
	for (var i=0; i<d.length; i+=2)
		if (i+1==d.length)
			s+= d.charAt(i)
		else
			s+= d.charAt(i+1)+d.charAt(i);
	return s.replace(/\?/g,'.');
}

function get_pictureobject(id) {
    var object = null;
    if (document.layers) {
        object = document.layers[id];
    } else if (document.all) {
        object = document.all[id];
    } else if (document.getElementById) {
        object = document.getElementById(id);
    }
    return object;
}

function change_thumb(imgurl, imgplac, largepic) {
    var myobj;
    myobj = get_pictureobject(imgplac);
    myobj.src = imgurl;
    document.MainPic = largepic;
}



// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
    var isNN = (navigator.appName == "Netscape") ? 1 : 0;
    var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
var optNN = 'scrollbars=no,width=' + defaultWidth + ',height=' + defaultHeight + ',left=' + PositionX + ',top=' + PositionY;
var optIE = 'scrollbars=no,width=150,height=100,left=' + PositionX + ',top=' + PositionY;
function popImage(popField) {
    var imageURL;
    imageURL = popField;
    if (isNN) { imgWin = window.open('about:blank', '', optNN); }
    if (isIE) { imgWin = window.open('about:blank', '', optIE); }
    with (imgWin.document) {
        writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>'); writeln('<sc' + 'ript>');
        writeln('var isNN,isIE;'); writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
        writeln('isNN=(navigator.appName=="Netscape")?1:0;'); writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
        writeln('function reSizeToImage(){'); writeln('if (isIE){'); writeln('window.resizeTo(300,300);');
        writeln('width=300-(document.body.clientWidth-document.images[0].width);');
        writeln('height=300-(document.body.clientHeight-document.images[0].height);');
        writeln('window.resizeTo(width,height);}'); writeln('if (isNN){');
        writeln('window.innerWidth=document.images["LargeImage"].width;'); writeln('window.innerHeight=document.images["LargeImage"].height;}}');
        writeln('</sc' + 'ript>');
        if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();;self.focus()">')
        else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();self.focus()" onblur="self.close()">');
        writeln('<img name="LargeImage" src=' + imageURL + ' style="display:block"></body></html>');
        close();
    }
}