
//here you place the ids of every element you want.


function HideServerValidationPanel(panelID)
    {    
        if (document.getElementById(panelID) != null)
        {
            document.getElementById(panelID).style.display = "none";
        }        
    }
    function DisplayErrors(errorMessages)
    {        
        if (errorMessages != null && errorMessages.length > 0)
        {
             LoadValidationErrorPanel(errorMessages); 
             
             return false; 
        }
        else
        {
            return true;
        }
       
    }
    function LoadValidationErrorPanel(arrMessage)
    {
        
        var myMain =  document.getElementById ("MainErrorTag");
        
        if (myMain.firstChild != null)
        {
            myMain.removeChild(myMain.firstChild);
        }        
       
        var myDiv = document.createElement("div");
        var myUL = document.createElement("ul");
        var myPara =  document.createElement("p");
        var myImg = document.createElement("img");
        var myDesc = document.createElement("strong");
        
        myDiv.className = "errorSection";
        //myImg.className = "xxx";
        //myDesc.className ="yyy"

        //myImg.setAttribute ("src","Cross.JPG");        
        myDesc.innerText = "         Please correct the following details before proceeding ..." ;
       
        //myPara.appendChild(myImg);
        
        myPara.appendChild(myDesc);
        myDiv.appendChild(myPara);
        var myLi;
        for(var j= 0; j < arrMessage.length;j++)
        {
            myLi = document.createElement("li");
            myLi.className="errorsectionli"
            myLi.innerText = arrMessage[j];
           // myLi.className = "abc";
            myUL.appendChild(myLi);
            
        }
        myDiv.appendChild(myUL);
        myMain.appendChild(myDiv);
    }
    function SetFocus(ControlField, isFocusSet)
    {
        if (isFocusSet == false)
        {
            controlField.focus();
            return true;
        }
        else
            return false;
    }
    
    function ValidateMyScreen()
    {
        var Errors = new Array();
        var ErrorCounter = 0;
        
	  
	  
        if (document.getElementById('Name_00').value == '')
        {
	 	    document.getElementById('Name_00').style.borderColor='#ff0000';
	 	    document.getElementById('Name_00').style.backgroundColor ='#ffd9cf';
		
	        Errors[ErrorCounter++] = "Please enter a Full Name";   
        }
		else
		{
		    document.getElementById('Name_00').style.borderColor='#999999';
	 	    document.getElementById('Name_00').style.backgroundColor ='white';
		
		}
		
 
        if (document.getElementById('Company_00').value== '')
        {
     	    document.getElementById('Company_00').style.borderColor='#ff0000';
	 	    document.getElementById('Company_00').style.backgroundColor ='#ffd9cf';
	
	        Errors[ErrorCounter++] = "Please enter a Company";   
        }
else
		{
		    document.getElementById('Company_00').style.borderColor='#999999';
	 	    document.getElementById('Company_00').style.backgroundColor ='white';
		
		}
				
        if (document.getElementById('JobSiteAddress_00').value== '')
        {
     	    document.getElementById('JobSiteAddress_00').style.borderColor='#ff0000';
	 	    document.getElementById('JobSiteAddress_00').style.backgroundColor ='#ffd9cf';
	
	        Errors[ErrorCounter++] = "Please enter a Job Site Address";   
        
		}    
else
		{
		    document.getElementById('JobSiteAddress_00').style.borderColor='#999999';
	 	    document.getElementById('JobSiteAddress_00').style.backgroundColor ='white';
		
		}
		        



		if (document.getElementById('Email_00').value== '')
        {
     	    document.getElementById('Email_00').style.borderColor='#ff0000';
	 	    document.getElementById('Email_00').style.backgroundColor ='#ffd9cf';
	
	        Errors[ErrorCounter++] = "Please enter an Email";   
        } 
else
		{
		    document.getElementById('Email_00').style.borderColor='#999999';
	 	    document.getElementById('Email_00').style.backgroundColor ='white';
		
		}
				
         if (document.getElementById('PhoneNumber_00').value== '')
        {
     	    document.getElementById('PhoneNumber_00').style.borderColor='#ff0000';
	 	    document.getElementById('PhoneNumber_00').style.backgroundColor ='#ffd9cf';
	
	        Errors[ErrorCounter++] = "Please enter a Phone Number";   
        } else
		{
		    document.getElementById('PhoneNumber_00').style.borderColor='#999999';
	 	    document.getElementById('PhoneNumber_00').style.backgroundColor ='white';
		
		}
		   
         if (document.getElementById('ServiceNeeded_00').value== '0')
        {
     	    document.getElementById('ServiceNeeded_00').style.borderColor='#ff0000';
	 	    document.getElementById('ServiceNeeded_00').style.backgroundColor ='#ffd9cf';
	
	        Errors[ErrorCounter++] = "Please enter a Service Needed";   
        }else
		{
		    document.getElementById('ServiceNeeded_00').style.borderColor='#999999';
	 	    document.getElementById('ServiceNeeded_00').style.backgroundColor ='white';
		
		}
		    
     //    if (isNaN(document.getElementById('comments_07').value)  && document.getElementById('section7').style.display == 'block' )
     //   {
     //       Errors[ErrorCounter++] = "Please enter the bird problem";   
      //  }    
        
        
    //HideServerValidationPanel('MainErrorTag');
    return DisplayErrors(Errors);
    }



function conditshow(rad,txt)
{
  if (document.getElementById(rad).checked)
     document.getElementById(txt).style.display = 'block';
  else
  {
       document.getElementById(txt).style.display = 'none';
       document.getElementById(txt).value='';
       }

}

function switchid(id){	

	hideallids();
	showdiv('section' + id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=1;i<11;i++){
  
		hidediv('section' + i);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		 ;
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}




