﻿function TransformText(action) {
	var defaultFontSize = 12;
	var content = document.getElementById('info').getElementsByTagName('*');
	for(i=0 ; i < content.length ; i++) {
			s = (content[i].style.fontSize) ? parseInt(content[i].style.fontSize.replace("px","")) : defaultFontSize;
			(action=='bigger') ? s++	: s--;
			content[i].style.fontSize=s+'px';
	}
}

function redirectTo(link) {
	window.location=link;
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=480,height=400');");
}

function displayCity(id,lang,link,type) {
	var url = '../helpers/contacts.php'
	pars = 'id='+id+'&lang='+lang+'&link='+escape(link)+'&type='+type;
	//pars = 'id='+id+'&lang='+lang+'&link='+link;
	$('flashresult').update();
	$('flashresult').className='flashresult info';

	if(link)
		$('flashmap').hide()
	else
		$('flashmap').show()

	var myAjax = new Ajax.Updater(
			'flashresult',
			url,
			{
				method: 'get',
				parameters: pars,
				onSuccess: restoreImage
			});
}

function restoreImage(request)
{
	$('flashresult').className='info';
	Element.scrollTo($('flashresult'));
//	window.location.hash="flashresult";
}




function change_class(element,classname) {
	$(element).className=classname;
}

function toggleContent(id) {
	Element.toggle($(id));
}


function toggleContent1(id) {
	Element.toggle($(id));
}

function openWindow(theURL,winName,features) {
  var popupWindow = window.open(theURL,winName,features);
  popupWindow.focus();
}