
rozwin_off = new Image();
rozwin_off.src = "img/but_rozwin_off.gif";
rozwin_on = new Image();
rozwin_on.src = "img/but_rozwin_on.gif";


function select(imgName) {
	imgOn = eval(imgName + "_on.src");
	document[imgName].src = imgOn;
}

function unselect(imgName) {
	imgOff = eval(imgName + "_off.src");
	document[imgName].src = imgOff;
}

var browser = checkBrowser();

function checkBrowser(){
	var is_major=parseInt(navigator.appVersion);
	this.nver=is_major;
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera=window.opera?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.opera)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera)?1:0;
	this.ie4=(document.all&&!this.dom&&!this.opera)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.ns6=(this.dom&&parseInt(this.ver)>=5)?1:0;
	this.hotjava=(this.agent.toLowerCase().indexOf('hotjava')!=-1)?1:0;
	this.ns4=(document.layers&&!this.dom&&!this.hotjava)?1:0;
	this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera);
	return this;
}

function createStartLayer(name,z,left,top,width,height){
	document.write(browser.ns4?'<layer id="'+name+'" z-index="'+z+'" left="'+left+'" top='+top+'" width="'+width+'" height="'+height+'"'+' visibility="hidden">\n':'<div id="'+name+'" style="position:absolute;z-index:'+z+';left:'+left+'px;top:'+top+'px;width:'+width+'px;height:'+height+'px;visibility:hidden;">\n');
} 

function createEndLayer(){
	document.write(browser.ns4?'</layer>\n':'</div>\n');
} 

function changeLayerVisibility(name,action) {
	switch(action) {
		case "show":var state=browser.ns4?'show':'visible';break;
		case "hide":var state=browser.ns4?'hide':'hidden';break;
	}
	browser.ns4?document.layers[name].visibility=state:document.all?document.all[name].style.visibility=state:document.getElementById(name).style.visibility=state;
}

function changeLinkColor(name,colorValue) {
	browser.ie?eval(name+".style.color='"+colorValue+"'"):'';
	browser.opera?eval(name+".style.color='"+colorValue+"'"):'';
	browser.ns6?eval("document.getElementById('"+name+"').style.color='"+colorValue+"'"):'';
}

function newWindow(width,height,filename) {
	var winWidth = (screen.width - width) / 2;
	var winHeight = (screen.height - height) / 2;
	winprops = 'width='+width+',height='+height+',top='+winHeight+',left='+winWidth+',scrollbars=0';
	window.open(filename,'avans',winprops);
}

function changeImg(imgName,dest) {
	document[dest].src = eval(imgName + ".src");
}


function createStartLayer1(name,z,left,top,width,height){
	document.write(browser.ns4?'<layer id="'+name+'" z-index="'+z+'" left="'+left+'" top='+top+'" width="'+width+'" height="'+height+'"'+' visibility="visible">\n':'<div id="'+name+'" style="position:absolute;z-index:'+z+';left:'+left+'px;top:'+top+'px;width:'+width+'px;height:'+height+'px;visibility:visible;">\n');
} 

function createEndLayer1(){
	document.write(browser.ns4?'</layer>\n':'</div>\n');
} 

function zamknijokno(){
	browser.ns4?document.layers['baner'].style.visibility="hidden":document.all?document.all['baner'].style.visibility="hidden":document.getElementById('baner').style.visibility="hidden";	
}

function changeTop(name){
	var h=document.body.scrollTop;
//	alert(name);
	browser.ns4?document.layers[name].style.top=h+'px':document.all?document.all[name].style.top=h:document.getElementById(name).style.top=h+'px';
} 

function createStartLayer2(name,z,left,top){
	var width = document.body.clientWidth;
	var height = document.body.clientHeight;

	document.write(browser.ns4?'<layer id="'+name+'" z-index="'+z+'" left="'+left+'px" top='+top+'px" width="100%" height="100%"'+' visibility="visible">\n':'<div id="'+name+'" style="position:absolute;z-index:'+z+';left:'+left+'px;top:'+top+'px;width:100%;height:100%;visibility:visible;">\n');
}

function insertTOPLAYER(nazwa, width, height, name){
	var newObject = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0" width="'+width+'" height="'+height+'" id="'+name+'"><param name="movie" value="'+nazwa+'"><param name="wmode" value="transparent"><param name="menu" value="false"><param name="quality" value="high"><param name="loop" value="false" /><param name="scale" value="noscale" /><param name="salign" value="cm" /><embed src="'+nazwa+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="noscale" salign="cm" width="'+width+'" height="'+height+'" wmode="transparent" menu="false" name="'+name+'"></embed></object>';
	document.write(newObject);
}
