jQuery(document).ready(function($){
	$('div.topmenu').mouseover(function(){
		$(this).css('color', 'white');
	}).mouseout(function(){
		$(this).css('color', '#e1e1e1');
	});

	$('#partners').click(function(){
		$('#changepartner').toggle($('#changepartner').css('display')=='none');
	});
	$('#language').click(function(){
		$('#changelang').toggle($('#changelang').css('display')=='none');
	});

	$('#to_top').click(function(){
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: 0}, 1500);
	});
	
	var path = window.location.pathname;

	//collecting and setting active menus
	$('div.right_new_menu').filter(function(){
		return $(this).attr('id') == path;
	}).css({'background-image' : 'url(/public/img/menu/new/menu_back_new_anchor.png)'});

	//collecting and setting inactive menus
	$('div.right_new_menu').filter(function(){
		return $(this).attr('id') != path;
	}).mouseover(function(){
		$(this).removeClass('right_new_menu').addClass('right_new_menu_sel');
	}).mouseout(function(){
		$(this).removeClass('right_new_menu_sel').addClass('right_new_menu');
	}).click(function(){
		window.location = $(this).attr('id');
	});
	
	//toggle archive news in both interior and architectural menus
	$('#more_news').addClass('news_arch').click(function(){
		$('#news_arch').toggle();
		$(this).toggle();
	});
	
	$('#less_news').addClass('news_arch').click(function(){
		$('#news_arch').toggle();
		$(this).toggle();
		$('#more_news').toggle();
	});
});

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

function popupvideo(filename, x, y)
{
	window.open("/multimedia/play/"+filename+"/"+x+"/"+y, "Video",",height=200,width=200,left=0,top=0,screenX=0,screenY=0")
}

function openSwf(url,winName,imageWidth,imageHeight)
{
	var posLeft=window.screen.width/2 - imageWidth/2;
	var posTop=window.screen.height/2 - imageHeight/2;
	var theWindow = window.open(url,"newWindow","width="+imageWidth+",height="+imageHeight+",status=0,menubar=0,resizable=no,scrollbars=no,left="+posLeft+",top="+posTop);
	if (theWindow)	{theWindow.focus();}
}



