function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function GetContent() {   document.getElementById("sSite").value = document.getElementById("content").innerHTML   //document.write('<input type="hidden" name="sSite" value="'+html+'">');}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function MM_jumpMenu(targ,selObj,restore){ //v3.0	eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value+"'");	if (restore) selObj.selectedIndex=0;}function PokazZwin(id){	var div = document.getElementById(id);	if(div.style.display == 'none'){		div.style.display = 'block';	}else{		div.style.display = 'none';	}}var timeout = 250;var timeoutObjectReferences = Array ();function toggleCombo  (comboListDivId){	//var comboListDivId = 'comboList';	if ( document.getElementById ( comboListDivId ).style.display == 'none' )	{		showLayer ( comboListDivId );	}	else	{		hideLayer ( comboListDivId );	}}function showLayer ( layerId ){	var onMouseOverEvent = 'clearTimeout( timeoutObjectReferences [\'' + layerId + '\'] )';	var onMouseOutEvent = 'hideLayer(\'' + layerId + '\')';	var objectReference = document.getElementById ( layerId );	clearTimeout(timeoutObjectReferences [ layerId ] );	objectReference.style.display = '';	objectReference.onmouseout = function ()	{		//eval ( onMouseOutEvent );	};	document.onclick = function ()	{		eval ( onMouseOutEvent );	};	objectReference.onmouseover = function ()	{		eval ( onMouseOverEvent );	};}function hideLayer ( layerId ){	timeoutObjectReferences [ layerId ] = setTimeout ( "document.getElementById ( '" + layerId + "' ).style.display = 'none'", timeout );}function ustawHidden(hidden,value,select,tekst,LayerToHide){	document.getElementById (LayerToHide).style.display = 'none';	document.getElementById(hidden).value=value;	document.getElementById(select).innerHTML=tekst;}function drukuj(id,typ){	displayWindow('drukuj.php?id='+id+'&typ='+typ,670,600);}function displayWindow(url, width, height) {        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + 'resizable=no,scrollbars=no,menubar=no' );}function SendNewsletter(value){ if (value == 0) document.getElementById('opcjanews').value='off'; else document.getElementById('opcjanews').value='on'; document.newsletter.submit();}//DODAJ DO ULUBIONYCHfunction addToBookmarks(tytul){    var adres = document.location;    //FireFox    if (window.sidebar) {        window.sidebar.addPanel(tytul, adres, "");    //IE    }  if (window.external) {        window.external.AddFavorite(adres, tytul);    //Opera    }  if (window.opera && window.print) {        var a = document.createElement('a');        a.setAttribute('href', adres);        a.setAttribute('title', tytul);        a.setAttribute('rel','sidebar');        a.click();    }	/*	{	//Wersja skryptu 1.0	//Modyfikacji dokonał: Krzysztof Samelko	//Data: 2008-05-12	if( window.sidebar && window.sidebar.addPanel )		{		//Gecko (Netscape 6 etc.) - add to Sidebar		window.sidebar.addPanel( sTitle, sHref, '' );		}	else if( window.external && ( navigator.platform == 'Win32' || ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) )		{		//IE Win32 or iCab - checking for AddFavorite produces errors for no		//good reason, so I use a platform and browser detect.		//adds the current page page as a favourite; if this is unwanted,		//simply write the desired page in here instead of 'location.href'		window.external.AddFavorite( window.location.href, document.title );		}	else if( window.opera && window.print )		{		//window.open('js/opera_dodaj_do_ulubionych.php','','width=150,height=50');		//Opera 6+ - add as sidebar panel to Hotlist		return true;		}	else if( document.layers )		{		//NS4 & Escape - tell them how to add a bookmark quickly (adds current page,		//not target page)		window.alert( 'Proszę kilknąć Ctrl+D aby dodać strone do ulubionych' );		}	else		{		//other browsers - tell them to add a bookmark (adds current page, not target page)		window.alert( 'Proszę użyć menu przeglądarki by utworzyć dodać strone do ulubionych' );		}	return false;	*/	}//DODAJ DO ULUBIONYCHfunction navHover() {	var lis = document.getElementById("navmenu").getElementsByTagName("LI");	for (var i=0; i<lis.length; i++) {		lis[i].onmouseover=function() {			this.className+=" iehover";		}		lis[i].onmouseout=function() {			this.className=this.className.replace(new RegExp(" iehover\\b"), "");		}	}}function PokazZdjecieRef(id) {    //symulacja kliknięcia na linka z podpiętym thickboxem    $("#refer"+id).click();}//podmiana na naglowki flashowe//podmieniany tekst powinien byc w tagu z atrybutem "rel" rozpoczynajacym sie na "textbox..." - ladowany jest taki plik jak t atrybucie "rel"function FlashHeaders() {    var  i=0;    $.each($("[class^=textbox]"), function(){    id = 'h'+i;    $(this).attr('id', id);    tekst = $(this).text();    textbox = $(this).attr('class');    if(textbox == 'textbox_stronaglowna')        width = 300;    else        width = 600;    	swfobject.embedSWF('template/flash/'+textbox+'.swf?tekst='+tekst, id, width, "20", "8.0.0", "expressInstall.swf",			/* FLASHVARS	*/	{  },			/* PARAMS 		*/	{ swliveconnect: true, wmode: "transparent", scale: "noborder", salign: "tl", align: "left" },			/* ATTRIBUTES	*/	{ id: id, name: id }		);    i=i+1;  });}function FlashFiles() {    var  i=0;	var aktywne = 0;    $.each($("[class^=flash_]"), function(){    id = 'a'+i;    $(this).attr('id', id);    tekst = $(this).text();    name = $(this).attr('class');		if($('#aktywne'))		aktywne = $('#aktywne').val();    if(name == 'flash_index') {        width = 961;        height = 296;    } else if(name == 'flash_podstrony') {        width = 961;        height = 147;    } else if(name == 'flash_mapa_dziedzictwo') {        width = 303;        height = 169;    } else if(name == 'flash_mapa_podmenu') {        width = 225;        height = 230;    } else if(name == 'flash_mapa_urzedy' || name == 'flash_mapa_robidz') {        width = 651;        height = 269;    } else if(name == 'flash_mapa_wykaz_muzeum') {        width = 320;        height = 284;    }    	swfobject.embedSWF('template/flash/'+name+'.swf', id, width, height, "8.0.0", "expressInstall.swf",			/* FLASHVARS	*/	{ zmienna: tekst, aktywne: aktywne },			/* PARAMS 		*/	{ swliveconnect: true, wmode: "transparent", scale: "noborder", salign: "tl", align: "left" },			/* ATTRIBUTES	*/	{ id: id, name: id }		);    i=i+1;  });}//pola w rejestracjifunction SelectFormFields(typ) {    if(typ == 's') {        $("#specjalisci_form").show();        $("#zarzadcy_form").hide();        $("#zarzadcy_form input").attr('disabled', 'disabled');        $("#specjalisci_form input").removeAttr('disabled');    } else if(typ == 'z') {        $("#specjalisci_form").hide();        $("#zarzadcy_form").show();        $("#specjalisci_form input").attr('disabled', 'disabled');        $("#zarzadcy_form input").removeAttr('disabled');    }}//zalezne od rodzaju wlasnoscifunction ShowHideFields(typ) {    if(typ == 0) {        $("#zarzadcy_form_instytucja").hide();        $("#zarzadcy_form_instytucja input").attr('disabled', 'disabled');    } else if (typ == 1) {        $("#zarzadcy_form_instytucja").show();        $("#zarzadcy_form_instytucja input").removeAttr('disabled');    }}function initRegisterForm(typ, wlasnosc) {    SelectFormFields(typ);    if(wlasnosc == 1)        ShowHideFields(1);    $(".error").focus(        function() {            if($(this).attr('class') == 'error') {                $(this).removeClass('error');                $(this).val('');            }        }    );}function dodajTooltip(){	$('.art_pictures .obrazek_szablon, .newRealizations').tooltip({		delay: 2,		showURL: false,		track: true	});}function CheckMail() {    mail = $("#mail").val();   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;    if((mail == '') || (reg.test(mail) == false)) {        $("#mail").attr('class', 'error');        $("#mail").val('nieprawidłowy adres e-mail');        $(".error").focus(            function() {                if($(this).attr('class') == 'error') {                    $(this).removeClass('error');                    $(this).val('');                }            }        );        return false;    } else {        return true;    }}// function RealizationsGallery(){	if ($('#realization #gallery a.zdjecia_mini').attr('href') != null) {		$('#realization #gallery #mainImage').attr('src',			$('#realization #gallery a.zdjecia_mini').attr('href').replace('real/', 'real/med/'));	}	if ($('#realization #gallery a.hover').attr('href') != null) {		$('#realization #gallery a.hover').mouseover(function(){			$('#realization #gallery #mainImage').attr('src', $(this).attr('href').replace('real/', 'real/med/'));		});	}}/** * Komunikaty */var komunikaty = {	/* inicjalizacja komunikatu wyświetlonego przez skrypt po stronie serwera */	init : function(){		this.ustaw_przyciski();	},	/* wyświetla komunikat danego rodzaju */	pokaz : function(rodzaj, tytul, tresc, link_ok, link_anuluj){		//alert(rodzaj+"\n"+tytul+"\n"+tresc);		if (document.komunikaty_tpl[rodzaj]) {			if (typeof (link_ok) == "undefined") {				link_ok = location.href;			}			if (typeof (link_anuluj) == "undefined") {				link_anuluj = location.href;			}			/* pobranie szablonu komunikatu */			var komunikat = document.komunikaty_tpl[rodzaj];			/* ustawienie treści */			komunikat = komunikat.replace('{TYTUL}', tytul).replace('{TRESC}',					tresc).replace('{LINK_OK}', link_ok).replace(					'{LINK_ANULUJ}', link_anuluj);			/* usunięcie poprzedniego komunikatu, jeśli istnieje */			if ($('#warstwa')[0]) {				komunikaty.usun();			}			/* wyświetlenie komunikatu */			$("body").prepend('<div id="over" class="overlay" style="z-index: 700; position: absolute; background-color: #333;"></div>');			$("#wrapper").prepend(komunikat);			//$("#warstwa").pngfix();			$('#over').css({				'width' : $(document).width(),				'height' : $(document).height(),				'opacity' : '0.8'			});			_main.scrollToTop();			var szerokosc = ( $(document).width() - $('#warstwa').width() ) / 2;			$('#warstwa').css({'left':szerokosc});			/* oprogramowanie przycisków */			komunikaty.ustaw_przyciski();			return true;		}		return false;	},	/* zamyka komunikat */	usun : function(){		if (o = document.getElementById('warstwa')) $(o).remove();		if (o = document.getElementById('warstwa_')) $(o).remove();		if (o = document.getElementById('over')) $(o).remove();	},	/* domyślne ustawienie przycisków */	ustaw_przyciski : function(){		if (!$(".kom_anuluj")[0]) {			$('.kom_close,.kom_ok').each( function(i){				this.onclick = function(e){					if(typeof this.href != undefined && this.href != location.href){						//alert(location.href+"\n"+this.href);						location.href = this.href;					}					komunikaty.usun();					return false;				};			});		} else {			$('.kom_anuluj').each( function(i){				this.onclick = function(){					komunikaty.usun();					return false;				};			});		}	}};function xshow(o) {	s = '';	for(e in o) {s += e+'='+o[e]+'\n';}	alert( s );}function TopMenu() {	$('#menu').mouseenter(function(){		if ($('#menu ul ul').height() + 60 < 178) {			$('#menu').css({				'height' : '178px',				'background-image' : 'url("template/img/gwib_do_menu.png")'			});				} else {						$('#menu').css({				'height' : $('#menu ul ul').height() + 60,				'background-image' : 'url("template/img/gwib_do_menu.png")'			});					}	});	$('#menu').mouseleave(function(){		$('#menu').css({			'height' : '40px',			'background-image' : 'none'		});	});	// IE Hack :]	$('div#menu > ul > li').mouseenter(function(){		$(this).find('ul').css({'display':'block'});		out = false;	});	$('div#menu > ul > li').mouseleave(function(){		$(this).find('ul').css({'display':'none'});		out = true;	});}$(document).ready(function(){	var params = { wmode: "transparent" };	var flashvars = { Link: "idm,587,nagrody-i-wyroznienia.html" };	// Nagrody na dole po prawej.	if (document.getElementById("awardsFlash123") != null)	{		swfobject.embedSWF("template/flash/Awards.swf",			"awardsFlash123", "203", "106", "9.0.0", "",			flashvars, params, {});	}	// Logo na stronie głównej.	if (document.getElementById("flashBaner456") != null)	{		swfobject.embedSWF(			"template/flash/baner.swf",			"flashBaner456", "940", "325", "9.0.0", "",			{}, params, {});	}	$('#polec_znajomemu_a').bind('click',function(){		komunikaty.pokaz('polec-znajomemu', '', '');		$('#polecenie .button').bind('mouseover',function(){ $(this).addClass('hover'); }).bind('mouseout',function(){ $(this).removeClass('hover'); });		$('#polecenie .button a').bind('click', _main.polec_znajomemu)		return false;	});    FlashHeaders()    FlashFiles();	RealizationsGallery();	TopMenu();	$('#sales .buttons a').click(function(){		$('#sales .buttons a').removeClass('on');		$('#sales #descLayer, #sales #tableLayer, #sales #filesLayer, #sales #galleryLayer').hide();		if ($(this).attr('class') == 'b1') {			$('#sales #descLayer').animate({ height: 'show', opacity: 'show' }, 'slow');		}		else if ($(this).attr('class') == 'b2') {			$('#sales #tableLayer').animate({ height: 'show', opacity: 'show' }, 'slow');		}		else if ($(this).attr('class') == 'b3') {			$('#sales #filesLayer').animate({ height: 'show', opacity: 'show' }, 'slow');		}		else if ($(this).attr('class') == 'b4') {			$('#sales #galleryLayer').animate({ height: 'show', opacity: 'show' }, 'slow');		}		$(this).addClass('on');		return false;	});	$("#map1").googleMap('52.167572', '21.0127491', 14, {		 controls: ["GSmallMapControl", "GMapTypeControl"]		,markers: [		   { lat:parseFloat(new String('52.167572'))			,lng:parseFloat(new String('21.0127491'))			,txt:'Alisma Construnction S.A.\				02-697 Warszawa<br/>\				ul. Rzymowskiego 19'}]	});    $('#login_error').focus(        function(){            $(this).val('');            $(this).removeAttr('id');        }    );    dodajTooltip();	$('.absmiddle').attr('align', 'absmiddle');	$('#addToBookmarks').click(function(){		addToBookmarks(this.title);	});	// Wysokość elementów mapy strony (potrzebne, aby mapa ustawiała się w dwóch wierszach).	// Do poprawki: zamienić na CSS lub OPT.	var count = 0;	var max = 0;	$('.siteMap > ul ul').each(function(i, o) {		count = 0;		$(this).find('li').each(function(i, o) {			count++;		});		if (count > max) {			max = count;		}	});	$('.siteMap > ul ul').css({'height' : max * 21});		if($.browser.msie){		$('#artykul .galeria a').hover(				function(){ $(this).children('img.lupa').css({'height':'144px','width':'144px','display':'block'}); },				function(){ $(this).children('img.lupa').css({'height':'0px','width':'144px','display':'none'}); }		);	}	$('#brak_flasha').show();});
