var afterLoad = function()
{
	// poprawiam obrazki
	if($.browser.msie && $.browser.version < 7)
	{
/*
		str = "";
		for(var sheetNr=0;sheetNr<document.styleSheets.length;sheetNr++)
			for(var styleNr=0;styleNr<document.styleSheets[sheetNr]['rules'].length;styleNr++)
				if(document.styleSheets[sheetNr]['rules'][styleNr].style['backgroundImage'].indexOf('.png') != -1)
				{
					url = document.styleSheets[sheetNr]['rules'][styleNr].style['backgroundImage'];
					s = url.substring(4,url.length-1);
					if(s.charAt(0) == '/') str+=s+"\n";
					document.styleSheets[sheetNr]['rules'][styleNr].style['filter'] = 
						"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+s+"')";
				}
		alert(str);
*/
		
		$.ifixpng('/img/fancy/blank.gif');
		$('#headButtons a').ifixpng();
		$('img[src$=.png]').ifixpng();
		$('#topmenu2').ifixpng();
//		$('#container').ifixpng();
//		$('#topmenu2').ifixpng('/img/fancy/blank.gif');
//		$('div').ifixpng('/img/fancy/blank.gif');
//		alert('juz');
//		if(true) return;
	}
	// WYROZNIAM DANE W DRUGIEJ KOLUMNIE
	$('table.2Columns tr').find("td:eq(1)").css("color", "red").css("font-weight", 'bold');
	// CO DRUGI WIERSZ INNY KOLOR
	$('table.colorRows tr:even').addClass('even');
	// PODSWIETLENIE WIERSZA
	$('table.mouseover tr').hover(
		function(){
			$(this).css('backgroundColor', '#b0defb');
		},
		function(){
			$(this).css('backgroundColor', '');
		}
	);
	$('input[type=submit], input[type=button]').addClass('button');
	$('input[type=text], textarea').addClass('input');
	$('textarea').width('100%');
	$("#flashMessage").colorBlend([{param:"background-color", fps:15, fromColor:"current", toColor:"white", cycles: 1}]);
	$('.error-message').colorBlend([{param:"color", fromColor:"black", toColor:"red"},{param:"background-color", fps:15, fromColor:"current", toColor:"red", cycles: 2}]); 	

	$('#tabs').tabs();
//	$('#tabs2').tabs();
	
	fixHeight();
//	setInterval(fixHeight, 1000);

	$.fn.fancyzoom.defaultsOptions.imgDir='/img/fancy/';
//	$('#companyRightPics a').fancyzoom(); 
//	$('#companyLogo a').fancyzoom(); 
//	$('a.fancy').fancyzoom();
	$('a.fancy').lightBox({fixedNavigation:true});
};

var fixHeight = function()
{
	// wysokość
//	if($('#pageright').height() < 300)
//		$('#pageright').height(300);
//	if($('#menu').height() < $('#pageright').height())
//		$('#menu').height($('#pageright').height());
//	if($('#menu').height() > $('#pageright').height())
//		$('#pageright').height($('#menu').height());	
}
	
var switchSubmenu = function(id)
{
	$('#topmenu2 ul').hide();
	if(id == 'current')
	{
		$('#sub'+id).show();
		return;
	}
	if(id)
		$('#sub'+id).show();
};

var book = function()
{ 
	var title = "www.targikarpaty.com - Karpackie Targi Turystyczne!";
	var url = "http://www.targikarpaty.pl/";  
	if (window.sidebar) 
	{ 
		// Mozilla Firefox Bookmark		
		window.sidebar.addPanel(title, url,"");	
	} 
	else if( window.external ) 
	{ 
		// IE Favorite		
		window.external.AddFavorite( url, title); 
	}	
	else if(window.opera && window.print) 
	{ 
		// Opera Hotlist
		return true; 
	}
};

var setHomePage = function(url)
{
	if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(url);
    }
    else if (window.sidebar)
    {
    	if(window.netscape)
    	{
    		try
    		{  
    			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
    		}  
    		catch(e)  
    		{  
    			//alert("this action was aviod by your browser, if you want to enable, please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
    		}
    	} 
    	var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    	prefs.setCharPref('browser.startup.homepage',url);
    }
};

	
