//  www.ilegforalvor.dk
//  Author: Jens Clausen
//  Email: wcms@jensclausen.dk
//  Revision date: 13. July 2010


// detect browser
var NS4 = false;
var IE4 = false;
var IE5 = false;
var NS6 = false;
var UKN = false; // unknown

if (document.layers) {
	NS4 = true;
}
else if (document.all) {
	if (document.getElementById) {
		IE5 = true;
	}
	else {
		IE4 = true;
	}
}
else if (document.getElementById) {
	if (!document.all) {
		NS6 = true;
	}
	else {
		UKN = true;
	}
}

function setstyle(el,st,att)
{
    if (IE5 || NS6){
        eval('document.getElementById("'+el+'").style.'+st+' = "'+att+'";');
     }
    else if (IE4){
        eval('document.all.'+el+'.style.'+st+' = "'+att+'";');
    }
    else if (NS4){
        eval('document.'+el+'.'+st+' = "'+att+'";');
    }
    else {
       eval('document.all.'+el+'.style.'+st+' = "'+att+'";');
    }
}

function infobox(name, url, w, h, tb) 
{
    this.name = name;
    this.url = url;
    this.w = w;
    this.h = h;
    
    if (tb) {
        this.m = 'yes';
    }
    else {
        this.m = 'no';
    }
    
    
    this.show = function()
    {  
        this.win = window.open(url,this.name,
                               'menubar='+this.m+',toolbar='+this.m+',scrollbars='+this.m+',width='+this.w+',height='+this.h+'screenX=20,screenY=20,left=20,top=20');
        if (window.focus) {this.win.focus()};
    }

    this.remove = function()
    {
        this.win.close();
    }
}

function pg_print(r)
{
    if (window.print) {
        r.print();
    }
    else {
        alert ("Din browser understøttes ikke denne funktion.\nForsøg i stedet at taste Ctrl-p");
        if (window.focus) {r.focus()};
    }
}

rp_01 = "<a ";
rp_02 = " </a>";
