function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "external")  
     anchor.target = "_blank";  
 }  
}  

function showTab(id){
	var lastId=$("#zakladki > div:visible").attr("id");
	if (lastId!=id){
		$("#zakladki > div:visible").slideUp();
		$("#"+id).slideDown("slow");
	}
}

function flash(id){
	$("input#"+id).animate({backgroundColor:"red"}).animate({backgroundColor:"white"});
}

$().ready(function(){
	$("#start").show("slow");
	
 /*	$("#realizacje").load("http://projektwww.pl/nportfolio/4_szablon.php","test=1");
	$("#linkRealizacje").load("http://projektwww.pl/nportfolio/5_szablon.php","test=2");
	*/
	$("#mainLinks li img").each(function(){
		var lnk=$(this).attr("rel");
		$(this).click(function(){
			showTab(lnk);
		});
	});
	$("#topLink").click(function(){
		showTab("start");
	});

	$("div#przyklady a").each(function(){
		if ($(this).attr("href").indexOf("#")==-1){
			$(this).addClass("extern");
		}
	 /*	else
			alert($(this).attr("href"));*/
	});
	$(".extern").click(function(){
		window.open($(this).attr("href"),"testWindow");
		return false;
	});
	//$("#zamow").load("http://sote5.pl/zapytanieForm.html.php",{"dolacz":"1"});

});