var xmlHttp;
var classs;
function Offer(ww,destto)
{
classs=ww;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="class.asp";
url=url+"?class="+ww+"&destto="+destto;
xmlHttp.onreadystatechange=stateServer1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateServer1() 
{ 
	if(xmlHttp.readyState==4)
	{
		if(xmlHttp.status==200)
		{		
		WriteData1(xmlHttp.responseText);
		}
		else
		{
			alert("There was a problem retrieving data from the server." );
		}
	}
}
function WriteData1(countryNode)
{ 
//document.getElementById("displayRulesDiv").style.visibility='hidden';
var rs;
var str="";
var linkimg="";
var rss=countryNode.split("^|");
if(rss.length-1>0)
	{
	str="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	//str=str + "<tr><td colspan=6>&nbsp;</td></tr>"
	str=str + "<tr class=\"SideOrange2\"><td>Dest From</td><td>Destination</td><td>Flight Type</td><td>Airline</td><td align='center'>Total Amount<br>Incl. Taxes</br></td><td>Baggage</td><td>Travel Between</td><!--<td>Rules</td>--><td></td></tr>"
	for(i=0;i<rss.length-1;i++)
		{		
			            var field;
			            var j;
				        field=rss[i].split("|");				
				        if(classs.toUpperCase()=="ECONOMY")
				        {
				        linkimg="<a href=\"../transfer.aspx?DestFrom=" + field[1] +"&DestTo=" + field[3] + "&Airline=" + field[5] + "&AirlineName=" + field[4] + "&Price=" + field[7] + "&DestFromAirportName=" + field[0] + "&DestToAirportName=" + field[2] + "\"><img src=\"../Pix/check_now.gif\" width=\"70\" height=\"18\" border=\"0\">";         				
				        }
				        else
				        {        					
					        linkimg="<a href=\"../booking.aspx?DestFrom=" + field[1] +"&DestTo=" + field[3] + "&Airline=" + field[5] + "&AirlineName=" + field[4] + "&Price=" + field[7] + "&DestFromAirportName=" + field[0] + "&DestToAirportName=" + field[2] + "\"><img src=\"../Pix/check_now.gif\" width=\"70\" height=\"18\" border=\"0\">"; 
				        }
			        var flightType;			
			        if(field[9].substr(0,6).toUpperCase()=="DIRECT".toUpperCase())
			        {
				        flightType="Direct-Non Stop";
			        }
			        else
			        {
				        flightType="InDirect-One Stop";
			        }
		                if(i%2==0)
			                    {
			                             if(field[12]=="")
			                                str=str + "<tr height=25 bgcolor=\"#FFFFFF\" class=site ><td>" + field[0]+"("+field[1]+")</td><td>" + field[2]+ "</td><td>" +flightType+ "</td><td width=100><img src=\"http://myvacations.co.uk/airlogo/"+field[5]+".gif\"></td><td align='center'><strong>&pound;&nbsp;" + field[10] + "</strong></td><td>"+field[13]+"</td><td>" + field[11]+ "</td><td></td><td><a href=\"#test\"><img width='60px'  height='16px' src=\"Images/Book_Button1.jpg\" border=\"0\"  ></a></td></tr>"
			                             else
			                             {
			                                     str=str + "<tr height=25 bgcolor=\"#EEEFE1\" class=site ><td>" + field[0]+"("+field[1]+")</td><td>" + field[2]+ "</td><td>" +flightType+ "</td><td width=100><img src=\"http://myvacations.co.uk/airlogo/"+field[5]+".gif\"></td><td align='center'><strong>&pound;&nbsp;" + field[10] + "</strong></td><td>"+field[13]+"</td><td>" + field[11]+ "</td><!--<td  style='cursor:hand;'><img name='" +field[0]+ "-"+field[2]+"' width='43px' height='16px' src=\"Images/Rules_Button1.jpg\" border=\"0\"  onclick='displayRules1(event,"+ field[14] +",this.name);'></td>--><td><a href=\"#test\"><img width='60px'  height='16px' src=\"Images/Book_Button1.jpg\" border=\"0\" ></a></td></tr>"			                                     
		                                 }                    			 
			                    }
			                else
			                {
			                             if(field[12]=="")			  
                                            str=str + "<tr height=25 bgcolor=\"#EEEFE1\" class=site ><td>" + field[0]+"("+field[1]+")</td><td>" + field[2]+ "</td><td>" + flightType + "</td><td width=100><img src=\"http://myvacations.co.uk/airlogo/"+field[5]+".gif\"></td><td align='center'><strong>&pound;&nbsp;" + field[10] + "</strong></td><td>"+field[13]+"</td><td>" + field[11]+ "</td><td></td><td><a href=\"#test\"><img width='60px'  height='16px' src=\"Images/Book_Button1.jpg\" border=\"0\" ></a></td></tr>"
			                             else
			                            {			                                 
			                                 str=str + "<tr height=25 bgcolor=\"#FFFFFF\" class=site ><td>" + field[0]+"("+field[1]+")</td><td>" + field[2]+ "</td><td>" + flightType + "</td><td width=100><img src=\"http://myvacations.co.uk/airlogo/"+field[5]+".gif\"></td><td align='center'><strong>&pound;&nbsp;" + field[10] + "</strong></td><td>"+field[13]+"</td><td>" + field[11]+ "</td><!--<td  style='cursor:hand;'><img name='" +field[0]+ "-"+field[2]+"'width='43px' height='16px' src=\"Images/Rules_Button1.jpg\" border=\"0\"  onclick='displayRules1(event,"+ field[14] +",this.name);'></td>--><td><a href=\"#test\"><img width='60px'  height='16px' src=\"Images/Book_Button1.jpg\" border=\"0\" ></a></td></tr>"			                                
			                            }
		                    }
		                    }
	        str=str+"</table>";
	        document.getElementById("result").innerHTML=str;
	}
	else
	{
		str="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td colSpan=6>&nbsp;</td><tr><td colSpan=6>&nbsp;</td></tr><tr><td colspan=6 align=center class=bluebignew>There Is No Offer Found In " + classs + " Class</td></tr><tr><td colSpan=6>&nbsp;</td><tr><td colSpan=6>&nbsp;</td></tr></table>"
		document.getElementById("result").innerHTML=str;
	}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
function changePicture(num)
	{
	
		if(num==0)
			{
				document.getElementById("eco").setAttribute("src","images/eco1.jpg"); 
				document.getElementById("bus").setAttribute("src","images/bus.jpg"); 
				document.getElementById("fir").setAttribute("src","images/fir.jpg"); 
			}
			if(num==1)
			{				
				document.getElementById("eco").setAttribute("src","images/eco.jpg"); 
				document.getElementById("bus").setAttribute("src","images/bus1.jpg"); 
				document.getElementById("fir").setAttribute("src","images/fir.jpg");				
			}
			if(num==2)
			{
				document.getElementById("eco").setAttribute("src","images/eco.jpg"); 
				document.getElementById("bus").setAttribute("src","images/bus.jpg"); 
				document.getElementById("fir").setAttribute("src","images/fir1.jpg");							
			}			
	}		
function dis(sheet)
	{
document.getElementById("sheet").innerHTML=""
document.getElementById("sheet").innerHTML=sheet;
	}
function outMouse()
	{
document.getElementById("sheet").innerHTML=""
	}	
//--------------------------------------------------------------------------------------------------------	
    function displayRules1(evt,text1,td_id)
	{
	       // getMouseXY(evt);
       var arr=text1;

            MM_openBrWindow("Rules.aspx?val="+arr,"","width=500,height=210")
	}