
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function MM_findObj(n, d) { //v4.0
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

/*
	Función para cambiar la imagen de un obj. imagen
	CambiarImg ('Nombre del obj imagen','Nombre de la nueva imagen')
*/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_setTextOfLayer(objName,x,newText) { //v3.0
if (document.getElementById && (document.all || parseInt(navigator.appVersion) > 5))
{
document.getElementById(objName).innerHTML = unescape(newText);
}
else
{
if ((obj=MM_findObj(objName))!=null) 
with (obj)
if (navigator.appName=='Netscape' && parseInt(navigator.appVersion) < 5 ) 
{document.open();document.write(unescape(newText)); document.close();}
else {
innerHTML = unescape(newText); 
}
}
}

function ltrim(argvalue){
	while (1) {
		if (argvalue.substring(0, 1) != " ")
			break;
		argvalue = argvalue.substring(1, argvalue.length);
	}
	return argvalue;
}

function rtrim(argvalue) {
	while (true) {
		if (argvalue.substring(argvalue.length - 1, argvalue.length) != " ")
			break;
		argvalue = argvalue.substring(0, argvalue.length - 1);
	}
	return argvalue;
}

function trim(argvalue) {
	return rtrim(ltrim(argvalue));
}

function isAlphaString(str) {
	re = /^[A-Za-z. _]+$/
	return re.test(str)
}

function isValidText(str) {
	re = /^[\wÑñáÁéÉíÍóÓúÚäÄëËïÏöÖüÜ\. ]+$/
	return re.test(str)
}

function validLogin(str) {
	re = /^[0-9A-Za-z._]+$/
	return re.test(str)
}

function validPwd( str ){
  if( str.indexOf( "'") != -1 ){
    return false;
  }

  if( str.indexOf( "\"") != -1 ){
    return false;
  }
  return true;
}
function isNumber(str) {
	re = /^[0-9 ]+$/
	return re.test(str)
}

function swapimgdoc(imgObj,url)
{
	if (document.layers){
		var ob = eval("document.images['"+imgObj+"']");
		ob.src = url;
	}
	else{
		var ob = eval("document."+imgObj);
		ob.src = url;
	}
}

function swapimg(divObj,imgObj,url)
{
	if (document.layers){
		var ob = eval("document."+divObj+".document.images['"+imgObj+"']");
		ob.src = url;
	}
	else{
		var ob = eval("document.all."+divObj+".document."+imgObj);
		ob.src = url;
	}
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function tmt_DivIndex(theDiv,v){
	var z = (document.layers) ? ".zIndex" : ".style.zIndex";
	var fun = (document.getElementById) ? "tmt_findObj" : "MM_findObj";
	var obj = eval(fun+"(theDiv)");
	if(obj)eval(fun+"('"+theDiv+"')"+z+"="+v);
}

function openWindows( path,yheight,xwidth){
	tsx=window.open(path,'','screenY='+ yheight +',screenX=' + xwidth +',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+xwidth+',height='+yheight+',alwaysRaised=No');
	tsx.opener = window.parent.frames["content"];
	tsx.resizeTo(xwidth,yheight)
}

function openWindow( path, width, height, parent ){
	var objWin=window.open(path,'','screenY='+ height +',screenX=' + width +',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',alwaysRaised=No');
	objWin.opener = parent
	objWin.resizeTo(width,height)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Popup al centro de la panatalla
function BrWinCenter(theURL, winName, Wp, Hp){
	var sw=screen.width;
	var sh=screen.height;
	var myLeft = (sw-Wp)/2;
	var myTop = (sh-Hp)/2-20;	
	window.open(theURL,winName,"height="+ Hp +",width="+ Wp +",left="+ myLeft +",top="+ myTop +",menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no")   
}


function jsEncode( strMessage ){

	strMessage = strMessage.replace( "á", "%E1" )
	strMessage = strMessage.replace( "é", "%E9" )
	strMessage = strMessage.replace( "í", "%ED" )
	strMessage = strMessage.replace( "ó", "%F3" )
	strMessage = strMessage.replace( "ú", "%FA" )
	strMessage = strMessage.replace( "ñ", "%F1" )
	
	strMessage = strMessage.replace( "Á", "%E1" )
	strMessage = strMessage.replace( "É", "%E9" )
	strMessage = strMessage.replace( "Í", "%ED" )
	strMessage = strMessage.replace( "Ó", "%F3" )
	strMessage = strMessage.replace( "Ú", "%FA" )
	strMessage = strMessage.replace( "Ñ", "%F1" )

	strMessage = strMessage.replace( "Ã¡", "%E1" )
	strMessage = strMessage.replace( "Ã©", "%E9" )
	strMessage = strMessage.replace( "Ã­", "%ED" )
	strMessage = strMessage.replace( "Ã³", "%F3" )
	strMessage = strMessage.replace( "Ãº", "%FA" )
	strMessage = strMessage.replace( "Ã±", "%F1" )

	return unescape(strMessage)
}

function isEMail(strEmail){
	emailreg = /^[\w\.\-\_]{2,}\@[\w\-]{2,}\.[a-z]{2,3}/i
	return( emailreg.exec( strEmail ) )
}

var letrareg=/^[a-zA-Z_.\u00D1\u00C1\u00CA\u00CD\u00D3\u00DA\u00F1\u00E1\u00E9\u00ED\u00F3\u00FA\s]{1,24}$/;
function letravalid(pletra){
	return(letrareg.test(pletra));
}


function openCFG(path){
	tsx=window.open(path,'CFG','location=no, menubar=no, status=yes, toolbar=no, scrollbars=yes, resizable=yes');
	tsx.opener = self;
	tsx.resizeTo(750,700);
	tsx.focus();
}

function openJATO(path){
	tsx=window.open(path,'JATO','location=no, menubar=no, status=yes, toolbar=no, scrollbars=yes, resizable=yes');
	tsx.opener = self;
	tsx.resizeTo(796,510);
	tsx.focus();
}


function openImage(strimagen){	
	var valor="";
	valor=strimagen;
	var display1=window.open('/Audi/CWE/mod/grl/GRL00FrameView?strURL='+ valor ,'Horizontal','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=20,height=30,alwaysRaised=No')
	display1.focus();
}

//-->
