<!--
var width = 630, height = 460;
var butt = new Array();
var action = new Array();
var buttonWidth = new Array();
var col = new Array();
var value = 0;
var margin = 0; // 16 is default

/*

    www.scriptfx.com/generators/button/button_generator.htm
    www.comptechdoc.org/independent/web/cgi/javamanual/javastyle.html

*/

if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    width = window.innerWidth-margin-6;
    height = window.innerHeight-16;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    width = document.documentElement.clientWidth-6-margin;
    height = document.documentElement.clientHeight-20;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    width = document.body.clientWidth-6-margin;
    height = document.body.clientHeight-20;
}

// Extended Tooltip Javascript
// copyright 9th August 2002, 3rd July 2005
// by Stephen Chapman, Felgall Pty Ltd
// permission is granted to use this javascript provided that the below code is not altered
var DH = 0;var an = 0;var al = 0;var ai = 0;if (document.getElementById) {ai = 1; DH = 1;}else {if (document.all) {al = 1; DH = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {an = 1; DH = 1;}}} function fd(oi, wS) {if (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi); if (al) return wS ? document.all[oi].style: document.all[oi]; if (an) return document.layers[oi];}
function pw() {return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;}
function mouseX(evt) {if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft: document.body.scrollLeft); else return null;}
function mouseY(evt) {if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop: document.body.scrollTop); else return null;}
function popUp(evt,oi) {if (DH) {var wp = pw(); ds = fd(oi,1); dm = fd(oi,0); st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else {tv = mouseY(evt) + 20; lv = mouseX(evt) - (ew/4); if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2; if (!an) {lv += 'px';tv += 'px';} ds.left = lv; ds.top = tv; ds.visibility = "visible";}}}
// permission end. http://javascript.about.com/library/bltip1.htm

function button(text, tooltip, c, w, fn) {
	for(var i = butt.length; i-- && butt[i] !== text;);
	if (!i) alert("dublett: "+text);

    value++;
    butt[value] = text;
    buttonWidth[value] = (w==0? width:w);
    col[value] = c;
    action[value] = fn;
	if (butt[value]) {
		if (butt[value].indexOf('<u>') != -1) {
	        var R = col[value].substring(0,2);
	        var G = col[value].substring(2,4);
	        var B = col[value].substring(4);
	        R = R=="ff"||R=="FF"?"FF":"E0";
	        G = G=="ff"||G=="FF"?"FF":"E0";
	        B = B=="ff"||B=="FF"?"FF":"E0";
	        var hover = " onMouseOver=\"this.style.backgroundColor=\'#"+R+G+B+"\';\"";
	        var code = "this.style.backgroundColor=\'#"+col[value]+"\';";
	        var reset = " onmouseout=\""+code+"\"";
		    if (tooltip == "") {
    			document.write('<button id="b'+value+'" style="Width: '+buttonWidth[value]+'px; Height: 22px; background-color:#'+col[value]+'; border-color:#'+col[value]+';" onClick="action['+value+']();'+code+'"'+hover+reset+'><font face="MS Sans Serif" size="1">'+butt[value]+'</button><BR>');
    		} else {
    		    document.write('<div id="t'+value+'" class="tip" style="Width: '+2*buttonWidth[value]/3+'px;">'+tooltip+'</div>');
    			document.write('<a href="#" onmouseout=popUp(event,"t'+value+'") onmouseover=popUp(event,"t'+value+'") onclick="return false"><button id="b'+value+'" style="Width: '+buttonWidth[value]+'px; Height: 22px; background-color:#'+col[value]+'; border-color:#'+col[value]+';" onClick="action['+value+']()"><font face="MS Sans Serif" size="1">'+butt[value]+'</button></a><BR>');
			}
		} else {
			alert('You didn\'t specify the underlined letter for the button number '+value+'. This button cannot be placed until you specify the underlined letter by using <u> and </u> tags.');
		}
	} else {
		alert('You are trying to place the button number '+value+', but you didn\'t declare its values on the variables area. \r\rThe button '+value+' will not be placed until you specify the variables "butt['+value+']" and "action['+value+']".');
	}
}

document.write('<script'+'>');
document.write('function myfocus(n) {');
for (a=1; a<button.length; a++) {
	document.write('if (n=='+a+') {document.all.b'+a+'.focus()}');
}
document.write('}');
document.write('<'+'/script>');

function chkKey(evt) {
	var mykey, alt, ctrl, shift;
	if (window.Event) {
		mykey = evt.which;
		alt = (evt.modifiers & Event.ALT_MASK) ? true: false;
		ctrl = (evt.modifiers & Event.CONTROL_MASK) ? true: false;
		shift = (evt.modifiers & Event.SHIFT_MASK) ? true: false;
	} else {
		mykey = evt.keyCode;
		alt = evt.altKey;
		ctrl = evt.ctrlKey;
		shift = evt.shiftKey;
	}
	if (mykey!=0 && mykey!=16 && mykey!=17 && mykey!=18) {
		if (alt) {
			for (i=1; i<button.length; i++) {
				ui = butt[i].indexOf('<u>');
				ul = butt[i].substring(ui + 3, ui + 4).toLowerCase();
				if (String.fromCharCode(mykey).toLowerCase() == ul) {
					myfocus(i);
					action[i]();
					break;
				}
			}
		}
	}
	return true;
}
if (window.Event) {
	document.captureEvents(Event.KEYDOWN);
	document.onkeydown = chkKey;
} else {
	document.onkeydown = function() {
		return chkKey(event);
	}
}

		function produktvalsknapp(txt, col, width, dest) {

		    var tooltip = "<br><center><H4>"+txt+"</H4> ... </center>";
		    tooltip = ""; //Ta bort denna rad för att få en tooltip
        	button("<u></u><b>"+txt+"</b>",tooltip,col,width,
        	    function () {goto(dest,"#"+col);} );
        }

		function goto(dest, col) {
			top.center.location = dest;
			top.stripe.document.bgColor = col;
		}
-->

