function fb() {
jQuery(document).ready(function(){

if (document.getElementById('fbBox')!=null){
  var script3 = document.createElement("script");
  script3.type="text/javascript";
  script3.async=true;
//  script3.src = "https://connect.facebook.net/pl_PL/all.js";
//  script3.src = "https://connect.facebook.net/pl_PL/all.js#xfbml=1";
  script3.src = document.location.protocol + '//connect.facebook.net/pl_PL/all.js#xfbml=1';
  document.getElementById('fbBox').appendChild(script3);

  var hconfig = {
    over: function(){jQuery("#fbBox").animate({"left":0});}, // function = onMouseOver callback (REQUIRED)
    timeout: 400, // number = milliseconds delay before onMouseOut
    out: function(){jQuery("#fbBox").animate({"left":"-310px"});} // function = onMouseOut callback (REQUIRED)
  };
  jQuery("#fbBox").append('<fb:like-box href="http://www.facebook.com/pages/PROJEKTwwwpl/185636978143536?ref=ts" width="300" show_faces="true" stream="false" header="true"></fb:like-box>').hoverIntent(hconfig);
}

});
}

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"});

});

