/* Regular expressions */
var telRegExp = /([0-9-]+){11}|([0-9]+){10}/; 
var timeRegExp = /^(\d{1,2}):(\d{2})$/;
var emailRegExp = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.([a-zA-Z]){2,4})$/;
var postcodeRegExp = /^([0-9]){4}([a-zA-Z]){2}$/;
var relpath = "http://77.74.50.99/~linkit";

function confirm_goto(question, url) {
	var cbox = confirm(question);
	if(cbox == true) {
		window.location = url;
	}
}

/* Jquery functions */
$(document).ready(function() {
	$('#menu div.menu_box_inner:not(.last, .active)').mouseover(function(){ 
		$(this).css('background-color', '#ffffff'); 
		$(this).animate({height: '130px'}, 'fast', function(){
			$(this).find('.menu_box_inner_box').stop().show();
		});
	});
	$('#menu div.menu_box_inner:not(.last, .active)').mouseleave(function(){ 
		if($(this).hasClass('active')){
			$(this).animate({height: '73px'}, 'fast', function(){
				$(this).find('.menu_box_inner_box').stop().hide();
			});
		} else {
			$(this).animate({height: '50px'}, 'fast', function(){
				$(this).find('.menu_box_inner_box').stop().hide();
				$(this).css('background-color', '#ebf2f7');
			});
		}
	});
	
	$('#menu div.menu_box_inner.last:not(.active)').mouseover(function(){ 
		$(this).css('background', '#ffffff'); 
		$(this).animate({height: '130px'}, 'fast', function(){
			$(this).find('.menu_box_inner_box').stop().show();
		});
	});
	$('#menu div.menu_box_inner.last:not(.active)').mouseleave(function(){ 
		if($(this).hasClass('active')){
			$(this).animate({height: '73px'}, 'fast', function(){
				$(this).find('.menu_box_inner_box').stop().hide();
			});
		} else {
			$(this).animate({height: '50px'}, 'fast', function(){
				$(this).find('.menu_box_inner_box').stop().hide();
				$(this).css('background', 'url('+relpath+'/skins/default/images/bg_contact_header.png) no-repeat right top');
			});
		}
	});	
	
	$("#slider").easySlider({
		continuous: true,
		auto:		true,
		pause:		10000,
		speed:		1000
	});
	
	//$(function() {
	$('#photo_album_photos .photo a').lightBox();
	//});	
	
	//var scale_home;
	
	if(window.scale_home == true) {
		content_diff = 50;
	} else {
		content_diff = 90;
	}
	
	var content_height = ($("#content_container").height() - content_diff); // was 90
	$("#content_right_inner").css('min-height', content_height+'px');
	
});

Cufon.replace('#menu .menu_box_inner', { fontFamily: 'Helvetica Neue LT Pro Roman' });
Cufon.replace('#menu .menu_box_inner a', { fontFamily: 'Helvetica Neue LT Pro Roman' });
