﻿<!--
            YAHOO.util.Event.onContentReady("invMenu", function () {
            var oMenuBar = new YAHOO.widget.MenuBar("invMenu", { 
                                                            autosubmenudisplay:true,
                                                            hidedelay: 750, 
                                                            lazyload: false});

                oMenuBar.render();
            });
           
           
           
  
  
   //var that are global for browser checking
        var appName=navigator.appVersion;
        var brName=appName.substr(17,4);//MSIE
        var brVer=appName.substr(22,3);//6.0
    //end global variable
   //function for set current date
    function setTime()
    {
        var m_names = new Array("January", "February", "March", 
            "April", "May", "June", "July", "August", "September", 
            "October", "November", "December");
        var currentDate=new Date();
        var currDay=currentDate.getDay();
        var currDate=currentDate.getDate();
        var currMonth=currentDate.getMonth();
        var currYear=currentDate.getFullYear();
        
        document.getElementById('currentTime').innerHTML=m_names[currMonth]+'&nbsp;&nbsp;'+currDate+'&nbsp;,&nbsp;'+currYear;
    }
    //function for set width of content div in ie 6.0
    function checkBrowser()
    {
       
        var tarElHeight=document.getElementById('centerMainCenter').clientHeight;
        if((brName=="MSIE" && brVer=="6.0")||(brName=="MSIE" && brVer=="6.0" && tarElHeight<518))
        {
             document.getElementById('centerMainCenter').style.height="518px";
              document.getElementById('centerMainCenter').style.width="475px";
        }
    }
    
    function setSideStrips()
    {
         
          document.getElementById("divMain").onmousemove= function()
           {
             document.getElementById("centerMainLeft").style.height= document.getElementById("centerMainCenter").clientHeight+"px"; 
                            
           }; 
             
    }
    var idOld="";
    function setTDHeight(id)
    {
       if(idOld!=id)
       {
        var tarHeight=document.getElementById(id).parentNode.clientHeight;
        document.getElementById(id).style.height=tarHeight+"px";
        }
       idOld=id; 
    }
   
   

 function createDDL(id)
    {
        var par=document.getElementById("selChMain");
        var parSel=document.getElementById("selChMain").getElementsByTagName("select");
        var len=parSel.length;
        var selValue=document.getElementById(id).selectedIndex;
        if(len>=1)
        {
           for(var i=0;i<len-1;i++)
           {
                par.removeChild(document.getElementById("chAge"+i));
            }
        }
        if(selValue>0)
        {
           var newEl= new Array();
            for(var i=0;i<selValue;i++)
            {
                newEl[i]=document.createElement("SELECT");
                newEl[i].id="chAge"+i;
                 newEl[i].style.width="40px";
                 for(j=1;j<=12;j++)
                 {
                   var opt=document.createElement("option");
                   newEl[i].options.add(opt);
                   opt.text=j;
                   opt.value=j;
                 }
                par.appendChild(newEl[i]);
            }
        }
    }
 
 
 function setVal(id)
     {
        var rePhone=/^\d{10}$/;
        var reEmail= /\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/gi;	
        var reNum= /^[0-9]+$/gi;
        var reZip= /^[0-9]{5}\-[0-9]{4}$/gi;
        var reDate = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/;
        var tar=document.getElementById(id).value;
        var tarLen=tar.length;
        var att1=document.getElementById(id).getAttribute('required');
        var att2=document.getElementById(id).getAttribute('mask');
       
        if(att1=='1' && att2=='blank')//required='1' for compulsary mask='blank' check only blank conditions
        {
            if(tarLen==0)
            {
                document.getElementById(id).style.backgroundColor ="lightyellow";
                document.getElementById(id).focus();
                return;
            }
            else
            {
                document.getElementById(id).style.backgroundColor ="white";
            }
        }
        
        if(att1=='1' && att2=='phone')//required='1' for compulsary mask='phone' to check 10 digit 
        {
            if(tarLen==0 || !tar.match(rePhone))
            {
                
                document.getElementById(id).style.backgroundColor ="lightyellow";
                
                document.getElementById(id).focus();
                return;
               
            }
            else
            {
                 document.getElementById(id).style.backgroundColor ="white";
            }
          }
          
          if(att2=='phone')//mask='phone' check valid 1o digit numbers not blank 
          {
            if(!tar.match(rePhone)&& tarLen!=0)
            {
                
                document.getElementById(id).style.backgroundColor ="lightyellow";
                document.getElementById(id).focus();
                return;
            }
            else
            {
                 document.getElementById(id).style.backgroundColor ="white";
            }
          }
          
          
          if(att1=='1' && att2=='numeric')//required='1' for compulsary mask='numeric' to check valid numbers 
          {
            if(tarLen==0 || !tar.match(reNum))
            {
                document.getElementById(id).style.backgroundColor ="lightyellow";
                document.getElementById(id).focus();
                return;
            }
            else
            {
                 document.getElementById(id).style.backgroundColor ="white";
            }
          }
          if(att2=='numeric')//mask='numeric' check valid numbers not blank 
          {
                if(!tar.match(reNum) && tarLen!=0)
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                    return;
                }
                else
                {
                     document.getElementById(id).style.backgroundColor ="white";
                }
          }
          
          
          if(att1=='1' && att2=='email')//required='1' for compulsary and mask='email' to check valid email 
          {
                if(tarLen==0 || !tar.match(reEmail))
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                    return;
                }
                else
                {
                    document.getElementById(id).style.backgroundColor ="white";
                }
           }
          
           if(att2=='email')// mask='email' to check valid email not for blank
            {
                if(!tar.match(reEmail) && tarLen!=0)
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                    return;
                }
                else
                {
                     document.getElementById(id).style.backgroundColor ="white";
                }
             }
             
          
           if(att1=='1' && att2=='zip')//required='1' for compulsary and mask='zip' to check valid zip 
              {
                if(tarLen==0 || !tar.match(reZip))
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                     return;
                }
                else
                {
                  document.getElementById(id).style.backgroundColor ="white";
                }
              }
             
           if(att2=='zip')// mask='zip' to check valid zip not for blank
            {
                if(!tar.match(reZip) && tarLen!=0)
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                    return;
                }
               else
                {
                    document.getElementById(id).style.backgroundColor ="white";
                }
            }
             
           if(att1=='1' && att2=='date')//required='1' for compulsary and mask='zip' to check valid zip 
              {
                if(tarLen==0 || !tar.match(reDate))
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                     return;
                }
                else
                {
                  document.getElementById(id).style.backgroundColor ="white";
                }
              }
             
           if(att2=='date')// mask='zip' to check valid zip not for blank
            {
                if(!tar.match(reDate) && tarLen!=0)
                {
                    document.getElementById(id).style.backgroundColor ="lightyellow";
                    document.getElementById(id).focus();
                    return;
                }
               else
                {
                    document.getElementById(id).style.backgroundColor ="white";
                }
            }
          
       
     }
	
    function setProp(id)
    {
        var inpEl=document.getElementById(id).getElementsByTagName('INPUT'); 
        var selEl=document.getElementById(id).getElementsByTagName('SELECT'); 
        var rePhone=/^\d{10}$/;
        var reEmail= /\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/gi;	
        var reNum= /^[0-9]+$/gi;
        var reZip= /^[0-9]{5}\-[0-9]{4}$/gi;
        var reDate = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/;
        var att1='';
        var att2='';
        
        for(var i=0;i<inpEl.length;i++)
        {  
            att1=inpEl[i].getAttribute('required');
            att2=inpEl[i].getAttribute('mask');
            val=inpEl[i].value;
            len=inpEl[i].value.length;
            if(att1 && att2)
            {
                    if(att2=='blank')
                    {
                        if(len==0)
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                    else if(att2=='phone')
                    {
                        if(len==0 ||!val.match(rePhone))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else    
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                   else if(att2=='email')
                    {
                        if(len==0 ||!val.match(reEmail))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                    else if(att2=='numeric')
                    {
                        if(len==0 ||!val.match(reEmail))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                    else if(att2=='zip')
                    {
                        if(len==0 ||!val.match(reEmail))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                     else if(att2=='date')
                    {
                        if(len==0 ||!val.match(reDate))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                
              }
             
              if(att2 && len!=0)
                {
                    if(att2=='phone')
                    {
                        if(!val.match(rePhone))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                       
                    else if(att2=='email')
                    {
                        if(!val.match(reEmail))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    } 
                       
                    else if(att2=='numeric')
                    {
                        if(!val.match(reNum))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }  
                    else if(att2=='zip')
                    {
                        if(!val.match(reZip))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }  
                     else if(att2=='date')
                    {
                        if(!val.match(reDate))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }  
                    
                }
                
         }
         for(var i=0;i<selEl.length;i++)
         {
            att1=selEl[i].getAttribute('required');
            att2=selEl[i].getAttribute('mask');
            val=selEl[i].value;
            len=selEl[i].value.length;
             if(att1 && att2)
            {
                    if(att2=='blank')
                    {
                        if(len==0)
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }
                    else if(att2=='phone')
                    {
                        if(len==0 ||!val.match(rePhone))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else    
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }
                   else if(att2=='email')
                    {
                        if(len==0 ||!val.match(reEmail))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }
                    else if(att2=='numeric')
                    {
                        if(len==0 ||!val.match(reEmail))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }
                    else if(att2=='zip')
                    {
                        if(len==0 ||!val.match(reEmail))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }
                     else if(att2=='date')
                    {
                        if(len==0 ||!val.match(reDate))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }
                
              }
             
              if(att2 && len!=0)
                {
                    if(att2=='phone')
                    {
                        if(!val.match(rePhone))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }
                       
                    else if(att2=='email')
                    {
                        if(!val.match(reEmail))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    } 
                       
                    else if(att2=='numeric')
                    {
                        if(!val.match(reNum))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    }  
                    else if(att2=='zip')
                    {
                        if(!val.match(reZip))
                        {
                            selEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            selEl[i].style.backgroundColor="white"; 
                        }
                    } 
                     else if(att2=='date')
                    {
                        if(!val.match(reDate))
                        {
                            inpEl[i].style.backgroundColor="lightyellow";
                        }
                        else
                        {
                            inpEl[i].style.backgroundColor="white"; 
                        }
                    }  
                     
                    
                }
         }
 }
	
function checkValidation(id)
{
    var inpEl=document.getElementById(id).getElementsByTagName("INPUT"); 
    var selEl=document.getElementById(id).getElementsByTagName("SELECT");
    var havingError,errorMessage,acName="";
    var count=0;
    for(var i=0;i<inpEl.length;i++)
    {
        if(inpEl[i].style.backgroundColor=='lightyellow')
        {
            count=inpEl[i].name.length;
            if(count>8)
            {
               acName=inpEl[i].name.split("$"); 
               errorMessage=errorMessage+"\r\n"+"Error in: " + acName[2];
            }
            else
            {
            errorMessage=errorMessage+"\r\n"+"Error in: " + inpEl[i].name;
            }
        havingError="yes";
        }
    }
    if(havingError=="yes")
    {
        alert(errorMessage);
        return false;
    }
    else
    {
       return chkDate('txtDtIn','txtDtOut');
    }
    
}
	
  -->
  
