// Java SCript Document
var flag=0;
function timedRedirect(redirectTo, timeoutPeriod) {
	setTimeout("location.href = redirectTo;",timeoutPeriod);
}

function filt(){
document.getElementById("div_filter").style.display='block';
}

function doms(){
alert=("dccfr");
document.getElementById("domestic").style.display='block';
document.getElementById("international").style.display='none';

}
function ints(){
document.getElementById("domestic").style.display='none';
document.getElementById("international").style.display='block';
}

function returndate(div)
{
	if(div=='oneway')
	{	document.getElementById("return").disabled= 'true';
}
	else if(div=='roundtrip')
	{	document.getElementById("return").disabled= '';	}	
	else{}
}

function returndateresult(div)
{
	if(div=='onewayresult')
	{	document.getElementById("returndate").disabled= 'true';
}
	else if(div=='roundtripresult')
	{	document.getElementById("returndate").disabled= '';	}	
	else{}
}

function returndate1(div)
{
	if(div=='oneway1')
	{	document.getElementById("return1").disabled= 'true';
}
	else if(div=='roundtrip1')
	{	document.getElementById("return1").disabled= '';	}	
	else{}
}

function returndateresult1(div)
{
	if(div=='onewayresult1')
	{	document.getElementById("returndate1").disabled= 'true';
}
	else if(div=='roundtripresult1')
	{	document.getElementById("returndate1").disabled= '';	}	
	else{}
}


function searchRail()
{
var a = document.getElementById("return").disabled;
if(a){window.open('search_flight.html','_self');}
else {window.open('search_loading_round.html','_self');}
}

function div_filter()
{	var a = document.getElementById('div_filter').style.display
	if(a=='block'){
		document.getElementById('div_filter').style.display = 'none';
				document.getElementById('arrow').style.background= 'url(images/arrow.png) no-repeat -12px 3px';
		flag=1;
	}
	else if(a=='none')	{
		document.getElementById('div_filter').style.display = 'block';
		document.getElementById('arrow').style.background= 'url(images/arrow.png) no-repeat 0px -24px';
		flag=0;
	}
}

function netFare()
{
	var a = document.getElementById('div_filter').style.display
	if(a=='block')	{
		document.getElementById('div_filter').style.display = 'none';
		document.getElementById('but').value = 'Show Net Fare';
	}
	else if(a=='none')	{
		document.getElementById('div_filter').style.display = 'block';
		document.getElementById('but').value = 'Hide Net Fare';		
	}
}

function show_hideDiv(div)
{
	var a = document.getElementById(div).style.display
	if(a=='block')
		document.getElementById(div).style.display = 'none';
	if(a=='none')
		document.getElementById(div).style.display = 'block';
}

function show_hideDiv1(div1,div2)
{
	var a = document.getElementById(div1).style.display
	if(a=='block')
		{
		document.getElementById(div1).style.display = 'none';
		document.getElementById(div2).style.display = 'block';
		}
	if(a=='none')
		{
		document.getElementById(div1).style.display = 'block';
		document.getElementById(div2).style.display = 'none';
		}
}

function show_hideDiv2(div1,div2)
{
	var a = document.getElementById(div1).style.display
	if(a=='block')
		{
		document.getElementById(div1).style.display = 'block';
		document.getElementById(div2).style.display = 'block';
		}
	if(a=='none')
		{
		document.getElementById(div1).style.display = 'block';
		document.getElementById(div2).style.display = 'block';
		}
}

function show_hideDivModify(div,h)
{
	var a = document.getElementById(div).style.display
	if(a=='block'){
		document.getElementById(div).style.display = 'none';
		h.style.background = 'url(../../images/arrowsmall.png) no-repeat 0px 9px'
	}
	if(a=='none'){
		document.getElementById(div).style.display = 'block';
		h.style.background = 'url(../../images/arrowsmalldown.png) no-repeat -1px 10px'
	}
}

function checkAll(field){
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}	
		
function uncheckAll(field){
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}


function goto(url){
	window.open(url,'_self');
}




 var cX = 0; var cY = 0; var rX = 0; var rY = 0;

        function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}

        function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}

        if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }

        else { document.onmousemove = UpdateCursorPosition; }

        function AssignPosition(d) {

        if(self.pageYOffset) {

              rX = self.pageXOffset;

              rY = self.pageYOffset;

              }

        else if(document.documentElement && document.documentElement.scrollTop) {

              rX = document.documentElement.scrollLeft;

              rY = document.documentElement.scrollTop;

              }

        else if(document.body) {

              rX = document.body.scrollLeft;

              rY = document.body.scrollTop;

              }

        if(document.all) {

              cX += rX;

              cY += rY;

              }

        d.style.left = (cX+10) + "px";

        d.style.top = (cY+10) + "px";

        }

        function HideContent(d) {

        if(d.length < 1) { return; }

        document.getElementById(d).style.display = "none";

        }

        function ShowContent(d) {

        if(d.length < 1) { return; }

        var dd = document.getElementById(d);

        AssignPosition(dd);

        dd.style.display = "block";

        }

        function ReverseContentDisplay(d) {

        if(d.length < 1) { return; }

        var dd = document.getElementById(d);

        AssignPosition(dd);

        if(dd.style.display == "none") { dd.style.display = "block"; }

        else { dd.style.display = "none"; }

        }
		
		
	function show(a)
{
for(i=1;i<=4;i++)
	document.getElementById('room'+i).style.display = 'none'
for(i=1;i<=a.value; i++)
	document.getElementById('room'+i).style.display = 'block'
}

function child(d,id)
{
for(i=1;i<=2;i++)
{
document.getElementById(id+i).style.display = 'none';	
}
if(d.value>0)
{
for(i=1;i<=d.value;i++)
{
document.getElementById(id+i).style.display = 'block';	
}}
}


function payNow(div,li)
{
for(i=1;i<=5;i++){
	document.getElementById("pay"+i).style.display = 'none';
	document.getElementById("li"+i).className = "";
	}
	document.getElementById("pay"+div).style.display = 'block';
	li.className = "currunt";
}