﻿// JScript File
        
        function Validate(val)
        {
            if(document.getElementById(val).value == 0)
            {
                alert('please select branch');
                return false;
            }
            else
            {
                BranchId = document.getElementById(val).value;
                document.location.href = "ContactUs.aspx?BranchId="+BranchId;
                return true;
            }
            
        }
        
        function checkData(val)
        {
            if(document.getElementById(val).value == "search")
            {
                document.getElementById(val).value = '';
            }
        }
        
        function deleteData(val)
        {
            if(document.getElementById(val).value != '' || document.getElementById(val).value != null)
            {
                document.getElementById(val).value = '';
            }
        }
        
        function ChangeBullet_Over(val,imgName)
        {
            if(val != ''){
                
                document.all[val].src = imgName;
             }
        }
        
        function ChangeBullet_Out(val,imgName)
        {
            if(val != '')
            {                
                document.all[val].src = imgName;
            }
        }
        
        function mySearch()
        {
            vSearch = document.forms[0].ctl00_Search.value;
            document.location.href="search.aspx?Search=" + vSearch;        
        }
        
        function myCmsSearch(val,page)
        {
            vSearch = document.getElementById(val).value;
            document.location.href=page+"?Search=" + vSearch;
        }
       
        function ChangeButton_over(val)
        {
            
            if(val != ''){
                document.all[val].src = '}images/gobutton_over.gif';
               }            
        }
        
        function ChangeButton(val)
        {
           
            if(val != ''){
                document.all[val].src = '}images/Go-button.gif';
               }            
        }
        
        function Desclaimer_Over(val)
        {
             if(val != ''){
                document.all[val].src = '}images/Wylie_nav/desclaimer_o.gif';
               } 
        }
        
        function Desclaimer_Out(val)
        {
            if(val != ''){
                document.all[val].src = '}images/Wylie_nav/desclaimer.gif';
               } 
        }
        
         function PAI_Over(val)
        {
             if(val != ''){
                document.all[val].src = '}images/Wylie_nav/PAI-act_o.gif';
               } 
        }
        
        function PAI_Out(val)
        {
            if(val != ''){
                document.all[val].src = '}images/Wylie_nav/PAI-act.gif';
               } 
        }

    function CheckData(val)
    {
        if(document.all[val].value == "SEARCH")
            document.all[val].value = "";
    }
    
    function showNav(val,subNav,imgName)
    {
        document.getElementById(val).style.display = 'block';
       
        document.getElementById(subNav).src = imgName;
        
    }
    
    function hideNav(val,subNav,imgName)
    {
        document.getElementById(val).style.display = 'none';
                
        document.getElementById(subNav).src = imgName;
    }
    
    function TextLength(fieldcount,field)
	{
	    var maxlen = 100;
	    
		if(document.all[field].value.length > maxlen)
			document.all[field].value = document.all[field].value.substring(0,document.all[field].value.length -1)				
		else
		document.all[fieldcount].value = maxlen - document.all[field].value.length; 
	}
	
	function TextLength1(fieldcount,field)
	{
	    var maxlen = 100;
	    
		if(document.all[field].value.length > maxlen)
		{
		    var extLen = document.all[field].value.length - maxlen;
			document.all[field].value = document.all[field].value.substring(0,document.all[field].value.length - extLen);
			document.all[fieldcount].value = maxlen - document.all[field].value.length;
	    }
		else
		document.all[fieldcount].value = maxlen - document.all[field].value.length; 
}

function posDiv()
	{
		var agt=navigator.userAgent.toLowerCase();
		var is_mac = (agt.indexOf("mac")!=-1);
		var MidX=screen.availWidth/2;
		
		if(is_mac)
		{
			if(agt.indexOf("mozilla/5.0") != -1)
			{
                document.getElementById('abtDiv').style.left = '-70px';
                document.getElementById('newsDiv').style.left = '-105px';
                document.getElementById('servDiv').style.left = '-100px';
            }
			else
			{
			   
            }
		}
		else
		{
			if(agt.indexOf("mozilla/5.0") != -1)
			{
			   document.getElementById('abtDiv').style.left = '-70px';
			   document.getElementById('newsDiv').style.left = '-105px';
			   document.getElementById('servDiv').style.left = '-100px';
			} 
			else
			{
			    
			}
		}	
	}
