var myWidth = 0, myHeight = 0;

function ovShow(cnt) {
	$('#ov').show();
	$('#n_overlay').height(1);
	
	switch(cnt) {
		case 'film':
			w = 690;
			h = 416;
			$('#ovcnt').html('<object width="640" height="360"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6959976&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6959976&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="360"></embed></object>');
		break;
		case 'mapka':
			w = 690;
			h = 416;
			$('#ovcnt').html('<iframe width="640" height="360" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=pl&amp;geocode=&amp;q=katowice,+uniwersytecka+13&amp;sll=37.0625,-95.677068&amp;sspn=33.984987,79.013672&amp;ie=UTF8&amp;ll=50.267728,19.024887&amp;spn=0.019751,0.054932&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe>');
		break;
		case 'panorama':
			w = 690;
			h = 416;
			$('#ovcnt').html('<div class="panorama"><object width=640 height=360 classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"><param name=src value="dswmedia/SPi-V.dcr"><param name=swURL value="test_sc_kyoto_sushi/test_sc_kyoto_sushi_hi_pl_01.xml"><param name=swStretchStyle value=stage><param name=swRemote value="swContextMenu=\'FALSE\'"><param name=progress value=false> <param name=logo value=false><embed width=100% height=100% type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/" src="dswmedia/SPi-V.dcr" swURL="test_sc_kyoto_sushi/test_sc_kyoto_sushi_hi_pl_01.xml" swStretchStyle=stage progress=FALSE swRemote="swContextMenu=\'FALSE\'" logo=FALSE></embed></object></div>');
		break;
	}
	$('#n_overlay-content').css({'width':''+w+'px','height':''+h+'px'});
	
	var mTop = -Math.round($('#n_overlay-content').height()/2);
	var mLeft = -Math.round($('#n_overlay-content').width()/2);
	
	var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
  
	if( myHeight>$('#n_overlay-content').height() ) {
		$('#n_overlay-content').css({'top':'50%','margin':''+mTop+'px 0 0 '+mLeft+'px'});
	} else {
		$('#n_overlay-content').css({'top':'0','margin':'0px 0 0 '+mLeft+'px'});
	}
	
	$('#n_overlay').height($(document).height());
}


