// JScript source code
function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

function checkenquiry(){
	var ftxt = '';

	if (document.enquiry.Name.value==''){
		ftxt += '\n- Please enter your Name.';
    }

    if (isValidEmail(document.enquiry.email.value) == false) {
        ftxt += '\n- Please enter your Email Address.';
    }
	
	if (document.enquiry.Telephone.value==''){
		ftxt += '\n- Please enter your Telephone Number.';
	}

	if (document.enquiry.Area.value == '') {
	    ftxt += '\n- Please select your Area of Interest.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}


function clearemailfield(fieldVal){
	if (isValidEmail(fieldVal)==false){
		document.newsletterform.email.value='';
	}
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}

function mainmenu(){
	$(".subnav").hide(); // Opera Fix
	$('.subnav').parent().hover(function(){
		$('.subnav').hide();
		$(this).find('.subnav').show();
	 });
}

$(document).ready(function(){					
	mainmenu()
});
 
$(document).ready(function(){
	$('.overlay').animate({opacity: 0}, 0);
	$('.overlayplay').animate({opacity: 0}, 0);
	
	$('#gallerybox li a').hover(function(){
		$(this).find('.overlay').animate({opacity: 0.80}, {queue: false, duration: 500});
		$(this).find('.overlayplay').animate({opacity: 0.80}, {queue: false, duration: 500});
	},function(){
		$(this).find('.overlay').animate({opacity: 0}, {queue: false, duration: 500});
		$(this).find('.overlayplay').animate({opacity: 0}, {queue: false, duration: 500});
	});
	
	$('#indexrightlist li a').hover(function(){
		$(this).find('.overlay').animate({opacity: 0.80}, {queue: false, duration: 500});
		$(this).find('.overlayplay').animate({opacity: 0.80}, {queue: false, duration: 500});
	},function(){
		$(this).find('.overlay').animate({opacity: 0}, {queue: false, duration: 500});
		$(this).find('.overlayplay').animate({opacity: 0}, {queue: false, duration: 500});
	});
	
	$('#indexrighttop a').hover(function(){
		$(this).find('.overlay').animate({opacity: 0.80}, {queue: false, duration: 500});
		$(this).find('.overlayplay').animate({opacity: 0.80}, {queue: false, duration: 500});
	},function(){
		$(this).find('.overlay').animate({opacity: 0}, {queue: false, duration: 500});
		$(this).find('.overlayplay').animate({opacity: 0}, {queue: false, duration: 500});
	});
	
	$('#action').toggle(function(){
		$('#coltwo').slideUp();
		$(this).addClass('selected');
	},function(){
		$('#coltwo').slideDown();
		$(this).removeClass('selected');
	});
	
	$('#togglepag').click(function(){
   		$('#sliderpagination').slideToggle();
   });
	
	
	$("#interest").change(function(){
		$('#select1').hide();   
		$('#select3').hide();   
		$('#select5').hide(); 
		$("#select" + this.value).show();
	});
	
	$("#interest").change();
	
	
});


