
// JavaScript Document
$(document).ready(function(){
		$('a.out, li.out a, body#page18 div.middle a, div.downloadFileBlock a').bind("click", openWindow);
		$('.textVideoBLock p').hide();
		$('.textVideoBLock p:first').show();
		
	$('.textVideoBLock select').bind("change", changeVideo);

   $("#various3").fancybox({
				'width'				: 902,
				'height'			: 602,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#various55").fancybox({
				'width'				: 902,
				'height'			: 602,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$(".popupSmall").fancybox({
				'width'				: 500,
				'height'			: 600,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
			$("#various3").fancybox({
				'width'				: 902,
				'height'			: 602,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$(".fancybox").fancybox();
			
			
		});

function changeVideo() {
  $('.mainVideoBlock .videoholder').remove();
  $('.textVideoBLock p').hide();
  $('.textVideoBLock p.'+$(this).children('option:selected').attr("class")).show();
  
  $('<div class="videoholder"><object width="320" height="220"><param name="movie" value="'+$(this).attr("value")+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="'+$(this).attr("value")+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="220"></embed></object></div>').appendTo(".mainVideoBlock");
  //$('.mainVideoBlock object param[name=movie]').attr("value") =  $(this).attr("value");
  //$('.mainVideoBlock embed').attr("src") =  $(this).attr("value");
	//alert($('.mainVideoBlock object param[name=movie]').attr("value"));
    
}

function openWindow() {
        window.open(this.href);
        return false;
}
selectboxSelect ();

function selectboxSelect () {
					var urldir = document.URL;
					var positionLast = (urldir.lastIndexOf('/')+1);
					var pageName = urldir.substring(positionLast, 100);


var pole = new Array("/assets/templates/biosynchron/flash/Banner1.swf", "/assets/templates/biosynchron/flash/Banner-kuze.swf", "/assets/templates/biosynchron/flash/Banner-nohy.swf", "/assets/templates/biosynchron/flash/Banner-pohyb.swf", "/assets/templates/biosynchron/flash/Banner-stop-bolesti.swf", "/assets/templates/biosynchron/flash/spanek-fixed.swf", "/assets/templates/biosynchron/flash/sport-fixed.swf");
switch(pageName)
				{
				case "o-metode-biosynchron":
				  var typeFlash = "3";
				break;
				case "program-stop-bolesti":
				  var typeFlash = "4";
				break;
				case "program-zdrava-kuze":
				  var typeFlash = "1";
				break;
				case "program-zdrave-nohy":
				  var typeFlash = "2";
				break;
				case "program-luxusni-spanek":
				  var typeFlash = "5";
				break;
				case "program-sport":
				  var typeFlash = "6";
				break;
				case "program-luxusny-spanok":
				  var typeFlash = "5";
				break;
				case "program-sport-sk":
				  var typeFlash = "6";
				break;
				case "":
				  var typeFlash = "0";
				break;
				default:
					 var typeFlash = Math.floor(Math.random()*5);
				}
			var flashvars = {};
			var params = {
				wmode: "transparent"
			};
			var attributes = {
				wmode: "transparent"
			};
			swfobject.embedSWF(pole[typeFlash], "bannerTop", "919", "202", "9.0.0","expressInstall.swf", flashvars, params, attributes);
		  }
		  

		  
		  var flashvars = {};
			var params = {
				wmode: "transparent"
			};
			var attributes = {
				wmode: "transparent"
			};
		  swfobject.embedSWF("/assets/templates/biosynchron/flash/prezentace.swf", "flashPrezentace", "900", "600", "9.0.0","expressInstall.swf", flashvars, params, attributes);
