
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 newdestination(selectch)

{

var feed = importXML('/ttrs/railtourism/html/destinationCitys1.xml');
var destincityRT = feed.getElementsByTagName('cityNameRailTour');
var destincityHoliday = feed.getElementsByTagName('cityNameHoliday');
var destinRT=new Array();
var destinHoliday=new Array();
var newDestin=new Array();
var datadest="";
var datadest1="";
datadest="<option value=\"\">Select DestinationCity</option>";
//datadest=datadest+"<option value=\"ALL\">ALL</option>";
for(var i = 0; i < destincityRT.length; i++)
{
   destinRT[i]=destincityRT[i].getAttribute('name');
}
for(var i = 0; i < destincityHoliday.length; i++)
{
   destinHoliday[i]=destincityHoliday[i].getAttribute('name');
}

try
{
	if(selectch=='1')
	{
	newDestin=destinRT.sort();
	}
	else if (selectch=='2')
	{
	newDestin=destinHoliday.sort();
	}
	else
	{
	newDestin=destinRT.concat(destinHoliday).sort();
	}
}
catch (err)
{
	newDestin=destinRT.concat(destinHoliday).sort();
}



//newDestin=destinRT.concat(destinHoliday).sort();
for(var i=0;i< newDestin.length;i++)
{
    if((i+1)!=newDestin.length && newDestin[i]==newDestin[i+1])
    {
      continue;
    }
    else
    {
      datadest=datadest+"<option value=\""+newDestin[i]+"\" >"+newDestin[i]+"</option>"
	  //document.write("<option value=\""+newCity[i]+"\" >"+newCity[i]+"</option>");
    }

}
return datadest;
}

/*var feed = importXML('ttrs/html/destinationCitys.xml');
var destincity = feed.getElementsByTagName('cityName');
var destin=new Array();
var newDestin=new Array();*/


document.write("<option value=\"\">Select DestinationCity</option>");
//document.write("<option value=\"ALL\">ALL</option>");
//Modified By Subrato Adhikary 15.01.2008 End







