// 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 searchRail()
{
var a = document.getElementById("return").disabled;
if(a){window.open('search_loading.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_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 payNow(div,li)
{
for(i=1;i<=4;i++){
	document.getElementById("pay"+i).style.display = 'none';
	document.getElementById("li"+i).className = "";
	}
	document.getElementById("pay"+div).style.display = 'block';
	li.className = "currunt";
}

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

function redirectTo(url,action)
{
		window.open(url,action);
}

function Expand_collaps(div,h)
{
	var a = document.getElementById(div).style.display
	if(a=='block'){
		document.getElementById(div).style.display = 'none';
		h.style.background = 'url(images/e_c1.gif) no-repeat 0px 0px'
	}
	if(a=='none'){
		document.getElementById(div).style.display = 'block';
		h.style.background = 'url(images/e_c1.gif) no-repeat 0px -25px'
	}
}


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 show_hideBus(div,x,pn,nn)
{
	var a = document.getElementById(div).style.display
	if(a=='block')
		{
			document.getElementById(div).style.display = 'none';
			document.getElementById(x).value=nn	;
		}
	if(a=='none')
	{
		document.getElementById(div).style.display = 'block';
			document.getElementById(x).value=pn;
	}
				//alert(x)
}

function checkLogin(but)
{
	if(but.value == 'Continue')
	goto('step3.html');
	if(but.value == 'Validate')
	show_hideDiv('varify')
}