        function setStyleImput(){
             ApplyStyle("INPUT")
             ApplyStyle("TEXTAREA")             
			 ApplyStyle("SELECT")                                  
        }    
        function ApplyStyle(tagName){
			var elems=document.getElementsByTagName(tagName)
            for (var k=0;k<elems.length;k++){
						var ParamName = elems[k].name.split("[")
						if (ParamName.length > 1){
							var name  = ParamName [0]
							var ParamName1=ParamName[1].split("]")
							var SubParamName1=ParamName1[0].split(",")						
							var Type=SubParamName1[0]
							var Required=SubParamName1[1]
							var DescField=SubParamName1[2]
							if ((Type=="NUMERICO" || Type=="INTERO") && tagName!="SELECT"){
								elems[k].style.textAlign='right';
								addEvent(elems[k], 'keypress', function(){onlyDigits(event)})
								/*var onChangeFunc=elems[k].onchange									
								elems[k].onchange=function(){}
								alert(onChangeFunc)
								removeEvent(elems[k],'change',arguments.callee)
								
								addEvent(elems[k], 'change', function anonymous(){
																	  	this.value=ReplaceSep(this.value)
																	  })
								addEvent(elems[k], 'change', onChangeFunc)
								//alert(onChangeFunc)
								//elems[k].onchange=onChangeFunc
								//alert(onChangeFunc)
								//addEvent(elems[k], 'change', onChangeFunc)
								*/
							}else if (Type=="DATA"){
								addEvent(elems[k], 'keypress', function(){onlyDigitsDate(event)})
							}
						}
						


                     if (tagName!="SELECT"){
						 addEvent(elems[k], 'focus',function (){
														if (this.className=="CampoNec" || this.className=="CampoFac"){
																	this.style.backgroundColor ='#BADCFE'
																	this.style.border='1px solid #0066CC';
														}
													 }             
						  );
					 }
                     addEvent(elems[k], 'blur', function(){
                                    if (this.className=="CampoNec"){
                                       this.style.backgroundColor ='#FFFFFF'
                                       this.style.border='1px solid #FF0000';                                
                                    }
                                    else if (this.className=="CampoFac"){
                                           this.style.backgroundColor ='#FFFFFF'
                                           this.style.border='1px solid #009900';                  
                                    }
									else if (this.className=="CampoDis"){
                                           this.style.backgroundColor ='#FFFFFF'
                                           this.style.border='1px solid #C9C9C2';                  										
									}
                     });
					 
					 var infotext=elems[k].getAttribute("infotext")
					 if (infotext){
						 if (infotext !=""){
							var infoshow=elems[k].getAttribute("infoshow")			
							if (!infoshow){
							infoshow="N"	
							}
							if (infoshow=="N"){
								 addEvent(elems[k], 'focus', function(){showInfo(this)})
								 elems[k].setAttribute("infoshow","S")								
							}

						 }
					 }					 
                }  
       }        
	   
	   function showInfo(obj){
			//alert("showInfo")
			var Info = new InfoBox()
		    var container=obj.getAttribute("container")
			var infotextalign=obj.getAttribute("infotextalign")
			if (infotextalign){
				Info.align=infotextalign
			}
			
			if  (container){
				Info.parent=document.getElementById(container)
			}
			else{
				if (document.getElementById("BodyForm")){
					Info.parent=document.getElementById("BodyForm")
				}else if (document.body){
					Info.parent=document.body
				}
				else{
					Info.parent=document.getElementByTagName("BODY")[0]
				}
			}
			
			 var infotext=obj.getAttribute("infotext")
			 if (infotext){
				 if (infotext !=""){
					Info.HtmlText=infotext
				 }
			 }				
			Info.objRef=obj
			Info.display()			
			
			obj.onblur=function(){hidInfo(Info)}
		}
		
		function showMouseInfo(obj,shiftLeft,shiftTop){
			//alert("showInfo")
			var Info = new InfoBox()
		    var container=obj.getAttribute("container")
			if  (container){
				Info.parent=document.getElementById(container)
			}
			else{
				Info.parent=document.getElementById("BodyForm")
			}
				Info.shiftleft=shiftLeft
				Info.shifttop=shiftTop			
			 var infotext=obj.getAttribute("infomousetext")
			 if (infotext){
				 if (infotext !=""){
					Info.HtmlText=infotext
				 }
			 }				
			Info.objRef=obj
			Info.display()			
			
			obj.onmouseout=function(){hidInfo(Info)}
		}
		
	   function setMouseInfo(obj,infotext,shiftLeft,shiftTop){
			obj.setAttribute("infomousetext",infotext)
		//	obj.onfocus=new Function();
			var infoshow=obj.getAttribute("infoshow")			
		    if (infoshow){
				if (infoshow=="S"){
					return		
				}
			}
			addEvent(obj, 'mouseover', function(){showMouseInfo(this,shiftLeft,shiftTop)})
		    obj.setAttribute("infoshow","S")
		}		
		
		
		function hidInfo(Info)  {
			   Info.hidden()  								
		}	

	   function setInfo(obj,infotext){
			obj.setAttribute("infotext",infotext)
		//	obj.onfocus=new Function();
			var infoshow=obj.getAttribute("infoshow")			
		    if (infoshow){
				if (infoshow=="S"){
					return		
				}
			}
			addEvent(obj, 'focus', function(){showInfo(this)})
		    obj.setAttribute("infoshow","S")
		}


addEvent(window, 'load', setStyleImput);	   