
$().ready(function() {
	
	$('#event .gallery .images a, #shop .gallery .images a').lightBox();
	
	$('#event .page:first').show();
	
	$('#home .news ul li').mouseover(function(){
		$('#home .news ul li').css('background-position','0px 0px');
		$(this).css('background-position','0px -255px');		
	});
	
	$('#home .news ul li').mouseout(function(){
		$(this).css('background-position','0px 0px');
	});	
	
	$('#header .item3 a, #headerHome .item3 a').mouseover(function(){
		$('.eventDd').show();
	});
	
	$('.eventDd a').mouseover(function(){
		$('.eventDd').show();
	});	
	
	$('.eventDd').mouseout(function(){
		$(this).hide();
	});
	
	$('.eventDd').mouseover(function(){
		$(this).show();
	});	
	
	

});

function showGalleryPage(page){
	$('#event .page').hide();
	$('#page'+page).show();
}

function embedFlash(){
	var promo = new SWFObject("/swf/4bropromo.swf", "flashPromo", "100%", "100%", "9");
	promo.addParam("scale", "noscale");
	promo.addParam("allowScriptAccess" , "allways");
	promo.addParam("menu", "false");
	promo.addParam("allowNetworking", "all");
	promo.addParam("quality", "high");
	promo.addParam("wmode", "transparent");
	promo.addVariable("promoURL", "/promo/xml/");
	promo.write("flashPromo");

}

function openIwiwShare(url) {
    var left = parseInt((screen.availWidth/2) - (650/2));
    var top = parseInt((screen.availHeight/2) - (600/2));	
	title = document.title;
	window.open('http://iwiw.hu/pages/share/share.jsp?u='+encodeURIComponent(url)+'&t='+encodeURIComponent(title),'iwiwshare','toolbar=0,status=0,location=1,width=650,height=600,top='+top+',left='+left+',scrollbars=1');
	return false;
} 

function openFacebookShare(url) {
    var left = parseInt((screen.availWidth/2) - (650/2));
    var top = parseInt((screen.availHeight/2) - (600/2));	
	title = document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(url),'iwiwshare','toolbar=0,status=0,location=1, width=650,height=600,top='+top+',left='+left+',scrollbars=1');
	return false;
} 