// POPUP
var DHTML = (document.getElementById || document.all || document.layers);
function popUp(URL, w, h)
{
	day = new Date(); 
	id = day.getTime(); 
	eval("page" + id + " = window.open(URL, " + id + ", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=" + w + ",height=" + h + "');");
}

function addBookmark(title,url)
{
	if(!document.all)
	{
		alert("Firefox: Prima OK e depois faça Ctrl + D para adicionar a página do Externato Maria Droste aos seus favoritos!");
	}
	else
	{
		if (window.sidebar)
		{ 
			window.addBookmark(title, url,""); 
		}
		else if( document.all )
		{
			window.external.AddFavorite( url, title);
		}
		else if( window.opera && window.print )
		{
			return true;
		}
	}
}

function DoPrinting()
{
	if (!window.print)
	{
		alert("Use o Netscape  ou Internet Explorer \n nas versões 4.0 ou superior!");
		return;
	}
	window.print();
}

function high(which2)
{
	theobject=which2
	highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2)
{
	clearInterval(highlighting)
	if (which2.style.MozOpacity)
	which2.style.MozOpacity=0.3
	else if (which2.filters)
	which2.filters.alpha.opacity=30
}

function highlightit(cur2)
{
	if (cur2.style.MozOpacity<1)
	cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
	else if (cur2.filters&&cur2.filters.alpha.opacity<100)
	cur2.filters.alpha.opacity+=10
	else if (window.highlighting)
	clearInterval(highlighting)
}

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event)
{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13)
	{
		var i;
		for (i = 0; i < field.form.elements.length; i++)
			if (field == field.form.elements[i])
				break;
		i = (i + 1) % field.form.elements.length;
		field.form.elements[i].focus();
		return false;
	} 
	else
	return true;
}      