//Ladowanie flasha do odpowiedniej warstwy
function addFlash(div,source,name,width,height,url){
	$('#'+div).flash({
		wmode: "transparent",
		src: source+name,
		width: width,
		height: height,
		flashvars: { clickTag: url }
	});
}

//Przekierowanie
function redirect(url,timer) {
	if(timer==null)
		timer=5000;
	
	setTimeout(function(){
		document.location.href=url;
	},timer);
}

//Zdarzenia logosow
function logos() {
	
	$(".logos .wrapper a img")
		.mouseover(function(){
			
			var tmp = $(this).attr("src").split("/");
			tmp[tmp.length-1] = tmp[tmp.length-1].replace("bw-","color-");
			
			$(this).attr("src",tmp.join("/"));
			
		})
		.mouseout(function(){
			
			var tmp = $(this).attr("src").split("/");
			tmp[tmp.length-1] = tmp[tmp.length-1].replace("color-","bw-");
			
			$(this).attr("src",tmp.join("/"));
			
		});
	
	$(".logos .wrapper a img").each(function(){
		
		var tmp = $(this).attr("src").split("/");
		tmp[tmp.length-1] = tmp[tmp.length-1].replace("bw-","color-");
		
		picture = new Image;
		picture.src = tmp.join("/");
		
	});
}

//Zdarzenia logosow
function socials() {
	
	$(".social a img")
		.mouseover(function(){
			
			var tmp = $(this).attr("src").split("/");
			tmp[tmp.length-1] = tmp[tmp.length-1].replace("-bw-","-color-");
			
			$(this).attr("src",tmp.join("/"));
			
		})
		.mouseout(function(){
			
			var tmp = $(this).attr("src").split("/");
			tmp[tmp.length-1] = tmp[tmp.length-1].replace("-color-","-bw-");
			
			$(this).attr("src",tmp.join("/"));
			
		});
	
	$(".social a img").each(function(){
		
		var tmp = $(this).attr("src").split("/");
		tmp[tmp.length-1] = tmp[tmp.length-1].replace("-bw-","-color-");
		
		picture = new Image;
		picture.src = tmp.join("/");
		
	});
}

//Zdarzenia dla opcji menu: Praktyka i Praca
function practiceAndWord() {
	
	$(".practiceAndWord")
		.mouseover(function(){
			
			$(this).find(".optionDSPL img").attr("src","/images/main-page/absolvent-rate-now-bw.png");
			$(this).css("background","url('/images/main-page/absolvent-underline-bw.png') no-repeat 0px 24px");
			
		})
		.mouseout(function(){
			
			$(this).find(".optionDSPL img").attr("src","/images/main-page/absolvent-rate-now.png");
			$(this).css("background","url('/images/main-page/absolvent-underline.png') no-repeat 0px 24px");
			
		});
}

//Zdarzenia dla opcji menu: Praktyka i Praca
function loginButton() {
	
	$(".top .login img")
		.mouseover(function(){
			
			var tmp = $(this).attr("src").split("/");
			tmp[tmp.length-1] = tmp[tmp.length-1].replace("-color","-hover");
			
			$(this).attr("src",tmp.join("/"));
			
		})
		.mouseout(function(){
			
			var tmp = $(this).attr("src").split("/");
			tmp[tmp.length-1] = tmp[tmp.length-1].replace("-hover","-color");
			
			$(this).attr("src",tmp.join("/"));
			
		});
	
	$(".top .login img").each(function(){
		
		var tmp = $(this).attr("src").split("/");
		tmp[tmp.length-1] = tmp[tmp.length-1].replace("-color","-hover");
		
		picture = new Image;
		picture.src = tmp.join("/");
		
	});
}

//Zdarzenia dla opcji menu: Praktyka i Praca
function menus() {
	
	$(".topLine2 .wrapper .option")
		.mouseover(function(){
			
			$(".topLine2").find(".absoluteBg").addClass("visibility");
			$(this).find(".absoluteBg").removeClass("visibility");
			
		})
		.mouseout(function(){
			
			$(".topLine2").find(".absoluteBg").addClass("visibility");
			$(".topLine2 .wrapper .checked").find(".absoluteBg").removeClass("visibility");
			
		});
}

