function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}
var sensSpeed = 80;
$(document).ready(function(){
	$(".sens09").hover(
		function(){
			$(this).fadeTo("slow",.75);
		},
		function(){
			$(this).fadeTo("slow",1);
		}
	);
	$(".sens").hover(
		function(){
			$(this).fadeTo(sensSpeed,.6);
		},
		function(){
			$(this).fadeTo(sensSpeed,1);
		}
	);
	Zo2Wo();
	$(".whi").css({ opacity: 0.7 });
	$("a[rel=gal]").fancybox({
		overlayOpacity:.8,
		overlayColor:'#000',
		onClosed:function(){
					$('.toHide').show(0);
				},
	})
	
	for(i=0;i<=window.globalIlProd;i++){
		$("#myId"+i).delay(100*i).fadeIn("slow");
	}
});
function mailto(local){
	if(local=='wod'){
		document.location.href='mailto:info@kucza.com.pl';
	}else if(local=='zor'){
		document.location.href='mailto:zorska@kucza.com.pl';
	}
}
function Zo2Wo(){
	$("#adresZo").delay(5000).fadeOut(function(){
		$("#adresWo").fadeIn(function(){
			$("#telZo").fadeOut(function(){
				$("#telWo").fadeIn(function(){
					Wo2Zo();
				})
			})
		})
	})
}
function Wo2Zo(){
	$("#adresWo").delay(5000).fadeOut(function(){
		$("#adresZo").fadeIn(function(){
			$("#telWo").fadeOut(function(){
				$("#telZo").fadeIn(function(){
					Zo2Wo();
				})
			})
		})
	})
}
function goImage(id){
	$('.toHide').hide(0);
	$('#link'+id).click();
}
function goList(){
	$.fancybox.showActivity();
	$('#columnAll').toggle('blind',function(){
		$('span#showHide').toggle();
		$.fancybox.hideActivity();
		if(getCookie('myCookie')==='open'){
			setCookie('myCookie','close');
		}else{
			setCookie('myCookie','open');
		}
	})
}
function note(){
	$.fancybox({
		href:'nota.php',
		overlayOpacity:.8,
		overlayColor:'#000'
	})
}
