function setBackground(strImg) 
{ 
	if (strImg==null)
		$("#main .bkgnd").hide();
	else
		$("#main .bkgnd").attr("src","images/"+strImg).show();
}
function openWindow(strUrl)
{
	var openWnd = window.open(strUrl,'','status,menubar,scrollbars,location,width=1024,height=680,resizable');
	openWnd.focus();
	return false;
}
function initPage()
{
	if ($("#content").length>0)
		$("#content").fadeIn(100);
}
function initCityPanel()
{
	if ($('#main_panel_right').length>0)
		$("#main_panel_right").fadeIn(100);
}
function loadPage(strUrl)
{
	if ($("#content").length>0)
		$("#content").fadeOut(50,function(){$('body').load(strUrl,function(){initPage();});});
	return false
}

function loadCity(strUrl)
{
	if ($("#main_panel_right").length>0)
		$("#main_panel_right").fadeOut(50,function(){$('#main_panel_right').load(strUrl,function(){initCityPanel();});});	
	
}

function startSlideshow( prefix, id, max_id, speed, delay )
{
	if ( id != -1 )
		$("img."+prefix+id).fadeOut( speed );
	if ( ++id == max_id )
		id=0;
	$("img."+prefix+id).fadeIn( speed );
	setTimeout( "startSlideshow('"+prefix+"',"+id+", "+max_id+", "+speed+", "+delay+")", delay );
}

$(document).ready( initPage );
