/* ********** (C) TAXI2AIRPORT 2009 ********** */

/* ********** ****** ********* ********** */
/* ********** JQUERY FUNCTIONS ********** */
/* ********** ****** ********* ********** */

$(document).ready(function() {
		
	$("area").mouseover(function() {
		var country = this.className; 
		$("#map").attr("src", "gfx/eu-" + country + ".png"); // 
    });
	
	$("area").mouseout(function() {
		$("#map").attr("src", "/taxi2airport/ontwerpen/taxi2airport.com/gfx/eu.png"); // 
    });
	
	$("table.countries tr").click(function() {
		var id = this.id;
		var url = $("#" + id + " td:first a").attr("href");
		window.location = url;
	});
	
	$("div.list div div").click(function() {
		var id = this.id;
		var url = $("#" + id + " a").attr("href");
		window.location = url;
	});
	
	$("#logo").click(function() {
		$("div#en").slideToggle(); 
    });
	
	$("#title1").click(function() {
		$("#content1").slideToggle(600); 
		$("#comment1").slideToggle(150); 
    });
	
	$("#title2").click(function() {
		$("#content2").slideToggle(400); 
		$("#comment2").slideToggle(150); 
    });
	
	var showmap = true;
	$("#closemap").click(function() {
		showmap = !showmap;
		$("div.flashobject").toggle(); 
		if (showmap)
		{
			$("#showhide").attr("src", "/taxi2airport/ontwerpen/taxi2airport.com/gfx/show-c.png");
		}
		else
		{
			$("#showhide").attr("src", "/taxi2airport/ontwerpen/taxi2airport.com/gfx/hidden-c.png");
		}
    });
	
	$("div.collapse").css('cursor', 'pointer');
	$("table.countries tr").css('cursor', 'pointer');
	$("div.list div div").css('cursor', 'pointer');
	
	/* LANGUAGES */
	/*
	$("div#languages a").click(function(){ 
		return false;
	});
	
	var current = 'en';
	$("div#languages a").click(function() {
		var id = this.id.substring(4,7); 
		$("div#lang_"+current).hide();
		$("div#lang_"+id).show();
		$("div#languages a.current").attr('class', ''); 
		$("div#languages a#tab_"+id).attr('class', 'current'); 
        current = id;
        return false;
	});
	
	$("div.lang").hide();
	$("div#lang_en").show();
	
//	$("table.countries tr").hide();
//	$("table.countries tr#abc_a").show();
	*/
	
	/* ABC */
	var abc = 'all';
	$("div.abc a").click(function(){ 
		id = $(this).text();
		$("table.countries tr").hide();
		$("table.countries tr.abc_"+id).show();
		$("div.abc a.current").attr('class', ''); 
		$("a#abc_"+id).attr('class', 'current'); 
		return false;
	});
	
	$("div.abc a#abc_all").click(function(){ 
		$("table.countries tr").show();
		$("div.abc a.current").attr('class', ''); 
		$("a#abc_all").attr('class', 'current'); 
		return false;
	});
	
	var abc = 'all';
	$("div.abc a").click(function(){ 
		id = $(this).text();
		$("div.list div div").hide();
		$("div.list div div.abc_"+id).show();
		$("div.abc a.current").attr('class', ''); 
		$("a#abc_"+id).attr('class', 'current'); 
		return false;
	});
	
	$("div.abc a#abc_all").click(function(){ 
		$("div.list div div").show();
		$("div.abc a.current").attr('class', ''); 
		$("a#abc_all").attr('class', 'current'); 
		return false;
	});
	
	/* QUOTE countryinfo */
	$("div.countryinfo").truncate( 500, {
        chars: /\s/,
        trail: [ " <a href='#' class='truncate_show'>more >>></a> ", " <a href='#' class='truncate_hide'><<< less</a> " ]
    });

	$("#foottip a").tooltip({ 
	    bodyHandler: function() { 
	        return $($(this).attr("href")).html(); 
	    }, 
	    showURL: false 
	});
	
	$("div.airports li").tooltip({ 
		bodyHandler: function() { 
	        return $('ap'+$(this).attr("ap")).html(); 
	    }, 
	    showURL: false 
	});

	/* If return trip is selected, expand row */
	if ( $("#offerte-retour").val() == 't' )
	{
		$(".retour").show();
	}
	else
	{
		$(".retour").hide();
	}
	
	/* QUOTE collapse return trip */
	$("#offerte-retour").change(function(){ 
		$(".retour").toggle();
	});
	
});


/* ********** ********** ********* ********** */
/* ********** JAVASCRIPT FUNCTIONS ********** */
/* ********** ********** ********* ********** */


/*

*/
