/*
$(function(){
	var LoadMsg = 'Please Wait ... ';
	var byName = $.getUrlVar('lang');
	
	$('#menu_bar ul li a').click(function(){
    	if(!$(this).hasClass("current")) {
		var _Href = $(this).attr('href');
				
		$('<div id="loading" style="position:relative; z-index: 200;">'+LoadMsg+_Href+'</div>').appendTo('body').fadeIn('slow',function(){
			$.ajax({
				type:	'POST',
				url:	_Href,
				data:	"ajax=1&lang="+byName,
				dataType:	'html',
				timeout:	5000,
				success: function(d,s){
						$('#loading').fadeOut('slow',function(){
							$(this).remove();
							$('#flash_box').slideUp('slow',function(){
									$(this).slideDown('slow', function(){
										$(this).html(d).fadeIn('slow');										
									});
								});

							});
						
////////////////////////////////////////////////
						$('#loading').fadeOut('slow',function(){
							$(this).remove();
							$('#content_left').fadeOut('slow');
							$('#booking_right').fadeOut('slow');
*/
/*							$('#content_cont').slideUp('slow',function(){
									$(this).html(d).slideDown('slow');
								});
*/
/*							$('#content_cont').slideUp('slow',function(){
									$(this).slideDown('slow', function(){
										$(this).html(d).fadeIn('slow');									
									});
								});

							});
/////////////////////////////////////////////////						
						
						},
//				error: function(o,s,e){
	//						window.location = _Href;
//						}
			});
		});
        }
		return false;
	});
});
*/
$.extend({
  getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      vars[hash[0]] = hash[1];
    }
    return vars;
  },
  getUrlVar: function(name){
    return $.getUrlVars()[name];
  }
});

$(function(){
	var LoadMsg = 'Please Wait ... ';
	var byName = $.getUrlVar('lang');
	
	$('#menu_bar ul li a').click(function(){
    	if(!$(this).hasClass("current")) {
		var _Href = $(this).attr('href');
		
		if(_Href == 'facilities.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "facilities_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}

		else if(_Href == 'accommodation.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "accommodation_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}

		else if(_Href == 'gallery.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "gallery_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}

		else if(_Href == 'destination.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "destination_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}


		$('<div id="loading" style="position:relative; z-index: 200;">'+LoadMsg+_Href+'</div>').appendTo('body').fadeIn('slow',function(){
			$.ajax({
				type:	'POST',
				url:	_Href,
				data:	"ajax=1&lang="+byName,
				dataType:	'html',
				timeout:	5000,
				success: function(d,s){
						$('#loading').fadeOut('slow',function(){
							$(this).remove();
							$('#content_left').fadeOut('slow');
							$('#booking_right').fadeOut('slow');
/*							$('#content_cont').slideUp('slow',function(){
									$(this).html(d).slideDown('slow');
								});
*/
							$('#content_cont').slideUp('slow',function(){
									$(this).slideDown('slow', function(){
										$(this).html(d).fadeIn('slow');										
									});
								});

							});
						},
				error: function(o,s,e){
							window.location = _Href;
						}
			});
		});
        }
		return false;
	});
});

$(function(){
	var LoadMsg = 'Please Wait ...';
	var byName = $.getUrlVar('lang');
	
	$('#menu_bar_under ul li a').click(function(){
    	if(!$(this).hasClass("current")) {
		var _Href = $(this).attr('href');

		if(_Href == 'google.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "google_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}

		else if(_Href == 'reservation.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "reservation_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}

		else if(_Href == 'guest.php')
		{
			 $.ajax({
			        type: "POST",
			        url: "guest_s.php",
			        dataType: 'html',
			        data: "ajax=1",
			
			        success: function(html){
			                 $("#flash_box").html(html).fadeIn('slow');
			        },
			
			        error: function(){
			        },
			
			        complete: function(){
			        }
			    });
		}

		$('<div id="loading" style="position:relative; z-index: 200;">'+LoadMsg+'</div>').appendTo('body').fadeIn('slow',function(){
			$.ajax({
				type:	'POST',
				url:	_Href,
				data:	"ajax=1&lang="+byName,
				dataType:	'html',
				timeout:	5000,
				success: function(d,s){
						$('#loading').fadeOut('slow',function(){
							$(this).remove();
							$('#content_left').fadeOut('slow');
							$('#booking_right').fadeOut('slow');
/*							$('#content_cont').slideUp('slow',function(){
									$(this).html(d).slideDown('slow');
								});
*/
							$('#content_cont').slideUp('slow',function(){
									$(this).slideDown('slow', function(){
										$(this).html(d).fadeIn('slow');										
									});
								});

							});
						},
				error: function(o,s,e){
							window.location = _Href;
						}
			});
		});
        }
		return false;
	});
});
