function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=700,height=500');");
}

$(document).ready(function()
{
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	$('.video a, .video a.active').click(function(){
		$('.video a.active').removeClass('active');	
		$(this).addClass('active');
		$('.myvideo').load($('.video a.active').attr('href'));
		return false;
	});
	
	$('.myvideo').load($('.video a.active').attr('href'));
	$('#home_contents_komersiante').load('hometabs2.php?tab=oferta');
	
	$('div.ad a').lightBox({fixedNavigation:true});
	
	
	
	$('div.slideshow').cycle(
	{ 
		fx:     'fade', 
		speed:  0,
		delay:5000,
		pager:'.slideshow_controls .nav'
	});
	
	$('.slideshow_pauze').click(function() { 
    $('div.slideshow').cycle('pause'); 
	});
	
	$('.slideshow_play').click(function() { 
    $('div.slideshow').cycle('resume'); 
	});
	
	$('#tabs_level1 .tab_inactive, #tabs_level1 .tab_active').click(function() 
	{ 
    	$('#tabs_level1 .tab_active').removeClass('tab_active').addClass('tab_inactive');
		$(this).removeClass('tab_inactive').addClass('tab_active');
		$('#tabcontents_level1').load('hometabs.php?eid='+$('#tabs_level1 .tab_active a').attr('rel'));
	});
	
	
	$('#tabs_level2 .tab_inactive, #tabs_level2 .tab_active').click(function() 
	{ 
    	$('#tabs_level2 .tab_active').removeClass('tab_active').addClass('tab_inactive');
		$(this).removeClass('tab_inactive').addClass('tab_active');
		$('#tabcontents_level2').load('hometabs.php?eid='+$('#tabs_level2 .tab_active a').attr('rel'));
	});
	
	$('#tabs_level1 .tab_inactive:first').removeClass('tab_inactive').addClass('tab_active');
	$('#tabs_level2 .tab_inactive:first').removeClass('tab_inactive').addClass('tab_active');
	
	$('#tabcontents_level1').load('hometabs.php?eid='+$('#tabs_level1 .tab_active a').attr('rel'));
	$('#tabcontents_level2').load('hometabs.php?eid='+$('#tabs_level2 .tab_active a').attr('rel'));
	
	
});





