function makeHomePage(object)
	{
	object.style.behavior='url(#default#homepage)';
	object.setHomePage('http://www.utazasiiroda.hu');
	}

function addToFav(favurl,favtxt)
	{
	if (window.external)
		{
		favurl=favurl!='' ? favurl : 'http://www.utazasiiroda.hu';
		favtxt=favtxt!='' ? favtxt : 'Utazási iroda';
		window.external.AddFavorite(favurl,favtxt);
		}
	else
		{
		alert("A böngésző nem támogatja ezt a szolgáltatást.");
		}
	}

function nopicsave()
	{
	return false;
	}

function zoomimg_m(img,action)
	{
	img.style.cursor = 'wait';

	reg1 = /(id\=\d+\&ext\=[^&]+|id\=\d+|database_name\=.+\&database_id\=[^&]+)/g;
	imgid = reg1.exec(img.src);
	reg2 = /id\=\d+\&ext\=[^&]+(.*)/g;
	imgth = reg2.exec(document.img_large_img_m.src);
	document.img_large_img_m.src='/image/?'+imgid[1]+imgth[1];

	blankreg = reg1.exec('');
	blankreg = reg2.exec('');

	img.style.cursor = 'url(\'/images/cursors/magnify.cur\'),pointer';
	}


function zoomimg(img,action,e)
	{
	if (action=='toggle') {action=document.img_large_img.src.indexOf('hourglass.gif')==-1 ? 0 : 1;}

	if (action==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);
				}

			/// IE and Moz correction
			/// if (typeof window.pageYOffset == 'undefined') {pos_large_y+=0;} else {pos_large_y+=0;}

			document.getElementById('img_large').style.left = pos_large_x+'px';
			document.getElementById('img_large').style.top = pos_large_y+'px';
			}
		else
			{
			pos_large_y=e.clientY+document.body.scrollTop-10;
			pos_large_x=e.clientX+document.body.scrollLeft-10;

			img_large.style.left = pos_large_x+'px';
			img_large.style.top = pos_large_y+'px';
			}

		///document.styleSheets[0].addRule('SELECT.need_to_hide','visibility: hidden');
		document.getElementById('img_large').style.display = 'block';
		document.getElementById('img_large').title=img.title;

		imgid = reg.exec('');
		}
	else
		{
		document.getElementById('img_large').style.display = 'none';
		document.img_large_img.src='/images/icons/hourglass.gif';
		///document.styleSheets[0].addRule('SELECT.need_to_hide','visibility: visible');
		}
	}



function scrollGallery(objInput,dir,horizontal)
	{
	horizontal = horizontal ? 1 : 0;

	if (typeof objInput=='object')
		{
		objGallery=objInput.parentNode;
		}
	else
		{
		objGallery=document.getElementById(objInput);
		}

	clearTimeout(objGallery.getAttribute('scrolltimeout'));
	if (dir!=0)
		{
		objGalleryDivs=objGallery.getElementsByTagName('DIV');
		objGalleryImgs=objGallery.getElementsByTagName('IMG');

		scrollcountorig=parseInt(objGallery.getAttribute('scrollcount'));
		scrollcount=scrollcountorig+dir;
		scrolllength=horizontal ? objGallery.getAttribute('scrollwidth') : objGallery.getAttribute('scrollheight');
		imgcount=objGalleryImgs.length;

		/// may need to modify these (div and img serials)
		///objScroll=objGalleryDivs[0];
		objScroll=objGallery;
		///objButtonRe=objGalleryImgs[imgcount];
		///objButtonFw=objGalleryImgs[imgcount+1];

		scrollcount=Math.max(0,scrollcount);
		scrollcount=Math.min(scrollcount,scrolllength);
		objGallery.setAttribute('scrollcount',scrollcount);
		if (horizontal)
			{
			imgwidth=objGallery.getAttribute('imgwidth');
			objScroll.scrollLeft=scrollcount*imgwidth;
			}
		else
			{
			imgheight=objGallery.getAttribute('imgheight');
			objScroll.scrollTop=scrollcount*imgheight;
			}

		///objButtonRe.style.visibility=scrollcount>0 ? 'visible' : 'hidden';
		///objButtonFw.style.visibility=scrollcount==scrolllength ? 'hidden' : 'visible';

		if (scrollcountorig!=scrollcount)
			{
			objGallery.setAttribute('scrolltimeout',setTimeout('scrollGallery(\''+objGallery.id+'\','+dir+','+horizontal+')',100));
			}
		}
	}





function openwindow(pageurl,width,height,scroll,winname) 
	{
	scroll=scroll!='no' ? '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);
	}



function registernewsletter()
	{
	newsletter_format=document.NewsletterForm.newsletters_format[1].checked ? 'txt' : 'html';
	openwindow('/magyar/misc/registernewsletter.php?email='+document.NewsletterForm.email.value+'&newsletters_format='+newsletter_format+'&action=save', '655','270', 'no', 'registernewsletter');
	}



content_loaded=Array();
newscript=Array();

function loadContent(contentid,contentparam,forcereload,outputid)
	{
	if (content_loaded[contentid]!=1 || forcereload==1)
		{
		content_loaded[contentid]=1;
		newscript[contentid]=document.createElement("script");
		contentparam=contentparam ? '&param='+contentparam+'&'+Math.random() : '&'+Math.random();
		outputparam=outputid ? '&outputid='+outputid : '';
		newscript[contentid].src='/inc/functions/load_content.php?contentid='+contentid+contentparam+outputparam;
		document.getElementsByTagName("body")[0].appendChild(newscript[contentid]);
		}

	return true;
	}

document.write('<script type="text/javascript" src="http://imgs.adverticum.net/scripts/goa3/goa3.js"></script>');

setTimeout('common_scripts_loaded=1;', 1000);
