var page_type = 'r';

function foc() {
    if (document.getElementById('classic_box').className == 'show') { 
	document.air.depCity.focus();
    } else if (document.getElementById('onebox_box').className == 'show') { 
	document.onebox_air.onebox.focus();
    }
    page_type = 's';
}

function foc_onebox() {
    document.air.onebox.focus();
    page_type = 's';
}

function foc_hotel() {
    document.hotel.dest.focus();
    page_type = 's';
}

function foc_car() {
    document.car.pulocation.focus();
    page_type = 's';
}

function foc_activity() {
    document.air.depCity.focus();
    page_type = 's';
}

// launch new windows
// user for choosing destination and date

function fill_in(page,w,h,scrollBars) {
    if (arguments.length < 4) {
	scrollBars = 0;
    }
    mywin = window.open( page, 'Note', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars='+scrollBars+', resizable=1, copyhistory=0, width='+w+',height='+h );
}


function emlWrite(a,b,c,d) { 
    var mail; 
    var link; 
    mail = a + "@" + b + "." + c; 
    link = '<a href="mailto:' + mail + '">' + d + '</a>'; 
    document.write(link); 
} 

function openChat(uri, name) {
	day = new Date();
	id  = day.getTime();
	settings = "resizable=no,scrollbars=no,width=700,height=400,top=" + ((screen.height - (screen.height/1.618))-(400/2)) + ",left="+((screen.width-700)/2);
	eval("cw" + id + " = window.open(\"" + uri + "\",\"" + name + "\",\"" + settings + "\");");
}

function show_multires(obj, num_dests) {
    // change the highlighted row
    var highlight = document.getElementById('multi-highlight');
    highlight.style.backgroundPosition = '0 ' + (obj*27) + 'px';
    // turn off the currently active info box
    for (i = 1; i <= num_dests; i++) {
	if (i != obj) {
	    var temp_el = document.getElementById('multi-flight-'+i);
	    temp_el.style.visibility = 'hidden';
	}
    }
    // turn on the new info box
    var el = document.getElementById('multi-flight-'+obj);
    el.style.visibility = 'visible';
}


