function showFlash(p)
{ document.writeln(p); }

function mOver(p)
{ 
	//var centerCell=p.firstChild.firstChild.getElementsByTagName('tr')[1].firstChild;
	//centerCell.style.color='#CF2900'; 
	p.style.color='#AB340A';
}

function mOut(p)
{
	//var centerCell=p.firstChild.firstChild.getElementsByTagName('tr')[1].firstChild;
	//centerCell.style.color='#242683'; 
	p.style.color='#3C140A';
}

function mSubOver(p)
{ p.style.color='#AB340A'; }

function mSubOut(p)
{ p.style.color='#3C140A'; }

function trim(sString) 
{
	while (sString.substring(0,1) == ' ')
	{ sString = sString.substring(1, sString.length); }
	
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{ sString = sString.substring(0,sString.length-1); }
	
	return sString;
}

function emailCheck(str)
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1)
	{ return false }

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{ return false }

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
	{ return false }

	 if (str.indexOf(at,(lat+1))!=-1)
	 { return false }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	 { return false }

	 if (str.indexOf(dot,(lat+2))==-1)
	 { return false }
	
	 if (str.indexOf(" ")!=-1)
	 { return false }

	 return true					
}

function sendIscr()
{
	if (!emailCheck(trim(document.getElementById('inpEmail').value)))
	{ alert('Email non valida!') }
	else
		{	
			document.getElementById('inpAction').value="save";
			document.getElementById('frmNews').submit();
		}
}
	
function removeIscr()
{
	if (!emailCheck(trim(document.getElementById('inpEmail').value)))
	{ alert('Email non valida!') }
	else
	{
		document.getElementById('inpAction').value="remove";
		document.getElementById('frmNews').submit();
	}
}

function mClick()
{ 
	subM=document.getElementById('sub');
	if (navigator.appName=='Microsoft Internet Explorer')
		{ subM.style.display=(subM.style.display=='none')?'block':'none'; }
	else
		{ subM.style.display=(subM.style.display=='none')?'table-row':'none'; }
}