/* Google maps */

$(document).ready(function(){
	if (debug_enabled){
		$('#debug_window').show('slow');
	}
	$('#debug_window').click(function(){
		$(this).hide('slow');
		return false;
	});
	
	$('p.buttons a[href="#prev"]').click(function(){
		if (previous) previous();
		return false;
	});
	$('p.buttons a[href="#next"]').click(function(){
		if (next) next();
		return false;
	});

        $('a.popup').fancybox({
            'width'     :   500,
            'height'    :   600,
            'padding'   :   4,
            'type'      :   'iframe'
        });
});

/*
window.onunload = function(){
	GUnload();
}
*/

/*
function make_address( country, city, street, house, y, x, selected )
{
	if (!selected) selected = false;
	$("#map-view").show();
	var map = new GMap2( document.getElementById( "map" ) );
	var zoom = 14;

	var status = false;
	if ( x && y ) status = true;
	
	if ( y == null ) y = 47.558052;
	if ( x == null ) x = 7.58387;

	$("#f-geo").val( y + ',' + x );

	map.addControl( new GLargeMapControl() );

	var pr_address;
	var s_address;
	if (selected){
		pr_address = $('#'+house).val()+' '+$('#'+street).val()+' '+$('#'+city).val()+' '+watch_text(country);
		s_address = watch_text(country)+' '+$('#'+city).val()+' '+$('#'+street).val()+', '+$('#'+house).val();
	} else {
		pr_address = house+' '+street+' '+city+' '+country;
		s_address = country+' '+city+' '+street+', '+house;
	}
	
	var geocoder = new GClientGeocoder();
	geocoder.getLatLng(
		pr_address,
		function(point)
		{
			if ( !point )
			{
				alert( str_err_address );
				if (window.opener) window.close();
				
				map.setCenter( new GLatLng(y, x), zoom );
				var marker = new GMarker( new GLatLng(y, x), {draggable: true} );
				
				GEvent.addListener(marker, "dragstart", function() {
					marker.closeInfoWindow();
				});

				GEvent.addListener(marker, "dragend", function() {
					var coords = marker.getLatLng();
					$("#f-geo").val( coords.y + ',' + coords.x );
				});
				
				map.addOverlay( marker );
					
				return false;
			}
			else
			{
				if ( status )
				{
					map.setCenter( new GLatLng(y, x), zoom );
					var marker = new GMarker( new GLatLng(y, x), {draggable: true} );					
				}
				else
				{
					map.setCenter( point, zoom );
					var marker = new GMarker( point, {draggable: true} );
				}

				GEvent.addListener(marker, "dragstart", function() {
					marker.closeInfoWindow();
				});

				GEvent.addListener(marker, "dragend", function() {
					var coords = marker.getLatLng();
					$("#f-geo").val( coords.y + ',' + coords.x );
				});

				map.addOverlay( marker );
				marker.openInfoWindowHtml( '<b>Address</b><br />' + s_address );
			}
		}
	);
}

*/