// JavaScript Document
$(function(){
	$('#resorts a').lightBox();
	$('#suites a').lightBox();
	$('#surrounding a').lightBox();
	$('#flowers a').lightBox();
	$('#picture-accommodation-change img:gt(0)').hide();
	$('#room-rate-each table tr').hide();
	$('#see-more-photos').hide();
	$('#book-here').hide();
	show_Slide_Images();
	$('div[id="nav-accommodation"]>ul>li>a').live('click',function(){
		title = $(this).attr('title');
		change_Picture_Content(title);
		$('div[id="nav-accommodation"]>ul>li>a').removeClass();
		$(this).attr('class','active');
		return false;
	});
	$('p[id="nav-sub-menu"]>a').live('click',function(){
		title = $(this).attr('title');
		change_Picture_Content(title);
		$('div[id="nav-accommodation"]>ul>li>a').removeClass();
		$('div[id="nav-accommodation"]>ul>li>a[title="'+title+'"]').attr('class','active');
		return false;
	});
	function show_Slide_Images()
	{
		$('.fadein img:gt(0)').hide();	
		$('.fadein-unique img:gt(0)').hide();
		$('.fadein-relaxation img:gt(0)').hide();	
		setInterval(function(){$('.fadein :first-child').fadeOut().next('img').delay(350).fadeIn(1000).end().appendTo('.fadein');}, 3000);			
		setInterval(function(){$('.fadein-unique :first-child').fadeOut().next('img').delay(350).fadeIn(1000).end().appendTo('.fadein-unique');}, 3000);		
		setInterval(function(){$('.fadein-relaxation  :first-child').fadeOut().next('img').delay(350).fadeIn(1000).end().appendTo('.fadein-relaxation');}, 3000);	
	}
	function change_Picture_Content(title)
	{		
		$('#room-rate-each table tr').show();//set table show
		link_w = "http://www.facebook.com/media/set/?set=a.188993527849588.46633.182560328492908&type=3";
		link_l = "http://www.facebook.com/media/set/?set=a.188913277857613.46615.182560328492908&type=3";
		link_f = "http://www.facebook.com/media/set/?set=a.182949125120695.45046.182560328492908&type=3";
		link_y = "http://www.facebook.com/media/set/?set=a.188998824515725.46635.182560328492908&type=3";
		link_h = "http://www.facebook.com/media/set/?set=a.188062024609405.46386.182560328492908&type=3";
		if(title  == "WILD ORCHID")
		{
			$('#picture-accommodation-change img').hide();
			$('#picture-accommodation-change img:eq(1)').fadeIn(3000);
			$('.detail-room-accommodation').css('display','none');
			$('.detail-room-accommodation:eq(1)').fadeIn(3000);	
			$('#see-more-photos').fadeIn(3000);	
			$('#see-more-photos a[id="facebook-photos-link"]').attr('href',link_w);		
			$('#room-rate-each table tr:gt(0)').hide();
			$('#room-rate-each table tr:eq(1)').fadeIn(3000);
			$('#book-here').fadeIn(3000);
		}		
		else if(title  == "LOTUS")
		{
			$('#picture-accommodation-change img').hide();
			$('#picture-accommodation-change img:eq(2)').fadeIn(3000);
			$('.detail-room-accommodation').css('display','none');
			$('.detail-room-accommodation:eq(2)').fadeIn(3000);	
			$('#see-more-photos').fadeIn(3000);	
			$('#see-more-photos a[id="facebook-photos-link"]').attr('href',link_l);	
			$('#room-rate-each table tr:gt(0)').hide();
			$('#room-rate-each table tr:eq(2)').fadeIn(3000);	
			$('#book-here').fadeIn(3000);
		}
		else if(title  == "FRANGIPANI")
		{
			$('#picture-accommodation-change img').hide();
			$('#picture-accommodation-change img:eq(3)').fadeIn(3000);
			$('.detail-room-accommodation').css('display','none');
			$('.detail-room-accommodation:eq(3)').fadeIn(3000);
			$('#see-more-photos').fadeIn(3000);	
			$('#see-more-photos a[id="facebook-photos-link"]').attr('href',link_f);
			$('#room-rate-each table tr:gt(0)').hide();
			$('#room-rate-each table tr:eq(3)').fadeIn(3000);
			$('#book-here').fadeIn(3000);
		}
		else if(title  == "YLANG YLANG")
		{
			$('#picture-accommodation-change img').hide();
			$('#picture-accommodation-change img:eq(4)').fadeIn(3000);
			$('.detail-room-accommodation').css('display','none');
			$('.detail-room-accommodation:eq(4)').fadeIn(3000);
			$('#see-more-photos').fadeIn(3000);	
			$('#see-more-photos a[id="facebook-photos-link"]').attr('href',link_y);
			$('#room-rate-each table tr:gt(0)').hide();
			$('#room-rate-each table tr:eq(4)').fadeIn(3000);
			$('#book-here').fadeIn(3000);
		}
		else if(title  == "HIBISCUS")
		{
			$('#picture-accommodation-change img').hide();
			$('#picture-accommodation-change img:eq(5)').fadeIn(3000);
			$('.detail-room-accommodation').css('display','none');
			$('.detail-room-accommodation:eq(5)').fadeIn(3000);
			$('#see-more-photos').fadeIn(3000);	
			$('#see-more-photos a[id="facebook-photos-link"]').attr('href',link_h);
			$('#room-rate-each table tr:gt(0)').hide();
			$('#room-rate-each table tr:eq(5)').fadeIn(3000);
			$('#book-here').fadeIn(3000);
		}
		else
		{
			//html_tag = '';
			$('#picture-accommodation-change img').hide();
			$('#picture-accommodation-change img:eq(0)').fadeIn(3000);
			$('.detail-room-accommodation').css('display','none');
			$('.detail-room-accommodation:eq(0)').fadeIn(3000);
			$('#room-rate-each table tr').hide();	
			$('#book-here').fadeIn(3000);		
		}
	}
	
	
/*	$('div[id|="menu"]>ul>li>a').live('click',function(){
		this_obj = $(this);
		page = this_obj.attr('href');
		//page_change = page.split(".php");
		//window.location.hash = page_change[0]+".html";
		//window.location = page;
		//get_Page(page);
		set_Menu_Active_Status(this_obj);
		set_tree(page);		
		return false;
	});*/
/*	function get_URL()
	{
		urlPath=window.location.pathname; 
		urlPathArray = urlPath.split('/');	
		urlPath1=urlPathArray[2];
		return urlPath1;
	}*/
/*	function get_Page(page)
	{
		$.ajax({
  		url: page,
  		success: function(data) {
			$('#content-wrap').html(data);				
			}
		});
	}*/		
});
