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=6072566&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=6072566&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_tychy':
			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?q=tychy,+decoline&amp;ie=UTF8&amp;hq=decoline&amp;hnear=Tychy,+Polska&amp;ll=50.159635,18.966179&amp;spn=0.039591,0.109692&amp;z=13&amp;iwloc=A&amp;output=embed"></iframe>');
		break;
		case 'mapka_katowice':
			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,+decoline&amp;sll=50.146546,18.953133&amp;sspn=0.167648,0.349846&amp;ie=UTF8&amp;hq=decoline&amp;hnear=Katowice,+Polska&amp;cid=716090723548845248&amp;ll=50.265012,19.027548&amp;spn=0.009876,0.027423&amp;z=15&amp;iwloc=A&amp;output=embed"></iframe>');
		break;
		case 'mapka_zywiec':
			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=%C5%BCywiec,+fabryczna+5&amp;sll=50.261226,19.025424&amp;sspn=0.010453,0.021865&amp;ie=UTF8&amp;hq=&amp;hnear=Fabryczna,+%C5%BBywiec,+%C5%BBywiecki,+%C5%9Al%C4%85skie,+Polska&amp;ll=49.683485,19.185605&amp;spn=0.004998,0.013711&amp;z=16&amp;iwloc=A&amp;output=embed"></iframe>');
		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());
}





function openImg(content, title) {
	Shadowbox.open({
        content:    content,
        player:     "img",
        title:      title
    });

}


function openMap(city) {
	switch(city) {
		default:
			Shadowbox.open({
        		content:    '<iframe width="800" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://musicclubnisza.pl/mapka.html"></iframe>',
        		player:     "html",
        		title:      "Music Club Nisza",
				width:		800,
				height:		500
    		});
		break;
	}
}


