var navV=navigator.appVersion;
var navA=navigator.userAgent;
var dom=document.getElementById?1:0;
var op=(navA.indexOf("Opera")>-1 && dom)?1:0;
var ie4=(document.all && !dom && !op)?1:0;
var ie5=(navV.indexOf("MSIE 5")>-1)?1:0;
var ie6=(navV.indexOf("MSIE 6")>-1)?1:0;
ie5=((ie5||ie6) && dom && !op)?1:0;
var ns4=(document.layers && !op)?1:0;
var ns5=(parseInt(navV)>= 5 && dom && !op)?1:0;
var win=navA.indexOf("Win")>-1?1:0;
var mac=navA.indexOf("Mac")>-1?1:0;
var useable=(dom||ie4||ie5||ie6||ns4||ns5||op)?1:0;
	
function resize(){
	document.location.reload();
}

function preload(){

//Active button
button1on = new Image();
button1on.src = "images/menuabout.gif";
button2on = new Image();
button2on.src = "images/menuprog.gif";
button3on = new Image();
button3on.src = "images/menuserv.gif";
button4on = new Image();
button4on.src = "images/menuproj.gif";
button5on = new Image();
button5on.src = "images/menupartners.gif";
button6on = new Image();
button6on.src = "images/tiporeshenia_h.gif";

//Non active button
button1off = new Image();
button1off.src = "images/menuabout_p.gif";
button2off = new Image();
button2off.src = "images/menuprog_p.gif";
button3off = new Image();
button3off.src = "images/menuserv_p.gif";
button4off = new Image();
button4off.src = "images/menuproj_p.gif";
button5off = new Image();
button5off.src = "images/menupartners_p.gif";
button6off = new Image();
button6off.src = "images/tiporeshenia_n.gif";
}

function show(x, y)
{
if (x == ActiveButton) return false;
if(document.images)
    if(document.readyState == "complete")
    { document.images[x].src=eval(y+'.src');}
    if (navigator.appName == "Netscape") 
    { document.images[x].src=eval(y+'.src');}
}

var ActiveButton

function Section()
{
	if (ActiveButton == 'btn1') document.images[ActiveButton].src=eval('button1on.src');
	if (ActiveButton == 'btn2') document.images[ActiveButton].src=eval('button2on.src');
	if (ActiveButton == 'btn3') document.images[ActiveButton].src=eval('button3on.src');
	if (ActiveButton == 'btn4') document.images[ActiveButton].src=eval('button4on.src');
	if (ActiveButton == 'btn5') document.images[ActiveButton].src=eval('button5on.src');
	if (ActiveButton == 'btn6') document.images[ActiveButton].src=eval('button6on.src');
}


function gotoSectionFunction() {
        self.location = document.sectionGoto.sectionList.options[document.sectionGoto.sectionList.selectedIndex].value;
return false;
}


var browserNamn = navigator.appName;
var browserVersion = parseInt(navigator.appVersion);
var ok="other";

if(browserNamn == "Microsoft Internet Explorer" && browserVersion >= 4)
        ok="ie4";
else if(browserNamn == "Netscape")
{
        if(browserVersion >= 4)
                ok="n4";
        else
                ok="n3";
}
else
        ok="other";

var winOk = 0;

function zoomImage(url,x,y)
{
		if(winOk == 0)
        {

popupWin=window.open(url,'popup','width='+x+',height='+y+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no');
                winOk++;
        }
        else if(popupWin.closed)

popupWin=window.open(url,'popup','width='+x+',height='+y+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no');
        else
        {
                if(ok != "other")
                        popupWin.blur();
                if(ok == "other" || ok == "n3")
                {
                        popupWin.close();

popupWin=window.open(url,'popup','width='+x+',height='+y+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no');
                }
                if(ok == "n4" || ok == "ie4")
                {
                        if(ok == "ie4")
						{		
								y = parseInt(y);
		                		y = y + 30;
						}
						popupWin.resizeTo(x, y);
                        popupWin.location = url;
                }
                if(ok != "other")
                        popupWin.focus();
        }
}


function wopen(imgName, w , h, Title)
{
var wo = window.open("", "abc", "width = " + w + " , height = " + h + ", scrollbars=0, status=0");
wo.document.open();
var win = "";
win = "<html><head><title>";
win += Title;
win += "</title></head>"
win += "<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' marginwidth='0' marginheight='0'>";
win += "<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'>";
win += "<a href='#' onClick='self.window.close();'><img src='" + imgName + "' width='" + w + "' height='" + h + "' border='0' alt='" + Title + "'></a>";
win += "</td></tr></table>";
win += "</body></html>";
w += 12;
h += 30;
wo.window.resizeTo(w, h);
wo.document.write(win);
wo.window.focus();
wo.document.close();
}
