function ge(a){ return document.getElementById(a); }
function mshow(a){ ge(a).style.display = 'block'; }
function mhide(a){ ge(a).style.display = 'none'; }
function addEvent(a,b,c){if(a.addEventListener)a.addEventListener(b,c,false);else if(a.attachEvent)a.attachEvent('on'+b,c);else return false;return true}
window.onload=function(){var a=ge('top_menu').getElementsByTagName('a');var b=navigator.appVersion.match(/IE 6\.[0-9]+;/)!==null&&navigator.appVersion.match(/IE 7\.[0-9]+;/)==null;for(i=0;i<a.length;i++){if(a[i].getAttribute('href').match(/#$/)!=null){a[i].style.cursor='default';addEvent(a[i],'click',a[i].blur);addEvent(a[i],'click',function(){return false});a[i].setAttribute('onclick','this.blur();return false');if(a[i].nextSibling){var c=a[i].nextSibling;while(c&&c.nodeType!=1)c=c.nextSibling;if(c.tagName&&c.tagName=='DIV'){if(a[i].className!='tm'){if(!b)a[i].style.background='url(/images/bg_submenu2.png) no-repeat';else{a[i].style.background='';a[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/bg_submenu2.png', sizingMethod='image')"}}c.style.width='207px';c.style.padding=0;c.style.background='none';var d=c.className=='ltm';if(d){c.style.left='auto';c.style.right='-7px'}var e=c.getElementsByTagName('a');for(i2=0;i2<e.length;i2++){e[i2].style.borderTop='none';if(b){e[i2].style.background='';e[i2].style.cursor='pointer'}if(i2+1<e.length){if(b)e[i2].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/bg_submenu.png', sizingMethod='image')";else e[i2].style.background='url(/images/bg_submenu.png) no-repeat'}else{if(b)e[i2].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/bg_submenu_btn"+(d?'2':'')+".png', sizingMethod='image')";else e[i2].style.background='url(/images/bg_submenu_btn'+(d?'2':'')+'.png) no-repeat';e[i2].style.paddingBottom='23px'}}}}}}}
function image_show(str, width, height){window.open('http://www.industrial.pl/statystyki/'+str,'Image','directories=no,fullscreen=no,height='+(height+30)+',location=no,menubar=no,resizable=no,scrollbars=no,status=yes,titlebar=yes,toolbar=no,width='+(width+30));return false;}
function gallery_show(a,b,c){max_width=screen.width-200;max_heigth=screen.height-200;b=Math.min(b,max_width);c=Math.min(c,max_heigth);window.open('http://www.industrial.pl/galeria/'+a,'Image','directories=no,fullscreen=no,height='+(c+30)+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=no,width='+(b+30));return false}

function zmien(){
	d = new Date();
	ge('tim').src = '/token.php?t=' + d.getTime();
}

function subm(i){

	for(j=0;j<10;j++)
		ge('sm' + j).style.display = 'none';
	if(i < 10 && i != null)
		ge('sm' + i).style.display = 'block';

}

var hide = Array();
function submn(i){ge('sm' + i).style.display = 'block';}
function delay_hide(i){ hide[i] = setTimeout('subm('+(i-8)+')',300); }
function cancel_hide(i){ if(hide[i])clearTimeout(hide[i]); }

function show_regions(){
	ge('reg_intro').style.display = 'none';
	ge('region_select').style.display = 'block';
	//ge('search').style.height = 104 + 'px';
	return false;
}

var active_content = Array();
var active_tab = Array();

function load_content(a,load_to,load_from){
	if(active_tab[load_to] != undefined) active_tab[load_to].className = 'inactive';
	if(active_content[load_to] != undefined) active_content[load_to].style.display = 'none';
	if(a != null) a.className = 'active';
	
	active_tab[load_to] = a;
	active_content[load_to] = ge(load_from);
	active_content[load_to].style.display = 'block';
	a.blur();
	
	if (load_from == 'opis_magazynu') {
		try{ ge('prez_parku').style.display = 'block'; }catch(err){}
		try{ ge('flash_magazyn').style.display = 'block'; }catch(err){}
	} else {
		try {	ge('prez_parku').style.display = 'none'; }catch(err){}
		try {	ge('flash_magazyn').style.display = 'none'; }catch(err){}
	}
	
	if (load_from == 'lokalizacja') 
	{
		GUnload();
		load();
	}
	
	return false;
}

function display_content(whe,wha){
	ge(whe).innerHTML = ge(wha).innerHTML;
	return false;
}

function setCookie(c_name,value,expiredays){
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate)
}
