// obslugujemy taby
$(function() {
	$("#qualityTabs").tabs({selected: 0});
});

// CUFON
Cufon.replace('.boxHead h2, .contactCenter h2, .offertBoxHead h2, .contentCenter .centerHeader h2, .subpageHead h2, .subRegStepNum, .relatedNewsHead h2, .regLeftBoxHead h2, .userFolderTopLeft h2, .userPanelContentBoxTop h2, #faq .subpageContent h2', {
	fontFamily: 'Calibri'
});

$(document).ready(function(){
						   
	// wywolujemy menu po lewej
	$("ul#leftMenu").superfish({
		delay: 100,
		//firstOnClick: true,
		autoArrows: false,
		dropShadows: true,
		speed: 'fast'
	});
	
	// klikamy na div'a i przechodzimy na strone z linka w tym DIVie
	$(".clickIn").click(
		function(event) {
			event.preventDefault();
			window.location = '/'+$(this).children("a").attr("href");
		}
	);
	
	// klikamy na div'a i przechodzimy na strone z linka po lewej 
	$(".click").click(
		function(event) {
			event.preventDefault();
			window.location = '/'+$(this).prev("a").attr("href");
		}
	);

	// klikamy na diva i przechodzimy pod wskazany w nim URL
	$(".funcClick").click(function() {
			window.location = '/'+$(this).attr("url");
		}
	);

	// otwieramy link w nowym oknie
	$(".extUrl").click(
		function(event) {
			event.preventDefault();
			window.open($(this).attr("href"),'pwin')
		}
	);	

	
	//hovers
	$('#advSearchPanelBtn, #leftMenu li, .linksBox li, .jobItem, .newsListWrap .newsItem, .userToolsBox .userToolsRow, .knowList .newsItem, .expertsWrap .expertItem, .tx-irfaq-pi1 .tx-irfaq-dynheader, .contentRight .expertBox #expertTabs .funcClick, #fullView, #simpleView').hover(function() {
	  $(this).addClass('myHover');
	}, function() {
	  $(this).removeClass('myHover');
	});	
});


//
// IE6 background flicker bug fixed
//
(function(){
	/*Use Object Detection to detect IE6*/
	var m = document.uniqueID /*IE*/
	&& document.compatMode /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;

	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */
		}
	}catch(oh){};
})();
