var CallType=-1;
var CallTypeText="";

function changeCategory(value,text)
{

    CallType=value;
    CallTypeText=text;
}

function resetValues()
{    
    document.getElementById('CallTypeID').value="-1";
    CallType=-1;      
    CallTypeText="";
}

function submitFaultDetails(btn,method)
{
            
    if (CallType!=-1)
    {
        var REDIRECT_1 = 'FaultMap_IE.php?callTypeID='+ CallType + "&callTypeDesc=" + CallTypeText;
        var REDIRECT_2 = 'DefectWizard.php?locationValue=1&callTypeID='+ CallType;    
        var REDIRECT_3 = 'FaultMap_IE_StreetLight.php?callTypeID='+ CallType;
       
        document.getElementById('errorText').style.visibility = "hidden";
        if(method==0)
        {      
            window.location = REDIRECT_2; 
        }
        else
        {
            if (CallType==1)//street lighting needs to go to another map     
            { 
                window.location = REDIRECT_3;
            }
            else
            {
                window.location = REDIRECT_1; 
            }
       } 
   }
   else
   {
        document.getElementById('errorText').style.visibility = "visible";         
        document.getElementById('TypeFieldId').style.color = "red";
         
   }
   
 }          
   
