function getXML(respText)
{
	if(window.ActiveXObject){
		var doc=new ActiveXObject("Microsoft.XMLDOM");
		doc.async="false";
		doc.loadXML(respText);
	}else{
		  var parser=new DOMParser();
		  var doc=parser.parseFromString(respText,"text/xml");
  	}
  	return doc;
}

var globalPnrNumber;
function inputPNRDetails (pnrNumber)
{
	globalPnrNumber=pnrNumber;
	var pnrno1=pnrNumber.substring(0, 3);
	var pnrno2=pnrNumber.substring(3, 10);
	indianRail.DWR_PNR_Status(pnrno1, pnrno2, getPNRResult);
}

function getPNRResult(data)
{
	var doc=getXML(data);
	var prsPnrOutput=doc.documentElement;
	
	var popupWindowData="";
	popupWindowData+="<table border='0' cellpadding='1' cellspacing='1' align='center' width='550' class='tdborder6'>";
	if(prsPnrOutput.getAttribute("errorCode")==null || prsPnrOutput.getAttribute("errorCode")=="null")
	{
		var serverDetail=prsPnrOutput.getElementsByTagName("serverDetail");
		var respTime=serverDetail[0].getAttribute("respTime");
		popupWindowData+="<tr class='tdborder1'><td><b>PNR No</b></td><td>"+globalPnrNumber+"</td><td><b>Status Time</b></td><td>"+respTime+"</td></tr>";
		
		var trainNo=prsPnrOutput.getAttribute("trainNo");
		var trainName=prsPnrOutput.getAttribute("trainName");
		popupWindowData+="<tr class='tdborder1'><td><b>Train Number</b></td><td>"+trainNo+"</td><td><b>Train Name</b></td><td>"+trainName+"</td></tr>";
		
		var from=prsPnrOutput.getAttribute("from");
		var to=prsPnrOutput.getAttribute("to");
		popupWindowData+="<tr class='tdborder1'><td><b>From Station</b></td><td>"+from+"</td><td><b>To Station</b></td><td>"+to+"</td></tr>";
		
		var boardingPoint=prsPnrOutput.getAttribute("boardingPoint");
		var reservationUpto=prsPnrOutput.getAttribute("reservationUpto");
		popupWindowData+="<tr class='tdborder1'><td><b>Boarding at</b></td><td>"+boardingPoint+"</td><td><b>Reservation Upto</b></td><td>"+reservationUpto+"</td></tr>";
		
		var day=prsPnrOutput.getAttribute("day");
		var month=prsPnrOutput.getAttribute("month");
		var year=prsPnrOutput.getAttribute("year");
		var classCode=prsPnrOutput.getAttribute("classCode");
		popupWindowData+="<tr class='tdborder1'><td><b>Date of Journey</b></td><td>"+(day+"-"+month+"-"+year)+"</td><td><b>Journey Class</b></td><td>"+classCode+"</td></tr>";
		
		var chartingStatus=prsPnrOutput.getAttribute("chartingStatus");
		popupWindowData+="<tr class='tdborder1'><td><b>Charting Status</b></td><td colspan='3'>"+chartingStatus+"</td></tr>";
		popupWindowData+="</table><br/>";
		
		popupWindowData+="<table border='0' cellpadding='1' cellspacing='1' width='550' align='center' class='tdborder6'>";
		popupWindowData+="<tr><td><b>Passenger Number</b></td><td><b>Current Status</b></td><td><b>Running Status</b></td></tr>";
		
		var pxnDetails=prsPnrOutput.getElementsByTagName("PassengerDetail");
		var pxnDetailsLen=pxnDetails.length;
		
		var slno="", currentStatus="", runningStatus="";
		for(l=0; l<pxnDetailsLen; l++)
		{
			slno=pxnDetails[l].getAttribute("slno");
			currentStatus=pxnDetails[l].getAttribute("currentStatus");
			runningStatus=pxnDetails[l].getAttribute("runningStatus");
			popupWindowData+="<tr class='tdborder1'><td>Passenger "+slno+"</td><td>"+currentStatus+"</td><td>"+runningStatus+"</td></tr>";
		}
	}
	else
	{
		popupWindowData+="<tr><td><b>Error Code:</b></td><td>"+prsPnrOutput.getAttribute("errorCode")+"</td></tr>";
		popupWindowData+="<tr><td><b>Error Description:</b></td><td>"+prsPnrOutput.getAttribute("errorDescription")+"</td></tr>";
	}
	popupWindowData+="</table>";
	ruleString=popupWindowData;
	window.open("/indus/html/flights/flightRulePopup.html", "pnr_window", "width=600, height=300, left=212, top=250, scrollbars=yes, menubar=no, resizable=no, location=no, toolbar=no");
}

var globalTrainNo;
var globalJDate;
var globalClickFrm;
function show_Route_Details (trainNo, jDate, clkFrm)
{
	globalTrainNo=trainNo;
	globalJDate=jDate;
	globalClickFrm=clkFrm;
	indianRail.DWR_Route_Details(trainNo, jDate, getRouteDetails);
}

function getRouteDetails (data)
{
	var doc=getXML(data);
	var prsRouteEnqOutput=doc.documentElement;
	
	var routeDetailStr="";
	routeDetailStr+="<table border='0' cellpadding='1' cellspacing='1' bgcolor='#000000' width='610'>";	
	routeDetailStr+="<tr class='tdborder1'>";
		routeDetailStr+="<td colspan='10' align='center'>";
		routeDetailStr+="<font color='blue' size='3'>";
			routeDetailStr+="Train Route [Train No "+globalTrainNo+", Date "+globalJDate+"]";
		routeDetailStr+="</font>";
		routeDetailStr+="</td>";
	routeDetailStr+="</tr>";
	
	if(globalClickFrm=="")
	{
		routeDetailStr+="<tr class='tdborder1'>";
			routeDetailStr+="<td colspan='10'>";
			routeDetailStr+="<font color='red' size='2'>";
			routeDetailStr+="The From/To Station you have selected does not exist on the route of the Train or this station has been deleted. Kindly select your station from the Train route shown below.";
			routeDetailStr+="</font>";
			routeDetailStr+="</td>";
		routeDetailStr+="</tr>";
	}
	
	routeDetailStr+="<tr class='tdborder2'>";
		routeDetailStr+="<td width=\"10\">Sl</td>";
		if(globalClickFrm=="")
		{	
			routeDetailStr+="<td width=\"50\">From</td>";
			routeDetailStr+="<td width=\"50\">To</td>";
		}
		routeDetailStr+="<td width=\"180\">Station Name</td>";
		routeDetailStr+="<td width=\"60\">Route No</td>";
		routeDetailStr+="<td width=\"80\">Arrival Time</td>";
		routeDetailStr+="<td width=\"85\">Departure Time</td>";	
		routeDetailStr+="<td width=\"50\">Distance</td>";	
		routeDetailStr+="<td width=\"20\">Day</td>";	
		routeDetailStr+="<td width=\"75\">Remarks</td>";
	routeDetailStr+="</tr>";
	
	if(prsRouteEnqOutput.getAttribute("errorCode")==null || prsRouteEnqOutput.getAttribute("errorCode")=="null")
	{
		var sno="", stnCode="", stnName="", routeNo="", arrTime="", depTime="", distance="", day="", remarks="";
		var routeEnquiryList=prsRouteEnqOutput.getElementsByTagName("RouteEnquiryList");
		var routeEnquiryListSize=routeEnquiryList.length;
		for(l=0; l<routeEnquiryListSize; l++)
		{
			sno=routeEnquiryList[l].getAttribute("SNo");
			stnCode=routeEnquiryList[l].getAttribute("stnCode");
			stnName=routeEnquiryList[l].getAttribute("stnName");
			routeNo=routeEnquiryList[l].getAttribute("routeNo");
			arrTime=routeEnquiryList[l].getAttribute("arrTime");
			depTime=routeEnquiryList[l].getAttribute("depTime");
			distance=routeEnquiryList[l].getAttribute("distance");
			day=routeEnquiryList[l].getAttribute("day");
			remarks=routeEnquiryList[l].getAttribute("remarks");
			
			routeDetailStr+="<tr class='tdborder1'>";
				routeDetailStr+="<td width=\"50\">"+sno+"</td>";
				if(globalClickFrm==""){
					if(remarks==""){				
						routeDetailStr+="<td width=\"50\"><input type=\"radio\" value='"+stnCode+"' name=\"frmStn\" onclick=\"selStn('frmst','"+sno+"','"+stnName+"','"+stnCode+"','"+routeEnquiryListNo+"');\" id=\"frmStn_"+sno+"\"></td>";
						routeDetailStr+="<td width=\"50\"><input type=\"radio\" value='"+stnCode+"' name=\"toStn\" onclick=\"selStn('tost','"+sno+"','"+stnName+"','"+stnCode+"','"+routeEnquiryListNo+"');\"  id=\"toStn_"+sno+"\"></td>";						
					}else{
						routeDetailStr+="<td width=\"50\"></td>";
						routeDetailStr+="<td width=\"50\"></td>";
					}
				}
			
				routeDetailStr+="<td width=\"150\">"+stnName+"&nbsp;("+stnCode+")</td>";
				routeDetailStr+="<td width=\"60\">"+routeNo+"</td>";
				routeDetailStr+="<td width=\"50\">"+arrTime+"</td>";
				routeDetailStr+="<td width=\"75\">"+depTime+"</td>";	
				routeDetailStr+="<td width=\"50\">"+distance+"</td>";	
				routeDetailStr+="<td width=\"50\">"+day+"</td>";	
				routeDetailStr+="<td width=\"75\">"+remarks+"</td>";
			routeDetailStr+="</tr>";
		}
	}
	else
	{
		routeDetailStr+="<tr class='tdborder1'><td><b>Error Code:</b></td><td>"+prsPnrOutput.getAttribute("errorCode")+"</td></tr>";
		routeDetailStr+="<tr class='tdborder1'><td><b>Error Description:</b></td><td>"+prsPnrOutput.getAttribute("errorDescription")+"</td></tr>";
	}
	routeDetailStr+="</table>";
	ruleString=routeDetailStr;
	window.open("/indus/html/flights/flightRulePopup.html", "route_window", "width=650, height=500, left=212, top=250, scrollbars=yes, menubar=no, resizable=no, location=no, toolbar=no");
}

function printETicketPDF (tcRefNo)
{
	indianRail.DWR_Print_ETicket(tcRefNo, getIRETicketResult);
}

function SplitBoardingDate(boardingDate)
{
	var tempArr=new Array();
	tempArr=boardingDate.split(" ");
	return tempArr[0];
}

var monthInArray=new Array("Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec");
function getMonthName(month)
{
	return monthInArray[Number(month)-1];
}

function getIRETicketResult(data)
{
	var doc=getXML(data);
	var prsRouteEnqOutput=doc.documentElement;
	
	if(prsRouteEnqOutput.getAttribute("errorCode")==null || prsRouteEnqOutput.getAttribute("errorCode")=="null")
	{
		var name, sex, age, bookingStatus, currentStatus, coach, seat, concessionCode;
		var isWL=false;
		
		var ticketNo=prsRouteEnqOutput.getAttribute("ticketNumber");
		var pnrNo=prsRouteEnqOutput.getAttribute("pnrNumber");
		var trainNo=prsRouteEnqOutput.getAttribute("trainNo");
		var trainName=prsRouteEnqOutput.getAttribute("trainName");
		var bookedDate=prsRouteEnqOutput.getAttribute("bookedDate");
		var boardingDate=prsRouteEnqOutput.getAttribute("boardingDate");
		var quota=prsRouteEnqOutput.getAttribute("quota");
		var class=prsRouteEnqOutput.getAttribute("class");
		var source=prsRouteEnqOutput.getAttribute("source");
		var destination=prsRouteEnqOutput.getAttribute("destination");
		var boardingStn=prsRouteEnqOutput.getAttribute("boardingStn");
		var reservUptoStn=prsRouteEnqOutput.getAttribute("reservUptoStn");
		var distance=prsRouteEnqOutput.getAttribute("distance");
		var totalFare=prsRouteEnqOutput.getAttribute("totalFare");
		var departure=prsRouteEnqOutput.getAttribute("departure");
		var slipRouteMsg=prsRouteEnqOutput.getAttribute("slipRouteMsg");
		var noAdult=prsRouteEnqOutput.getAttribute("noAdult");
		var noChild=prsRouteEnqOutput.getAttribute("noChild");
		var userName=prsRouteEnqOutput.getAttribute("userName");
		var irctcSerChrg=prsRouteEnqOutput.getAttribute("irctcSerChrg");
		var day=prsRouteEnqOutput.getAttribute("day");			
		var month=prsRouteEnqOutput.getAttribute("month");			
		var year=prsRouteEnqOutput.getAttribute("year");
		var journeyDate=day+"-"+getMonthName(month)+"-"+year;

		var pxnDetailList=prsRouteEnqOutput.getElementsByTagName("PassengerDetail");
		var pxnDetailSize=pxnDetailList.length;
		for(l=0; l<pxnDetailSize; l++)
		{
			bookingStatus=pxnDetailList[l].getAttribute("bookingStatus");
			if(bookingStatus.indexOf("WL")!=(-1)){
				isWL=true;
				break;
			}
		}
		
		var eticketDetailStr="";
		eticketDetailStr+="<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td align='right'><a href='javascript:window.print();'><img src='/indus/images/indus/b-print.gif' border='0' title='Click to print'/></a></td></tr>";
	   	eticketDetailStr+="</table>";
	   	
		eticketDetailStr+="<table border='0' cellpadding='4' cellspacing='0' width='100%'>";
		if(isWL){
			eticketDetailStr+="<tr><td width='10%'><img src='/indus/images/irerslogo.jpg' border='0' width='50' height='50'/></td><td width='20%' align='center'><img src='/indus/images/wait_list.gif' width='50' height='50' /></td><td align='center'><b>IRCTCs e-Ticketing Service\nElectronic Reservation Slip</b></td><td width='20%' align='center'><img src='/indus/images/wait_list.gif' width='50' height='50' /></td><td width='10%' align='right'><img src='/indus/images/irctcerslogo.jpg' border='0' width='50' height='50'/></td></tr>";
        	eticketDetailStr+="<tr><td colspan='5'><b>PNRs having Fully waitlisted status will be dropped and names of the passengers will not appear on the chart. They are not allowed to board the train. If full waitlisted passengers are found travelling, they will be treated as without ticket and charged as per extant Railway rules.</b></td></tr>";
		}else{
			eticketDetailStr+="<tr><td width='10%'><img src='/indus/images/irerslogo.jpg' border='0' width='50' height='50'/></td><td width='20%'></td><td align='center'><b>IRCTCs e-Ticketing Service\nElectronic Reservation Slip</b></td><td width='20%'></td><td width='10%' align='right'><img src='/indus/images/irctcerslogo.jpg' border='0' width='50' height='50'/></td></tr>";
		}
		eticketDetailStr+="<tr><td colspan='5'><b>This ticket Will only be valid along with an ID proof. If found traveling without ID Proof, Passenger will be treated as without ticket and charge as per extant Railway rules</b></td></tr>";
		eticketDetailStr+="</table>";
		
		eticketDetailStr+="<table border='1' cellpadding='1' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td colspan='2'><b>Transaction ID: </b>"+ticketNo+"</td><td><b>PNR No:</b> "+pnrNo+"</td></tr>";
		eticketDetailStr+="<tr><td colspan='2'><b>Train No. &amp; Name: </b>"+trainNo+" / "+trainName+"</td><td><b>Date of Journey:</b> "+journeyDate+"</td></tr>";
		eticketDetailStr+="<tr><td width='33%'><b>Class:</b> "+class+"</td><td width='33%'><b>Date of Booking:</b> "+bookedDate+"</td><td width='33%'><b>Date of Boarding:</b> "+SplitBoardingDate(boardingDate)+"</td></tr>";
		eticketDetailStr+="<tr><td><b>From:</b> "+source+"</td><td><b>To:</b> "+destination+"</td><td><b>Distance:</b> "+distance+"</td></tr>";
		eticketDetailStr+="<tr><td><b>Boarding:</b> "+boardingStn+"</td><td><b>Resv Upto:</b> "+reservUptoStn+"</td><td><b>Quota: </b>"+quota+"</td></tr>";
		eticketDetailStr+="<tr><td><b>Scheduled Departure:</b> "+departure+"</td><td><b>Total Fare:</b> "+totalFare+"</td><td><b>Adult:</b> "+noAdult+", <b>Child:</b> "+noChild+"</td></tr>";
		eticketDetailStr+="</table>";
		
		eticketDetailStr+="<table border='0' cellpadding='0' cellspacing='0' width='100%' height='30'>";
		eticketDetailStr+="<tr><td valign='bottom'><b><LI>Departure time printed on the ERS is liable to change. New time table from 01-July-2010.<b></td></tr>";
		eticketDetailStr+="</table>";
		
		eticketDetailStr+="<table border='1' cellpadding='1' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td width='6%'><b>SNO.</b></td><td><b width='30%'>Name</b></td><td width='7%'><b>Age</b></td><td width='7%'><b>Sex</b></td><td width='20%'><b>Concession Code</b></td><td width='30%'><b>Booking Status/Current Status/Coach No/Seat No</b></td></tr>";
		for(l=0; l<pxnDetailSize; l++)
		{
			name=pxnDetailList[l].getAttribute("name");
			sex=pxnDetailList[l].getAttribute("sex");
			age=pxnDetailList[l].getAttribute("age");
			bookingStatus=pxnDetailList[l].getAttribute("bookingStatus");
			currentStatus=pxnDetailList[l].getAttribute("currentStatus");
			concessionCode=pxnDetailList[l].getAttribute("concessionCode");
			coach=pxnDetailList[l].getAttribute("coach");
			seat=pxnDetailList[l].getAttribute("seat");
			
			eticketDetailStr+="<tr><td>"+(l+1)+"</td><td>"+name+"</td><td>"+age+"</td><td>"+sex+"</td><td>"+concessionCode+"</td><td>"+bookingStatus+"/"+currentStatus+"/"+coach+"/"+seat+"</td></tr>";
		}
		
		eticketDetailStr+="</table><br/>";
		
		/**Agent Details*/
		eticketDetailStr+="<table border='1' cellpadding='1' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td width='37%'>Principal Agent: Thomas Cook (India) Ltd.</td><td width='33%'>Sub Agent Name: "+userName+" - thomascook.in</td><td width='30%'>Email ID: support@thomascook.in</td></tr>";
		eticketDetailStr+="<tr><td colspan='2'>Address: Unit No. 8, Corporate Park, Sion Trombay Road, Chembur, Mumbai 400071.</td><td>Phone No: 1800-2099-100</td></tr>";
		eticketDetailStr+="</table><br/>";
		
		/**Service Charges*/
		eticketDetailStr+="<table border='0' cellpadding='1' cellspacing='0' width='100%'>";
		if(slipRouteMsg!=""){
			eticketDetailStr+="<tr><td colspan='3'><b># Slip Train= "+slipRouteMsg+"</b></td></tr>";
		}
		eticketDetailStr+="<tr><td><b><u>Service Charges</u></b></td></tr>";
		eticketDetailStr+="<tr><td>1.) IRCTC service charge:- Rs "+irctcSerChrg+"</td></tr>";
		eticketDetailStr+="<tr><td>2.) Agents charge (in addition to IRCTC service charges) Rs.10/- for Second / Sleeper class per ticket and Rs. 20/- for higher class per ticket.</td></tr>";
		eticketDetailStr+="</table>";
		
		eticketDetailStr+="<table border='0' cellpadding='4' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td><img src='/indus/images/ERS_Banner3.jpg' border='0' width='100%' height='100%'/></td></tr>";
		eticketDetailStr+="</table>";
		
		/**Important*/
		eticketDetailStr+="<table border='0' cellpadding='1' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td><b><u>Important</u></b></td></tr>";
		eticketDetailStr+="<tr><td><LI>New time table will be effected from 01-07-2010. Departure time printed in ERS is liable to change. Customers are requested to check with Railway enquiry.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>One of the passenger booked on an E-ticket is required to present any of the identity cards noted below in original during the train journey and same will be accepted as a proof of identity failing which all the passengers will be treated as travelling without ticket and shall be dealt as per extant Railway Rules. Valid Ids:- Voter Identity Card / Passport / PAN Card / Driving License / Photo ID card issued by Central / State Govt. for their employees / Student Identity Card with photograph issued by recognized School / College for their students / Nationalised Bank Passbook with photograph.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>The accommodation booked is not transferable and is valid only if one of the ID card noted above is presented during the journey. The passenger should carry with him the Electronic Reservation Slip print out. In case the passenger does not carry the electronic reservation slip, a charge of Rs.50/- per ticket shall be recovered by the ticket checking staff and an excess fare ticket will be issued in lieu of that.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>E-ticket cancellations are permitted before preparation of chart. In case e-ticket is booked through an agent, please contact respective agent for cancellations.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI><b>For Railway Enquiry Dial 139 or SMS 'RAIL' to 139.</b></LI></td></tr>";
		eticketDetailStr+="<tr><td><LI><b>Jago Yatri Jago.</b></LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>For catering related queries dial toll free no. 1800-111-139.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>Helpline No:- 1800-2099-100 or Mail To: support@thomascook.in</LI></td></tr>";
		eticketDetailStr+="</table>";
		
		if(isWL){
			/**Rules for Waitlisted E tickets passengers*/
			eticketDetailStr+="<br/><table border='0' cellpadding='1' cellspacing='0' width='100%'>";
			eticketDetailStr+="<tr><td align='center'><b><u>Rules for Waitlisted E tickets passengers</u></b></td></tr>";
			eticketDetailStr+="<tr><td><b>a) Status of E-tickets after chart preparation</b></td></tr>";
			eticketDetailStr+="<tr><td>1. Confirmed E ticket Wait-listed E- ticket where all passengers are confirmed at the time of charting.</td></tr>";
			eticketDetailStr+="<tr><td>2. Partially waitlisted/Confirmed/RAC E ticket -Wait-listed E- ticket where some passengers are confirmed/RAC and others are wait-listed at the time of charting.</td></tr>";
			eticketDetailStr+="<tr><td>3. Fully waitlisted E tickets - Wait-listed E- ticket where all passengers continue to be waitlisted at the time of charting.</td></tr>";
			
			eticketDetailStr+="<tr><td><b>b) Authorization to board the train</b></td></tr>";
			eticketDetailStr+="<tr><td>1. Passengers with Confirmed E ticket are permitted to board the train. Their names will appear on the chart.</td></tr>";
			eticketDetailStr+="<tr><td>2. Names of passengers with Partially Waitlisted /Confirmed/RAC will appear on the chart (including the Waitlisted passengers).</td></tr>";
			eticketDetailStr+="<tr><td>3. PNRs having Fully waitlisted status will be dropped and names of the passengers will not appear on the chart. They are not allowed to board the train. If full waitlisted passengers are found travelling, they will be treated as without ticket and charged as per extant Railway rules. </td></tr>";
			
			eticketDetailStr+="<tr><td><b>c) Cancellation rules</b></td></tr>";
			eticketDetailStr+="<tr><td>1. Confirmed E ticket can be cancelled by passengers through internet before chart preparation only.</td></tr>";
			eticketDetailStr+="<tr><td>2. Partially waitlisted/Confirmed/RAC E ticket can be cancelled by passengers through internet before chart preparation only.</td></tr>";
			eticketDetailStr+="<tr><td>3. Fully waitlisted E tickets can be cancelled by passenger using internet before chart preparation. After chart preparation it will be cancelled by Railways and money refunded automatically to agents account.</td></tr>";
			
			eticketDetailStr+="<tr><td><b>d) Refund rules</b></td></tr>";
			eticketDetailStr+="<tr><td>1. After chart preparation, Refunds for Confirmed E ticket will be processed on a receipt of mail from user/agent on the email id: irail@thomascook.in . It would then be processed offline and refund sanctioned by Railways would be credited back to user's account.</td></tr>";
			eticketDetailStr+="<tr><td>2. For refunds of Fully waitlisted E ticket after chart preparation, customer needs not to apply to IRCTC for cancellation and refund. Their tickets will be cancelled online by Railways and refund shall be credited to user/agents account automatically.</td></tr>";
			eticketDetailStr+="<tr><td>3. Partially waitlisted E-Ticket holders where part passengers have travelled & want to claim refund for the passengers who have not travelled are required to collect Guard certificate from TTE / Conductor of the coach. Refund will be processed after receiving mail from user/agent on the email id: irail@thomascook.in and the guard certificate in original at following address:</td></tr>";
			eticketDetailStr+="<tr><td align='center'>";
			eticketDetailStr+="<table border='0' cellpadding='1' cellspacing='0' width='30%'>";
			eticketDetailStr+="<tr><td>General Manager (Ops)</td></tr>";
			eticketDetailStr+="<tr><td>IRCTC</td></tr>";
			eticketDetailStr+="<tr><td>Internet Ticketing Centre,</td></tr>";
			eticketDetailStr+="<tr><td>State Entry Road</td></tr>";
			eticketDetailStr+="<tr><td>New Delhi 110055.</td></tr>";
			eticketDetailStr+="</table>";
			eticketDetailStr+="</td></tr>";
			eticketDetailStr+="<tr><td>4. Submission of Guard certificate in original to IRCTC is also required for refund claim on account of A.C. failure/Coach not attached / Accommodation offered in lower class in addition to filing of TDR. Guard certificate can be obtained from TTE / Conductor of the coach.</td></tr>";
			eticketDetailStr+="</table>";
		}
		
		/**Other instruction*/
		eticketDetailStr+="<table border='0' cellpadding='1' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr><td><b><u>Other Instructions</u></b></td></tr>";
		eticketDetailStr+="<tr><td><LI>E-ticket passenger is permitted in the train against a berth/seat only when his name appears in the reservation chart failing which he can be treated as a passenger travelling without ticket.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>E-ticket cannot be cancelled after chart preparation through internet. After Chart preparation, refund will be processed through TDR refund process as per Indian Railways Refund rules. Submission of Guard certificate in original to IRCTC is also required for refund claim on account of A.C. failure/Coach not attached/Accommodation offered in lower class in addition to filing of TDR. Guard certificate can be obtained from TTE / Conductor of the coach.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>If train is cancelled, E-ticket can be cancelled through internet by the user upto 3 days from the date of departure of the train.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>Bank charges, if any, will be payable extra.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>The compartment/cabin/coupe numbers for first ACC and first class will be allotted at the time of chart preparation.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>For Train No. 2901 / 2902 (Gujarat Mail), Coach No. S2 to S6 will be attached / detached at Dadar</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>In case of 1-AC booking, Coach / Seat No. will be given at the time of charting.</LI></td></tr>";
		eticketDetailStr+="<tr><td><LI>The customer who has opted for auto-up gradation during booking of his/her e-ticket is requested to check the up-gradation chart before boarding the train.</LI></td></tr>";
		eticketDetailStr+="</table>";
	}
	else
	{
		eticketDetailStr+="<table border='0' cellpadding='1' cellspacing='0' width='100%'>";
		eticketDetailStr+="<tr class='tdborder1'><td><b>Error Code:</b></td><td>"+prsRouteEnqOutput.getAttribute("errorCode")+"</td></tr>";
		eticketDetailStr+="<tr class='tdborder1'><td><b>Error Description:</b></td><td>"+prsRouteEnqOutput.getAttribute("errorDescription")+"</td></tr>";
		eticketDetailStr+="</table>";
	}
	ruleString=eticketDetailStr;
	window.open("/indus/html/flights/flightRulePopup.html", "route_window", "width=650, height=500, left=212, top=50, scrollbars=yes, menubar=no, resizable=no, location=no, toolbar=no");
}