$.fn.slideSubmenu = function (direction)
{
	if (direction == 'down')
	{
		$(this).next('.submenu').slideDown();
		$(this).find('.submenu').slideDown(); /*fck IE*/
		$(this).css('background-image','url(/images/minus.png)');
	}
	else
	{
		$(this).next('.submenu').slideUp();
		$(this).find('.submenu').slideUp(); /*fck IE*/
		$(this).css('background-image','url(/images/plus.png)');
	}
}

$(function()
{
	$('[spin=true]').spin({min: 0, imageBasePath: '/images/', timeInterval: 80});
	
	$('.menu > li > a').toggle(function(){$(this).parent().slideSubmenu('down');},function(){$(this).parent().slideSubmenu('up');});
	$('.menu > li').toggle( function(){$(this).slideSubmenu('down');},function(){$(this).slideSubmenu('up');});

	$('.submenu > li > a').click(function(){window.location = $(this).attr('href');}); /*fck fck fck IE*/

	$('h3.tmh').toggle( function(){$(this).next().slideUp();},function(){$(this).next().slideDown();});
	
	$('a.arch').toggle( function(){$(this).parent().prev().slideDown();},function(){$(this).parent().prev().slideUp();});
});

function openWindow(path,title)
{
	windowStyle = 'toolbar=no,location=no,ulectories=no,menubar=no,scrollbars=no,width=200,height=360';
	popupWindow = window.open(path, title, windowStyle);
}

function openpict(title,path,height)
{ 
    attr = "top=100,left=60,bottom=0,right=0,width=900,height="+height;
    window.open(path, title, attr);
}
    
function opencert(title,path,width,height)
{ 
    attr = "top=100,left=60,bottom=0,right=0,width="+width+",height="+height;
    window.open(path, title, attr);
}
    
if (document.images) 
{
     homeon = new Image();
     homeon.src ="linkshome.gif";

     phoneon = new Image();
     phoneon.src ="linksphone.gif";

     mailon = new Image();
     mailon.src ="linksmail.gif";

     priceon = new Image();
     priceon.src ="plmain.gif";


     homeoff = new Image();
     homeoff.src ="linkshomem.gif";

     phoneoff = new Image();
     phoneoff.src ="linksphonem.gif";

     mailoff = new Image();
     mailoff.src ="linksmailm.gif";

     priceoff = new Image();
     priceoff.src ="plmainm.gif";
} 

function imgOn(imgName) 
{
	if (document.images) document[imgName].src = eval(imgName + "on.src");
} 

function imgOff(imgName) 
{
	if (document.images) document[imgName].src = eval(imgName + "off.src");
} 
