﻿function FlightsTopSearch()
{
	var arrSize = size.split('x');
	var w = parseInt(arrSize[0], 10) / 2;
	var h = parseInt(arrSize[1], 10) / 2;
	$('#' + DIV_ID).html('<div class="top-loading" style="width:' + arrSize[0] + 'px;height:' + arrSize[1] + 'px;display:block;text-align:center;"><img src="http://www.europelowcost.com/images/toploader.gif" alt="Loading" style="padding-top:' + (h-18) + 'px;"></div>');
    var url = 'http://www.europelowcost.fr/lowcostplanet/topsearch/FlightTopSearch.aspx?';
    
    var idDIV = DIV_ID;
  
    var args = {
        'language_id': language_id,
        'currency': currency,
        'header': header,
        'size': size,
        'maxtimeoffers': maxtimeoffers,
	'service': service,
        'arrivalcity': arrivalcity,
        'arrivalcountry': arrivalcountry
    };
  
    $.ajax({
		type:'POST',
		url:url,
		data: args,
		success:function(data){
			$('#' + idDIV).html(data);
		},
		error:function(data){
			$('#' + idDIV).html('');
		}
	});	
}
function HotelsTopSearch() {
	var arrSize = size.split('x');
	var w = parseInt(arrSize[0], 10) / 2;
	var h = parseInt(arrSize[1], 10) / 2;
	$('#' + DIV_ID).html('<div class="top-loading" style="width:' + arrSize[0] + 'px;height:' + arrSize[1] + 'px;display:block;text-align:center;"><img src="http://www.europelowcost.com/images/toploader.gif" alt="Loading" style="padding-top:' + (h-18) + 'px;"></div>');
    var url = 'http://www.europelowcost.fr/lowcostplanet/topsearch/HotelTopSearch.aspx?';
    var idDIV = DIV_ID;
    var args = {
        'language_id': language_id,
        'currency': currency,
        'header': header,
        'size': size,
        'maxtimeoffers': maxtimeoffers,
        'maxsearchrange': maxsearchrange,
        'service': service,
		'country': country,
		'city': city,
        'serviceId': 'Hotels'
    };
    $.ajax({
        type: 'POST',
        url: url,
        data: args,
        success: function(data) {
            $('#' + idDIV).html(data);
        },
        error: function(data) {
            $('#' + idDIV).slideUp('slow');
        }
    });
}
function HostelsTopSearch() {
	var arrSize = size.split('x');
	var w = parseInt(arrSize[0], 10) / 2;
	var h = parseInt(arrSize[1], 10) / 2;
	$('#' + DIV_ID).html('<div class="top-loading" style="width:' + arrSize[0] + 'px;height:' + arrSize[1] + 'px;display:block;text-align:center;"><img src="http://www.europelowcost.com/images/toploader.gif" alt="Loading" style="padding-top:' + (h-18) + 'px;"></div>');
    var url = 'http://www.europelowcost.fr/lowcostplanet/topsearch/HostelTopSearch.aspx?';
    var idDIV = DIV_ID;
    var args = {
        'language_id': language_id,
        'currency': currency,
        'header': header,
        'size': size,
        'maxtimeoffers': maxtimeoffers,
        'maxsearchrange': maxsearchrange,
        'service': service,
		'country': country,
		'city': city,
        'serviceId': 'Hostels'
    };
    $.ajax({
        type: 'POST',
        url: url,
        data: args,
        success: function(data) {
            $('#' + idDIV).html(data);
        },
        error: function(data) {
            $('#' + idDIV).slideUp('slow');
        }
    });
}
function FlightsAndHotelsTopSearch() {
	var arrSize = size.split('x');
	var w = parseInt(arrSize[0], 10) / 2;
	var h = parseInt(arrSize[1], 10) / 2;
	$('#' + DIV_ID).html('<div class="top-loading" style="width:' + arrSize[0] + 'px;height:' + arrSize[1] + 'px;display:block;text-align:center;"><img src="http://www.europelowcost.com/images/toploader.gif" alt="Loading" style="padding-top:' + (h-18) + 'px;"></div>');
    var url = 'http://www.europelowcost.fr/lowcostplanet/topsearch/FlightAndHotelTopSearch.aspx?';
    var idDIV = DIV_ID;
    var args = {
        'language_id': language_id,
        'currency': currency,
        'header': header,
        'size': size,
        'maxtimeoffers': maxtimeoffers,
        'maxsearchrange': maxsearchrange,
        'service': service,
		'arrcountry': arrivalcountry,
        'serviceId': 'FlightsAndHotels'
    };
    $.ajax({
        type: 'POST',
        url: url,
        data: args,
        success: function(data) {
            $('#' + idDIV).html(data);
        },
        error: function(data) {
            $('#' + idDIV).slideUp('slow');
        }
    });
}
function CarsTopSearch() {
	var arrSize = size.split('x');
	var w = parseInt(arrSize[0], 10) / 2;
	var h = parseInt(arrSize[1], 10) / 2;
	$('#' + DIV_ID).html('<div class="top-loading" style="width:' + arrSize[0] + 'px;height:' + arrSize[1] + 'px;display:block;text-align:center;"><img src="http://www.europelowcost.com/images/toploader.gif" alt="Loading" style="padding-top:' + (h-18) + 'px;"></div>');
    var url = 'http://www.europelowcost.fr/lowcostplanet/topsearch/CarTopSearch.aspx?';
    var idDIV = DIV_ID;
    var args = {
        'language_id': language_id,
        'currency': currency,
        'header': header,
        'size': size,
        'maxtimeoffers': maxtimeoffers,
        'maxsearchrange': maxsearchrange,
        'service': service,
		'country': country,
        'serviceId': 'Cars'
    };
    $.ajax({
        type: 'POST',
        url: url,
        data: args,
        success: function(data) {
            $('#' + idDIV).html(data);
        },
        error: function(data) {
            $('#' + idDIV).slideUp('slow');
        }
    });
}
