function mailto(m)
	{
	window.location.href='mailto:'+m.substring(0,m.indexOf('$'))+'@'+m.substring(m.indexOf('$')+1,m.length);
	}

function toggledisp(i,s)
	{
	document.getElementById(i).style.display=(s)?'block':'none';
	}

function promptfor(l,m)
	{
	if(a=prompt(m,'0')) { l=l+a;window.location.href=l; }
	}

function askfor(l,m)
	{
	if(confirm(m)) { window.location.href=l; }
	}

function daysCount(y,m)
	{
	return new Date(y,m,0).getDate();
	}

function changeDays(y,m,d,id)
	{
	var ds=daysCount(y,m);
	var e=document.getElementById(id);
	e.innerHTML='';
	for(var i=1;i<=ds;i++)
		{
		var li=document.createElement('OPTION');
		li.value=i;
		li.text=i;
		if (d==i) li.selected=true;
		e.options.add(li);
		}
	}

function googleStat(c,i)
	{
	if (typeof(urchinTracker)=='function')
		{
		_uacct=i;
		urchinTracker();
		}
	else
		{
		if(c--)setTimeout('googleStat('+c+',"'+i+'")',500);
		}
	}

function addCSS(f)
	{
	var s=document.createElement('link');
	s.rel="stylesheet";
	s.type="text/css";
	s.href=f;
	document.getElementsByTagName('head')[0].appendChild(s);
	}

function addJS(f, type)
	{
	var s=document.createElement('script');
	s.type="text/javascript";
	if ((type) && ('async' == type)) s.async = true;
	s.src=f;
	document.getElementsByTagName('head')[0].appendChild(s);
	}

function iniG(i)
	{
	addJS("http://www.google-analytics.com/urchin.js", "sync");
	googleStat(10,i);
	}

function init()
	{
	iniGAAsync("UA-1614948-16");
	}

function GAStat(c,i)
	{
	if(typeof(_gat)=='undefined')
		{
		if(c--)setTimeout('GAStat('+c+',"'+i+'")',500);
		}
	else
		{
		try
			{
			var pageTracker = _gat._getTracker(i);
			pageTracker._trackPageview();
			}
		catch(err)
			{}
		}
	}

function iniGA(i)
	{
	addJS("http://www.google-analytics.com/ga.js", "sync");
	GAStat(10,i);
	}

function iniGAAsync(i)
	{
	window._gaq = window._gaq || [];
	_gaq.push(['_setAccount', i]);
	_gaq.push(['_trackPageview']);
	addJS("http://www.google-analytics.com/ga.js", "async");
	}

function GAtrackPageview(uri, i)
	{
	}

function trackForm(uri, frm, i)
	{
	if (i--)
		{
		if (typeof(_gaq) === 'object' && (_gaq.length > 1 || _gaq.length === undefined))
			{
			_gaq.push(['_trackPageview', uri]);
			setTimeout(function() { frm.submit(); }, 400);
			}
		else
			{
			setTimeout(function() { trackForm(uri, frm, i); }, 100);
			}
		}
	else
		{
		frm.submit();
		}
	return false;
	}
