function click1(adres){
	
 
location.href = adres;
 
}
function click2(adres){
	
 
window.open(adres);
 
}

function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no' );
}

function displayWindow2(url, width, height) {
        var Win = window.open(url,"displayWindow2",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no' );
}

function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
  }
function searchform(form ){

if($('#searchfield').val()!=""){
window.location.href = "search-1."+$('#searchfield').val()+'.html';
}
return false;
}




function galeria(adres) 
{
  var width=640;
  var height=480;
  var Win=window.open("","Image", 'width=' + width + ',height=' + height + ',resizable=no,scrollbars=no,menubar=no');

  Win.document.write('<html><HEAD><TITLE>Image</TITLE><style>body{ margin-left: 0px;margin-right: 0px; margin-top: 0px;margin-bottom: 0px; }</style><link rel="stylesheet" href="style.css" type="text/css"></HEAD>');
  Win.document.write('<body bgcolor="#FFFFFF">');
  Win.document.write('<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center><a href="javascript:close();"><img name="obrazek" border="0" src='+adres+' onload="javascript:window.resizeTo(obrazek.width+30,obrazek.height+70);" class=border></a></td></tr></table>');
  Win.document.write('<body></html>');
  	 Win.document.close();
	 Win.focus();
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

 
   function play_small_video(zm,btn){
		
			$(document).ready(function() {
			$.ajax({
			  url: "video360.php?id="+zm,
			  cache: false, 
			  success: function(html){
				$(".trailer_video_player").fadeIn(1000);
				 
 				$("#trailer_video_player").html(html); 
			  }
			});
		
		 	$("ul.video_list li").removeClass("active"); //Remove any "active" class
			$(btn).addClass("active");
 
			
			});
		  }
		  
		  

	$(document).ready(function() {

 
		$(".inline").fancybox();
	
		
	$(".smallWindow").fancybox({
	'width'				: 400,
	'height'			: 480,
	'titlePosition'		: 'none',
	'transitionIn'		: 'none',
	'transitionOut'		: 'none',
	'overlayShow'       : true ,
	'overlayColor'      : '#000',
	'type'				: 'iframe' ,
	'hideOnContentClick' : false
 
    });
	
	
	$(".videos").fancybox({
	'width'				: 660,
	'height'			: 380,
	'titlePosition'		: 'none',
	'transitionIn'		: 'none',
	'transitionOut'		: 'none',
	'overlayShow'       : true ,
	'overlayColor'      : '#000',
	'type'				: 'iframe' ,
	'hideOnContentClick' : false
 
    });
	
		$(".newsletter").fancybox({
	'width'				: 780,
	'height'			: 580,
	'titlePosition'		: 'none',
	'transitionIn'		: 'none',
	'transitionOut'		: 'none',
	'overlayShow'       : true ,
	'overlayColor'      : '#000',
	'type'				: 'iframe' ,
	'hideOnContentClick' : false
 
    });
	
//------------news tabs

	 $(".ntab_content").hide(); //Hide all content
 	$("ul.news_tabs li:first").addClass("active");
 	$("ul.news_tabs li:first").find("a").css("color","#333333");
	$(".ntab_content:first").show(); //Show first tab content
	
	 	$("ul.news_tabs li")
	 .mouseout(function() {
	
	 
	
	// 	$("ul.tabs li a").addClass("active"); //Remove any "active" class
	// 	$(this).addClass("active"); //Add "active" class to selected tab
	 //	$(".tab_content").hide(); //Hide all tab content
	
		//	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		// $(activeTab).fadeIn(); //Fade in the active ID content
		//	return false;
		})
	
	.click(function() {
	
	
	
	if( ! $( this ).hasClass( 'active' ) )
	{
  
		$("ul.news_tabs li a").css("color","#FFFFFF");
		$("ul.news_tabs li").removeClass("active"); //Remove any "active" class
		$(this).find("a").css("color","#333333");
	 
		$(this).addClass("active"); //Add "active" class to selected tab		
	 	$(".ntab_content").fadeOut(500); //Hide all tab content

		var activeTabN = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTabN).fadeIn(500); //Fade in the active ID content
	 
		return false; 
		
	}else{
		return false; 	
	}
	}) ;

	
  //---------videos
  

  
    $(".vtab_content").hide(); //Hide all content
 	$("ul.video_tabs li:first").addClass("active");
 	$("ul.video_tabs li:first").find("a").css("color","white");
	$(".vtab_content:first").show(); //Show first tab content
 
  
  $(".play_btn").click(function() {
	 clearInterval(refreshIntervalIdVideo); 
  });
  
  	$("ul.video_tabs li")
	 .mouseout(function() {
	
	 
	
	// 	$("ul.tabs li a").addClass("active"); //Remove any "active" class
	// 	$(this).addClass("active"); //Add "active" class to selected tab
	 //	$(".tab_content").hide(); //Hide all tab content
	
		//	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		// $(activeTab).fadeIn(); //Fade in the active ID content
		//	return false;
		})
	
	.click(function() {
	
	
	
	if( ! $( this ).hasClass( 'active' ) )
	{


					
		clearInterval(refreshIntervalIdVideo);
	 
		$("ul.video_tabs li a").css("color","#666666");
		$("ul.video_tabs li").removeClass("active"); //Remove any "active" class
		$(this).find("a").css("color","white");
		$(".trailer_video_player").fadeOut(500); 
		$(this).addClass("active"); //Add "active" class to selected tab		
		$(".vtab_content").fadeOut(500); //Hide all tab content

		var activeTabV = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTabV).fadeIn(500); //Fade in the active ID content
	 
		return false; 
		
	}else{
		return false; 	
	}
	}) ;

 //--------------------video 
 var i=1;
 
function updatePromoVideo(){
	
  if(i>4){ i=0; }
i++;
 
	 
		$("ul.video_tabs li a").css("color","black");
		$("ul.video_tabs li").removeClass("active"); //Remove any "active" class
		$('.vtab'+i).css("color","white");
		 
		$('.vtabli'+i).addClass("active"); //Add "active" class to selected tab		
		$(".vtab_content").fadeOut(500); //Hide all tab content

		var activeTabV = $('.vtab'+i).attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTabV).fadeIn(500); //Fade in the active ID content
 		if(i==4){ i=0;      }			
		return false;
 
 

}

var refreshIntervalIdVideo = setInterval(updatePromoVideo, 5000);

 
//-------------------------------	
	
	
	 
	
// promocje		   
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$("ul.tabs li:first").find("a").css("color","white");
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li")
	 .mouseout(function() {
	
	 
	
	// 	$("ul.tabs li a").addClass("active"); //Remove any "active" class
	// 	$(this).addClass("active"); //Add "active" class to selected tab
	 //	$(".tab_content").hide(); //Hide all tab content
	
		//	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		// $(activeTab).fadeIn(); //Fade in the active ID content
		//	return false;
		})
	
	.click(function() {
	
	
	
	if( ! $( this ).hasClass( 'active' ) )
	{


					
		clearInterval(refreshIntervalId);
	 
		$("ul.tabs li a").css("color","black");
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).find("a").css("color","white");
	
		$(this).addClass("active"); //Add "active" class to selected tab		
		$(".tab_content").fadeOut(1000); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(1000); //Fade in the active ID content
	 
		return false;
		
	}
	}) ;


	}) ;







 var i=1;
 
function updatePromo(){
	
  if(i>4){ i=0; }
i++;
 
	 
		$("ul.tabs li a").css("color","black");
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$('.tab'+i).css("color","white");
		 
		$('.tabli'+i).addClass("active"); //Add "active" class to selected tab		
		$(".tab_content").fadeOut(1000); //Hide all tab content

		var activeTab = $('.tab'+i).attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(1000); //Fade in the active ID content
 		if(i==4){ i=0;      }			
		return false;
 
 

}

var refreshIntervalId = setInterval(updatePromo, 10000);


 

$(document).ready(function() {

	//When page loads...
	$(".gtab_content").hide(); //Hide all content
	$("ul.gtabs li:first").addClass("active").show(); //Activate first tab
	$(".gtab_content:first").show(); //Show first tab content
	
	$(".gtab_container").animate({height:($(".gtab_content:first").height()+20)+'px'}, 500);
	//On Click Event
	$("ul.gtabs li").click(function() {

		$("ul.gtabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".gtab_content").fadeOut(500); //Hide all tab content
		
	
 


		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(500); //Fade in the active ID content
		
		var activeTabHeight = $(activeTab).height()+20; 
		//alert(activeTabHeight);
		$(".gtab_container").animate({height:activeTabHeight+'px'}, 500);
		return false;
	}); 

}); 








$(document).ready(
	function () {
		// #myFlashVars is the selector
		 if($.flash.hasVersion(9.1)){
		
			
					   flashMovie = $('#logo');										
						flashMovie.flash(
						{
							// test_flashvars.swf is the flash document
							swf: 'swf/TW_Logo_interactive.swf',
							width: 254,
							wmode: 'transparent',
							quality: 'high',
							height: 78,
							bgcolor: '#000000'
						}
					);
					
	 	  
			
					
		//goto_frame(2);
					
			 		
			}else{
				
			//$('.bg').css("background-image", "url(images/bg.jpg)");  	
			}
	}
); 	 


 

$(document).ready(function(){
						   
	// This initialises carousels on the container elements specified, in this case, carousel1.
	$("#carousel1").CloudCarousel(		
		{			 
		reflHeight: 40,
		reflGap:-10,		 			
		titleBox: $('#da-vinci-title'),
		altBox: $('#da-vinci-alt'),
		extBox: $('#da-vinci-ext'),	 
		yRadius:10,
		xRadius:180,
		xPos: 180,  
		yPos: 10,
		autoRotate: 'left',
		autoRotateDelay: 2000,
		speed:.05,
		mouseWheel:true,
		minScale: 0.4
		}
	);
});

