function nopicsave()
	{
	alert('Amennyiben képekre van szüksége, kérjük szíveskedjen felvenni velünk a kapcsolatot a megadott elérhetőségek valamelyikén! Köszönjük!');
	return false;
	}



function openwindow(pageurl,width,height,scroll,winname)
	{
	showscroll=(scroll!='yes' && scroll!=true) ? true : false;
	$("#bpopup_popup").html('<iframe src="'+pageurl+'" width="'+width+'" height="'+height+'" frameborder="no"></iframe><span class="bClose" style="display:none;"></span>');
	$("#bpopup_popup").openPopup({amsl:0, followSpeed:100, fadeSpeed: 500, scrollBar:showscroll, fixed:true, modalClose:true});
	}


function shareContent(share, url) 
	{
	share_url='';

	a = document.createElement('a');
	a.href = url ? url : document.location.href;

	url_href=a.href;
	url_pathname = a.pathname.indexOf('/')!=0 ? '/'+a.pathname : a.pathname ; /// IE hiba miatti '/' korrekció...
	url_search = a.search;

	share_title = encodeURIComponent('KonferenciaPortál: ' + $("H1").text());

	if (share=='print')
		{
		openwindow('/misc/printpage.php?pageurl='+escape(document.location.pathname)+'&'+document.location.search.substring(1), '720','450', 'yes','yes','yes');
		}
	else if (share=='email')
		{
		openwindow('/misc/sendbyemail.php?pageurl='+escape(document.location.pathname)+'&fullurl='+escape(document.location.pathname+document.location.search)+'&'+document.location.search.substring(1), '480','380','no','no','no');
		}
	else if (share=='facebook')
		{
		share_url='http://www.facebook.com/share.php?u='+escape(url_href);
		}
	else if (share=='twitter')
		{
		share_url='http://twitter.com/home?status=' + share_title + ' ' + escape(url_href);
		}
	else if (share=='linkedin')
		{
		share_url='http://www.linkedin.com/shareArticle?mini=true&title=' + share_title + '&source=KonferenciaPortal&url=' + escape(url_href);
		}
	else if (share=='googleplus')
		{
		share_url='https://m.google.com/app/plus/x/?v=compose&content=' + share_title + ' ' + escape(url_href);
		}
	else if (share=='foursquare')
		{
		share_url='https://foursquare.com/remote_todo?vid=2847885&color=light';
		}
	else if (share=='iwiw')
		{
		share_url='http://iwiw.hu/pages/share/share.jsp?u='+url_href;
		}

	if (share_url) openwindow(share_url);
	} 


function catMenu(database_name,catrootid,cols,levels)
	{
	/// setup
	if (database_name=='setup')
		{
		$("DIV.cat_head_w,DIV.cat_head_n").hover(   /// set onmouseover/out
			function() {$(this).find("img").attr("src", $(this).find("img").attr("src").replace('.gif','_white.gif'));},
			function() {$(this).find("img").attr("src", $(this).find("img").attr("src").replace('_white.gif','.gif'));}
			);
		}
	/// load content and setup
	else if (!content_loaded['cat_menu'])
		{
		loadContent('cat_menu','database_name='+database_name+'&catrootid='+catrootid+'&cols='+cols+'&levels='+levels,0,'','',catMenu); /// load content
		}
	/// content has loaded, so set the content height and show for first time
	else if (content_loaded['cat_menu']==1)
		{
		$("#cat_menu").css('display','block').animate({height: $("#cat_menu_table").height()}, 500); /// show
		arrowimg=$("DIV.cat_head_w,DIV.cat_head_n").find("img");
		arrowimg.attr("src", arrowimg.attr("src").replace('cat+','cat-')); /// swap arrow
		content_loaded['cat_menu']=2; /// ...so we know we have been here...
		}
	/// toggle
	else
		{
		$("#cat_menu").slideToggle(500, function()
			{
			arrowimg=$("DIV.cat_head_w,DIV.cat_head_n").find("img");
			if ($(this).css("display")=='none')
				{
				arrowimg.attr("src", arrowimg.attr("src").replace('cat-','cat+'));
				}
			else
				{
				arrowimg.attr("src", arrowimg.attr("src").replace('cat+','cat-'));
				}
			});
		}
	}


content_loaded=Array();
newscript=Array();
function loadContent(contentid,contentparam,forcereload,outputid,lang,onloadfunct)
	{
	outputid=(outputid ? outputid : contentid);
	contentparam=contentparam ? contentparam : '';
	if (content_loaded[outputid]!=1 || forcereload==1)
		{
		if (lang=='en' || contentparam.indexOf('lang=en')!=-1)
			{
			loading_text='Loading...';
			}
		else if (lang=='de' || contentparam.indexOf('lang=de')!=-1)
			{
			loading_text='Loading...';
			}
		else
			{
			loading_text='Betöltés...';
			}
		document.getElementById(outputid).innerHTML='<br/><br/><center>'+loading_text+'</center>';

		content_loaded[outputid]=1;

		sitemapidparam=sitemap_id ? '&sitemap_id='+sitemap_id : '';
		contentidparam='&contentid='+contentid;
		langparam=lang ? '&lang='+lang : '';
		contenturl='/inc/functions/content_'+contentid+'.php?'+(contentparam.indexOf('contentid')==-1 ? sitemapidparam+contentidparam+langparam+'&' : '') + contentparam;

		if (window.XMLHttpRequest) {xmlhttp=new XMLHttpRequest();} else {	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
		if (!xmlhttp && typeof xmlhttprequest!='undefined') {xmlhttp = new xmlhttprequest();}
		xmlhttp.onreadystatechange = function (e)
			{
			if (xmlhttp.readyState == 4)
				{
				content=xmlhttp.responseText;
				document.getElementById(outputid).innerHTML=content;
				if (onloadfunct) onloadfunct();
				}
			};
		xmlhttp.open('GET',contenturl,true);
		xmlhttp.send();
		}

	return true;
	}


function doFilter(loc)
	{
	if (loc) 
		{
		urlpath='/szakember-kereso/';
		eval('fieldnames=doFilter_fieldnames' + '_' + loc + ';');
		}
	else
		{
		urlpath='';
		fieldnames=doFilter_fieldnames;
		}

	selector = "[name='" + fieldnames.join("'],[name='") + "']," + "[submitName='" + fieldnames.join("'],[submitName='") + "']";
	querystr = $(selector).serialize();
	document.location=urlpath+'talalatok.php?' + querystr;
	}


function doFilterIndex()
	{
	querystr='?';

	fieldnames=doFilterIndex_fieldnames;
	selector = "[name='" + fieldnames.join("'],[name='") + "']," + "[submitName='" + fieldnames.join("'],[submitName='") + "']";
	querystr = $(selector).serialize();

	document.location='?' + querystr;
	}


function doABC(letter)
	{
	document.getElementsByName('letter')[0].value=letter;
	doFilter();
	return void(0);
	}


events_calendar_active='';
function events_calendar(id)
	{
	if (events_calendar_active==id) return;

	$("#events_calendar [id^='year'][id!='" + id + "']").slideUp(500); /// minden 'year' kezdetűt kivéve az aktuálisat eltüntet
	$("#events_calendar #" + id).slideDown(500); /// az aktuálisat megjeleníti
	$("#events_calendar [id^='button_year']").addClass("title_13_inactive").removeClass("title_13"); /// átállítgatja inaktívra
	$("#events_calendar [id^='button_"+id+"']").addClass("title_13").removeClass("title_13_inactive"); /// átállítgatja inaktívra

	events_calendar_active=id;
	}


/// favourites
function favourites(action,item_type,item_id,item_url,redirect)
	{
	action=action ? action : 'read';
	item_type=item_type ? item_type : '';
	item_id=item_id ? item_id : '';
	item_url=item_url ? item_url : item_id!='' ? encodeURIComponent(window.location) : '';
	redirect=((redirect==undefined && action!='read') || redirect==1) ? encodeURIComponent(window.location) : redirect ? redirect : '';

	if (action=='send')
		{
		openwindow('/misc/sendbyemail.php?mailtype=favourites&pageurl=/kedvencek/&fullurl=/kedvencek/', '629','323','no');
		}
	else
		{
		if (action=='delete' && ((item_id && !confirm('Biztosan törölni szeretné ezt az elemet a kedvencek közül?')) || (!item_id && !confirm('Biztosan törölni szeretné a kedvenceket?'))))
			{
			return;
			}
		document.location='/kedvencek/?action='+action+'&item_type='+item_type+'&item_id='+item_id+'&item_url='+item_url+'&redirect='+redirect;
		}
	}


function showMap(id)
	{
	/// create map and markers
	$('#map_area_'+id).goMap(
		{
		maptype: 'ROADMAP',
		mapTypeControlOptions: {position: 'TOP_RIGHT',style:'DROPDOWN_MENU'},
		markers: map_markers[id],
		zoom:14
		});
//	$.goMap.fitBounds();
	for(i in map_markers[id])
		{
		if (map_markers[id][i]['url']) $.goMap.createListener({type:'marker', marker:map_markers[id][i]['id']}, 'click', function() {document.location=map_markers[id][i]['url'];});
		}
	}


function showContent(id,txtshow,txthide)
	{
	$("#"+id).slideToggle(500);

	src = $("#"+id+"_img").attr("src");
	src = $("#"+id).css("height")=="1px" ? src.replace('down','up') : src.replace('up','down');
	$("#"+id+"_img").attr("src", src);

	if (txtshow && txthide)
		{
		txt = $("#"+id+"_div").html();
		txt = $("#"+id).css("height")=="1px" ? txt.replace(txtshow,txthide) : txt.replace(txthide,txtshow);
		$("#"+id+"_div").html(txt);
		}
	}


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';
	}


function outboundClicks()
	{
	var owndomain = document.domain;
	$("A").each(function()
		{
		linkhref=$(this).attr("href");
		if (((owndomain!='' && linkhref.indexOf(owndomain)<0) || owndomain=='') && linkhref.indexOf('://')>0)
			{
			$(this).click(function()
				{
				_gaq.push(['_trackEvent', 'outbound', 'click', $(this).attr("href").substring(7)]);
				});
			}
		});
	}



/// onload
$(document).ready(function()
	{
	/// mérje a kifele mutató linkeket
	outboundClicks();
	});
