// JavaScript Document
function get_button(id, titulo, url, css)
{
	var html = '<a href="'+url+'" class="'+css+'">';
	html = '<div id="'+id+'" onclick="'+url+'" class="'+css+'" onmouseover="this.className=\''+css+'_hover\'" onmouseout="this.className=\''+css+'\'">';
	html += '  <table cellpadding="0" cellspacing="0" border="0">';
	html += '  <tr><td class="cl"></td><td class="cc">'+titulo;
	html += '  </td><td class="cr"></td></tr></table>';
	html += '</div>';
	html += '</a>';
	return(html);
}
function change_button_class(id, css, wmouseover)
{
	var obj = document.getElementById(id);
	if (obj)
	{
		obj.className = css;
		if (wmouseover)
		{
			obj.onmouseover = function(){this.className=''+css+'_hover';};
			obj.onmouseout = function(){this.className=''+css;};
		}
		else
		{
			obj.onmouseover = null;
			obj.onmouseout = null;
		}
	}
}
function draw_button(id, titulo, url, css)
{
	document.write(get_button(id, titulo, url, css));
}
function get_button_w(id, titulo, url, css, width)
{
	var html = '<a href="'+url+'" class="'+css+'">';
	html = '<div style="width:'+width+'px" id="'+id+'" onclick="'+url+'" class="'+css+'" onmouseover="this.className=\''+css+'_hover\'" onmouseout="this.className=\''+css+'\'">';
	html += '  <table cellpadding="0" cellspacing="0" border="0" width="100%">';
	html += '  <tr><td class="cl"></td><td class="cc" >'+titulo+'</td><td class="cr"></td></tr></table>';
	html += '</div>';
	html += '</a>';
	return(html);

}
function draw_button_w(id, titulo, url, css, width)
{
	document.write(get_button_w(id, titulo, url, css, width));
}


function draw_butao1(id, text, url){
	return(draw_butao(id, text, url, 'butao1'));
}
function draw_butao3(id, text, url){
	
	return(draw_butao(id, text, url, 'butao3'));
}
function draw_butao(id, text, url, style){
	var html = '';
	html += '<a href="#" onclick="'+url+'" class="'+style+'" id="'+id+'"><table cellpadding="0" cellspacing="0"><tr><td class="texto">'+text+'</td><td class="fim"></td></tr></table></a>';
	document.write(html);
}
function get_butao(id, text, url, style){
	var html = '';
	html += '<a href="#" onclick="'+url+'" class="'+style+'" id="'+id+'"><table cellpadding="0" cellspacing="0"><tr><td class="texto">'+text+'</td><td class="fim"></td></tr></table></a>';
	return(html);
}

function draw_tab(id, text, url, style){
	return(draw_butao(id, text, url, 'tab_button_not_selected'));
}

function ShowId(id)
{
	var obj = document.getElementById(id);
	if (obj)
	{
		obj.style.display="";
	}
}
function HideId(id)
{
	var obj = document.getElementById(id);
	if (obj)
	{
		obj.style.display="none";
	}
}

function ToogleId(id)
{
	var obj = document.getElementById(id);
	if (obj)
	{
		if (obj.style.display=="") obj.style.display="none";
		else obj.style.display="";
	}
}
function VisibleId(id)
{
	var obj = document.getElementById(id);
	if (obj)
	{
		obj.style.visibility="visible";
	}
}

function InvisibleId(id)
{
	var obj = document.getElementById(id);
	if (obj)
	{
		obj.style.visibility="hidden";
	}
}

/* */
function ShowPopUpYESNO(msg, yesmsg, nomsg, yesJS, noJS)
{
	var obj = document.getElementById("popUpYESNO");
	var html = "";
	if (obj)
	{
		html +='<table style="border:3px double #000066;padding:10px; background:#FFFFFF;margin-top:200px;">';
		html +='<tr>';
		html +='	<td colspan="2"><p>'+msg+'</p></td>';
		html +='</tr>';
		html +='<tr>';
		html +='	<td><button onClick="'+yesJS+'";>'+yesmsg+'</button></td>';
		html +='	<td><button onClick="'+noJS+'">'+nomsg+'</button></td>';
		html +='</tr>';
		html +='</table>';
		obj.innerHTML=html;
		obj.style.display="";
	}
}

function draw_butao_100(id, text, url, style){
	var html = '';
	html += '<div onclick="'+url+'" class="'+style+'" id="'+id+'" >';
	html += '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="texto">'+text+'</td><td class="fim"></td></tr></table></div>';
	document.write(html);
}

function draw_butao_target_blank(id, text, url, style){
	var html = '';
	html += '<div onclick="javascript:window.open(\''+url+'\')" class="'+style+'" id="'+id+'"><table cellpadding="0" cellspacing="0"><tr><td class="texto">'+text+'</td><td class="fim"></td></tr></table></div>';
	document.write(html);
}

function SetNavArrows(leftstr, rightstr)
{
	var obj = document.getElementById("navigation_arrows");
	if(obj)
	{
		var html = '<table width="100%" class="navigation_arrows"><tr><td width="10">&nbsp;</td><td><a href="#" onclick="PrevNaviPage()">'+(String(leftstr))+'</a></td><td align="right"><a href="#" onclick="NextNaviPage()">'+(String(rightstr))+'</a></td></tr></table>';
		obj.innerHTML = html;
	}
}

function setDefault(obj, txt)
{
	var tempval = obj.value;
	if (obj.value=="") obj.value = txt;
}
function removeDefault(obj, txt)
{
	var tempval = obj.value;
	if (obj.value==txt) obj.value = "";
}
