
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;
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function navi_DoFSCommand(command, args) {
	var naviObj = isInternetExplorer ? document.all.navi : document.navi;
	if (command=='changeLayerHeight') { changeLayerHeight(args,'menu_top') };

}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub navi_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call navi_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function changeLeft(name,state){
	var h=document.body.clientWidth;
	h=h/2-state;
	if (h<178) h=178;
	browser.ns4?document.layers[name].left=h+'px':document.all?document.all[name].style.left=h:document.getElementById(name).style.left=h+'px';
} 

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 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="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 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 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 changeLayerHeight(state,name) {
	browser.ns4?document.layers[name].height=state:document.all?document.all[name].style.height=state:document.getElementById(name).style.height=state+'px';
}


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,target,p) {
	var winWidth = (screen.width - width) / 2;
	var winHeight = (screen.height - height) / 2;
	if (!target) {
		target = 'colgatenewwindow';
	}
	if (p) {
		winprops = 'width='+width+',height='+height+',top='+winHeight+',left='+winWidth;
	} else {
		winprops = 'width='+width+',height='+height+',top='+winHeight+',left='+winWidth+',scrollbars=1';
	}
	window.open(filename,target,winprops);
}

function img(width,height,filename,nazwa) {
	width += 20;
	height += 80;
	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('img_popup.php?img='+filename+'&nazwa='+nazwa,'hyundaiimgpopup',winprops);
//	alert("width="+width+", height="+height+", filename="+filename);
}

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





function m_out(a, w, h, w2, h2){
a.style.width=w;
a.style.height=h;
a.width=w;
a.height=h;
a.innerHeight=h;
}

function m_over(a, w, h, w2, h2){
a.style.width=w2;
a.style.height=h2;
a.width=w2;
a.height=h2;
a.innerHeight=h2;
}

function insertSWF(nazwa, width, height, name){
	var newObject = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="../download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0/#version=6,0,29,0/default.htm" 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="lt" /><embed src="'+nazwa+'" quality="high" pluginspage="../www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="noscale" salign="lt" width="'+width+'" height="'+height+'" wmode="transparent" menu="false" name="'+name+'"></embed></object>';
	document.write(newObject);
}
function insertTOPLAYER(nazwa, width, height, name){
	var newObject = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="../download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0/#version=6,0,29,0/default.htm" 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="../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);
}