
function open_gallery (gid,pic) {
	window.open('http://www.kortyolda.hu/_gallery.php?id='+gid+'&pic='+pic,'Galéria','status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=600,width=690');
}
function open_center_layer(element,x,y,mode){
	/*
	mode : 0; absolut középre, x és y a div fele
	mode : 1; a toppos = y;
	mode : 2; a leftpos = x; toppos = y;
	*/
	document.getElementById(element).style.display = "none";
	leftpos = 0 ;
	toppos = 0 ;

	if(mode==0){
		/* TOP */
		if(self.pageYOffset){
			yScroll = self.pageYOffset;
		}else if(document.documentElement && document.documentElement.scrollTop){
			yScroll = document.documentElement.scrollTop;
		}else if(document.body){
			yScroll = document.body.scrollTop;
		}
		if (self.innerHeight) {
			inheight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			inheight = document.documentElement.clientHeight;
		} else if (document.body) {
			inheight = document.body.clientHeight;
		}
		toppos = (yScroll + (inheight/2)) - y;
	}else{
		toppos = y;
	}

	if(mode==0){
		/* LEFT */
		if (screen){
			leftpos = (document.body.clientWidth/2) - x ;
		}

		if (leftpos<0)
			leftpos = 10 ;
	}else if(mode==2){
		leftpos = x;
	}

	document.getElementById(element).style.left = leftpos+'px';
	document.getElementById(element).style.top = toppos+'px';
}

function showmessagebox(mode){
	var elem = '';
	if(mode==0){
		elem = 'error_message';
	}else if(mode==1){
		elem = 'success_message';
	}else{
		elem = 'messagebox';
	}

	document.getElementById(elem).style.display = "block" ;
	window.focus() ;

	document.onclick = function(){
		document.getElementById(elem).style.display = "none" ;
		window.focus() ;
		document.onclick = empty ;
	}
}
function showmessagebox_popup(mode){
	var elem = '';
	if(mode==0){
		elem = 'error_message';
	}else if(mode==1){
		elem = 'success_message';
	}else{
		elem = 'messagebox_popup';
	}

	document.getElementById(elem).style.display = "block" ;
	window.focus() ;

	document.onclick = function(){
		document.getElementById(elem).style.display = "none" ;
		window.focus() ;
		document.onclick = empty ;
	}
}
function empty(){
}


// FLASH MEGJELENÍTÉS

function showflash(file,width,height,bgcolor,wmode) {
	if (wmode)
		wmode = 'transparent' ;
	else
		wmode = 'opaque' ;
	document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+width+'\" height=\"'+height+'\">');
	document.write('<param name=\"allowScriptAccess\" value=\"always\" />');
	document.write('<param name=\"movie\" value=\"'+file+'\" />');
	document.write('<param name=\"quality\" value=\"high\" />');
	document.write('<param name=\"wmode\" value=\"'+wmode+'\" />');
	document.write('<param name=\"bgcolor\" value=\"'+bgcolor+'\" />');
	document.write('<param name=\"swliveconnect\" value=\"true\" />');
	document.write('<param name=\"menu\" value=\"false\" />');
	document.write('<embed src=\"'+file+'\" quality=\"high\" bgcolor=\"'+bgcolor+'\" width=\"'+width+'\" height=\"'+height+'\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"'+wmode+'\"  swliveconnect=\"true\" menu=\"false\"/>');
	document.write('</object>');
}

// RADIO BUTTONOK MEGJELÖLT ÉRTÉKÉNEK VISSZAADÁSA
function getradiovalue(radioObj)
	{
	if (!radioObj)
		return "" ;
	var radioLength = radioObj.length ;
	if (radioLength == undefined)
		if (radioObj.checked)
			return radioObj.value ;
		else
			return "" ;
	for (var i = 0; i < radioLength; i++)
			{
		if (radioObj[i].checked)
			{
			return radioObj[i].value ;
			}
		}
	return "" ;
	}

function showelement(element)
	{
	document.getElementById(element).style.display = "block" ;
	window.focus() ;
	}

function hideelement(element)
	{
	document.getElementById(element).style.display = "none" ;
	window.focus() ;
	}
function hideall(elements){
	var element = elements.split(',');
	for(i=0; i<element.length; i++)	{
		e = element[i];
		if(document.getElementById(e)){
			document.getElementById(e).style.display = "none" ;
		}
	}
	window.focus() ;
}
function showhideelement(element)
	{
	if (document.getElementById(element).style.display=='none')
	showelement(element) ;
	else
	hideelement(element) ;
	window.focus() ;
	}
function s(param0){
	var context=document;
	param0_arr = param0.split(' ');
	var max=param0_arr.length;
	var retnode = new Array();
	chekType(param0_arr,0);
	return retnode;
	
	function chekType(param0_arr,index){
			var first=param0_arr[index].charAt(0);
			var content=param0_arr[index].substring(1,param0_arr[index].length);
			if(first=="#"){
				context=context.getElementById(content);
				if(context){
					index++;
					if(max>index){
						return chekType(param0_arr,index);	
					}else{
						retnode=context;
					}	
				}else{
					return false;
				}	
			}else if(first=="."){
				var elem = context.getElementsByTagName('*');
				index++;
				for (var i = 0; i < elem.length; i++) {
					var classes = elem[i].className;
					if (classes==content){
						if(elem[i]){
							if(max>index){
								context=elem[i];
								chekType(param0_arr,index);
							}else{
								retnode.push(elem[i]);
							}
						}
					}
				}
				return retnode;
			}else{
				var elem = context.getElementsByTagName(first+content);
				index++;
				for (var i = 0; i < elem.length; i++) {
					if(elem[i]){
						if(max>index){
							context=elem[i];
							chekType(param0_arr,index);
						}else{
							retnode.push(elem[i]);
						}
					}
				}
				return retnode;
			}
	}
}
function setFixSize(){
	var maxh=document.getElementById('obox0').offsetHeight;
	if(maxh<document.getElementById('obox1').offsetHeight){
		maxh=document.getElementById('obox1').offsetHeight;
	}
	if(maxh<document.getElementById('obox2').offsetHeight){
		maxh=document.getElementById('obox2').offsetHeight;
	}
	if(maxh<document.getElementById('obox3').offsetHeight){
		maxh=document.getElementById('obox3').offsetHeight;
	}
	document.getElementById('obox0').style.height = document.getElementById('obox1').style.height = document.getElementById('obox2').style.height = document.getElementById('obox3').style.height = maxh+'px';
}
