/////////////////////////////////////////////////////
// loading bar //
/////////////////////////////////////////////////////
//show loading bar  
function showLoading(){  
$("#loading").show(); 
}  
//hide loading bar  
function hideLoading(){  
$("#loading").fadeOut("fast"); 
}
/////////////////////////////////////////////////////
$(function(){
/////////////////////////////////////////////////////
// tab menu //
/////////////////////////////////////////////////////
	$('.venue-container').hide(0);
	$('.tabs-selected').show(0);
	$('.venue-menu li a').live('click', function() {
		if($(this).parent().attr('class')=="tab-selected"){
		} else {
			$('.venue-container').hide(0);
			$('.venue-menu li').removeClass();
			var el = $(this).parent();
			var node = '#'+$(this).attr('name');
			$(el).addClass('tab-selected');
			$(node).show(0);
			return false;
		}
	});
/////////////////////////////////////////////////////
// menu //
/////////////////////////////////////////////////////
	$('#prices .column1 ul').hide(0);
	$('#prices .column1 h3 small').append('open');
	$('#prices .column1 h3').css('cursor', 'pointer');
	$('#prices .column1 h3').live('click', function() {
		var el = $(this);
		var node = $(this).next();
		var child = $(this).children();
		$('#prices .column1 h3').not(this).is(':hidden') ?
		$('#prices .column1 h3').not(this).slideDown('slow'):
		$('#prices .column1 h3').not(this).slideUp('slow');
		$('#prices .column1 h3').each(function(){
			$(this).removeClass('expanded');
		});
		$('#prices .column1 ul').each(function(){
			if( $(this).is(':visible') && $(this).get(0) != $(node).get(0) )
				$(this).slideUp('slow');
		});
		$(node).is(':hidden') ?
		$(node).fadeIn('slow', function(){ $(child).empty().append('close') }) :
		$(node).fadeOut('slow', function(){ $(child).empty().append('open') }) ;
		return false;
	});
/////////////////////////////////////////////////////
// innerfade //
/////////////////////////////////////////////////////	
	$('#gallery').innerfade({ speed: 'slow', timeout: 7000, type: 'sequence', containerheight: 'auto' });
/////////////////////////////////////////////////////
}); 
/////////////////////////////////////////////////////
// validation script for email addresses //
/////////////////////////////////////////////////////
function emailcheck(str) {
      var at="@";
      var dot=".";
      var lat=str.indexOf(at);
      var lstr=str.length;
      var ldot=str.indexOf(dot);
      if (str.indexOf(at)==-1){
      return false;
      }
      if (str.indexOf(at)==-1 || str.indexOf(at)===0 || str.indexOf(at)==lstr){
      return false;
      }
      if (str.indexOf(dot)==-1 || str.indexOf(dot)===0 || str.indexOf(dot)==lstr){
      return false;
      }
      if (str.indexOf(at,(lat+1))!=-1){
      return false;
      }
      if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      return false;
      }
      if (str.indexOf(dot,(lat+2))==-1){
      return false;
      }
      if (str.indexOf(" ")!=-1){
      return false;
      }
      return true	;				
}
