function szallas_kereso(v,t) {
	if ( t == 0 ) {
		idName = 'megye_sel';
		url = '?l1=szallashely&l2=plug_szallashely&l3=main&mid=0&regio='+v;
	} else {
		idName = 'telepules_sel';
		url = '?l1=szallashely&l2=plug_szallashely&l3=main&mid=0&megye='+v;
	}
	new Ajax.Updater(idName, url, { method: 'get' });
}

function showprint( URL, Page ) {
	window.open( URL+'print.php?page='+Page,'printversion', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=700,left = 262,top = 134');
}

function changeCalendar( year, month ) {
	new Ajax.Updater('calendar', '?l1=calendar&l2=plug_calendar&l3=showCalender&date='+year+'-'+month+'&ajax=1', { method: 'get' });
	return false;
}

function showOpenVideo( x, y, name, time ) {
 	document.write('<div onclick="hideLayer( \'GrayLayer\', \'InnerLayer\' )" id="GrayLayer"></div>');
	document.write('<div onclick="hideLayer( \'GrayLayer\', \'InnerLayer\' )" id="InnerLayer"></div>');
	var fo = new FlashObject("sablons/cms/pics/"+name+".swf", "flashobject", x, y, "8", "#FFFFFF");
	fo.write("InnerLayer");

	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
			_offsetY = window.pageYOffset;
			plusz = 0;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
			winH = document.documentElement.clientHeight;
			_offsetY = document.documentElement.scrollTop;
			plusz = 16;
		}
	}

	set_height = Math.max( document.getElementById('main').offsetHeight, winH );

	layer = document.getElementById('GrayLayer');
	innerL = document.getElementById('InnerLayer');

	fullpic_w = Math.min( innerL.offsetWidth, 800 );

	layer.style.height = set_height+'px';
	layer.style.width = winW+'px';
	innerL.style.left = ( (winW/2) - Math.max( (x/2), 100 ) )+'px';
	innerL.style.top = ( (winH/2) - Math.max( (innerL.offsetHeight/2), 100 ) + _offsetY )+'px';
	innerL.style.width = x+'px';

	setTimeout( 'hideLayer(\'GrayLayer\', \'InnerLayer\')', time*1000 )
}

function hideLayer( layer1, layer2 ) {
 	document.getElementById(layer1).style.display = 'none';
	document.getElementById(layer2).style.display = 'none';
	document.getElementById(layer2).innerHTML = '';
}

function setVote( vote_id ) {
	vote_div = document.getElementById('vote_num_'+vote_id);
	sub_divs = vote_div.getElementsByTagName('SPAN');
	for( i=0; i<sub_divs.length; i++ ) {
		vote_name = sub_divs[i].id.replace('vote_percent_', '');
		percent = (sub_divs[i].innerHTML*1)-200;
		document.getElementById('vote_element_'+vote_name).style.backgroundPosition = percent+'px';
	}
}

function setBg() {
	document.getElementById('body').style.backgroundImage='url(sablons/cms/pics/hatter.gif)';
	document.getElementById('body').style.backgroundColor='#24461C';
}