    // Impede Seleção
	//document.onselectstart = function() { return false; }
    
    // Menu Lateral
    if (document.getElementById){
		document.write('<style type="text/css">\n')
		document.write('.options{display: none;}\n')
		document.write('</style>\n')
    }
    
    //this function is for Request Form Error Found form, it's to hide, the extra questions.
    function SwitchRequestHideShow(obj, message){
    	var object = document.getElementById(obj);
    	if(message){
    		//object.style.display = "block";
    		object.style.display = "";
    	} else {
    		object.style.display = "none";
    		
    		var ar = object.getElementsByTagName("input");
    		
    		for (var i=0; i<ar.length; i++){
    				if(ar[i].type == "radio"){
    					ar[i].checked = false;
					} else if(ar[i].type == "button"){
    					//ignore
    				} else {
						ar[i].value = "";
					}
			}
			
    	}
    }

    function SwitchMenu(obj){
    	if(document.getElementById){
		var el = document.getElementById(obj + "a");
		var elb = document.getElementById(obj + "b");
		var elc = document.getElementById(obj + "c");
		var eld = document.getElementById(obj + "d");
		var ele = document.getElementById(obj + "e");
	
		var ar = document.getElementById("masterdiv").getElementsByTagName("div");
			if(el.style.display != "block"){
				for (var i=0; i<ar.length; i++){
					ar[i].style.display = "none";
				}
				el.style.display = "block";
				elb.style.display = "block";
				elc.style.display = "block";
				eld.style.display = "block";
				ele.style.display = "block";
			}else{
				el.style.display = "none";
				elb.style.display = "none";
				elc.style.display = "none";
				eld.style.display = "none";
				ele.style.display = "none";
			}
    	}
    }

	function ClientInformationSystemOther(obj1, obj2){
    	if(document.getElementById){
			var el = document.getElementById(obj1);
			var elb = document.getElementById(obj2);
			
			if(obj1.selectedIndex == 10 ){
				elb.style.display = "block";			
			} else {
				elb.style.display = "none";
			}
		}
    }

	function ImpactOfErrorInOperations(obj1, obj2){
    	if(document.getElementById){
			var el = document.getElementById(obj1);
			var elb = document.getElementById(obj2);
			
			if(obj1.selectedIndex == 4 ){
				elb.style.display = "block";			
			} else {
				elb.style.display = "none";
			}
		}
    }
    
    
    
function showtip(current,e,text)
{
	if (document.all)
	{
		document.all.tooltip.innerHTML='<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" BGCOLOR="black" BORDERCOLOR="#000000"><TR><TD><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="lightyellow" BORDERCOLOR="#000000"><TR><TD STYLE="font-family:Arial,Helvetica,Sans-Serif;font-size:12px;" NOWRAP>'+text+'</TD></TR></TABLE></TD></TR></TABLE>';
		document.all.tooltip.style.pixelLeft=event.clientX+document.body.scrollLeft+10;
		document.all.tooltip.style.pixelTop=event.clientY+document.body.scrollTop+10;
		if (document.all.tooltip.style.pixelLeft+document.all.tooltip.clientWidth>=document.body.offsetWidth+document.body.scrollLeft-16)
			document.all.tooltip.style.pixelLeft=event.clientX-document.all.tooltip.clientWidth+document.body.scrollLeft-4;
		if (document.all.tooltip.style.pixelTop+document.all.tooltip.clientHeight>=document.body.offsetHeight+document.body.scrollTop-16)
			document.all.tooltip.style.pixelTop=event.clientY-document.all.tooltip.clientHeight+document.body.scrollTop-4;
		document.all.tooltip.style.visibility="visible";
	}
	else if (document.layers)
	{
		document.tooltip.document.write('<LAYER BGCOLOR="lightyellow" STYLE="border:1px solid black;font-family:Arial,Helvetica,Sans-Serif;font-size:12px;">'+text+'</LAYER>');
		document.tooltip.document.close();
		document.tooltip.left=e.pageX+5;
		document.tooltip.top=e.pageY+5;
		var d=(document.tooltip.clip.height+e.pageY+5)-(window.innerHeight+window.pageYOffset);
		if (d>0) document.tooltip.top=e.pageY+5-d;
		document.tooltip.visibility="show";
	}
	else
	{
		var elem=document.getElementById("tooltip");
		elem.innerHTML='<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="black" BORDERCOLOR="#000000" STYLE="border:1px solid black;font-family:Arial,Helvetica,Sans-Serif;font-size:12px;"><TR><TD NOWRAP><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="lightyellow" BORDERCOLOR="#000000"><TR><TD STYLE="font-family:Arial,Helvetica,Sans-Serif;font-size:12px;" NOWRAP>'+text+'</TD></TR></TABLE></TD></TR></TABLE>';
		elem.style.left=e.pageX+5+'px';
		elem.style.top=e.pageY+5+'px';
		var d=(elem.style.clip.height+e.pageY+5)-(window.innerHeight+window.pageYOffset);
		if (d>0) elem.style.top=e.pageY+5-d+'px';
		elem.style.visibility="visible";
	}
}

function hidetip()
{
	if (document.all)
		document.all.tooltip.style.visibility="hidden";
	else if (document.layers)
		document.tooltip.visibility="hide";
	else
	{
		var elem=document.getElementById("tooltip");
		elem.style.visibility="hidden";
	}
}

function lgu_name_request_id(obj, obj2){
	var object = document.getElementById(obj2);
	if (object != null)
	{
		var date = new Date();
		var w = obj.selectedIndex;
		var selected_text = obj.options[w].text;
	
		object.value = (selected_text.substr(0,3)).toUpperCase();
		object.value = object.value + "-" + date.getYear() + "-000";
	}
}



function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

/*
  additional scripts
  @author Reymond D. Ong 
 */
 
function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}

function indexOf(haystack, needle)
{
	var i = 0;
	for (i = 0; i < haystack.length; i++)
	{
		if (haystack[i] == needle)
		{
			return i;
		}
	}
	return -1;
}

function y2k(number) { 
	if (number < 1000)
	{
		return number + 1900;
	}
	else
	{
		return number;
	}
}

function isDateValid(year, month, day) 
{
    year = y2k(year);
    month = month-1;
    var test = new Date(year, month, day);
    if ( (y2k(test.getYear()) == year) && (month == test.getMonth()) 
    	&& (day == test.getDate()) )
    {
    	return true;
    }
    else
    {
    	return false;
    }
}

function validateDate(year, month, day)
{
	var day_value = day.value; //backs up old value
	
	day.options.length = 28;
	
	if (isDateValid(year.value, month.value, 29))
	{
		day.options[28] = new Option("29", 29);
	}
	if (isDateValid(year.value, month.value, 30))
	{
		day.options[29] = new Option("30", 30);
	}
	if (isDateValid(year.value, month.value, 31))
	{
		day.options[30] = new Option("31", 31);
	}
	if (day_value > day.options.length)
	{
		day.selectedIndex = 1;
	}
	else
	{
		day.selectedIndex = day_value - 1;
	}
}

/*
function HidePrintBar()
{
	var print_bar = document.getElementById("group_print_header");
	print_bar.style.display = "none";
}

function ShowPrintBar()
{
	var print_bar = document.getElementById("group_print_header");
	print_bar.style.display = "";
}

function PrintPage()
{
	window.setTimeout("javascript:HidePrintBar();", 1200);
	window.setTimeout("javascript:ShowPrintBar()", 2000);
}

*/
/*
var shell;

function SetPrintProperties() {
try 
{
shell = new ActiveXObject("WScript.Shell");

shell.SendKeys("%fu");
window.setTimeout("javascript:SetPaperSize();", 1200);
window.setTimeout("javascript:setLandScape();", 2000);

} 
catch (e) 
{
alert('Please verify that your print settings have a Landscape orientation and minimum margins.');
}

}

function SetPaperSize() 
{
shell.sendKeys("%a{TAB}.2{TAB}0{TAB}0{TAB}0{ENTER}");
}

function setLandScape() 
{
shell.sendKeys("%fp");
window.print();
}
*/	