






var xmlFeed=false;
var gecko= (document.implementation && document.implementation.createDocument) ? true:false;
var ie= (window.ActiveXObject && document.all) ? true:false;

// FIX MIMETYPES/DOCUMENT HEADERS FOR GECKO
// By Vladdy from CodingForums.com
function fixXmlMimeType(filename)
{
    var oxmlhttp = null;
    try {
        oxmlhttp = new XMLHttpRequest();
        oxmlhttp.overrideMimeType("text/xml");
    }
    catch(e) {
        try {
            oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e) {
            return null;
        }
    }

    if (!oxmlhttp) return null;

    try {
        oxmlhttp.open("GET", filename, false);
        oxmlhttp.send(null);
    }
    catch(e) {
        return null;
    }

    return oxmlhttp.responseXML;
}


// IMPORT XML DOCUMENT
// Code from the Public Domain
function importXML(FeedParserRSSFile)
{
    // For Gecko Browsers
    if (gecko)
    {
        xmlFeed = document.implementation.createDocument("", "", null);
        xmlFeed.async=false;
        xmlFeed = fixXmlMimeType(FeedParserRSSFile);
    }

    // For IE/Win
    else if (ie)
    {
        xmlFeed = new ActiveXObject("Microsoft.XMLDOM");
        xmlFeed.async=false;
        xmlFeed.load(FeedParserRSSFile);
    }

    // If a browser doesn't support this, do nothing.
    else return false;

    // If it's all good, return the object.
    if (typeof xmlFeed != "undefined") return xmlFeed;
    else return false;
}

function newcategory(selectch1)
{

var feed = importXML('/ttrs/railtourism/html/categoryList1.xml');
var contactCategoryRT = feed.getElementsByTagName('categoryNameRailTour');
var contactCategoryHoliday = feed.getElementsByTagName('categoryNameHoliday');
var categoryRT=new Array();
var categoryHoliday=new Array();
var newCategory=new Array();
var datadest="";
var datadest1="";

datadest="<option value=\"0\">Select Category</option>";
//datadest=datadest+"<option value=\"ALL\">ALL</option>";
for(var i = 0; i < contactCategoryRT.length; i++)
{
   categoryRT[i]=contactCategoryRT[i].getAttribute('name');

}
for(var i = 0; i < contactCategoryHoliday.length; i++)
{
   categoryHoliday[i]=contactCategoryHoliday[i].getAttribute('name');

}

try
{
	if(selectch1=='1')
	{
	newCategory=categoryRT.sort();
	}
	else if (selectch1=='2')
	{
	newCategory=categoryHoliday.sort();
	}
	else
	{
	newCategory=categoryRT.concat(categoryHoliday).sort();
	}
}
catch (err)
{
	newCategory=categoryRT.concat(categoryHoliday).sort();
}

//newCategory=category.concat(category).sort();

for(var i=0;i< newCategory.length;i++)
{
    if((i+1)!=newCategory.length && newCategory[i]==newCategory[i+1])
    {
      continue;
    }
    else
    {
      datadest=datadest+"<option value=\""+newCategory[i]+"\" >"+newCategory[i]+"</option>";
    }

}
return datadest;
}
document.write("<option value=\"0\">Select Category</option>");
//document.write("<option value=\"ALL\">ALL</option>");
//Modified By Subrato Adhikary 15.01.2008 End







