
/* Variograma TranscriptionWare JS Library */



var focusedObj = null;
var kb = null;
var actionCode = null;

var ez_strictHTML=0;
var ez_usefx=0;
var ez_isMac=(navigator.appVersion.indexOf("Mac")!=-1);
var ez_NN4=document.layers?1:0;
var ez_IE4=document.getElementById?0:1;
var ez_OPR=(navigator.userAgent.indexOf("Opera")!=-1)?1:0;
var ez_OPR7=0;
var ez_isIE=(navigator.appVersion.indexOf("MSIE")>-1)?1:0;
var ez_NS6=(document.getElementById&&!document.all&&!ez_OPR)?1:0;
if(ez_OPR){
temp=navigator.userAgent.split("Opera");
if(temp[1].substring(0,1)=="/"){temp=temp[1].split("/");}
ver=parseFloat(temp[1]);
if(ver>=7)ez_OPR7=1;
if(ver<7)ez_strictHTML=0;
}
var ez_MOZ=0;
ez_MOZ=(navigator.userAgent.indexOf("ozilla")!=-1)?1:0;
ez_SAF=(navigator.userAgent.indexOf("Safari")!=-1)?1:0;
var aspnm_hideSelectElems=true;
var aspnm_restoreSelectElems=true;
var aspnm_mac=false;
aspnm_hideSelectElems=aspnm_restoreSelectElems=(ez_isIE&&!ez_OPR7);

//hide selected elements for the divs (yes, ie big unresolved problem :-///)
function aspnm_hideSelectElements(group){

	if(aspnm_hideSelectElems&&document.getElementsByTagName){

		var arrElements=document.getElementsByTagName('select');
		
		for(var i=0;i<arrElements.length;i++){
		
			if(aspnm_objectsOverlapping(document.all[group],arrElements[i])){
				arrElements[i].style.visibility='hidden';
			}
		}
	}
}

//show selected elements (cause the divs)
function aspnm_restoreSomeSelectElements(group)
{

	if(aspnm_restoreSelectElems&&document.getElementsByTagName){
	
		var arrElements=document.getElementsByTagName('select');

		for(var i=0;i<arrElements.length;i++){
		
			if(aspnm_objectsOverlapping(document.all[group],arrElements[i])){
				arrElements[i].style.visibility='visible';
			}
		}
	}
}

//show all selected elements
function aspnm_restoreSelectElements(){

	if(aspnm_restoreSelectElems&&document.getElementsByTagName){

		var arrElements=document.getElementsByTagName('select');

		for(var i=0;i<arrElements.length;i++){
			arrElements[i].style.visibility='visible';
		}
	}
}

function aspnm_objectsOverlapping(obj1,obj2)
{
var result=true;
/*
var obj1Left=aspnm_pageX(obj1)-window.document.body.scrollLeft;
var obj1Top=aspnm_pageY(obj1)-window.document.body.scrollTop;
var obj1Right=obj1Left+obj1.offsetWidth;
var obj1Bottom=obj1Top+obj1.offsetHeight;
var obj2Left=aspnm_pageX(obj2)-window.document.body.scrollLeft;
var obj2Top=aspnm_pageY(obj2)-window.document.body.scrollTop;
var obj2Right=obj2Left+obj2.offsetWidth;
var obj2Bottom=obj2Top+obj2.offsetHeight;
if(obj1Right<=obj2Left||obj1Bottom<=obj2Top||
obj1Left>=obj2Right||obj1Top>=obj2Bottom)
result=false;
*/
return result;
}
function aspnm_pageX(o)
{
return(aspnm_mac?aspnm_macX(o):aspnm_winX(o));
}
function aspnm_winX(o)
{
var x=0;
while(o!=document.body)
{
x+=o.offsetLeft;
o=o.offsetParent;
}
return x;
}
function aspnm_macX(o)
{
var x=0;
while(o.offsetParent!=document.body)
{
if((o.tagName=="TABLE")&&(o.offsetParent.tagName=="TD"))
x+=o.clientLeft;
else
x+=o.offsetLeft;
o=o.offsetParent;
}
x+=(o.offsetLeft+aspnm_pgMrgX());
return x;
}
function aspnm_pgMrgX()
{
if(!aspnm_marginX)
{
if(!document.all["aspnm_pgMrgMsr"])
aspnm_createPgMrgMsr();
aspnm_marginX=-document.all["aspnm_pgMrgMsr"].offsetLeft;
}
return aspnm_marginX;
}
function aspnm_pageY(o)
{
return(aspnm_mac?aspnm_macY(o):aspnm_winY(o));
}
function aspnm_winY(o)
{
var y=0;
while(o!=document.body)
{
y+=o.offsetTop;
o=o.offsetParent;
}
return y;
}
function aspnm_macY(o)
{
var y=0;
while(o.offsetParent!=document.body)
{
if((o.tagName=="TABLE")&&(o.offsetParent.tagName=="TD"))
y+=o.clientTop;
else
y+=(o.tagName!="TD")?o.offsetTop:o.parentElement.offsetTop;
o=o.offsetParent;
}
y+=(o.offsetTop+aspnm_pgMrgY());
return y;
}
function aspnm_pgMrgY()
{
if(!aspnm_marginY)
{
if(!document.all["aspnm_pgMrgMsr"])
aspnm_createPgMrgMsr();
aspnm_marginY=-document.all["aspnm_pgMrgMsr"].offsetTop;
}
return aspnm_marginY;
}
function aspnm_createPgMrgMsr()
{
document.body.insertAdjacentHTML('beforeEnd',
'<div id="aspnm_pgMrgMsr" style="position:absolute;left:0;top:0;z-index:-1000;visibility:hidden">*</div>');
}


function writeFullTransparentDiv(width) {
    var doc = document;
    if (!width) width = 760;
    doc.writeln('<div id="fullTransparentDIV" style="background-color: white; opacity: .7; DISPLAY: none; Z-INDEX: 1000; FILTER: alpha(opacity=70); VISIBILITY: visible; POSITION: absolute; -moz-opacity: .6; width: 100%; height: 4000; left: 0px; top: 0px; right: 0px;"></div>');
}

function writeQuestionDiv(yesButtonLabel, noButtonLabel, left) {
    var doc = document;
    if (!left) left = 156;
    doc.writeln('<div id="questionDIV" style="display: none; left: '+left+'px; top: 144px; Z-INDEX: 1001; POSITION: absolute;">');
    doc.writeln('<table border="0" cellspacing="0" cellpadding="0" class="popup_table">');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="14" border="0"></td></tr>');
    doc.writeln('<tr>');
    doc.writeln('<td id="questionMessage" class="popup_msg2" colspan="2"></td>');
    doc.writeln('</tr>');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="14" border="0"></td></tr>');
    doc.writeln('<tr>');
    doc.writeln('<td width="1"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="14" border="0"></td>');
    doc.writeln('<td class="popup_msg1" width="399">');
    doc.writeln('<a id="questionYes" href="#" class="Button_1">'+yesButtonLabel+'</a>');
    doc.writeln('<a id="questionNo" href="#" class="Button_1">'+noButtonLabel+'</a>');
    doc.writeln('</td>');
    doc.writeln('</tr>');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="24" border="0"></td></tr>');
    doc.writeln('</table>');
    doc.writeln('</div>');
}
function writeWaitDiv(waitMessage, left) {
    var doc = document;
    if (!left) left = 186;
    doc.writeln('<div id="waitPopupDIV" style="display: none; left: '+left+'px; top: 164px; Z-INDEX: 1101; POSITION: absolute;">');
    doc.writeln('<table border="0" cellspacing="0" cellpadding="0" class="popup_table" width="380">');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="15" border="0"></td></tr>');
    doc.writeln('<tr><td class="popup_msg2" colspan="2" align="center"><br>'+waitMessage+'<br><br><img src="/vrglyphs/img/wait6.gif" width="220" height="19"/></td></tr>');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="15" border="0"></td></tr>');
    doc.writeln('</table>');
    doc.writeln('</div>');
}



/** DIV (div_script.js) **/
function writeAlertDiv(okButtonLabel,left) {
    var doc = document;
    if (!left) left = 186;
    doc.writeln('<div id="alertDIV" style="display: none; left: '+left+'px; top: 164px; Z-INDEX: 1001; POSITION: absolute;">');
    doc.writeln('<table border="0" cellspacing="0" cellpadding="0" class="popup_table">');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="24" border="0"></td></tr>');
    doc.writeln('<tr>');
    doc.writeln('<td id="alertMessage" class="popup_msg2" colspan="2"></td>');
    doc.writeln('</tr>');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="34" border="0"></td></tr>');
    doc.writeln('<tr>');
    doc.writeln('<td width="1"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="24" border="0"></td>');
    doc.writeln('<td class="popup_msg1" width="399">');
    doc.writeln('<a onclick="javascript: if (actionCode) { eval(actionCode); };');
    doc.writeln('if (focusedObj) {if (focusedObj.focus) focusedObj.focus();}');
    doc.writeln('hideOnTopDIV(\'fullTransparentDIV\');');
    doc.writeln('hideDIV(\'alertDIV\'); ');
    doc.writeln('if (kb) { kb.style.display = \'inline\';}"');
    doc.writeln('href="#" class="Button_1">' + okButtonLabel + '</a>');
    doc.writeln('</td>');
    doc.writeln('</tr>');
    doc.writeln('<tr><td colspan="2"><img src="/vrglyphs/img/px.gif" alt="" width="1" height="24" border="0"></td></tr>');
    doc.writeln('</table>');
    doc.writeln('</div>');
}



function showOnTopDIV(divId){

	styleObj=document.getElementById(divId).style;

	var scrollY=getScrollY();
	var ySize=getYSize();
	var newHeight= getScrollXY()[1];//scrollY+ySize;


	if (newHeight==0) newHeight=ySize;

	styleObj.height=newHeight+'px';
	

	if(ez_OPR||ez_SAF){
		styleObj.background="url('/vrglyphs/img/back.png')";

		if(ez_MOZ&&ez_isMac){}
		
	}else{
		styleObj.backgroundColor="#FFFFFF";
	}

	scroll(0,0);
	showDIV(divId);
	
	aspnm_hideSelectElements(divId);
}
function hideOnTopDIV(divId){
	aspnm_restoreSomeSelectElements(divId);
	hideDIV(divId);
}

function hideDIV(divId){
	document.getElementById(divId).style.display="none";
}

function showDIV(divId){
	document.getElementById(divId).style.display="inline";
}



function getYSize(){
	var myWidth=0,myHeight=0;
	if(typeof(window.innerWidth)=='number'){
		myWidth=window.innerWidth;
		myHeight=window.innerHeight;
	}else if(document.documentElement&&
	(document.documentElement.clientWidth||document.documentElement.clientHeight)){
		myWidth=document.documentElement.clientWidth;
		myHeight=document.documentElement.clientHeight;
	}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
		myWidth=document.body.clientWidth;
		myHeight=document.body.clientHeight;
	}
	return myHeight;
}



function getScrollY(){
	var scrOfX=0,scrOfY=0;
	if(typeof(window.pageYOffset)=='number'){
	scrOfY=window.pageYOffset;
	scrOfX=window.pageXOffset;
	}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
	scrOfY=document.body.scrollTop;
	scrOfX=document.body.scrollLeft;
	}else if(document.documentElement&&
	(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
	scrOfY=document.documentElement.scrollTop;
	scrOfX=document.documentElement.scrollLeft;
	}
	return scrOfY;
}
function getScrollXY() {
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}
	else // Explorer Mac;
	     //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	return [x,y];
}




function showAlert(message, object) {
  kb = document.getElementById("keyboard");
  if (kb) {
    kb.style.display = 'none';
  }

    if (object) {
        focusedObj = object;
        if (object.blur) object.blur();
    } else {
        focusedObj = null;
    }

    document.getElementById("alertMessage").innerHTML=message;

    showOnTopDIV("fullTransparentDIV");
    showDIV("alertDIV");
}

function showAlertForDiv(message, object) {
  kb = document.getElementById("keyboard");
  if (kb) {
    kb.style.display = 'none';
  }

    focusedObj = null;
    document.getElementById("alertMessage").innerHTML=message;

    showOnTopDIV("fullTransparentDIV");
    showDIV("alertDIV");
}

function showActionAlert(message, _actionCode) {
  actionCode = _actionCode;
  kb = document.getElementById("keyboard");
  if (kb) {
    kb.style.display = 'none';
  }


    document.getElementById("alertMessage").innerHTML=message;

    showOnTopDIV("fullTransparentDIV");
    showDIV("alertDIV");
}

/* END - ALERT POPUP */




/* QUESTION POPUP */

/* faz uma pergunta e mostra o wait depois de se clicar no OK */
function askQuestionWithWait(message,yesCode,noCode) {
    // Place the validation errors
  document.getElementById("questionMessage").innerHTML=message;
    document.getElementById("questionYes").onclick = function(){
    hideDIV('questionDIV');
	showWaitMessage();
    eval(yesCode);
	
    //askQuestion= function(){return;}
  };
  if (noCode) {
    document.getElementById("questionNo").onclick = function(){
      hideOnTopDIV('fullTransparentDIV');
      hideDIV('questionDIV');
      eval(noCode);
      };
  } else {
    document.getElementById("questionNo").onclick = function(){
      hideOnTopDIV('fullTransparentDIV');
      hideDIV('questionDIV');
    };
  }

  // Show the div with the confirmation
  showOnTopDIV("fullTransparentDIV");
  showDIV("questionDIV");
}

function askQuestion(message,yesCode,noCode) {
    // Place the validation errors
  document.getElementById("questionMessage").innerHTML=message;
    document.getElementById("questionYes").onclick = function(){
    hideDIV('questionDIV');
    eval(yesCode);
    //askQuestion= function(){return;}
  };
  if (noCode) {
    document.getElementById("questionNo").onclick = function(){
      hideOnTopDIV('fullTransparentDIV');
      hideDIV('questionDIV');
      eval(noCode);
      };
  } else {
    document.getElementById("questionNo").onclick = function(){
      hideOnTopDIV('fullTransparentDIV');
      hideDIV('questionDIV');
    };
  }

  // Show the div with the confirmation
  showOnTopDIV("fullTransparentDIV");
  showDIV("questionDIV");
}



function askQuestionURL(message,url) {
	s="window.location='"+url+"'";
	askQuestionWithWait(message,s);
}


function showOneButtonAlert(message,buttonCode) {
  // Place the validation errors
  document.getElementById("questionMessage").innerHTML=message;
  document.getElementById("questionYes").innerHTML='Cancelar';
  document.getElementById("questionYes").onclick = function() {
        hideDIV('questionDIV');
        eval(buttonCode);
    };
    document.getElementById("questionNo").style.display = 'none';
    // Show the div with the confirmation
    showOnTopDIV("fullTransparentDIV");
    showDIV("questionDIV");
}

/* END QUESTION POPUP */

/* WAIT POPUP */
function showWaitMessage() {
    showOnTopDIV("fullTransparentDIV");
    showDIV("waitPopupDIV");
    if (document.getElementById('keyboard')) {
      document.getElementById('keyboard').style.display = 'none';
    }
}
function hideWaitPopupDIV(){
hideDIV("waitPopupDIV");

}



/*** AJAX STUFF **/
/*** LIBVRWeb Ajax/javascript library **/

/*HTML_AJAX.defaultServerUrl = '/ajax.php';*/


var _loading='';

/** timers */
var _tim=[0];

// inicia a actualizacao da statusbar
function initStatusBar() {
	window.setInterval('updateStatusBar()',90000);
}

function updateStatusBar() {
	HTML_AJAX.call('vrajax','getSystemVersion',updateStatusBarCallback);
}

function updateStatusBarCallback(result) {
	document.getElementById('statusbar').innerHTML=result;
}

/** global vrajax instance */
_vrajax=new vrajax(vrajax);

/**
 * Processes a lookup immediately
 */
//function doLookupNow(inputboxid,displayid,queryid,idfield,namefield) {
function doLookupNow(inputboxid,displayid,queryid,idfield,namefield,queryargs) {
	valor=document.getElementById(inputboxid).value;
	//resultado=HTML_AJAX.call('vrajax','lookupresult',false,queryid,idfield,namefield,valor);
	resultado=HTML_AJAX.call('vrajax','lookupresult',false,queryid,idfield,namefield,valor,queryargs);
	document.getElementById(displayid).innerHTML=resultado;
}

/**
 * Processes a lookup some a second after
 */
//function doLookup(inputboxid,displayid,queryid,idfield,namefield) {
function doLookup(inputboxid,displayid,queryid,idfield,namefield,queryargs) {
	_tim[inputboxid]=clearTimeout(_tim[inputboxid]);
	//_tim[inputboxid]=setTimeout('doLookupNow("'+inputboxid+'","'+displayid+'","'+queryid+'","'+idfield+'","'+namefield+'")',800);
	_tim[inputboxid]=setTimeout('doLookupNow("'+inputboxid+'","'+displayid+'","'+queryid+'","'+idfield+'","'+namefield+'","'+queryargs+'")',800);
}

/**
 * global variables for the lookup div 
 */
//var _inputboxid='',_displayid='',_queryid='',_idfield='',_namefield='';
var _inputboxid='',_displayid='',_queryid='',_idfield='',_namefield='',_queryargs='';


/**
 * Shows the lookup DIV
 */
//function showLookup(inputboxid,displayid,queryid,idfield,namefield) {
function showLookup(inputboxid,displayid,queryid,idfield,namefield,queryargs) {
  _inputboxid=inputboxid;
  _displayid=displayid;
  _queryid=queryid;
  _idfield=idfield;
  _namefield=namefield;
  _queryargs=queryargs;
  showOnTopDIV("fullTransparentDIV");
  showDIV("lookupDIV");
}

/**
 * Hides the lookup DIV
 */
function hideLookup() {
	document.getElementById('lookupresults').innerHTML='';
	document.getElementById('lookuptext').value='';
    hideOnTopDIV('fullTransparentDIV');
    hideDIV('lookupDIV');
}

/**
 * performs a search inside the lookup div 
 */
function doLookupSearch() {
  var el=document.getElementById('lookupresults');
  //showWaitMessage();
  el.innerHTML='Searching, please wait...';
  text=document.getElementById('lookuptext').value;
  
  //el.innerHTML=HTML_AJAX.call('vrajax','lookupsearch',false,_queryid,_idfield,_namefield,text);
  el.innerHTML=HTML_AJAX.call('vrajax','lookupsearch',false,_queryid,_idfield,_namefield,text,_queryargs);
  //hideWaitMessage();
}

/**
 * function called whenever a search result is clicked
 */
function lookupResultClick(resultid,sender) {
  document.getElementById(_inputboxid).value=resultid;
  document.getElementById(_displayid).innerHTML=sender.innerHTML;
  hideLookup();
}

/**
 * Writes the DIV for AJAX lookups
 */
function writeAjaxLookupDiv() {
    var doc = document;
    var left = 150;
    doc.writeln('<div id="lookupDIV" style="display: none; left: '+left+'px; top: 50px; Z-INDEX: 1002; POSITION: absolute;">');
    doc.writeln('<table border="0" width="400" cellspacing="0" cellpadding="0" class="popup_table">');
    doc.writeln('<tr>');
	doc.writeln('<td>'+
	 '<input type="text" id="lookuptext" size="20"><button onclick="doLookupSearch()">'+vrmsg.search+'</button><button onclick="hideLookup()">'+vrmsg.cancel+'</button>'+
     '</td>');
    doc.writeln('</tr>');
	doc.writeln('<tr><td><div  id="lookupresults" style="overflow-y:scroll;height:300px"></div></td></tr>');
    doc.writeln('</table>');
    doc.writeln('</div>');
}

/**
 * Writes the modal dialog div
 */
function writeModalDialogDiv() {
    var doc = document;
    doc.writeln('<div id="modalDialogDIV" style="display: none; left: 120px; top: 80px; Z-INDEX: 1001; POSITION: absolute;">');
    doc.writeln('<table class="popup_table" border="0" cellspacing="0" cellpadding="0"  width="600px">');
    doc.writeln('<tr><td width="500px%" class="modalCaption" id="modalCaption">***</td><td width="100px" align="right" class="modalCaption"><button onclick=\"hideModalDialog()\">'+vrmsg.cancel+'</button></td></tr>');
    doc.writeln('<tr><td colspan="2" width="600px" align="left"><div id="modalContents">Please wait...</div></td></tr>');
    doc.writeln('</table>');
    doc.writeln('</div>');
}

/**
 * Shows a modal dialog using AJAX
 */
function showModalDialog(url,caption) {
	showWaitMessage();
	// Ajax request
	document.getElementById('modalContents').innerHTML='Loading, please wait...';
	HTML_AJAX.replace('modalContents',url);
	// show the dialog
	document.getElementById('modalCaption').innerHTML=caption;
	hideDIV("waitPopupDIV")
    showDIV("modalDialogDIV");	
	
}

/**
 * Hides the modal dialog
 */
function hideModalDialog() {
	hideDIV("modalDialogDIV");
	hideOnTopDIV("fullTransparentDIV");
}



/* faz uma pergunta com uma caixa de comentário e mostra o wait depois de se clicar no OK */
function askQuestionWithLink(message,yesURL) {
  document.getElementById("questionMessage").innerHTML=message;
  
  document.getElementById("questionYes").onclick = function(){
    hideDIV('questionDIV');
	showWaitMessage();
    document.location=yesURL;
  };
   document.getElementById("questionNo").onclick = function(){
      hideOnTopDIV('fullTransparentDIV');
      hideDIV('questionDIV');
  }
  showOnTopDIV("fullTransparentDIV");
  showDIV("questionDIV");
}


function writeCommentDiv(yesButtonLabel, noButtonLabel, left, caption) {
    var doc = document;
    if (!left) left = 146;
    doc.writeln('<div id="commentDIV" style="display: none; left: '+left+'px; top: 120px; Z-INDEX: 1001; POSITION: absolute;">');
    doc.writeln('<table border="0" cellspacing="0" cellpadding="0" class="popup_table">');
    doc.writeln('<tr><td><img src="/vrglyphs/img/px.gif" alt="" width="1" height="14" border="0"></td></tr>');
	doc.writeln('<tr><td class="popup_msg2"><form id="commentform" method="post"><p id="commentMessage"></p><p style="font-size: 8pt">'+caption+'</p><textarea name="comment" style="width: 300px; height: 80px"></textarea></form></td></tr>');    
    doc.writeln('<tr>');
    doc.writeln('<td class="popup_msg1" width="399">');
    doc.writeln('<a id="commentYes" href="#" class="Button_1">'+yesButtonLabel+'</a>');
    doc.writeln('<a id="commentNo" href="#" class="Button_1">'+noButtonLabel+'</a>');
    doc.writeln('</td>');
    doc.writeln('</tr>');
    doc.writeln('</table>');
    doc.writeln('</div>');
}



/* faz uma pergunta e mostra o wait depois de se clicar no OK */
function askQuestionWithComment(message,yesURL) {
  document.getElementById("commentMessage").innerHTML=message;
  document.getElementById("commentForm").action=yesURL;;
  
  document.getElementById("commentYes").onclick = function(){
    hideDIV('commentDIV');
	showWaitMessage();
    document.getElementById("commentForm").submit();
  //  document.location=yesURL;
  };
   document.getElementById("commentNo").onclick = function(){
      hideOnTopDIV('fullTransparentDIV');
      hideDIV('commentDIV');
  }
  showOnTopDIV("fullTransparentDIV");
  showDIV("commentDIV");
}


function setloading(elemid) {
	xdiv=document.getElementById(elemid);
	xdiv.innerHTML='<div class="loading"><img src="/vrglyphs/img/wait3.gif" width="18" height="15"/>'+_loading+'</div>';
	
}

function docspellercallback(result) {
	xdiv=document.getElementById("docspell");
	xdiv.innerHTML=result;
}

/* mostra o corrector ortográfico */
function showDocSpeller(docid,forcestatus) {
	xdiv=document.getElementById("docspell");
	xdiv.className='docspelldiv';
	setloading("docspell");
//	xdiv.innerHTML='Please wait...';
	HTML_AJAX.call('vrajax','getdocspeller',docspellercallback,docid,forcestatus);	
	hl=document.getElementById('historylog');
	hl.style.visibility='hidden';
}


function searchWordcallback(result) {
	xdiv=document.getElementById("wordsearchresults");
	xdiv.innerHTML=result;
}

function searchWord(word) {
	setloading("wordsearchresults");
	HTML_AJAX.call('vrajax','wordlookup',searchWordcallback,word);	
}

function doWordSearch(word) {
	_tim['wordsearch']=clearTimeout(_tim['wordsearch']);
	_tim['wordsearch']=setTimeout('searchWord("'+word+'")',1500);
}

function setelemclass(elem,clas) {
	wtd=document.getElementById(elem);
	wtd.className=clas;
}


function wstatuscback(result) {
	eval(result);
}

/* muda o estado de uma palavra */
function wstatus(wordid,stat) {
	setelemclass('w'+wordid,'wxx');
	HTML_AJAX.call('vrajax','setwordstatus',wstatuscback,wordid,stat);
}

function widgetcallback(result) {
}

function updatewidget(id) {
	HTML_AJAX.call('vrajax','updatewidget','widgetcallback',id);
}



function fsubmit(formid) {
	aa=document.getElementById(formid);
	if (aa.onsubmit()) {
		aa.submit();
	}
}



function mstatcallback(result) {
	xdiv=document.getElementById("ministats");
	xdiv.innerHTML=result;
}

/* ministats */
function mstat(days) {
	setloading("ministats");
	HTML_AJAX.call('vrajax','mstat',mstatcallback,days);	
}


function showolderdocs_cb(result) {
	xdiv=document.getElementById("olderdocs");
	xdiv.innerHTML=result;
}

function showolderdocs(doctorid) {
	xdiv=document.getElementById("olderdocs");
	xdiv.className='olderdocsdiv';
	setloading("olderdocs");
	HTML_AJAX.call('vrajax','olderdocsinit',showolderdocs_cb,doctorid);	
}
function hideolderdocs() {
	xdiv=document.getElementById("olderdocs");
	xdiv.className='hiddenelement';
}		


function showolddoc() {
	setloading("olddocbody");
	var sel=document.getElementById('olddocsel');
	HTML_AJAX.call('vrajax','getolddocbody',showolddoc_cb,sel.value);	
}

function showolddoc_cb(result) {
	xdiv=document.getElementById("olddocbody");
	xdiv.innerHTML=result;
}

function setClipbrd(contents) 
{ if (window.clipboardData) { 
	window.clipboardData.setData("Text",contents);
  }
}


function fsubmitAndWait(formid) {
	aa=document.getElementById(formid);
	if (aa.onsubmit()) {
		showWaitMessage();
		aa.submit();
	}
}
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

function hasOptions(obj){if(obj!=null && obj.options!=null){return true;}return false;}
function selectUnselectMatchingOptions(obj,regex,which,only){if(window.RegExp){if(which == "select"){var selected1=true;var selected2=false;}else if(which == "unselect"){var selected1=false;var selected2=true;}else{return;}var re = new RegExp(regex);if(!hasOptions(obj)){return;}for(var i=0;i<obj.options.length;i++){if(re.test(obj.options[i].text)){obj.options[i].selected = selected1;}else{if(only == true){obj.options[i].selected = selected2;}}}}}
function selectMatchingOptions(obj,regex){selectUnselectMatchingOptions(obj,regex,"select",false);}
function selectOnlyMatchingOptions(obj,regex){selectUnselectMatchingOptions(obj,regex,"select",true);}
function unSelectMatchingOptions(obj,regex){selectUnselectMatchingOptions(obj,regex,"unselect",false);}
function sortSelect(obj){var o = new Array();if(!hasOptions(obj)){return;}for(var i=0;i<obj.options.length;i++){o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;}if(o.length==0){return;}o = o.sort(
function(a,b){if((a.text+"") <(b.text+"")){return -1;}if((a.text+"") >(b.text+"")){return 1;}return 0;});for(var i=0;i<o.length;i++){obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);}}
function selectAllOptions(obj){if(!hasOptions(obj)){return;}for(var i=0;i<obj.options.length;i++){obj.options[i].selected = true;}}
function moveSelectedOptions(from,to){if(arguments.length>3){var regex = arguments[3];if(regex != ""){unSelectMatchingOptions(from,regex);}}if(!hasOptions(from)){return;}for(var i=0;i<from.options.length;i++){var o = from.options[i];if(o.selected){if(!hasOptions(to)){var index = 0;}else{var index=to.options.length;}to.options[index] = new Option( o.text, o.value, false, false);}}for(var i=(from.options.length-1);i>=0;i--){var o = from.options[i];if(o.selected){from.options[i] = null;}}if((arguments.length<3) ||(arguments[2]==true)){sortSelect(from);sortSelect(to);}from.selectedIndex = -1;to.selectedIndex = -1;}
function copySelectedOptions(from,to){var options = new Object();if(hasOptions(to)){for(var i=0;i<to.options.length;i++){options[to.options[i].value] = to.options[i].text;}}if(!hasOptions(from)){return;}for(var i=0;i<from.options.length;i++){var o = from.options[i];if(o.selected){if(options[o.value] == null || options[o.value] == "undefined" || options[o.value]!=o.text){if(!hasOptions(to)){var index = 0;}else{var index=to.options.length;}to.options[index] = new Option( o.text, o.value, false, false);}}}if((arguments.length<3) ||(arguments[2]==true)){sortSelect(to);}from.selectedIndex = -1;to.selectedIndex = -1;}
function moveAllOptions(from,to){selectAllOptions(from);if(arguments.length==2){moveSelectedOptions(from,to);}else if(arguments.length==3){moveSelectedOptions(from,to,arguments[2]);}else if(arguments.length==4){moveSelectedOptions(from,to,arguments[2],arguments[3]);}}
function copyAllOptions(from,to){selectAllOptions(from);if(arguments.length==2){copySelectedOptions(from,to);}else if(arguments.length==3){copySelectedOptions(from,to,arguments[2]);}}
function swapOptions(obj,i,j){var o = obj.options;var i_selected = o[i].selected;var j_selected = o[j].selected;var temp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);var temp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected);o[i] = temp2;o[j] = temp;o[i].selected = j_selected;o[j].selected = i_selected;}
function moveOptionUp(obj){if(!hasOptions(obj)){return;}for(i=0;i<obj.options.length;i++){if(obj.options[i].selected){if(i != 0 && !obj.options[i-1].selected){swapOptions(obj,i,i-1);obj.options[i-1].selected = true;}}}}
function moveOptionDown(obj){if(!hasOptions(obj)){return;}for(i=obj.options.length-1;i>=0;i--){if(obj.options[i].selected){if(i !=(obj.options.length-1) && ! obj.options[i+1].selected){swapOptions(obj,i,i+1);obj.options[i+1].selected = true;}}}}
function removeSelectedOptions(from){if(!hasOptions(from)){return;}if(from.type=="select-one"){from.options[from.selectedIndex] = null;}else{for(var i=(from.options.length-1);i>=0;i--){var o=from.options[i];if(o.selected){from.options[i] = null;}}}from.selectedIndex = -1;}
function removeAllOptions(from){if(!hasOptions(from)){return;}for(var i=(from.options.length-1);i>=0;i--){from.options[i] = null;}from.selectedIndex = -1;}
function addOption(obj,text,value,selected){if(obj!=null && obj.options!=null){obj.options[obj.options.length] = new Option(text, value, false, selected);}}

/* Rotinas globais JS do LIBVRWEB */

/* Strings traduzíveis */
var vrmsg={
	wait:'Please wait...',
	yes:'Yes',
	no:'No',
	commentmsg:'Comment:',
	loading:'Loading..',
	search:'Search',
	cancel:'Cancel',
	none:'none'
}

/* "classe" VR */
var vr= {
	copyright: 'Copyright Variograma, all rights reserved',
	
	/* returns an element */
	e:function(eid) {
		return document.getElementById(eid);
	},
	/* makes an element visible */
	showelement:function(elid) {
		vr.e(elid).style.display='block';
	},
	/* makes an element invisible */
	hideelement:function(elid) {
		vr.e(elid).style.display='hidden';
	},
	
	/* Alert window */
	alert: function(msg) {
		Dialog.alert('<p align="center">'+msg+'</p>', 
             {className: "jswin", width:350, okLabel: "OK", 
              ok:function(win) {return true;}});
	},
	
	/* reloads the current page - FIXME:STILL DEPENDENT ON EXTERNAL FUNCTIONS */
	selfreload: function() {
		showWaitMessage(vrmsg.loading);
		HTML_AJAX.replace('contentarea',location.href);
	}
	
}

/* funções para lisboxes/selects */
var vrlb={
	// deletes an item 
	delitem:function(lbid,itvalue) {
		var idx=vrlb.itemindex(lbid,itvalue);
		if (idx!=-1) vr.e(lbid).remove(idx);
	},
	// returns item index 
	itemindex:function(lbid,itvalue) {
		x=vr.e(lbid);
		var sels=new Array;
		for (var i = 0; i < x.options.length; i++){
		    if (x.options[i].value==itvalue) return i;
		}	
		return -1;
	},
	// ret.array with selected items
	getsel:function(lbid) {
		x=vr.e(lbid);
		var sels=new Array;
		for (var i = 0; i < x.options.length; i++){
		    if (x.options[i].selected)
				sels[sels.length] = x.options[i];
		}	
		return sels;
	},
	
	// ret.array with all items
	getall:function(lbid) {
		x=vr.e(lbid);
		var sels=new Array;
		for (var i = 0; i < x.options.length; i++){
			sels[sels.length] = x.options[i];
		}	
		return sels;
	},
	// ret.array with selected values 
	getselvalues:function(lbid) {
		si=vrlb.getsel(lbid);
		var sv=new Array;
		for (k in si) sv[sv.length]=si[k].value;
		return sv;
	},
	// deletes selected items
	delselected:function(lbid) {
	    s=vrlb.getselvalues(lbid);
		for(k in s) vrlb.delitem(lbid,s[k]);
	},
	// inserts a new item, ignoring duplicates
	newitem:function(lbid,value,text) {
		if (vrlb.itemindex(lbid,value)==-1) {
			var ni;
	//		ni=document.createElement("option");
			ni=new Option(text,value);
			ni.value=value;
			ni.text=text;
			ni.selected=true;
			el=vr.e(lbid);
			el.add(ni);
		}
	},
	// apaga todos os items
	clear:function(lbid) {
		e=vr.e(lbid);
		while(e.options.length>0) e.remove(0);
	},
	// moves selected items from lbid to lbid2
	moveselected:function(lbid,lbid2) {
	    s=vrlb.getsel(lbid);
		for(k in s) {
			vrlb.newitem(lbid2,s[k].value,s[k].text);
			vrlb.delitem(lbid,s[k].value);
		}
	},
	// moves all items from lbid to lbid2
	moveall:function(lbid,lbid2) {
	    s=vrlb.getall(lbid);
		for(k in s) {
			vrlb.newitem(lbid2,s[k].value,s[k].text);
			vrlb.delitem(lbid,s[k].value);
		}
	}
}

// vars for current linked list dialog
var vrllvars={
	fieldid:'',
	queryid:''
}

// linked lists
var vrll={
	showdialog:function(fieldid,queryid,caption) {
		var values=document.getElementById(fieldid).value;
		vrllvars.fieldid=fieldid;
		vrllvars.queryid=queryid;
		showWaitMessage();
		document.getElementById('modalCaption').innerHTML=caption;
		HTML_AJAX.call('vrajax','linkedlist_getdialog',vrll.receivedialog,queryid,values);
	},
	// receives dialog from ajax
	receivedialog:function(s) {
		vr.e('modalContents').innerHTML=s;
		showDIV("modalDialogDIV");
		hideDIV("waitPopupDIV");
		
	},
	// procura e guarda resultados na llblx1
	dosearch:function() {
		var txt=vr.e('lltext').value;
		HTML_AJAX.call('vrajax','linkedlist_search',vrll.dosearch_cb,vrllvars.queryid,txt);
		showDIV("waitPopupDIV");		
	},
	dosearch_cb:function(r) {
		vrlb.clear('llbox1');
		eval(r);
		hideDIV("waitPopupDIV");		
	},
	// copia da lb1 para a lb2
	lb1lb2_all:function() {
		vrlb.moveall('llbox1','llbox2');
	},
	lb1lb2_sel:function() {
		vrlb.moveselected('llbox1','llbox2');
	},
	// copia da lb2 para a lb1
	lb2lb1_all:function() {
		vrlb.moveall('llbox2','llbox1');
	},
	lb2lb1_sel:function() {
		vrlb.moveselected('llbox2','llbox1');
	},
	// aceita resultados
	accept:function() {
		//alert(vrlb.getselvalues('llbox2'));
		x=vr.e('llbox2');
		var sels=new Array;
		var sid='';
		var stxt='';
		var c=0;
		for (var i = 0; i < x.options.length; i++){
			stxt=stxt+'<b>'+x.options[i].text+'</b>; ';
			sels[sels.length] = x.options[i].value;
			c++;
		}
		if (c==0) {
			stxt=vrmsg.none;
		}
		vr.e(vrllvars.fieldid).value=sels;
		vr.e('lldiv_'+vrllvars.fieldid).innerHTML=stxt;
		hideDIV("modalDialogDIV");
		hideDIV("fullTransparentDIV");
	}
}

var vrtab={
	tabs:new Array,
	add:function(tabid) {
		vrtab.tabs[vrtab.tabs.length]=tabid;
	},
	showtab:function(tabid) {
		var s='';
		var el=null;
		var bt=null;
		for (var i = 0; i < vrtab.tabs.length; i++){
			s=vrtab.tabs[i];
			el=document.getElementById(s);
			bt=document.getElementById('btn_'+s);
			if (s==tabid) {
				bt.className='tabbuttonsel';
				el.className='tab';
				//el.style.display='block';
			} else {
				bt.className='tabbutton';
				el.className='tabhidden';
				//el.style.display='hidden';
			}
		}
	}
}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

/* Funções específicas, vroom extranet */


function getsel(elemid) {
	var elem=vr.e(elemid);
	var sels=new Array;
	for (var i = 0; i < elem.options.length; i++){
		elem.options.remove(i);
//	    if (elem.options[i].selected)
//			sels[sels.length] = elem.options[i];
	}	
	return sels;
}

function xxxdel() {
	sel=vrlb.delselected('box1');
}

function xxxsel() {
    alert(vrlb.getselvalues('box1'));
}

function xxxmove12() {
	vrlb.moveselected('box1','box2');
}
function xxxmove21() {
	vrlb.moveselected('box2','box1');
}

