function submitcust(action)
	{
	lang=document.CustForm.cust_lang.value;
	if (action) document.CustForm.formaction.value=action;

	/// login
	if (action=='login' || action=='modify' || action=='register' || action=='logout')
		{
		document.CustForm.action='/'+lang+'/misc/register.php';
		}
	else if (action=='message')
		{
		document.CustForm.action='/'+lang+'/contact/message/index.php';
		}
	else if (action=='contact')
		{
		document.CustForm.action='/'+lang+'/contact/contactdetails/index.php';
		}
	else if (action=='downloads')
		{
		document.CustForm.action='/'+lang+'/customerservice/downloads/index.php';
		}
	else if (action=='encyclopedia' || action=='wizard_format' || action=='wizard_weight' || action=='visitpress' || action=='callback' || action=='offer_press')
		{
		document.CustForm.action='/'+lang+'/services/press/'+action+'/index.php';
		}
	else if (action=='administration')
		{
		document.CustForm.action='/'+lang+'/services/distribution/administration/index.php';
		}
	else if (action=='adorder')
		{
		document.CustForm.action='/'+lang+'/services/advertising/'+action+'/index.php';
		}
	else
		{
		document.CustForm.action='/'+lang+'/customerservice/'+action+'.php';
		}

	document.CustForm.submit();
	}


function nopicsave()
	{
	return false;
	}


function openwindow(pageurl,width,height,scroll,winname) 
	{
	scroll=(scroll!='no' && scroll!=0) ? 'yes' : 'no';
	winname=winname ? winname : '_blank';
	if (width || height)
		{
		posleft=(screen.width-width)/2;
		postop=(screen.height-height)/2;
		if (0>postop) postop=0; 
		if (0>posleft) posleft=0;
		pos=',toolbar=no,location=no,directories=no,menubar=no,status=no,left='+posleft+',top='+postop+',width='+width+',height='+height;
		}
	else
		{
		pos='';
		}

	window.open(pageurl,winname,'scrollbars='+scroll+pos);
	}


zoomimg_timer=0;
img_large_visible=0;

function zoomimg(img,action,addx,addy,e)
	{
	if (action=='toggle') {action=img_large_visible==1 ? -1 : 1;}

	/// display
	if (action==1)
		{
		zoomimg(null,'cleartimer');
		img_large_visible=1;

		reg = /(id\=\d+\&ext\=[^&]+|id\=\d+|database_name\=.+\&database_id\=[^&]+)/g;
		imgid = reg.exec(img.src);

		document.img_large_img.src='/image/?'+imgid[1]+'&th=f';

		if (!e)
			{
			pos_large_x=0;
			pos_large_y=0;
			pos_str='';
			pos_obj=img;
			while(pos_obj)
				{
				pos_large_x+=pos_obj.offsetLeft;
				pos_large_y+=pos_obj.offsetTop;
				pos_str+='.offsetParent';
				eval('pos_obj=img'+pos_str);
				}

			/// modositva! -1 -re!
			pos_large_y+=addy ? addy : -1;
			document.getElementById('img_large').style.top = pos_large_y+'px';
			}
		else
			{
			pos_large_y=e.clientY+document.body.scrollTop-10;
			img_large.style.top = pos_large_y+'px';
			}

		document.getElementById('img_large').title=img.title;
		document.getElementById('img_large_descript').innerHTML=img.title;
		document.getElementById('img_large').style.display = 'block';

		imgid = reg.exec('');
		}
	/// reposition
	else if (action=='reposition' && document.img_large_img.src.indexOf('hourglass.gif')==-1)
		{
		zoomimg(null,'cleartimer');
		document.getElementById('img_large').style.top = Math.max((parseInt(document.getElementById('img_large').style.top) - parseInt(document.getElementById('img_large').offsetHeight) - 25),160) + 'px';
		document.getElementById('img_large').style.visibility = 'visible';
		}
	/// hide
	else if (action==0 || action==-1)
		{
		if (action==-1 || zoomimg_timer)
			{
			img_large_visible=0;
			zoomimg(null,'cleartimer');
			document.getElementById('img_large').style.visibility = 'hidden';
			document.getElementById('img_large').style.display = 'none';
			document.img_large_img.src='/images/icons/hourglass.gif';
			}
		else if (img_large_visible)
			{
			zoomimg_timer=setTimeout("zoomimg(null,-1);", 300);
			}
		}
	else if (action=='cleartimer')
		{
		clearTimeout(zoomimg_timer);
		zoomimg_timer=0;
		}
	}


function zoomimg_gallery(img,action)
	{
	if (action==1)
		{
		reg = /id\=(\d+)/g;
		imgid=reg.exec(img.src);
		document.getElementById('main_img_descript').innerHTML=img.title;
		document.getElementById('i_count').innerHTML=img.name;
		document.getElementById('main_img').src='/image/?id='+imgid[1]+'&th=g';
		imgid = reg.exec('');
		}
	}

content_loaded=Array();
newscript=Array();

function loadContent(contentid,contentparam,forcereload,outputid,lang)
	{
	if (content_loaded[contentid]!=1 || forcereload==1)
		{
		loading_text='Betöltés...';
		document.getElementById('content_'+contentid).innerHTML='<br/><br/><center>'+loading_text+'</center>';

		content_loaded[contentid]=1;
		newscript[contentid]=document.createElement("script");
		outputparam=outputid ? '&outputid='+outputid : '';
		langparam=lang ? '&lang='+lang : '';
		newscript[contentid].src='/inc/functions/load_content.php?' + (contentparam.indexOf('contentid')==-1 ? 'contentid='+contentid+outputparam+langparam : '') + contentparam;
		document.getElementsByTagName("body")[0].appendChild(newscript[contentid]);
		}

	return true;
	}





var fontpx = 11;
var minpx = 9;
var maxpx = 19;

function changeFont(dif) 
	{
	var obj;
	var newpx = fontpx + dif;

	if (newpx >= minpx && newpx <= maxpx) 
		{
		obj = document.getElementById("text");
		if (obj) obj.style.fontSize = newpx + "px";
		fontpx = newpx;
		}
	} 


function shareContent(share,lang) 
	{
	share_url='';
	url_href=escape(document.location.href);

	if (share=='print')
		{
		openwindow('/'+lang+'/misc/printpage.php?pageurl='+escape(document.location.pathname)+'&'+document.location.search.substring(1), '720','450', 'yes','yes','yes');
		}
	else if (share=='email')
		{
		openwindow('/'+lang+'/misc/sendbyemail.php?pageurl='+escape(document.location.pathname)+'&fullurl='+escape(document.location.pathname+document.location.search)+'&'+document.location.search.substring(1), '480','350','no','no','no');
		}

	if (share_url) openwindow(share_url);

	} 

function on_mouse_over() 
	{
	element = eval("document.getElementById('block_share')");
	element.style.visibility = 'visible';
	}

function on_mouse_out() 
	{
	element = eval("document.getElementById('block_share')");
	element.style.visibility = 'hidden';
	}


setTimeout('common_scripts_loaded=1;', 1000);