function Print()
{
	window.print();
}
function Back()
{
	history.back(); 
}
function setFocus()
{
	var campos = document.forms[0].elements;
	var i;
	for (i = 0; i <= campos.length; i++)
	{
		if (campos[i].type == "text" 			||
			campos[i].type == "password"		||
			campos[i].type == "textarea" 		||
			campos[i].type == "checkbox" 		||
			campos[i].type == "radio" 			||
			campos[i].type == "file")
		{
			campos[i].focus();
			break;
		}
		else if (campos[i].type == "select" 			||
				 campos[i].type == "select-one"			||
				 campos[i].type == "select-multiple")
		{
			break;
		}
	}
}
/*
function setFocus()
{
	var campos = document.forms[0].elements;
	var i;
	for (i = 0; i <= campos.length; i++)
	{
		if (campos[i].type == "text" 			||
			campos[i].type == "password"		||
			campos[i].type == "textarea" 		||
			campos[i].type == "checkbox" 		||
			campos[i].type == "radio" 			||
			campos[i].type == "select" 			||
			campos[i].type == "select-one" 		||
			campos[i].type == "select-multiple" ||
			campos[i].type == "file")
		{
			campos[i].focus();
			break;
		}
	}
}
*/
function CheckIsIE()
{
	if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') return true;
	else return false;
}

function AbrirJanelaRel(url)
{
	window.open(url,'_blank','channelmode=no,directories=no,fullscreen=no,height=480,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no,top=0,width=640');
	//window.history.back();
}

function checkRadioButton(e)
{
	if (e.type == "radio")
	{
		e.checked = true;
	}
	else
	{
		e[0].checked = true;
	}
}

function CampoFoco(e) {
    try {
        e.focus();
    }
    catch (ex)
    { }
}

function notas(Janela,Name,Scroll,TM,LG)
{
	///window.open(janela,'notas','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=450,top=130,left=150');
	window.open(Janela,Name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+Scroll+',resizable=no,copyhistory=no,width='+LG+',height='+TM+',top=130,left=150');
}
 
function clickIE()

{if (document.all)
{(message);return false;}}

function clickNS(e) {
    if (document.layers||(document.getElementById&&!document.all)){
        if (e.which == 2 || e.which == 3) {
            return false;
        }
    }
}
if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clickNS;
}
else {
    document.onmouseup = clickNS; document.oncontextmenu = clickIE;
}
document.oncontextmenu = new Function("return false")


function mouseDown(e) {
    var shiftPressed = 0;
    var ctrlPressed = 0;
    if (parseInt(navigator.appVersion) > 3) {
        if (navigator.appName == "Netscape") {
            var mString = (e.modifiers + 32).toString(2).substring(3, 6);
            shiftPressed = (mString.charAt(0) == "1");
            ctrlPressed = (mString.charAt(1) == "1");
        } else {
            shiftPressed = event.shiftKey;
            ctrlPressed = event.ctrlKey;
        }
        if (shiftPressed || ctrlPressed || event.button == 4) {
            alert('Funcionalidade Desabilitada!')
            return false;
        }
    }
    return true;
}
if (parseInt(navigator.appVersion) > 3) {
    document.onmousedown = mouseDown;
    if (navigator.appName == "Netscape")
        document.captureEvents(Event.MOUSEDOWN);
}