       var URL = "http://www.brac.co.za/viewFleets.asp?" ;
        function initPage()
        {
            var settings = {
            tl: { radius: 10 },
            tr: { radius: 10 },
            bl: { radius: 10 },
            br: { radius: 10 },
            antiAlias: true,
            autoPad: false,
            validTags: ["div"] };
            $("#standard").css("color","#B6B6B6").css("fontWeight","bold");
            $("div.shadowed").corner(settings); 
            $("#standard_rates").show();
            $("table.rates tr:even").addClass("even");
            $("table.rates tr:odd").addClass("odd"); 
            $("input[@type=button]").parent().addClass("grey");
            $("input[@type=button]").hover(function()
            {		
                $(this).fadeTo("fast", 0.6); 
            },function()
            {   		
                $(this).fadeTo("fast", 1.0); 
            });
            /*$("input[@type=button]").click(function()
            {		
                $("#linkAll").get()[0].href = URL + QUERY + DIR + COV + "GRP=" + $(this).parent().next().text();
                $("#linkAll").trigger("click"); 
            }); */
            $("a#intbook").click(function()
            {		
               $(this).get()[0].href = $(this).get()[0].href + "&" + QUERY + DIR + COV;
            });            
            $("div.headingRow").find("a").click(function()
            {
                aColor($(this).get()[0]);
                var tab = "#" + $(this).get()[0].id + "_rates";
                $("div.rates:visible").hide();
                $(tab).show("normal");
                if(tab == "#standard_rates"){
                  COV = "COV=L&";DIR = "DIR=L&";}  
                if(tab == "#super_rates"){
                  COV = "COV=S&";DIR = "DIR=L&";}
                if(tab == "#inbound_rates"){
                  COV = "COV=NA&";DIR = "DIR=I&";}
                if(tab == "#outbound_rates"){
                  COV = "COV=NA&";DIR = "DIR=O&";}
                document.body.focus();
            }); 
            routing(); 	        
        }
        
        function aColor(obj)
        {
          $("div.headingRow").find("a").css("color","#4e8fab").css("fontWeight","normal");
          obj.style.color = "#B6B6B6";
          obj.style.fontWeight = "bold";
        }
        
        function state(id, isDisabled)
        {
            if(isDisabled)
            {
                $(id).attr("disabled","disabled");
                $(id).fadeTo("fast", 0.6);
                //$(id).attr("class","disabled");
            }
            else
            {
                $(id).removeAttr("disabled");
                $(id).fadeTo("fast", 1.0);        
            }
        }
        var flight;
        var QUERY = "";
        var COV = "COV=L&"; 
        var DIR = "DIR=L&";
        function routing()
        {
         /*   var airports = "BFN,CPT,DUR,ELS,GCJ,GRJ,HGS,HLA,JN8,JNB,KIM,M2L,MBD,MGH,MQP,PHW,PLZ,PTG,PZB,RCB,UTN,UTT,WEL,YW3,";
            var qs = location.search;
            if(!qs)return;
            var nvp = qs.replace("?","").split("&");
            var ht = new Object();
            for(var i=0; i < nvp.length;i++)
            {
                var n = nvp[i].split("=")[0];
                var p = nvp[i].split("=")[1]
                ht[n] = p;    
            }
            if(!ht["destinationFlight"])return;
            if(!ht["departureFlight"])return;
            var dest = ht["destinationFlight"].split("~");
            var dep = ht["departureFlight"].split("~");
            flight = {origin_country : dep[dep.length-1], origin_airport : dep[dep.length-2],dest_country : dest[dest.length-1], dest_airport : dest[dest.length-2],
            isLocal : (dep[dep.length-1] == "ZA" && airports.indexOf(dest[dest.length-2]) > -1), isInbound : (dep[dep.length-1] != "ZA" && airports.indexOf(dest[dest.length-2]) > -1),
            isOutbound : (dep[dep.length-1] == "ZA" && airports.indexOf(dest[dest.length-2])< 0) || (dep[dep.length-1] != "ZA" && airports.indexOf(dest[dest.length-2]) > -1),
            title : ht["title"], FirstName : ht["FirstName"], LastName : ht["LastName"], Email : ht["Email"], phone : ht["phone"],cell : ht["cell"], DOB : ht["DOB"],
            voyager : "SA/" + ht["voyager"], pnr : ht["pnr"], STA :  dest[dest.length-2], ETA : dest[1].replace("-20","").replace("-","").toUpperCase() + "/" + dest[2].replace(":",""),
            ILC :  dest[dest.length-2], ETT : dep[1].replace("-20","").replace("-","").toUpperCase() + "/" + dep[2].replace(":",""), VIA : dep[0].replace(" ","").replace("%20",""), CTR : dep[dep.length-1],
            CNAM :  ht["LastName"] + "," + ht["FirstName"] + "," + ht["title"], MailAddress : ht["Email"], CON : ht["phone"] };  
            QUERY = "STA=" + flight.STA + "&ETA=" + flight.ETA + "&ILC=" + flight.ILC + "&ETT=" + flight.ETT + "&VIA=" + flight.VIA + "&CTR=" + flight.CTR + "&CNAM=" + flight.CNAM + "&MailAddress=" + flight.MailAddress + "&CON=" + flight.CON + ((flight.voyager == "SA/" || flight.voyager == "SA/Undefined") ? "" : "&FTN=" + flight.voyager )+ "&";    
            if(flight.isLocal)
            {
                state("#standard", false);
                state("#super",false);
                state("#inbound",true);
                state("#outbound",true);
                $("#standard").trigger("click");
                DIR = "DIR=L&";
                COV = "COV=L&";
                return;
            }
            if(flight.isInbound)
            {
                state("#standard", true);
                state("#super",true);
                state("#inbound",false);
                state("#outbound",true);
                $("#inbound").trigger("click");
                DIR = "DIR=I&";
                COV = "COV=NA&";
                return;
            }
            if(flight.isOutbound)
            {
                state("#standard", true);
                state("#super",true);
                state("#inbound",true);
                state("#outbound",false);
                $("#outbound").trigger("click");
                DIR = "DIR=O&";
                COV = "COV=NA&";
                return;
            } 
                   */    
        }