﻿function highlightResults(e,bool)
{
    if(bool=="TRUE")
    { 
        e.style.backgroundColor="#fff69d";
    }
    else
    {
         e.style.backgroundColor="#ffffff";
    }  
}

function goSearchAJAX(strQ,bTransform,nTransformType)
{
    if (strQ != "" && strQ != "find tickets")
    {
        strQ = trim(strQ).replace("'", "").replace("&", "%26");
        var strServiceURL =  "http://"+location.hostname+"/ws/tcws.asmx/UpdateSearchResults";             
        var strParams = "strQ="+strQ+"&Transform="+bTransform+"&nTransformType="+nTransformType;
        ajaxPost(strParams,strServiceURL,"renderResults");
    }
    else
    {
        return false;
    }
}

function renderResults(xml)
{
    var bActiveX=true;
    if (document.implementation && document.implementation.createDocument)
    {
        bActiveX=false;
        xmlDoc = document.implementation.createDocument("", "", null);
        parser=new DOMParser();
        xmlDoc=parser.parseFromString(xml,"text/xml");
    }
    else if (window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.loadXML(xml);
    }
    else
    {
        alert("Your browser is having problems with our website!\n\nPlease call us to resolve this issue.");
        return;
    }

    nodeRedirect=getElementsByAttribute(xmlDoc,"div","id","divRedirect");

    if(!nodeRedirect[0])
    {
        returnObj("divSearchResults").obj.innerHTML=xml; 
        positionFooter();
    }
    else
    {
        window.location.href=nodeRedirect[0].firstChild.nodeValue;
    }
}
