// Cobblestone JavaScript Document


var big_ver;
var flashId = 'video_container';
var offset_video_container= 100;




function flashobj(flashId)
		{
			return document[flashId];	
	
		} 
		function setFlashVar(flash_variable, flash_value)
		{
		  flashobj(flashId).SetVariable(flash_variable, flash_value);
		}

 


function showvideo(vid, bigversion, autoplayer) {
	
if (bigversion) { 
	$('#video_surround').css("width","768px");
	$('#video_surround').css("height","616px");
	
	};
	
										var flashvars = {};
										flashvars.videoname = vid; 
										flashvars.stoppfilm = autoplayer;
										
										
										var params = {};										
										params.play = "flase";
										params.loop = "false";
										params.menu = "false";
										params.quality = "best";
										params.allowfullscreen = "true";
										params.allowscriptaccess = "always";
										params.salign = "ct";	
										/*params.wmode = "transparent";		*/							
										var required_flashversion = "9.0.115";
															  
									  swfobject.embedSWF("flash/movieplayer_new2.swf", "video_container", "100%", "100%", required_flashversion, "flash/expressInstall.swf", flashvars, params);
										if (bigversion) {$('#video_container').css("width","768px"); $('#video_container').css("height","616px")};									  
							
	
	}


var dim_width,dim_height;
function check_browser_dim(){
	poslogo = $("#logo").position();
	if(poslogo) {
		videopos = poslogo.left+400;
	} else {
		videopos = 400;
	}
		if (self.innerHeight) // all except Explorer
		{
		dim_width = self.innerWidth;
		dim_height = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
		{
		dim_width = document.documentElement.clientWidth;
		dim_height = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{
		dim_width = document.body.clientWidth;
		dim_height = document.body.clientHeight;
		}
		
}



function zoom_video() {
		big_ver=true;
	  $('#video_content p').css({'display' :'none'});	
	  
  	$('.close').show();
	  $('#video_container').css({'width' :'768px'});
	  $('#video_surround').css({'width' :'768px'});
	  $('#video_content').css({'width' :'768px'});
	  $('#video_content').css({'position' :'absolute'});
	  var center_pos = dim_width/2-384+10;
	  $('#video_content').css({'left' : center_pos + 'px'});
	  $('#video_content').css({'padding' :'15px'});
	  $('#video_container').css({'height' :'616px'})
	  $('#video_surround').css({'height' :'616px'})
	  $('#list_bigversion').show();
	  $('#list_nonbigversion').hide();
	  var content_height = $('#video_content').height();
	  var contentpos = (dim_height - content_height)/2-30;
	  if (contentpos <=0) {contentpos=0;}
	  $('#video_content').css({'top' : contentpos + 'px'});
	  
	  $("#logo").focus();
		$('#video_container').blur();	 
  }

function open_pic(bild) {
	
	
	$('.close').show();
$(".close").append("images/feature_film/1.jpg");
	
	
	}


function check_browser_change() {
	  if (big_ver==true) {check_browser_dim();
	  var center_pos = dim_width/2-384+10;
	  $('#video_content').css({'left' : center_pos + 'px'});
	  var content_height = $('#video_content').height();
	  var contentpos = (dim_height - content_height)/2-30;
	  if (contentpos <=0) {contentpos=0;}
	  $('#video_content').css({'top' : contentpos + 'px'});
	 } else {check_browser_dim();$('#video_content').css({'left' : videopos+'px'});	}
  }


function unzoom_video() {
	big_ver=false;
		$('.close').hide();
		$('#video_container').css({'width' :'480px'});
	  $('#video_container').css({'height' :'385px'});
	  $('#video_surround').css({'width' :'480px'});
	  $('#video_surround').css({'height' :'385px'});		
	  $('#video_content').css({'width' :'480px'});
	  $('#video_content').css({'top' : '0px'});
	  $('#video_content').css({'left' : videopos+'px'});
	  $('#video_content').css({'padding' :'0px'});	  					
	  $('#list_bigversion').hide();
	  $('#list_nonbigversion').show();
	  $('#video_content p').css({'display' :'block'});	  					
	}
var poslogo;
var videopos;
$(document).ready(function(){		
check_browser_dim();	
timer = setInterval("check_browser_change()", 500);


	
	
$('#video_content').css({'left' : videopos+'px'});	

var h = ($("#mainmenu").height()+ $("#logo").height())+206;
var diff = 206;
if (h > dim_height) {
					diff = 206 - (h - dim_height);
					if (diff < 30) {
									diff = 30
					};
};

$('#mainmenu').css({'margin-top' : diff + 'px'});


/* DIRECTORS SUBMENU ACADAMY CLICK*/
$("#academy").hide();
$("#directors_academy").toggle(
		  function () {
		   $("#academy").slideDown("fast");      
		  },
		  function () {
		  $("#academy").fadeOut(300); 
		  }
	);

/* BIGVERSION ZOOM */
$('.close').hide();
$('#imprint').mouseover(function(){
	$('#imprint_hidden').show();
	 });



/*


$('.close').click(function(){
	alert("");
	setFlashVar('videostatus', 'normal');
	
				     	$('.close').hide();
				    	$('#video_container').css({'width' :'480px'});
	  					$('#video_container').css({'height' :'385px'});
	  					$('#video_surround').css({'width' :'480px'});
	  					$('#video_surround').css({'height' :'385px'});		
	  					$('#video_content').css({'width' :'480px'});
	  					$('#video_content').css({'top' : '0px'});
	  					$('#video_content').css({'left' : '375px'});
	  					$('#video_content').css({'padding' :'0px'});
	  					
	  					$('#list_bigversion').hide();
	  					$('#list_nonbigversion').show();
	  					$('#video_content p').css({'display' :'block'});
	  					return false;
				     });

*/
/*---*/
$('a').click(function() {
		this.blur();
		});

$('#contact span').hide();
$('h3').hide();
$('hr').hide();

}); 
