function IrA(D){location.href=D;}
function IrAN(D,P){if(P.length==0)P='width=600,height=500,top=10,left=10,resizable=yes,scrollbars=yes';window.open(D,'',P);return;}

function AsigValSelect(F,V){var ctd=eval("window.document.forms."+F+".length");for(var cp=0;cp<ctd;cp++)if(eval("window.document.forms."+F+".options[cp].value")==V)eval("window.document.forms."+F+".selectedIndex="+cp);}
function DelOption(d){var c=eval("window.document.forms."+d+".options.length"); for(var i=c-1;i>=0;i--)eval("window.document.forms."+d+".remove("+i+")");}// d= "formulario.campo"
function InsOption(d,v,t){var c=eval("window.document.forms."+d+".options.length");eval("window.document.forms."+d+".add(window.document.createElement('<option>'));");eval("window.document.forms."+d+".options["+c+"].text='"+t+"'");eval("window.document.forms."+d+".options["+c+"].value='"+v+"'");}// "formulario.campo", valor, texto

function CTArea(C,S,T){var t=T-T_CTArea(C);if(t<0){C_CTArea(C,T);t=T-T_CTArea(C);}if(S!='')eval('window.document.forms.'+S+'.value='+(t));}
function T_CTArea(C){var t=eval('window.document.forms.'+C+'.value'),D='\1\2\3',o='\n';while(t.search(o)>=0)t=t.replace(o,D);return t.length;} // Intro: JS=CR,LF(2 bytes) HTML=<BR>(4 bytes)
function C_CTArea(C,T){var t=eval('window.document.forms.'+C+'.value'), D='\1\2\3', o='\n';while(t.search(o)>=0)t=t.replace(o,D);if (t.charAt(t.length-3)=='\1' && t.length>T) t=t.substring(0,t.length-4);t=t.substring(0,T);while(t.search(D)>=0)t=t.replace(D,o);t=t.replace('\1','');t=t.replace('\2','');t=t.replace('\3','');eval('window.document.forms.'+C+'.value=t');} // corta

function FImg(D,C){var e="document."+D+".src='"+C+"'";eval(e);}//Donde Cual

function lTrim(c){var i,p,t=c.length;for(i=0;i<t;i++)if(c.charCodeAt(i)!=160){p=i;i=t;}return c.substr(p);}

function aI(c,vNaN,vNull){try{var n=parseInt(c);if(isNaN(n))n=vNaN;return n;}catch(e){}return vNull;}

function ReSizeW(w,h){if(window.outerWidth){window.outerWidth=w;window.outerHeight=h;}else if(window.resizeTo){window.resizeTo(w,h);}else{alert("Not supported.");}}
function MoveToW(x,y){window.moveTo(x,y);}

function EsVentanaHija(){if(typeof(window.opener)!='object'||window.opener==null)return false;else return true;}

function AsignaValor(F,C,V)
{
	var O=eval('window.document.forms.'+F+'.'+C);
	if(typeof(O)!='object')alert('No se encuentra '+F+'.'+C);/*en explotación que no haga nada*/
	else/*existe*/
	{
		var T=O.type;if(typeof(T)!='string')T=O[0].type;
		switch(T)
		{
			case'select-one':for(var i=0;i<O.length;i++)if(O.options[i].value==V)O.selectedIndex=i;break;
			case'button':case'submit':case'text':case'textarea':case'hidden':case'password':O.value=V;break;
			case'checkbox':case'radio':/*1*/if(!isFinite(O.length))if(O.value==V)O.checked=true;else O.checked=false;/*>1*/else for(i=0;i<O.length;i++) if(O[i].value==V)O[i].checked=true;else O[i].checked=false; break;
		}
	}
}
