
if (!(window.showModalDialog))			// mozilla 
{
	window.dFeatures = 'dialogHeight: 450px; dialogWidth: 1049px; dialogTop: 646px; dialogLeft: 4px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;';//default features 
 
	xevent = new Object();

	window.fakemodal = 1 ;
	
	window.showModalDialog = function xShowModalDialog( sURL, vArguments, sFeatures )
		{
		    pHeight = 800 ;
		    pWidth  = 600 ;
		    if (sURL==null||sURL=='') 
		    { 
		        alert ("URL invalida.");
		        return false; 
		    } 
		    if (vArguments==null||vArguments=='') 
		    { 
		        vArguments=''; 
		    } 
		    if (sFeatures==null||sFeatures=='') 
		    { 
		        sFeatures=dFeatures; 
		    } 
		    sFeatures = sFeatures.replace(/ /gi,''); 
		    aFeatures = sFeatures.split(";"); 
		    sWinFeat = "directories=0,menubar=0,titlebar=0,toolbar=0,"; 
		    for ( x in aFeatures ) 
		    { 
		        aTmp = aFeatures[x].split(":"); 
		        sKey = aTmp[0].toLowerCase(); 
		        sVal = aTmp[1]; 
		        switch (sKey) 
		        { 
		            case "dialogheight": 
		                sWinFeat += "height="+sVal+","; 
		                pHeight = sVal; 
		                break; 
		            case "dialogwidth": 
		                sWinFeat += "width="+sVal+","; 
		                pWidth = sVal; 
		                break; 
		            case "dialogtop": 
		                sWinFeat += "screenY="+sVal+","; 
		                break; 
		            case "dialogleft": 
		                sWinFeat += "screenX="+sVal+","; 
		                break; 
		            case "resizable": 
		                sWinFeat += "resizable="+sVal+","; 
		                break; 
		            case "status": 
		                sWinFeat += "status="+sVal+","; 
		                break; 
		            case "center": 
		                if ( sVal.toLowerCase() == "yes" ) 
		                { 
		                    sWinFeat += "screenY="+((screen.availHeight-pHeight)/2)+","; 
		                    sWinFeat += "screenX="+((screen.availWidth-pWidth)/2)+","; 
		                } 
		                break; 
		        } 
		    } 
		    window.modalWin=window.open(String(sURL),"",sWinFeat+';resizable=no'); 
		    //if (vArguments!=null&&vArguments!='') 
		    //{ 
		    window.modalWin.dialogArguments=vArguments; 
		    //} 
		}

	window.ShowModalDialog = showModalDialog ;
	window.showModalDialog = showModalDialog ;

	//alert('mcompat 2');

	//alert( document.getElementByTagName('body') ) ;

}


window.location.JSReplace = function JSReplace(sLocationIn)

{
/*
  //SSI 18086 - DANILO - 26/11/2009

  var sLocationOut
  if (sLocationIn.indexOf('?') < 0 ){
    sLocationOut = sLocationIn + '?xparmx=' + ID_COOKIE_KEY
  }else{
    sLocationOut = sLocationIn + '&xparmx=' + ID_COOKIE_KEY
  }
*/
//SSI 19046 - MONTEIRO - 22/09/2010
  if (typeof(document.all.frmSubmitTela)=='object'){
    document.frmSubmitTela.action = sLocationIn;
    document.frmSubmitTela.submit();  
  }else{  
    window.location.replace(sLocationIn);
  }
}


